Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nzy committed Jul 2, 2024
1 parent 3ca71df commit 79aa2dc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/YaoBlocks/test/primitive/time_evolution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,18 @@ 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, rtol=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, rtol=1e-6)
allpass &= isapprox(vec(pb[j,:]), mpb[Int(j)+1,:]; atol=1e-6, rtol=1e-6)
allpass &= isapprox(vec(pb[:, EntryTable([j], [1.0+0im])]), mpb[:, Int(j)+1]; atol=1e-6, rtol=1e-6)
allpass &= isapprox(vec(pb[EntryTable([j], [1.0+0im]),:]), mpb[Int(j)+1,:]; atol=1e-6, rtol=1e-6)
allpass &= isclean(pb[:,j])
end
@test allpass
end
end
end

0 comments on commit 79aa2dc

Please sign in to comment.