openfermioncirq.CubicFermionicSimulationGate¶
-
class
openfermioncirq.
CubicFermionicSimulationGate
(weights: Tuple[complex, complex, complex] = (1.0, 1.0, 1.0), **kwargs)[source]¶ w0 * |110><101| + w1 * |110><011| + w2 * |101><011| + hc interaction.
With weights \((w_0, w_1, w_2)\) and exponent \(t\), this gate’s matrix is defined as
\[e^{-i t H},\]where
\[H = \left(w_0 \left| 110 \right\rangle\left\langle 101 \right| + \text{h.c.}\right) + \left(w_1 \left| 110 \right\rangle\left\langle 011 \right| + \text{h.c.}\right) + \left(w_2 \left| 101 \right\rangle\left\langle 011 \right| + \text{h.c.}\right)\]This corresponds to the Jordan-Wigner transform of
\[H = -\left(w_0 a^{\dagger}_i a^{\dagger}_{i+1} a_{i} a_{i+2} + \text{h.c.}\right) - \left(w_1 a^{\dagger}_i a^{\dagger}_{i+1} a_{i+1} a_{i+2} + \text{h.c.}\right) - \left(w_2 a^{\dagger}_i a^{\dagger}_{i+2} a_{i+1} a_{i+2} + \text{h.c.}\right),\]where \(a_i\), \(a_{i+1}\), \(a_{i+2}\) are the annihilation operators for the fermionic modes \(i\), \((i+1)\) \((i+2)\), respectively mapped to the three qubits on which this gate acts.
Parameters: weights – The weights of the terms in the Hamiltonian. -
__init__
(weights: Tuple[complex, complex, complex] = (1.0, 1.0, 1.0), **kwargs) → None[source]¶ Initializes the parameters used to compute the gate’s matrix.
The eigenvalue of each eigenspace of a gate is computed by
1. Starting with an angle in half turns as returned by the gate’s
_eigen_components
method:θShifting the angle by global_shift:
θ + s
Scaling the angle by exponent:
(θ + s) * e
Converting from half turns to a complex number on the unit circle:
exp(i * pi * (θ + s) * e)
Parameters: - exponent – The t in gate**t. Determines how much the eigenvalues of the gate are scaled by. For example, eigenvectors phased by -1 when gate**1 is applied will gain a relative phase of e^{i pi exponent} when gate**exponent is applied (relative to eigenvectors unaffected by gate**1).
- global_shift –
Offsets the eigenvalues of the gate at exponent=1. In effect, this controls a global phase factor on the gate’s unitary matrix. The factor is:
exp(i * pi * global_shift * exponent)For example, cirq.X**t uses a global_shift of 0 but cirq.rx(t) uses a global_shift of -0.5, which is why cirq.unitary(cirq.rx(pi)) equals -iX instead of X.
Methods
__init__
(weights, complex, complex] = (1.0, …)Initializes the parameters used to compute the gate’s matrix. controlled
(num_controls, control_values, …)Returns a controlled version of this gate. num_qubits
()The number of qubits this gate acts on. on
(*qubits)Returns an application of this gate to the given qubits. validate_args
(qubits)Checks if this gate can be applied to the given qubits. wrap_in_linear_combination
(coefficient, …)Attributes
exponent
global_shift
-