-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
matthewware
Collaborator
|
||
|
||
# Matrix arthimetic | ||
@test norm(X - [0 1; 1 0]) == 0 | ||
This comment has been minimized.
Sorry, something went wrong. |
||
@test norm(Y - [0 -1im;1im 0]) == 0 | ||
@test norm(Z - [1 0; 0 -1]) == 0 |
Why are these tests approximate? Shouldn't they be
==
?