|View source on GitHub|
Indicates preferences on how to add multiple operations to a circuit.
cirq.circuits.InsertStrategy( name: str, doc: str )
Scans backward from the insert location until a moment with operations touching qubits affected by the operation to insert is found. The operation is added into the moment just after that location.
If the scan reaches the start of the circuit without finding any conflicting operations, the operation is added into the first moment of the circuit.
The operation is never added into moments after the insert location. If the moment just before the insert location has conflicting operations, or the insert index is 0, then the operation is inserted into a new moment at the desired location.
Attempts to add the operation to insert into the moment just before the
desired insert location. But, if there's already an existing operation
affecting any of the qubits touched by the operation to insert, or the
desired index is 0, a new moment is created and inserted at the desired
In case the insert index is smaller than -len(
Always creates a new moment at the desired insert location, and adds the operation to insert into that moment.
Creates a new moment at the desired insert location for the first operation, but then switches to inserting operations inline.