From cc7029d6076914c651ef5698e03303349caa936b Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Thu, 14 Mar 2024 02:12:42 -0700 Subject: [PATCH] size fix --- src/stim/stabilizers/conversions.inl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/stim/stabilizers/conversions.inl b/src/stim/stabilizers/conversions.inl index 0983ca3d2..6ab5f2b17 100644 --- a/src/stim/stabilizers/conversions.inl +++ b/src/stim/stabilizers/conversions.inl @@ -576,7 +576,15 @@ Tableau stabilizers_to_tableau( size_t used = 0; for (const auto &e : stabilizers) { - buf = e; + if (e.num_qubits == num_qubits) { + buf = e; + } else { + buf.xs.clear(); + buf.zs.clear(); + memcpy(buf.xs.u8, e.xs.u8, e.xs.num_u8_padded()); + memcpy(buf.zs.u8, e.zs.u8, e.zs.num_u8_padded()); + buf.sign = e.sign; + } buf.ref().do_circuit(elimination_instructions); // Find a non-identity term in the Pauli string past the region used by other stabilizers.