77 apply! (CliffordOperator (r, nqubits (l)), l; phases= phases)
88 end
99
10- q = 2
11- shots = 1
10+ q = 64
11+ shots = 16
1212
1313 # @testset "Apply Right single-qubit" begin
1414 # for gate in subtypes(AbstractSingleQubitOperator)
15- # if gate in [sPhase, sInvPhase, SingleQubitOperator, sXYZ, sZYX ]
15+ # if gate in [sPhase, sInvPhase, SingleQubitOperator, sCXYZ, sCZYX ]
1616 # continue
1717 # end
1818 # r = gate(rand(1:q))
4747 @test isequal (apply_right! (copy (l), sHadamard (q1)), apply_right_slow! (l, sHadamard (q1)))
4848 @test isequal (apply_right! (copy (l), sHadamardXY (q1)), apply_right_slow! (l, sHadamardXY (q1)))
4949 @test isequal (apply_right! (copy (l), sHadamardYZ (q1)), apply_right_slow! (l, sHadamardYZ (q1)))
50- @test isequal (apply_right! (copy (l), sPhase (q1)), apply_right_slow! (l, sPhase (q1)))
50+ # @test isequal(apply_right!(copy(l), sPhase(q1)), apply_right_slow!(l, sPhase(q1)))
5151 # @test isequal(apply_right!(copy(l), sInvPhase(q1)), apply_right_slow!(l, sInvPhase(q1)))
5252 @test isequal (apply_right! (copy (l), sX (q1)), apply_right_slow! (l, sX (q1)))
5353 @test isequal (apply_right! (copy (l), sY (q1)), apply_right_slow! (l, sY (q1)))
5656 @test isequal (apply_right! (copy (l), sInvSQRTX (q1)), apply_right_slow! (l, sInvSQRTX (q1)))
5757 @test isequal (apply_right! (copy (l), sSQRTY (q1)), apply_right_slow! (l, sSQRTY (q1)))
5858 @test isequal (apply_right! (copy (l), sInvSQRTY (q1)), apply_right_slow! (l, sInvSQRTY (q1)))
59+ # @test isequal(apply_right!(copy(l), sSQRTZ(q1)), apply_right_slow!(l, sSQRTZ(q1)))
60+ # @test isequal(apply_right!(copy(l), sInvSQRTZ(q1)), apply_right_slow!(l, sInvSQRTZ(q1)))
5961 # @test isequal(apply_right!(copy(l), sCXYZ(q1)), apply_right_slow!(l, sCXYZ(q1)))
6062 # @test isequal(apply_right!(copy(l), sCZYX(q1)), apply_right_slow!(l, sCZYX(q1)))
6163 @test isequal (apply_right! (copy (l), sId1 (q1)), apply_right_slow! (l, sId1 (q1)))
6264 end
6365 end
6466
65- # @testset "Apply Right two-qubit" begin
66- # for _ in 1:shots
67- # l = random_clifford(q)
68- # q1 = rand(1:q); q2 = rand(setdiff(1:q, [q1]))
67+ @testset " Apply Right two-qubit" begin
68+ for _ in 1 : shots
69+ l = random_clifford (q)
70+ q1 = rand (1 : q); q2 = rand (setdiff (1 : q, [q1]))
6971
70- # @test isequal(apply_right!(copy(l), sSWAP(q1, q2)), apply_right_slow!(l, sSWAP(q1, q2)))
71- # # @test isequal(apply_right!(copy(l), sSWAPCX(q1, q2)), apply_right_slow!(l, sSWAPCX(q1, q2)))
72- # # @test isequal(apply_right!(copy(l), sInvSWAPCX(q1, q2)), apply_right_slow!(l, sInvSWAPCX(q1, q2)))
73- # @test isequal(apply_right!(copy(l), sISWAP(q1, q2)), apply_right_slow!(l, sISWAP(q1, q2)))
74- # @test isequal(apply_right!(copy(l), sInvISWAP(q1, q2)), apply_right_slow!(l, sInvISWAP(q1, q2)))
75- # # @test isequal(apply_right!(copy(l), sCZSWAP(q1, q2)), apply_right_slow!(l, sCZSWAP(q1, q2)))
76- # # @test isequal(apply_right!(copy(l), sCXSWAP(q1, q2)), apply_right_slow!(l, sCXSWAP(q1, q2)))
77- # @test isequal(apply_right!(copy(l), sCNOT(q1, q2)), apply_right_slow!(l, sCNOT(q1, q2)))
78- # # @test isequal(apply_right!(copy(l), sCPHASE(q1, q2)), apply_right_slow!(l, sCPHASE(q1, q2)))
79- # @test isequal(apply_right!(copy(l), sZCX(q1, q2)), apply_right_slow!(l, sZCX(q1, q2)))
80- # @test isequal(apply_right!(copy(l), sZCY(q1, q2)), apply_right_slow!(l, sZCY(q1, q2)))
81- # @test isequal(apply_right!(copy(l), sZCZ(q1, q2)), apply_right_slow!(l, sZCZ(q1, q2)))
82- # @test isequal(apply_right!(copy(l), sXCX(q1, q2)), apply_right_slow!(l, sXCX(q1, q2)))
83- # @test isequal(apply_right!(copy(l), sXCY(q1, q2)), apply_right_slow!(l, sXCY(q1, q2)))
84- # @test isequal(apply_right!(copy(l), sXCZ(q1, q2)), apply_right_slow!(l, sXCZ(q1, q2)))
85- # @test isequal(apply_right!(copy(l), sYCX(q1, q2)), apply_right_slow!(l, sYCX(q1, q2)))
86- # @test isequal(apply_right!(copy(l), sYCY(q1, q2)), apply_right_slow!(l, sYCY(q1, q2)))
87- # @test isequal(apply_right!(copy(l), sYCZ(q1, q2)), apply_right_slow!(l, sYCZ(q1, q2)))
88- # # @test isequal(apply_right!(copy(l), sZCrY(q1, q2)), apply_right_slow!(l, sZCrY(q1, q2)))
89- # # @test isequal(apply_right!(copy(l), sInvZCrY(q1, q2)), apply_right_slow!(l, sInvZCrY(q1, q2)))
90- # @test isequal(apply_right!(copy(l), sSQRTZZ(q1, q2)), apply_right_slow!(l, sSQRTZZ(q1, q2)))
91- # @test isequal(apply_right!(copy(l), sInvSQRTZZ(q1, q2)), apply_right_slow!(l, sInvSQRTZZ(q1, q2)))
92- # @test isequal(apply_right!(copy(l), sSQRTXX(q1, q2)), apply_right_slow!(l, sSQRTXX(q1, q2)))
93- # @test isequal(apply_right!(copy(l), sInvSQRTXX(q1, q2)), apply_right_slow!(l, sInvSQRTXX(q1, q2)))
94- # @test isequal(apply_right!(copy(l), sSQRTYY(q1, q2)), apply_right_slow!(l, sSQRTYY(q1, q2)))
95- # @test isequal(apply_right!(copy(l), sInvSQRTYY(q1, q2)), apply_right_slow!(l, sInvSQRTYY(q1, q2)))
96- # end
97- # end
72+ @test isequal (apply_right! (copy (l), sSWAP (q1, q2)), apply_right_slow! (l, sSWAP (q1, q2)))
73+ # @test isequal(apply_right!(copy(l), sSWAPCX(q1, q2)), apply_right_slow!(l, sSWAPCX(q1, q2)))
74+ # @test isequal(apply_right!(copy(l), sInvSWAPCX(q1, q2)), apply_right_slow!(l, sInvSWAPCX(q1, q2)))
75+ @test isequal (apply_right! (copy (l), sISWAP (q1, q2)), apply_right_slow! (l, sISWAP (q1, q2)))
76+ @test isequal (apply_right! (copy (l), sInvISWAP (q1, q2)), apply_right_slow! (l, sInvISWAP (q1, q2)))
77+ # @test isequal(apply_right!(copy(l), sCZSWAP(q1, q2)), apply_right_slow!(l, sCZSWAP(q1, q2)))
78+ # @test isequal(apply_right!(copy(l), sCXSWAP(q1, q2)), apply_right_slow!(l, sCXSWAP(q1, q2)))
79+ @test isequal (apply_right! (copy (l), sCNOT (q1, q2)), apply_right_slow! (l, sCNOT (q1, q2)))
80+ # @test isequal(apply_right!(copy(l), sCPHASE(q1, q2)), apply_right_slow!(l, sCPHASE(q1, q2)))
81+ @test isequal (apply_right! (copy (l), sZCX (q1, q2)), apply_right_slow! (l, sZCX (q1, q2)))
82+ @test isequal (apply_right! (copy (l), sZCY (q1, q2)), apply_right_slow! (l, sZCY (q1, q2)))
83+ @test isequal (apply_right! (copy (l), sZCZ (q1, q2)), apply_right_slow! (l, sZCZ (q1, q2)))
84+ @test isequal (apply_right! (copy (l), sXCX (q1, q2)), apply_right_slow! (l, sXCX (q1, q2)))
85+ @test isequal (apply_right! (copy (l), sXCY (q1, q2)), apply_right_slow! (l, sXCY (q1, q2)))
86+ @test isequal (apply_right! (copy (l), sXCZ (q1, q2)), apply_right_slow! (l, sXCZ (q1, q2)))
87+ @test isequal (apply_right! (copy (l), sYCX (q1, q2)), apply_right_slow! (l, sYCX (q1, q2)))
88+ @test isequal (apply_right! (copy (l), sYCY (q1, q2)), apply_right_slow! (l, sYCY (q1, q2)))
89+ @test isequal (apply_right! (copy (l), sYCZ (q1, q2)), apply_right_slow! (l, sYCZ (q1, q2)))
90+ # @test isequal(apply_right!(copy(l), sZCrY(q1, q2)), apply_right_slow!(l, sZCrY(q1, q2)))
91+ # @test isequal(apply_right!(copy(l), sInvZCrY(q1, q2)), apply_right_slow!(l, sInvZCrY(q1, q2)))
92+ @test isequal (apply_right! (copy (l), sSQRTZZ (q1, q2)), apply_right_slow! (l, sSQRTZZ (q1, q2)))
93+ @test isequal (apply_right! (copy (l), sInvSQRTZZ (q1, q2)), apply_right_slow! (l, sInvSQRTZZ (q1, q2)))
94+ @test isequal (apply_right! (copy (l), sSQRTXX (q1, q2)), apply_right_slow! (l, sSQRTXX (q1, q2)))
95+ @test isequal (apply_right! (copy (l), sInvSQRTXX (q1, q2)), apply_right_slow! (l, sInvSQRTXX (q1, q2)))
96+ @test isequal (apply_right! (copy (l), sSQRTYY (q1, q2)), apply_right_slow! (l, sSQRTYY (q1, q2)))
97+ @test isequal (apply_right! (copy (l), sInvSQRTYY (q1, q2)), apply_right_slow! (l, sInvSQRTYY (q1, q2)))
98+ end
99+ end
98100end
0 commit comments