Skip to content

Commit e428a7e

Browse files
committed
Enable more tests
1 parent b8169a9 commit e428a7e

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

test/cuda/operators.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ using MatrixAlgebraKit
77
using TensorKit: ℙ, tensormaptype, TensorMapWithStorage
88
using Adapt, CUDA, cuTENSOR
99

10+
# TODO revisit this once https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/issues/176
11+
# is resolved
1012
MPSKit.Defaults.alg_svd() = CUSOLVER_QRIteration()
1113

1214
@testset "CuFiniteMPO" for V in (ℂ^2, U1Space(0 => 1, 1 => 1))

test/cuda/states.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using MPSKit: _transpose_front, _transpose_tail
33
using MPSKit: GeometryStyle, InfiniteChainStyle, TransferMatrix
44
using TensorKit
55
using TensorKit:
6-
using Adapt, CUDA
6+
using Adapt, CUDA, cuTENSOR
77

88
@testset "CuMPS ($(sectortype(D)), $elt)" for (D, d, elt) in
99
[(ℙ^10, ℙ^2, ComplexF64), (Rep[U₁](1 => 3), Rep[U₁](0 => 1), ComplexF64)]
@@ -13,7 +13,7 @@ using Adapt, CUDA
1313
@test TensorKit.storagetype(ψ) == CuVector{ComplexF64, CUDA.DeviceMemory}
1414
@test eltype(ψ) == eltype(typeof(ψ))
1515

16-
#=for i in 1:length(ψ)
16+
for i in 1:length(ψ)
1717
@plansor difference[-1 -2; -3] := ψ.AL[i][-1 -2; 1] * ψ.C[i][1; -3] -
1818
ψ.C[i - 1][-1; 1] * ψ.AR[i][1 -2; -3]
1919
@test norm(difference, Inf) < tol * 10
@@ -27,19 +27,19 @@ using Adapt, CUDA
2727
@test TransferMatrix.AL[i], ψ.AR[i]) * r_LR(ψ, i) r_LR(ψ, i + 1)
2828
@test TransferMatrix.AR[i], ψ.AL[i]) * r_RL(ψ, i) r_RL(ψ, i + 1)
2929
@test TransferMatrix.AR[i], ψ.AR[i]) * r_RR(ψ, i) r_RR(ψ, i + 1)
30-
end=# # TODO
30+
end
3131

3232
L = rand(3:20)
3333
ψ = adapt(CuArray, FiniteMPS(rand, elt, L, d, D))
3434
@test TensorKit.storagetype(ψ) == CuVector{ComplexF64, CUDA.DeviceMemory}
3535
@test eltype(ψ) == eltype(typeof(ψ))
36-
#=ovl = dot(ψ, ψ)
36+
ovl = dot(ψ, ψ)
3737

3838
@test ovl norm.AC[1])^2
3939

4040
for i in 1:length(ψ)
4141
@test ψ.AC[i] ψ.AL[i] * ψ.C[i]
42-
#@test ψ.AC[i] ≈ _transpose_front(ψ.C[i - 1] * _transpose_tail(ψ.AR[i])) # TODO
42+
@test ψ.AC[i] _transpose_front.C[i - 1] * _transpose_tail.AR[i]))
4343
end
4444

4545
@test ComplexF64 == scalartype(ψ)
@@ -48,5 +48,5 @@ using Adapt, CUDA
4848
ψ = 3 * ψ
4949
@test ovl * 9 * 9 norm(ψ)^2
5050

51-
@test norm(2 * ψ + ψ - 3 * ψ) ≈ 0.0 atol = sqrt(eps(real(ComplexF64)))=# # TODO
51+
@test norm(2 * ψ + ψ - 3 * ψ) 0.0 atol = sqrt(eps(real(ComplexF64)))
5252
end

0 commit comments

Comments
 (0)