Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "KroneckerArrays"
uuid = "05d0b138-81bc-4ff7-84be-08becefb1ccc"
authors = ["ITensor developers <[email protected]> and contributors"]
version = "0.2.4"
version = "0.2.5"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down Expand Up @@ -35,7 +35,7 @@ FillArrays = "1.13"
GPUArraysCore = "0.2"
LinearAlgebra = "1.10"
MapBroadcast = "0.1.10"
MatrixAlgebraKit = "0.2, 0.3, 0.4"
MatrixAlgebraKit = "0.2, 0.3, 0.4, 0.5"
TensorAlgebra = "0.3.10, 0.4"
TensorProducts = "0.1.7"
TypeParameterAccessors = "0.4.2"
Expand Down
20 changes: 10 additions & 10 deletions src/matrixalgebrakit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ using MatrixAlgebraKit:
svd_trunc,
svd_vals!,
svd_vals,
truncate!
truncate

using DiagonalArrays: DiagonalArrays, diagview
function DiagonalArrays.diagview(a::KroneckerMatrix)
Expand Down Expand Up @@ -203,7 +203,7 @@ end

# Truncation

using MatrixAlgebraKit: TruncationStrategy, findtruncated, truncate!
using MatrixAlgebraKit: TruncationStrategy, findtruncated, truncate

struct KroneckerTruncationStrategy{T <: TruncationStrategy} <: TruncationStrategy
strategy::T
Expand Down Expand Up @@ -256,30 +256,30 @@ end

for f in [:eig_trunc!, :eigh_trunc!]
@eval begin
function MatrixAlgebraKit.truncate!(
function MatrixAlgebraKit.truncate(
::typeof($f), DV::NTuple{2, KroneckerMatrix}, strategy::TruncationStrategy
)
return truncate!($f, DV, KroneckerTruncationStrategy(strategy))
return truncate($f, DV, KroneckerTruncationStrategy(strategy))
end
function MatrixAlgebraKit.truncate!(
function MatrixAlgebraKit.truncate(
::typeof($f), (D, V)::NTuple{2, KroneckerMatrix}, strategy::KroneckerTruncationStrategy
)
I = findtruncated(diagview(D), strategy)
return (D[I, I], V[(:) × (:), I])
return (D[I, I], V[(:) × (:), I]), I
end
end
end

function MatrixAlgebraKit.truncate!(
function MatrixAlgebraKit.truncate(
f::typeof(svd_trunc!), USVᴴ::NTuple{3, KroneckerMatrix}, strategy::TruncationStrategy
)
return truncate!(f, USVᴴ, KroneckerTruncationStrategy(strategy))
return truncate(f, USVᴴ, KroneckerTruncationStrategy(strategy))
end
function MatrixAlgebraKit.truncate!(
function MatrixAlgebraKit.truncate(
::typeof(svd_trunc!),
(U, S, Vᴴ)::NTuple{3, KroneckerMatrix},
strategy::KroneckerTruncationStrategy,
)
I = findtruncated(diagview(S), strategy)
return (U[(:) × (:), I], S[I, I], Vᴴ[I, (:) × (:)])
return (U[(:) × (:), I], S[I, I], Vᴴ[I, (:) × (:)]), I
end
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ GPUArraysCore = "0.2"
JLArrays = "0.2"
KroneckerArrays = "0.2"
LinearAlgebra = "1.10"
MatrixAlgebraKit = "0.2, 0.3, 0.4"
MatrixAlgebraKit = "0.2, 0.3, 0.4, 0.5"
SafeTestsets = "0.1"
StableRNGs = "1.0"
Suppressor = "0.2"
Expand Down
Loading