quantumlib / Stim

A fast stabilizer circuit library.
Apache License 2.0
338 stars 97 forks source link

add tools for manipulating `stim.FlipSimulator` in parallel #653

Closed ghost closed 3 weeks ago

ghost commented 11 months ago

stim.FlipSimulator.set_pauli_flips(paulis: Iterable[int | str], qubit: int) w len(paulis) == batch_size

stim.FlipSimulator.xor_pauli_flips(paulis: Iterable[int | str], qubit: int) w len(paulis) == batch_size to avoid needing to peek and set

stimFlipSimulator.apply_pauli_error(pauli: str|int, mask: Iterable[bool]) w len(mask) == batch_size * qubits for the more common case of wanting to apply 1 pauli error, but selectively over both qubits and simulation indices (might be more clever ways of providing the ~2D mask other than just flattening it, could do Iterable[Iterable[bool]], but then it's harder to prevent ragged data / take advantage of it being rectangular)

Strilanc commented 3 weeks ago

Done now