cirq.FSimGate

class cirq.FSimGate(theta: float, phi: float)[source]

Fermionic simulation gate family.

Contains all two qubit interactions that preserve excitations, up to
single-qubit rotations and global phase.

The unitary matrix of this gate is:

[[1, 0, 0, 0],
 [0, a, b, 0],
 [0, b, a, 0],
 [0, 0, 0, c]]

where:

a = cos(theta)
b = -i·sin(theta)
c = exp(-i·phi)
Note the difference in sign conventions between FSimGate and the
ISWAP and CZPowGate:
FSimGate(θ, φ) = ISWAP**(-2θ/π) CZPowGate(exponent=-φ/π)
__init__(theta: float, phi: float)[source]
Parameters
  • theta – Swap angle on the |01⟩ |10⟩ subspace, in radians. Determined by the strength and duration of the XX+YY interaction. Note: uses opposite sign convention to the iSWAP gate. Maximum strength (full iswap) is at pi/2.

  • phi – Controlled phase angle, in radians. Determines how much the |11⟩ state is phased. Note: uses opposite sign convention to the CZPowGate. Maximum strength (full cz) is at pi/2.

Methods

controlled([num_controls, control_values, …])

Returns a controlled version of this gate. If no arguments are

num_qubits()

The number of qubits this gate acts on.

on(*qubits)

Returns an application of this gate to the given qubits.

qubit_index_to_equivalence_group_key(index)

Returns a key that differs between non-interchangeable qubits.

validate_args(qubits)

Checks if this gate can be applied to the given qubits.

wrap_in_linear_combination([coefficient])