From 65b9615d4251aa2b76b33bb23923b5618cb3b8a0 Mon Sep 17 00:00:00 2001 From: Karl Pierce Date: Wed, 14 Aug 2024 16:28:47 -0400 Subject: [PATCH] Need conj to approximate the norm --- NDTensors/test/test_diag.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NDTensors/test/test_diag.jl b/NDTensors/test/test_diag.jl index b5fa998b9e..cb8adc367a 100644 --- a/NDTensors/test/test_diag.jl +++ b/NDTensors/test/test_diag.jl @@ -63,7 +63,7 @@ using .NDTensorsTestUtils: devices_list, is_supported_eltype @test x == dev(diagm(0 => vr)) @test x == D end - @test sqrt(contract(D, (-1, -2), D, (-1, -2))[]) ≈ norm(D) + @test sqrt(contract(D, (-1, -2), conj(D), (-1, -2))[]) ≈ norm(D) # This if statement corresponds to the reported bug: # https://github.com/JuliaGPU/Metal.jl/issues/364 if !(dev == NDTensors.mtl && elt === ComplexF32)