From b37f6975a55b9bd9ccf666bb131fbbe522fee439 Mon Sep 17 00:00:00 2001 From: Karl Pierce Date: Fri, 17 May 2024 10:42:54 -0400 Subject: [PATCH] Fix trace test --- test/base/test_itensor.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/base/test_itensor.jl b/test/base/test_itensor.jl index f7366cbbbb..62feb98b58 100644 --- a/test/base/test_itensor.jl +++ b/test/base/test_itensor.jl @@ -316,17 +316,19 @@ end @test ndims(A) == 0 end - @testset "trace (tr) (eltype=$elt)" for elt in (Float32, Float64, Complex{Float32}, Complex{Float64}) + @testset "trace (tr) (eltype=$elt)" for elt in ( + Float32, Float64, Complex{Float32}, Complex{Float64} + ) i, j, k, l = Index.((2, 3, 4, 5), ("i", "j", "k", "l")) - T = random_itensor(ElType, j, k', i', k, j', i) + T = random_itensor(elt, j, k', i', k, j', i) trT1 = tr(T) - trT2 = (T * δ(ElType, i, i') * δ(ElType, j, j') * δ(ElType, k, k'))[] + trT2 = (T * δ(elt, i, i') * δ(elt, j, j') * δ(elt, k, k'))[] @test trT1 ≈ trT2 - T = random_itensor(ElType, j, k', i', l, k, j', i) + T = random_itensor(elt, j, k', i', l, k, j', i) trT1 = tr(T) @test eltype(trT1) === elt - trT2 = T * δ(ElType, i, i') * δ(ElType, j, j') * δ(ElType, k, k') + trT2 = T * δ(elt, i, i') * δ(elt, j, j') * δ(elt, k, k') @test trT1 ≈ trT2 end