Skip to content

Commit

Permalink
Don't test for \approx 0
Browse files Browse the repository at this point in the history
Fixes #12
  • Loading branch information
blakejohnson authored and matthewware committed Dec 14, 2018
1 parent 7ffb3c3 commit 61f382a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/testpaulis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ for i=1:20
@test weight(Pauli(vX + vY + vZ,rS)) == sum(v .> .25)
end

#
@test norm(X - [0 1; 1 0]) 0
@test norm(Y - [0 -1im;1im 0]) 0
@test norm(Z - [1 0; 0 -1]) 0
# Matrix conversions
@test complex(X) [0 1; 1 0]
@test complex(Y) [0 -1im; 1im 0]
@test complex(Z) [1 0; 0 -1]

This comment has been minimized.

Copy link
@stevengj

stevengj Dec 14, 2018

Why are these tests approximate? Shouldn't they be ==?

This comment has been minimized.

Copy link
@matthewware

matthewware Dec 14, 2018

Collaborator

They probably should be. I can't think of a reason where it would make sense to have these be approximate and not exact.


# Matrix arthimetic
@test norm(X - [0 1; 1 0]) == 0

This comment has been minimized.

Copy link
@stevengj

stevengj Dec 14, 2018

@test iszero(X - [0 1; 1 0]) would also work

@test norm(Y - [0 -1im;1im 0]) == 0
@test norm(Z - [1 0; 0 -1]) == 0

0 comments on commit 61f382a

Please sign in to comment.