From 884bc71a7910210d3bf62819daeb8a3aae47abb0 Mon Sep 17 00:00:00 2001 From: mtfishman Date: Thu, 9 May 2024 17:28:58 -0400 Subject: [PATCH] Fix more tests --- test/test_cucontract.jl | 5 +++-- test/test_cuitensor.jl | 3 ++- test/test_dmrg.jl | 2 -- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_cucontract.jl b/test/test_cucontract.jl index a99ea83..786f392 100644 --- a/test/test_cucontract.jl +++ b/test/test_cucontract.jl @@ -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 diff --git a/test/test_cuitensor.jl b/test/test_cuitensor.jl index 3691164..7bb7736 100644 --- a/test/test_cuitensor.jl +++ b/test/test_cuitensor.jl @@ -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...) diff --git a/test/test_dmrg.jl b/test/test_dmrg.jl index e3498bc..590b496 100644 --- a/test/test_dmrg.jl +++ b/test/test_dmrg.jl @@ -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