Skip to content

Commit 40dba2e

Browse files
committed
apply code suggestions
1 parent 4bdb660 commit 40dba2e

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/factorizations/factorizations.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ LinearAlgebra.svdvals!(t::AbstractTensorMap) = diagview(svd_vals!(t))
5858
function MAK.ishermitian(t::AbstractTensorMap; kwargs...)
5959
return InnerProductStyle(t) === EuclideanInnerProduct() &&
6060
domain(t) == codomain(t) &&
61-
all(cb -> MatrixAlgebraKit.ishermitian(cb[2]; kwargs...), blocks(t))
61+
all(cb -> MAK.ishermitian(cb[2]; kwargs...), blocks(t))
6262
end
6363
function MAK.isantihermitian(t::AbstractTensorMap; kwargs...)
6464
return InnerProductStyle(t) === EuclideanInnerProduct() &&
6565
domain(t) == codomain(t) &&
66-
all(cb -> MatrixAlgebraKit.isantihermitian(cb[2]; kwargs...), blocks(t))
66+
all(cb -> MAK.isantihermitian(cb[2]; kwargs...), blocks(t))
6767
end
6868
LinearAlgebra.ishermitian(t::AbstractTensorMap) = MAK.ishermitian(t)
6969

@@ -91,9 +91,5 @@ function MAK.is_right_isometric(t::AbstractTensorMap; kwargs...)
9191
f((c, b)) = MAK.is_right_isometric(b; kwargs...)
9292
return all(f, blocks(t))
9393
end
94-
function MAK.isisometric(t::AbstractTensorMap, (p₁, p₂)::Index2Tuple; kwargs...)
95-
t = permute(t, (p₁, p₂); copy = false)
96-
return MAK.isisometric(t; kwargs...)
97-
end
9894

9995
end

test/autodiff/ad.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ function remove_eighgauge_dependence!(
124124
ΔV, D, V; degeneracy_atol = MatrixAlgebraKit.default_pullback_degeneracy_atol(D)
125125
)
126126
gaugepart = project_antihermitian!(V' * ΔV)
127-
gaugepart = (gaugepart - gaugepart') / 2
128127
for (c, b) in blocks(gaugepart)
129128
Dc = diagview(block(D, c))
130129
# for some reason this fails only on tests, and I cannot reproduce it in an
@@ -597,7 +596,7 @@ for V in spacelist
597596
# Jacobian changes size if the truncation space changes, causing errors.
598597
# So, first test the fixed space case, then do more limited testing on
599598
# some gradients and compare to the fixed space case
600-
V_trunc = spacetype(t)(c => ceil(Int, min(size(b)...) / 2) for (c, b) in blocks(t))
599+
V_trunc = spacetype(t)(c => div(min(size(b)...), 2) for (c, b) in blocks(t))
601600
trunc = truncspace(V_trunc)
602601
USVᴴ_trunc = svd_trunc(t; trunc)
603602
ΔUSVᴴ_trunc = (rand_tangent.(Base.front(USVᴴ_trunc))..., zero(last(USVᴴ_trunc)))

0 commit comments

Comments
 (0)