Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix more tests
Browse files Browse the repository at this point in the history
mtfishman committed May 9, 2024
1 parent 56ee607 commit 884bc71
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions test/test_cucontract.jl
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ using CUDA
using ITensorGPU
using ITensors
using LinearAlgebra: tr
using Random: Random
using Test: @test, @testset

@testset "cuITensor $T Contractions" for T in (Float64, ComplexF64)
@@ -211,8 +212,8 @@ using Test: @test, @testset
end
@test Ccpu cpu(C)
for shuffles in 1:1 # too many permutations to test all
inds_a = shuffle(vcat(a_only_inds, shared_inds))
inds_b = shuffle(vcat(b_only_inds, shared_inds))
inds_a = Random.shuffle(vcat(a_only_inds, shared_inds))
inds_b = Random.shuffle(vcat(b_only_inds, shared_inds))
cA_ = permute(cA, inds_a...)
cB_ = permute(cB, inds_b...)
@disable_warn_order begin
3 changes: 2 additions & 1 deletion test/test_cuitensor.jl
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ using CUDA
using ITensorGPU
using ITensors
using LinearAlgebra: tr
using Random: Random
using Test: @test, @testset

# gpu tests!
@@ -40,7 +41,7 @@ using Test: @test, @testset
A = randomITensor(SType, (inds))
CA = cuITensor(A)
for shuffle_count in 1:20
perm_inds = shuffle(inds)
perm_inds = Random.shuffle(inds)
permCA = permute(CA, perm_inds...)
permA = cpu(permCA)
pA = permute(A, perm_inds...)
2 changes: 0 additions & 2 deletions test/test_dmrg.jl
Original file line number Diff line number Diff line change
@@ -23,8 +23,6 @@ end
dmrg_kwargs = (;
nsweeps=3, maxdim=[10, 20, 40], mindim=[1, 10], cutoff=1e-11, noise=1e-11
)
str = split(sprint(show, sweeps), '\n')
@test length(str) > 1
energy, psi = dmrg(H, psi; outputlevel=0, dmrg_kwargs...)
@test energy < -12.0
end

0 comments on commit 884bc71

Please sign in to comment.