You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not run this repro code unless you like thrashing your machine.
import cirq
op = cirq.CircuitOperation(
cirq.FrozenCircuit(),
repetitions=1_000_000_000_000,
use_repetition_ids=False)
Expected behavior
Because use_repetition_ids is set to False, no list of repetition ids is ever created and the code finishes in under a second. This remains true when using the operation for other actions that don't affect the repetition ids, like transforming its qubits or putting it into a diagram.
Actual behavior
Internally, the code attempts to create a list of one trillion repetition ids. This list will never be used and also does not fit in memory. The code takes forever and eventually crashes.
For context, I know that Mike Newman has used stim to run circuits with hundreds of millions of rounds. If he ever attempted to use stimcirq to convert that circuit into a cirq circuit... *KABOOM*.
The text was updated successfully, but these errors were encountered:
Strilanc
changed the title
Don't construct CircuitOperation huge repetition id lists when use_repetition_ids=False
Don't construct huge repetition id lists for CircuitOperation when use_repetition_ids=False
May 29, 2022
Do not run this repro code unless you like thrashing your machine.
Expected behavior
Because
use_repetition_ids
is set toFalse
, no list of repetition ids is ever created and the code finishes in under a second. This remains true when using the operation for other actions that don't affect the repetition ids, like transforming its qubits or putting it into a diagram.Actual behavior
Internally, the code attempts to create a list of one trillion repetition ids. This list will never be used and also does not fit in memory. The code takes forever and eventually crashes.
For context, I know that Mike Newman has used stim to run circuits with hundreds of millions of rounds. If he ever attempted to use stimcirq to convert that circuit into a cirq circuit...
*KABOOM*
.The text was updated successfully, but these errors were encountered: