You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/user_interface/decompositions.md
+57-10Lines changed: 57 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,11 +40,10 @@ lq_full
40
40
lq_compact
41
41
```
42
42
43
-
Alongside these functions, we provide a LAPACK-based implementation for dense arrays, as provided by the following algorithm:
43
+
The following algorithm is available for QR and LQ decompositions:
44
44
45
45
```@docs; canonical=false
46
-
LAPACK_HouseholderQR
47
-
LAPACK_HouseholderLQ
46
+
Householder
48
47
```
49
48
50
49
## Eigenvalue Decomposition
@@ -63,9 +62,9 @@ These functions return the diagonal elements of `D` in a vector.
63
62
Finally, it is also possible to compute a partial or truncated eigenvalue decomposition, using the [`eig_trunc`](@ref) and [`eigh_trunc`](@ref) functions.
64
63
To control the behavior of the truncation, we refer to [Truncations](@ref) for more information.
65
64
66
-
### Symmetric Eigenvalue Decomposition
65
+
### Hermitian or Real Symmetric Eigenvalue Decomposition
67
66
68
-
For symmetric matrices, we provide the following functions:
67
+
For hermitian matrices, thus including real symmetric matrices, we provide the following functions:
69
68
70
69
```@docs; canonical=false
71
70
eigh_full
@@ -78,7 +77,7 @@ eigh_vals
78
77
By default, MatrixAlgebraKit applies a gauge fixing convention to ensure reproducible results.
79
78
See [Gauge choices](@ref sec_gaugefix) for more details.
80
79
81
-
Alongside these functions, we provide a LAPACK-based implementation for dense arrays, as provided by the following algorithms:
80
+
The following algorithms are available for the hermitian eigenvalue decomposition:
82
81
83
82
```@autodocs; canonical=false
84
83
Modules = [MatrixAlgebraKit]
@@ -100,7 +99,7 @@ eig_vals
100
99
By default, MatrixAlgebraKit applies a gauge fixing convention to ensure reproducible results.
101
100
See [Gauge choices](@ref sec_gaugefix) for more details.
102
101
103
-
Alongside these functions, we provide a LAPACK-based implementation for dense arrays, as provided by the following algorithms:
102
+
The following algorithms are available for the standard eigenvalue decomposition:
104
103
105
104
```@autodocs; canonical=false
106
105
Modules = [MatrixAlgebraKit]
@@ -120,7 +119,7 @@ schur_full
120
119
schur_vals
121
120
```
122
121
123
-
The LAPACK-based implementation for dense arrays is provided by the following algorithms:
122
+
The following algorithms are available for the Schur decomposition:
124
123
125
124
```@autodocs; canonical=false
126
125
Modules = [MatrixAlgebraKit]
@@ -153,11 +152,11 @@ svd_trunc
153
152
By default, MatrixAlgebraKit applies a gauge fixing convention to ensure reproducible results.
154
153
See [Gauge choices](@ref sec_gaugefix) for more details.
155
154
156
-
MatrixAlgebraKit again ships with LAPACK-based implementations for dense arrays:
155
+
The following algorithms are available for the singular value decomposition:
157
156
158
157
```@autodocs; canonical=false
159
158
Modules = [MatrixAlgebraKit]
160
-
Filter = t -> t isa Type && t <: MatrixAlgebraKit.LAPACK_SVDAlgorithm
159
+
Filter = t -> t isa Type && t <: MatrixAlgebraKit.SVDAlgorithms
Selecting a specific driver is an advanced feature intended for users who need to target a specific computational backend, such as a GPU. For most use cases, the default driver selection is sufficient.
394
+
395
+
Each algorithm in MatrixAlgebraKit can optionally accept a `driver` keyword argument to explicitly select the computational backend.
396
+
By default, the driver is set to `DefaultDriver()`, which automatically selects the most appropriate backend based on the input matrix type.
397
+
The available drivers are:
398
+
399
+
```@docs; canonical=false
400
+
MatrixAlgebraKit.DefaultDriver
401
+
MatrixAlgebraKit.LAPACK
402
+
MatrixAlgebraKit.CUSOLVER
403
+
MatrixAlgebraKit.ROCSOLVER
404
+
MatrixAlgebraKit.GLA
405
+
MatrixAlgebraKit.Native
406
+
```
407
+
408
+
For example, to force LAPACK for a generic matrix type, or to use a GPU backend:
409
+
410
+
```julia
411
+
using MatrixAlgebraKit
412
+
using MatrixAlgebraKit: LAPACK, CUSOLVER # driver types are not exported by default
413
+
414
+
# Default: driver is selected automatically based on the input type
415
+
U, S, Vᴴ =svd_compact(A)
416
+
U, S, Vᴴ =svd_compact(A; alg =SafeDivideAndConquer())
417
+
418
+
# Expert: explicitly select LAPACK
419
+
U, S, Vᴴ =svd_compact(A; alg =SafeDivideAndConquer(; driver =LAPACK()))
420
+
421
+
# Expert: use a GPU backend (requires loading the appropriate extension)
422
+
U, S, Vᴴ =svd_compact(A; alg =QRIteration(; driver =CUSOLVER()))
423
+
```
424
+
425
+
Similarly, for QR decompositions:
426
+
427
+
```julia
428
+
using MatrixAlgebraKit: LAPACK # driver types are not exported by default
429
+
430
+
# Default: driver is selected automatically
431
+
Q, R =qr_compact(A)
432
+
Q, R =qr_compact(A; alg =Householder())
433
+
434
+
# Expert: explicitly select a driver
435
+
Q, R =qr_compact(A; alg =Householder(; driver =LAPACK()))
436
+
```
437
+
391
438
## [Gauge choices](@id sec_gaugefix)
392
439
393
440
Both eigenvalue and singular value decompositions have residual gauge degrees of freedom even when the eigenvalues or singular values are unique.
Copy file name to clipboardExpand all lines: src/common/defaults.jl
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -59,3 +59,5 @@ function default_fixgauge(new_value::Bool)
59
59
DEFAULT_FIXGAUGE[] = new_value
60
60
return previous_value
61
61
end
62
+
63
+
const _fixgauge_docs ="The `fixgauge` keyword can be used to toggle whether or not to fix the gauge of the output, see also [`default_fixgauge`](@ref) for a global toggle and [`gaugefix!`](@ref) for implementation details."
0 commit comments