Skip to content

Commit 99ccd91

Browse files
committed
naming changes
1 parent 6bb3d09 commit 99ccd91

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

src/backtrajectory.jl

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,8 @@ function backtrajectory(circuit::Vector{<:AbstractOperation}, n::Int)
4444
for op in circuit
4545
if op isa AbstractCliffordOperator
4646
apply_right!(T, op)
47-
elseif op isa sMX
48-
push!(results, do_MX!(T, op))
49-
elseif op isa sMY
50-
push!(results, do_MY!(T, op))
51-
elseif op isa sMZ
52-
push!(results, do_MZ!(T, op))
47+
elseif op isa AbstractMeasurement
48+
push!(results, do_measure!(T, op))
5349
elseif op isa sMRX
5450
push!(results, do_MRX!(T, op))
5551
elseif op isa sMRY
@@ -67,7 +63,7 @@ function backtrajectory(circuit::Vector{<:AbstractOperation}, n::Int)
6763
end
6864

6965

70-
function do_MX!(T, op::sMX)
66+
function do_measure!(T, op::sMX)
7167
collapse_x!(T, op.qubit)
7268
return phases(tab(T))[op.qubit] == 0x00 ? 1 : -1
7369
end
@@ -96,7 +92,7 @@ function collapse_x!(T, q::Int)
9692
apply_right!(T, sHadamard(q))
9793
end
9894

99-
function do_MY!(T, op::sMY)
95+
function do_measure!(T, op::sMY)
10096
collapse_y!(T, op.qubit)
10197
return eval_y_obs(T, op.qubit).phase[] == 0x00 ? 1 : -1
10298
end
@@ -141,7 +137,7 @@ function eval_y_obs(T, q::Int)
141137
return result
142138
end
143139

144-
function do_MZ!(T, op::sMZ)
140+
function do_measure!(T, op::sMZ)
145141
collapse_z!(T, op.qubit)
146142
return phases(tab(T))[nqubits(T)+op.qubit] == 0x00 ? 1 : -1
147143
end
@@ -209,6 +205,20 @@ end
209205
@inline getzbytes(T, r) = tab(T).xzs[2:2:end,r]
210206

211207

208+
# function do_measure!(T, op::PauliMeasurement)
209+
# h_xz = []
210+
# h_yz = []
211+
# cnot = []
212+
# meas = []
213+
214+
# start = 0
215+
216+
# end
217+
218+
# function do_set!(T, state)
219+
# end
220+
221+
212222
# function backtrajectory(circuit0::Vector{AbstractOperation}, state::AbstractStabilizer)
213223
# # TODO - Figure out if to use Reset or Gates
214224
# pushfirst!(circuit0, Reset(state, 1:nqubits(state)))

0 commit comments

Comments
 (0)