Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GiggleLiu committed Jun 16, 2024
1 parent 937e672 commit 51fe39d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/YaoBlocks/test/primitive/time_evolution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 51fe39d

Please sign in to comment.