Skip to content

Commit 82d5e8d

Browse files
committed
remove sSQRTZ, update tests
1 parent 3a5f82a commit 82d5e8d

File tree

3 files changed

+9
-43
lines changed

3 files changed

+9
-43
lines changed

src/QuantumClifford.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export
5353
# Symbolic Clifford Ops
5454
AbstractSymbolicOperator, AbstractSingleQubitOperator, AbstractTwoQubitOperator,
5555
sHadamard, sPhase, sInvPhase, SingleQubitOperator, sId1, sX, sY, sZ,
56-
sHadamardXY, sHadamardYZ, sSQRTX, sInvSQRTX, sSQRTY, sInvSQRTY, sSQRTZ, sInvSQRTZ, sCXYZ, sCZYX,
56+
sHadamardXY, sHadamardYZ, sSQRTX, sInvSQRTX, sSQRTY, sInvSQRTY, sCXYZ, sCZYX,
5757
sCNOT, sCPHASE, sSWAP,
5858
sXCX, sXCY, sXCZ, sYCX, sYCY, sYCZ, sZCX, sZCY, sZCZ,
5959
sZCrY, sInvZCrY, sSWAPCX, sInvSWAPCX, sCZSWAP, sCXSWAP, sISWAP, sInvISWAP,

test/test_apply_right.jl

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,10 @@
1515
l = random_clifford(q)
1616
q1 = rand(1:q)
1717

18-
@test isequal(apply_right!(copy(l), sHadamard(q1)), apply_right_slow!(l, sHadamard(q1)))
19-
@test isequal(apply_right!(copy(l), sHadamardXY(q1)), apply_right_slow!(l, sHadamardXY(q1)))
20-
@test isequal(apply_right!(copy(l), sHadamardYZ(q1)), apply_right_slow!(l, sHadamardYZ(q1)))
21-
@test isequal(apply_right!(copy(l), sPhase(q1)), apply_right_slow!(l, sPhase(q1)))
22-
@test isequal(apply_right!(copy(l), sInvPhase(q1)), apply_right_slow!(l, sInvPhase(q1)))
23-
@test isequal(apply_right!(copy(l), sX(q1)), apply_right_slow!(l, sX(q1)))
24-
@test isequal(apply_right!(copy(l), sY(q1)), apply_right_slow!(l, sY(q1)))
25-
@test isequal(apply_right!(copy(l), sZ(q1)), apply_right_slow!(l, sZ(q1)))
26-
@test isequal(apply_right!(copy(l), sSQRTX(q1)), apply_right_slow!(l, sSQRTX(q1)))
27-
@test isequal(apply_right!(copy(l), sInvSQRTX(q1)), apply_right_slow!(l, sInvSQRTX(q1)))
28-
@test isequal(apply_right!(copy(l), sSQRTY(q1)), apply_right_slow!(l, sSQRTY(q1)))
29-
@test isequal(apply_right!(copy(l), sInvSQRTY(q1)), apply_right_slow!(l, sInvSQRTY(q1)))
30-
@test isequal(apply_right!(copy(l), sCXYZ(q1)), apply_right_slow!(l, sCXYZ(q1)))
31-
@test isequal(apply_right!(copy(l), sCZYX(q1)), apply_right_slow!(l, sCZYX(q1)))
32-
@test isequal(apply_right!(copy(l), sId1(q1)), apply_right_slow!(l, sId1(q1)))
18+
for gate in subtypes(AbstractSingleQubitOperator)
19+
gate == SingleQubitOperator && continue
20+
@test isequal(apply_right!(copy(l), gate(q1)), apply_right_slow!(l, gate(q1)))
21+
end
3322
end
3423
end
3524

@@ -38,32 +27,9 @@
3827
l = random_clifford(q)
3928
q1 = rand(1:q); q2 = rand(setdiff(1:q, [q1]))
4029

