cirq.decompose_two_qubit_interaction_into_four_fsim_gates
Decomposes operations into an FSimGate near theta=pi/2, phi=0.
cirq.decompose_two_qubit_interaction_into_four_fsim_gates(
interaction: Union['cirq.SupportsUnitary', np.ndarray],
*,
fsim_gate: Union['cirq.FSimGate', 'cirq.ISwapPowGate'],
qubits: Optional[Sequence['cirq.Qid']] = None
) -> 'cirq.Circuit'
This decomposition is guaranteed to use exactly four of the given FSim
gates. It works by decomposing into two B gates and then decomposing each
B gate into two of the given FSim gate.
This decomposition only works for FSim gates with a theta (iswap angle)
between 3/8π and 5/8π (i.e. within 22.5° of maximum strength) and a
phi (cphase angle) between -π/4 and +π/4 (i.e. within 45° of minimum
strength).
Args |
interaction
|
The two qubit operation to synthesize. This can either be
a cirq object (such as a gate, operation, or circuit) or a raw numpy
array specifying the 4x4 unitary matrix.
|
fsim_gate
|
The only two qubit gate that is permitted to appear in the
output. Must satisfy 3/8π < phi < 5/8π and abs(theta) < pi/4.
|
qubits
|
The qubits that the resulting operations should apply the
desired interaction to. If not set then defaults to either the
qubits of the given interaction (if it is a cirq.Operation ) or
else to cirq.LineQubit.range(2) .
|
Returns |
A list of operations implementing the desired two qubit unitary. The
list will include four operations of the given fsim gate, various single
qubit operations, and a global phase operation.
|
Raises |
ValueError
|
If the fsim_gate has invalid angles or is parameterized, or
if the supplied target to synthesize acts on more than two qubits.
|
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.
[[["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."],[],[]]