Skip to content

Commit

Permalink
Solve piracies and ambiguities (QuantumSavory#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar authored Aug 6, 2024
1 parent 263195c commit e51a142
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/misc_ops.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import QuantumInterface: nsubsystems

"""A Stabilizer measurement on the entirety of the quantum register.
`projectrand!(state, pauli)` and `apply!(state, PauliMeasurement(pauli))` give the same (possibly non-deterministic) result.
Expand All @@ -17,6 +19,9 @@ function apply!(state::AbstractStabilizer, m::PauliMeasurement)
state
end

function apply!(state::MixedDestabilizer, indices::Base.AbstractVecOrTuple, operation::Type{<:AbstractSymbolicOperator})
apply!(state, operation(indices...))
end

"""A Clifford gate, applying the given `cliff` operator to the qubits at the selected `indices`.
Expand Down Expand Up @@ -140,3 +145,5 @@ struct ClassicalXOR{N} <: AbstractOperation
end

ClassicalXOR(bits,store) = ClassicalXOR{length(bits)}(tuple(bits...),store)

nsubsystems(state::MixedDestabilizer) = nqubits(state)

0 comments on commit e51a142

Please sign in to comment.