Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
kmp5VT committed Nov 6, 2023
1 parent f3ce2ce commit 4b39f1e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions NDTensors/ext/examples/NDTensorCUDA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ function main()
end

function test_dmrg()
gpu = NDTensors.cu
gpu = NDTensors.cu

for n in [2, 50]
for n in [2, 50]
N = n
sites = siteinds("S=1", N)

Expand All @@ -135,17 +135,17 @@ function test_dmrg()
mindim!(sweeps, 1, 10)
cutoff!(sweeps, 1e-11)
noise!(sweeps, 1e-10)
energy, ψ = @time dmrg(H, ψ₀, sweeps);
tg = @elapsed dmrg(H, ψ₀, sweeps);
if n == 50
energy, ψ = @time dmrg(H, ψ₀, sweeps)
tg = @elapsed dmrg(H, ψ₀, sweeps)
if n == 50
@test tg < 10
end
cH = NDTensors.cpu(H);
cP = NDTensors.cpu(ψ₀);
cenergy, p = @time dmrg(cH, cP, sweeps);
@test energy cenergy
cH = NDTensors.cpu(H)
cP = NDTensors.cpu(ψ₀)
cenergy, p = @time dmrg(cH, cP, sweeps)
@test energy cenergy
end
end

main()
test_dmrg()
test_dmrg()

0 comments on commit 4b39f1e

Please sign in to comment.