41-
@test isequal(apply_right!(copy(l), sSWAP(q1, q2)), apply_right_slow!(l, sSWAP(q1, q2)))
42-
@test isequal(apply_right!(copy(l), sSWAPCX(q1, q2)), apply_right_slow!(l, sSWAPCX(q1, q2)))
43-
@test isequal(apply_right!(copy(l), sInvSWAPCX(q1, q2)), apply_right_slow!(l, sInvSWAPCX(q1, q2)))
44-
@test isequal(apply_right!(copy(l), sISWAP(q1, q2)), apply_right_slow!(l, sISWAP(q1, q2)))
45-
@test isequal(apply_right!(copy(l), sInvISWAP(q1, q2)), apply_right_slow!(l, sInvISWAP(q1, q2)))
46-
@test isequal(apply_right!(copy(l), sCZSWAP(q1, q2)), apply_right_slow!(l, sCZSWAP(q1, q2)))
47-
@test isequal(apply_right!(copy(l), sCXSWAP(q1, q2)), apply_right_slow!(l, sCXSWAP(q1, q2)))
48-
@test isequal(apply_right!(copy(l), sCNOT(q1, q2)), apply_right_slow!(l, sCNOT(q1, q2)))
49-
@test isequal(apply_right!(copy(l), sCPHASE(q1, q2)), apply_right_slow!(l, sCPHASE(q1, q2)))
50-
@test isequal(apply_right!(copy(l), sZCX(q1, q2)), apply_right_slow!(l, sZCX(q1, q2)))
51-
@test isequal(apply_right!(copy(l), sZCY(q1, q2)), apply_right_slow!(l, sZCY(q1, q2)))
52-
@test isequal(apply_right!(copy(l), sZCZ(q1, q2)), apply_right_slow!(l, sZCZ(q1, q2)))
53-
@test isequal(apply_right!(copy(l), sXCX(q1, q2)), apply_right_slow!(l, sXCX(q1, q2)))
54-
@test isequal(apply_right!(copy(l), sXCY(q1, q2)), apply_right_slow!(l, sXCY(q1, q2)))
55-
@test isequal(apply_right!(copy(l), sXCZ(q1, q2)), apply_right_slow!(l, sXCZ(q1, q2)))
56-
@test isequal(apply_right!(copy(l), sYCX(q1, q2)), apply_right_slow!(l, sYCX(q1, q2)))
57-
@test isequal(apply_right!(copy(l), sYCY(q1, q2)), apply_right_slow!(l, sYCY(q1, q2)))
58-
@test isequal(apply_right!(copy(l), sYCZ(q1, q2)), apply_right_slow!(l, sYCZ(q1, q2)))
59-
@test isequal(apply_right!(copy(l), sZCrY(q1, q2)), apply_right_slow!(l, sZCrY(q1, q2)))
60-
@test isequal(apply_right!(copy(l), sInvZCrY(q1, q2)), apply_right_slow!(l, sInvZCrY(q1, q2)))
61-
@test isequal(apply_right!(copy(l), sSQRTZZ(q1, q2)), apply_right_slow!(l, sSQRTZZ(q1, q2)))
62-
@test isequal(apply_right!(copy(l), sInvSQRTZZ(q1, q2)), apply_right_slow!(l, sInvSQRTZZ(q1, q2)))
63-
@test isequal(apply_right!(copy(l), sSQRTXX(q1, q2)), apply_right_slow!(l, sSQRTXX(q1, q2)))
64-
@test isequal(apply_right!(copy(l), sInvSQRTXX(q1, q2)), apply_right_slow!(l, sInvSQRTXX(q1, q2)))
65-
@test isequal(apply_right!(copy(l), sSQRTYY(q1, q2)), apply_right_slow!(l, sSQRTYY(q1, q2)))
66-
@test isequal(apply_right!(copy(l), sInvSQRTYY(q1, q2)), apply_right_slow!(l, sInvSQRTYY(q1, q2)))
30+
for gate in subtypes(AbstractTwoQubitOperator)
31+
@test isequal(apply_right!(copy(l), gate(q1, q2)), apply_right_slow!(l, gate(q1, q2)))
32+
end
6733
end
6834
end
6935
end

test/test_inv.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
stabilizers = [S" I", S" X", S" Y", S" Z",
66
S"-I", S"-X", S"-Y", S"-Z",]
77
for gate in subtypes(AbstractSingleQubitOperator)
8-
gate [SingleQubitOperator, sSQRTZ, sInvSQRTZ] && continue
8+
gate == SingleQubitOperator && continue
99
for stab in stabilizers
1010
@test apply_inv!(stab, gate(1)) == apply!(stab, inv(CliffordOperator(gate(1), 1)))
1111
end

0 commit comments

Comments
 (0)