Skip to content

Commit eceef30

Browse files
authored
Release v0.6 + small fixes (#97)
* Bump v0.6 * rename `gaugefix` -> `fixgauge` * reduce unnecessary warnings * fix `copy_input` signatures in Mooncake tests * Add changelog to docs
1 parent 15d1c5a commit eceef30

File tree

17 files changed

+167
-101
lines changed

17 files changed

+167
-101
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MatrixAlgebraKit"
22
uuid = "6c742aac-3347-4629-af66-fc926824e5e4"
33
authors = ["Jutho <[email protected]> and contributors"]
4-
version = "0.5.0"
4+
version = "0.6.0"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ makedocs(;
5757
],
5858
"Developer Interface" => "dev_interface.md",
5959
"Library" => "library.md",
60+
"Changelog" => "changelog.md",
6061
],
6162
checkdocs = :exports,
6263
doctest = true,

docs/src/changelog.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## Guidelines for updating this changelog
9+
10+
When making changes to this project, please update the "Unreleased" section with your changes under the appropriate category:
11+
12+
- **Added** for new features.
13+
- **Changed** for changes in existing functionality.
14+
- **Deprecated** for soon-to-be removed features.
15+
- **Removed** for now removed features.
16+
- **Fixed** for any bug fixes.
17+
- **Security** in case of vulnerabilities.
18+
19+
When releasing a new version, move the "Unreleased" changes to a new version section with the release date.
20+
21+
[Unreleased]: https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/compare/v0.6.0...HEAD
22+
[0.6.0]: https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/releases/tag/v0.6.0
23+
24+
## [Unreleased]
25+
26+
### Added
27+
28+
### Changed
29+
30+
### Deprecated
31+
32+
### Removed
33+
34+
### Fixed
35+
36+
### Security
37+
38+
## [0.6.0] - 2025-11-14
39+
40+
### Added
41+
- New `project_isometric` function for projecting matrices onto isometric manifold ([#67](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/67))
42+
- New `PolarNewton` algorithm for polar decomposition ([#67](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/67))
43+
- New matrix property functions: `ishermitian`, `isantihermitian`, `hermitianpart!`, `hermitianpart`, `antihermitianpart!`, and `antihermitianpart` ([#64](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/64))
44+
- Support for `BigFloat` via new `GenericLinearAlgebra` extension ([#87](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/87))
45+
- Mooncake reverse-mode AD rules ([#85](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/85))
46+
- GPU support for image and null space computations ([#82](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/82))
47+
- GPU support for polar decomposition ([#83](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/83))
48+
- GPU support for new projection operations ([#81](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/81))
49+
- Output truncation error for truncated decompositions ([#75](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/75))
50+
- Documentation for truncated decomposition keyword arguments ([#71](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/71))
51+
- Default algorithm implementations for GPU wrapper array types ([#49](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/49))
52+
53+
### Changed
54+
55+
- Made `gaugefix!` optional ([#95](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/95))
56+
- Renamed `isisometry` to `isisometric` for consistency with `project_isometric` ([#73](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/73))
57+
- Refactored `left_orth`, `right_orth`, `left_null` and `right_null` interface ([#79](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/79))
58+
- Improved GPU support for SVD operations ([#80](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/80))
59+
- Loosened strictness on hermitian checks ([#78](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/78))
60+
- Updated pullback tolerances ([#92](https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/92))
61+
62+
### Removed
63+
64+
### Fixed

docs/src/user_interface/decompositions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,21 +413,21 @@ This preserves the decomposition `A = U * Σ * Vᴴ` while fixing the gauge.
413413
### Disabling Gauge Fixing
414414

415415
Gauge fixing is enabled by default for all eigenvalue and singular value decompositions.
416-
If you prefer to obtain the raw results from the underlying computational routines without gauge fixing, you can disable it using the `gaugefix` keyword argument:
416+
If you prefer to obtain the raw results from the underlying computational routines without gauge fixing, you can disable it using the `fixgauge` keyword argument:
417417

418418
```julia
419419
# With gauge fixing (default)
420420
D, V = eigh_full(A)
421421

422422
# Without gauge fixing
423-
D, V = eigh_full(A; gaugefix = false)
423+
D, V = eigh_full(A; fixgauge = false)
424424
```
425425

426426
The same keyword is available for `eig_full`, `eig_trunc`, `svd_full`, `svd_compact`, and `svd_trunc` functions.
427-
Additionally, the default value can also be controlled with a global toggle using [`MatrixAlgebraKit.default_gaugefix`](@ref).
427+
Additionally, the default value can also be controlled with a global toggle using [`MatrixAlgebraKit.default_fixgauge`](@ref).
428428

429429
```@docs; canonical=false
430430
MatrixAlgebraKit.gaugefix!
431-
MatrixAlgebraKit.default_gaugefix
431+
MatrixAlgebraKit.default_fixgauge
432432
```
433433

ext/MatrixAlgebraKitGenericLinearAlgebraExt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module MatrixAlgebraKitGenericLinearAlgebraExt
22

33
using MatrixAlgebraKit
4-
using MatrixAlgebraKit: sign_safe, check_input, diagview, gaugefix!, default_gaugefix
4+
using MatrixAlgebraKit: sign_safe, check_input, diagview, gaugefix!, default_fixgauge
55
using GenericLinearAlgebra: svd!, svdvals!, eigen!, eigvals!, Hermitian, qr!
66
using LinearAlgebra: I, Diagonal, lmul!
77

@@ -17,7 +17,7 @@ function MatrixAlgebraKit.svd_compact!(A::AbstractMatrix, USVᴴ, alg::GLA_QRIte
1717
F = svd!(A)
1818
U, S, Vᴴ = F.U, Diagonal(F.S), F.Vt
1919

20-
do_gauge_fix = get(alg.kwargs, :gaugefix, default_gaugefix())::Bool
20+
do_gauge_fix = get(alg.kwargs, :fixgauge, default_fixgauge())::Bool
2121
do_gauge_fix && gaugefix!(svd_compact!, U, Vᴴ)
2222

2323
return U, S, Vᴴ
@@ -29,7 +29,7 @@ function MatrixAlgebraKit.svd_full!(A::AbstractMatrix, USVᴴ, alg::GLA_QRIterat
2929
S = MatrixAlgebraKit.zero!(similar(F.S, (size(U, 2), size(Vᴴ, 1))))
3030
diagview(S) .= F.S
3131

32-
do_gauge_fix = get(alg.kwargs, :gaugefix, default_gaugefix())::Bool
32+
do_gauge_fix = get(alg.kwargs, :fixgauge, default_fixgauge())::Bool
3333
do_gauge_fix && gaugefix!(svd_full!, U, Vᴴ)
3434

3535
return U, S, Vᴴ

src/common/defaults.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ Default tolerance for deciding to warn if the provided `A` is not hermitian.
4343
default_hermitian_tol(A) = eps(norm(A, Inf))^(3 / 4)
4444

4545

46-
const DEFAULT_GAUGEFIX = Ref(true)
46+
const DEFAULT_FIXGAUGE = Ref(true)
4747

4848
@doc """
49-
default_gaugefix() -> current_value
50-
default_gaugefix(new_value::Bool) -> previous_value
49+
default_fixgauge() -> current_value
50+
default_fixgauge(new_value::Bool) -> previous_value
5151
5252
Global toggle for enabling or disabling the default behavior of gauge fixing the output of the eigen- and singular value decompositions.
53-
""" default_gaugefix
53+
""" default_fixgauge
5454

55-
default_gaugefix() = DEFAULT_GAUGEFIX[]
56-
function default_gaugefix(new_value::Bool)
57-
previous_value = DEFAULT_GAUGEFIX[]
58-
DEFAULT_GAUGEFIX[] = new_value
55+
default_fixgauge() = DEFAULT_FIXGAUGE[]
56+
function default_fixgauge(new_value::Bool)
57+
previous_value = DEFAULT_FIXGAUGE[]
58+
DEFAULT_FIXGAUGE[] = new_value
5959
return previous_value
6060
end

src/implementations/eig.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ function eig_full!(A::AbstractMatrix, DV, alg::LAPACK_EigAlgorithm)
8282
check_input(eig_full!, A, DV, alg)
8383
D, V = DV
8484

85-
do_gauge_fix = get(alg.kwargs, :gaugefix, default_gaugefix())::Bool
86-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
85+
do_gauge_fix = get(alg.kwargs, :fixgauge, default_fixgauge())::Bool
86+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
8787

8888
if alg isa LAPACK_Simple
8989
isempty(alg_kwargs) ||
@@ -102,7 +102,7 @@ function eig_vals!(A::AbstractMatrix, D, alg::LAPACK_EigAlgorithm)
102102
check_input(eig_vals!, A, D, alg)
103103
V = similar(A, complex(eltype(A)), (size(A, 1), 0))
104104

105-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
105+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
106106

107107
if alg isa LAPACK_Simple
108108
isempty(alg_kwargs) ||
@@ -145,8 +145,8 @@ function eig_full!(A::AbstractMatrix, DV, alg::GPU_EigAlgorithm)
145145
check_input(eig_full!, A, DV, alg)
146146
D, V = DV
147147

148-
do_gauge_fix = get(alg.kwargs, :gaugefix, default_gaugefix())::Bool
149-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
148+
do_gauge_fix = get(alg.kwargs, :fixgauge, default_fixgauge())::Bool
149+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
150150

151151
if alg isa GPU_Simple
152152
isempty(alg_kwargs) || @warn "invalid keyword arguments for GPU_Simple"
@@ -162,7 +162,7 @@ function eig_vals!(A::AbstractMatrix, D, alg::GPU_EigAlgorithm)
162162
check_input(eig_vals!, A, D, alg)
163163
V = similar(A, complex(eltype(A)), (size(A, 1), 0))
164164

165-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
165+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
166166

167167
if alg isa GPU_Simple
168168
isempty(alg_kwargs) || @warn "invalid keyword arguments for GPU_Simple"

src/implementations/eigh.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ function eigh_full!(A::AbstractMatrix, DV, alg::LAPACK_EighAlgorithm)
9292
D, V = DV
9393
Dd = D.diag
9494

95-
do_gauge_fix = get(alg.kwargs, :gaugefix, default_gaugefix())::Bool
96-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
95+
do_gauge_fix = get(alg.kwargs, :fixgauge, default_fixgauge())::Bool
96+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
9797

9898
if alg isa LAPACK_MultipleRelativelyRobustRepresentations
9999
YALAPACK.heevr!(A, Dd, V; alg_kwargs...)
@@ -114,7 +114,7 @@ function eigh_vals!(A::AbstractMatrix, D, alg::LAPACK_EighAlgorithm)
114114
check_input(eigh_vals!, A, D, alg)
115115
V = similar(A, (size(A, 1), 0))
116116

117-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
117+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
118118

119119
if alg isa LAPACK_MultipleRelativelyRobustRepresentations
120120
YALAPACK.heevr!(A, D, V; alg_kwargs...)
@@ -168,8 +168,8 @@ function eigh_full!(A::AbstractMatrix, DV, alg::GPU_EighAlgorithm)
168168
D, V = DV
169169
Dd = D.diag
170170

171-
do_gauge_fix = get(alg.kwargs, :gaugefix, default_gaugefix())::Bool
172-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
171+
do_gauge_fix = get(alg.kwargs, :fixgauge, default_fixgauge())::Bool
172+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
173173

174174
if alg isa GPU_Jacobi
175175
_gpu_heevj!(A, Dd, V; alg_kwargs...)
@@ -192,7 +192,7 @@ function eigh_vals!(A::AbstractMatrix, D, alg::GPU_EighAlgorithm)
192192
check_input(eigh_vals!, A, D, alg)
193193
V = similar(A, (size(A, 1), 0))
194194

195-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
195+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
196196

197197
if alg isa GPU_Jacobi
198198
_gpu_heevj!(A, D, V; alg_kwargs...)

src/implementations/gen_eig.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ function gen_eig_full!(A::AbstractMatrix, B::AbstractMatrix, WV, alg::LAPACK_Eig
5858
check_input(gen_eig_full!, A, B, WV, alg)
5959
W, V = WV
6060

61-
do_gauge_fix = get(alg.kwargs, :gaugefix, default_gaugefix())::Bool
62-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
61+
do_gauge_fix = get(alg.kwargs, :fixgauge, default_fixgauge())::Bool
62+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
6363

6464
if alg isa LAPACK_Simple
6565
isempty(alg_kwargs) ||
@@ -78,7 +78,7 @@ function gen_eig_vals!(A::AbstractMatrix, B::AbstractMatrix, W, alg::LAPACK_EigA
7878
check_input(gen_eig_vals!, A, B, W, alg)
7979
V = similar(A, complex(eltype(A)), (size(A, 1), 0))
8080

81-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
81+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
8282

8383
if alg isa LAPACK_Simple
8484
isempty(alg_kwargs) ||

src/implementations/svd.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ function svd_full!(A::AbstractMatrix, USVᴴ, alg::LAPACK_SVDAlgorithm)
120120
return USVᴴ
121121
end
122122

123-
do_gauge_fix = get(alg.kwargs, :gaugefix, default_gaugefix())::Bool
124-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
123+
do_gauge_fix = get(alg.kwargs, :fixgauge, default_fixgauge())::Bool
124+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
125125

126126
if alg isa LAPACK_QRIteration
127127
isempty(alg_kwargs) ||
@@ -153,8 +153,8 @@ function svd_compact!(A::AbstractMatrix, USVᴴ, alg::LAPACK_SVDAlgorithm)
153153
check_input(svd_compact!, A, USVᴴ, alg)
154154
U, S, Vᴴ = USVᴴ
155155

156-
do_gauge_fix = get(alg.kwargs, :gaugefix, default_gaugefix())::Bool
157-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
156+
do_gauge_fix = get(alg.kwargs, :fixgauge, default_fixgauge())::Bool
157+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
158158

159159
if alg isa LAPACK_QRIteration
160160
isempty(alg_kwargs) ||
@@ -183,7 +183,7 @@ function svd_vals!(A::AbstractMatrix, S, alg::LAPACK_SVDAlgorithm)
183183
check_input(svd_vals!, A, S, alg)
184184
U, Vᴴ = similar(A, (0, 0)), similar(A, (0, 0))
185185

186-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
186+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
187187

188188
if alg isa LAPACK_QRIteration
189189
isempty(alg_kwargs) ||
@@ -336,8 +336,8 @@ function svd_full!(A::AbstractMatrix, USVᴴ, alg::GPU_SVDAlgorithm)
336336
return USVᴴ
337337
end
338338

339-
do_gauge_fix = get(alg.kwargs, :gaugefix, default_gaugefix())::Bool
340-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
339+
do_gauge_fix = get(alg.kwargs, :fixgauge, default_fixgauge())::Bool
340+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
341341

342342
if alg isa GPU_QRIteration
343343
isempty(alg_kwargs) || @warn "invalid keyword arguments for GPU_QRIteration"
@@ -368,7 +368,7 @@ function svd_trunc!(A::AbstractMatrix, USVᴴ, alg::TruncatedAlgorithm{<:GPU_Ran
368368
# normal `truncation_error!` does not work here since `S` is not the full singular value spectrum
369369
ϵ = sqrt(norm(A)^2 - norm(diagview(Str))^2) # is there a more accurate way to do this?
370370

371-
do_gauge_fix = get(alg.alg.kwargs, :gaugefix, default_gaugefix())::Bool
371+
do_gauge_fix = get(alg.alg.kwargs, :fixgauge, default_fixgauge())::Bool
372372
do_gauge_fix && gaugefix!(svd_trunc!, Utr, Vᴴtr)
373373

374374
return Utr, Str, Vᴴtr, ϵ
@@ -378,8 +378,8 @@ function svd_compact!(A::AbstractMatrix, USVᴴ, alg::GPU_SVDAlgorithm)
378378
check_input(svd_compact!, A, USVᴴ, alg)
379379
U, S, Vᴴ = USVᴴ
380380

381-
do_gauge_fix = get(alg.kwargs, :gaugefix, default_gaugefix())::Bool
382-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
381+
do_gauge_fix = get(alg.kwargs, :fixgauge, default_fixgauge())::Bool
382+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
383383

384384
if alg isa GPU_QRIteration
385385
isempty(alg_kwargs) || @warn "invalid keyword arguments for GPU_QRIteration"
@@ -403,7 +403,7 @@ function svd_vals!(A::AbstractMatrix, S, alg::GPU_SVDAlgorithm)
403403
check_input(svd_vals!, A, S, alg)
404404
U, Vᴴ = similar(A, (0, 0)), similar(A, (0, 0))
405405

406-
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:gaugefix,)})
406+
alg_kwargs = Base.structdiff(alg.kwargs, NamedTuple{(:fixgauge,)})
407407

408408
if alg isa GPU_QRIteration
409409
isempty(alg_kwargs) || @warn "invalid keyword arguments for GPU_QRIteration"

0 commit comments

Comments
 (0)