From 51fe39d1acc1006cbd7f2c92110ce5c89890785a Mon Sep 17 00:00:00 2001 From: GiggleLiu Date: Sun, 16 Jun 2024 23:25:32 +0900 Subject: [PATCH] fix tests --- lib/YaoBlocks/test/primitive/time_evolution.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/YaoBlocks/test/primitive/time_evolution.jl b/lib/YaoBlocks/test/primitive/time_evolution.jl index 6c11bf05..a7474cf8 100644 --- a/lib/YaoBlocks/test/primitive/time_evolution.jl +++ b/lib/YaoBlocks/test/primitive/time_evolution.jl @@ -108,16 +108,16 @@ end mpb = mat(pb) allpass = true for i=basis(pb), j=basis(pb) - allpass &= pb[i, j] ≈ mpb[Int(i)+1, Int(j)+1] + allpass &= isapprox(pb[i, j], mpb[Int(i)+1, Int(j)+1]; atol=1e-6) end @test allpass allpass = true for j=basis(pb) - allpass &= vec(pb[:, j]) ≈ mpb[:, Int(j)+1] - allpass &= vec(pb[j,:]) ≈ mpb[Int(j)+1,:] - allpass &= vec(pb[:, EntryTable([j], [1.0+0im])]) ≈ mpb[:, Int(j)+1] - allpass &= vec(pb[EntryTable([j], [1.0+0im]),:]) ≈ mpb[Int(j)+1,:] + allpass &= isapprox(vec(pb[:, j]), mpb[:, Int(j)+1]; atol=1e-6) + allpass &= isapprox(vec(pb[j,:]), mpb[Int(j)+1,:]; atol=1e-6) + allpass &= isapprox(vec(pb[:, EntryTable([j], [1.0+0im])]), mpb[:, Int(j)+1]; atol=1e-6) + allpass &= isapprox(vec(pb[EntryTable([j], [1.0+0im]),:]), mpb[Int(j)+1,:]; atol=1e-6) allpass &= isclean(pb[:,j]) end @test allpass