@@ -3,9 +3,12 @@ using Test, TestExtras
33using MPSKit
44using MPSKit: GeometryStyle, FiniteChainStyle, InfiniteChainStyle, OperatorStyle, MPOStyle
55using TensorKit
6+ using MatrixAlgebraKit
67using TensorKit: ℙ, tensormaptype, TensorMapWithStorage
78using Adapt, CUDA, cuTENSOR
89
10+ MPSKit. Defaults. alg_svd () = CUSOLVER_QRIteration ()
11+
912@testset " CuFiniteMPO" for V in (ℂ^ 2 , U1Space (0 => 1 , 1 => 1 ))
1013 # start from random operators
1114 L = 4
@@ -15,15 +18,18 @@ using Adapt, CUDA, cuTENSOR
1518 O₂ = rand (T, space (O₁))
1619 O₃ = rand (real (T), space (O₁))
1720
18- mpo₁ = adapt (CuArray , FiniteMPO (O₁))
19- mpo₂ = adapt (CuArray , FiniteMPO (O₂))
20- mpo₃ = adapt (CuArray , FiniteMPO (O₃))
21+ mpo₁ = adapt (CuVector{T, CUDA . DeviceMemory} , FiniteMPO (O₁))
22+ mpo₂ = adapt (CuVector{T, CUDA . DeviceMemory} , FiniteMPO (O₂))
23+ mpo₃ = adapt (CuVector{T, CUDA . DeviceMemory} , FiniteMPO (O₃))
2124
2225 @test isfinite (mpo₁)
2326 @test isfinite (typeof (mpo₁))
2427 @test GeometryStyle (typeof (mpo₁)) == FiniteChainStyle ()
2528 @test GeometryStyle (mpo₁) == FiniteChainStyle ()
2629 @test OperatorStyle (typeof (mpo₁)) == MPOStyle ()
30+ @test TensorKit. storagetype (mpo₁) == CuVector{T, CUDA. DeviceMemory}
31+ @test TensorKit. storagetype (mpo₂) == CuVector{T, CUDA. DeviceMemory}
32+ @test TensorKit. storagetype (mpo₃) == CuVector{T, CUDA. DeviceMemory}
2733
2834 @test @constinferred physicalspace (mpo₁) == fill (V, L)
2935 Vleft = @constinferred left_virtualspace (mpo₁)
0 commit comments