Skip to content

Commit 617843c

Browse files
committed
more tests for sZCrY
1 parent 73ccb34 commit 617843c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/test_symcontrolled.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,21 @@
125125
end
126126
end
127127
end
128+
129+
@testset "Ket-based definition for Y and rY" begin
130+
for control in (:Z,)
131+
target = :Y
132+
for r in (true, false)
133+
s = Stabilizer(QuantumClifford._T_str(string(control)))
134+
k1 = Ket(s)
135+
s.tab.phases[1] = 0x2
136+
k2 = Ket(s)
137+
i = Operator(tId1)
138+
o = Operator(CliffordOperator(eval(Symbol(:s,target,))(1),1))
139+
gate = projector(k1)i + (r ? -1 : -im) * projector(k2)o # XXX there is a -1 here because global phase is arbitrary and thus our Operator(tY) is NOT im*Operator(X)*Operator(Z)
140+
implemented_gate = Operator(CliffordOperator(eval(Symbol(:s,control,:C,(r ? :rY : :Y)))(1,2),2))
141+
@test gateimplemented_gate
142+
end
143+
end
144+
end
128145
end

0 commit comments

Comments
 (0)