cirq.merge_k_qubit_unitaries_to_circuit_op
Merges connected components of operations, acting on <= k qubits, into circuit operations.
cirq.merge_k_qubit_unitaries_to_circuit_op(
circuit: CIRCUIT_TYPE,
k: int,
*,
tags_to_ignore: Sequence[Hashable] = (),
merged_circuit_op_tag: Optional[str] = None,
deep: bool = False
) -> CIRCUIT_TYPE
Uses cirq.merge_operations_to_circuit_op
to identify and merge connected components of
unitary operations acting on at-most k-qubits. Moment structure is preserved for operations
that do not participate in merging. For merged operations, the newly created circuit operations
are constructed by inserting operations using EARLIEST strategy.
Args |
circuit
|
Input circuit to apply the transformations on. The input circuit is not mutated.
|
k
|
Merge-able operations acting on <= k qubits are merged into a connected component.
|
tags_to_ignore
|
Tagged operations marked any of tags_to_ignore will not be considered as
potential candidates for any connected component.
|
merged_circuit_op_tag
|
Tag to be applied on circuit operations wrapping valid connected
components. A default tag is applied if left None.
|
deep
|
If true, the transformer primitive will be recursively applied to all circuits
wrapped inside circuit operations.
|
Returns |
Copy of input circuit with valid connected components wrapped in tagged circuit operations.
|
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."],[],[]]