Skip to content

Conversation

Stasiu51
Copy link

  • What: Iterate crossings via {q1, q2} instead of [q1, q2] in PropagatedPauliFrameLayer.toString.
  • Why: crossings entries are objects {q1, q2, color}. Array destructuring throws TypeError: .for is not
    iterable when calling String(layer) or String(pf).
  • Reproducing from dev console in browser (which requires an un-minified version of crumble such as the one you get just by cloning stim and hosting locally):
const {Circuit} = await import('./circuit/circuit.js');
const {PropagatedPauliFrames} = await import('./circuit/propagated_pauli_frames.js');
const c = Circuit.fromStimCircuit(`
QUBIT_COORDS(0,0) 0
QUBIT_COORDS(1,0) 1
MARKX(0) 0
TICK
CX 0 1
`);
const pf = PropagatedPauliFrames.fromCircuit(c, 0);
String(pf); // throws in toString() today

[This bug was found with the help of AI tools]

Copy link

google-cla bot commented Aug 27, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant