Skip to content

Commit 9341d1d

Browse files
lkdvosmtfishman
andauthored
Add missing trunc arguments to eigen functions (#65)
Co-authored-by: Matt Fishman <[email protected]>
1 parent d3512a4 commit 9341d1d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TensorAlgebra"
22
uuid = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a"
33
authors = ["ITensor developers <[email protected]> and contributors"]
4-
version = "0.3.8"
4+
version = "0.3.9"
55

66
[deps]
77
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/MatrixAlgebra.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,19 @@ for (eigen, eigh_full, eig_full, eigh_trunc, eig_trunc) in (
4444
@eval begin
4545
function $eigen(A::AbstractMatrix; trunc=nothing, ishermitian=nothing, kwargs...)
4646
ishermitian = @something ishermitian LinearAlgebra.ishermitian(A)
47-
f = if !isnothing(trunc)
48-
ishermitian ? $eigh_trunc : $eig_trunc
47+
return if !isnothing(trunc)
48+
if ishermitian
49+
$eigh_trunc(A; trunc, kwargs...)
50+
else
51+
$eig_trunc(A; trunc, kwargs...)
52+
end
4953
else
50-
ishermitian ? $eigh_full : $eig_full
54+
if ishermitian
55+
$eigh_full(A; kwargs...)
56+
else
57+
$eig_full(A; kwargs...)
58+
end
5159
end
52-
return f(A; kwargs...)
5360
end
5461
end
5562
end

0 commit comments

Comments
 (0)