From e51a142d8c6b8300cfa1b417b677c7e349a1bb0b Mon Sep 17 00:00:00 2001
From: Adriano Meligrana <68152031+Tortar@users.noreply.github.com>
Date: Tue, 6 Aug 2024 17:07:25 +0200
Subject: [PATCH] Solve piracies and ambiguities (#334)

---
 src/misc_ops.jl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/misc_ops.jl b/src/misc_ops.jl
index a48ff70fc..8587e28ed 100644
--- a/src/misc_ops.jl
+++ b/src/misc_ops.jl
@@ -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.
@@ -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`.
 
@@ -140,3 +145,5 @@ struct ClassicalXOR{N} <: AbstractOperation
 end
 
 ClassicalXOR(bits,store) = ClassicalXOR{length(bits)}(tuple(bits...),store)
+
+nsubsystems(state::MixedDestabilizer) = nqubits(state)