cirq.InsertStrategy
Indicates preferences on how to add multiple operations to a circuit.
cirq.InsertStrategy(
name: str, doc: str
)
Class Variables |
EARLIEST
|
Instance of cirq.InsertStrategy
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.
|
INLINE
|
Instance of cirq.InsertStrategy
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
location instead.
In case the insert index is smaller than -len() it is
treated like it would be 0.
For too big indices it attempts to insert the operation into the last
moment of the circuit.
|
NEW
|
Instance of cirq.InsertStrategy
Always creates a new moment at the desired insert location, and adds the
operation to insert into that moment.
|
NEW_THEN_INLINE
|
Instance of cirq.InsertStrategy
Creates a new moment at the desired insert location for the first
operation, but then switches to inserting operations inline.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-06-27 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]