qoqo.operations.Fsim
- class qoqo.operations.Fsim
The fermionic qubit simulation (Fsim) gate.
\[\begin{split}U = \begin{pmatrix} \cos(\Delta) & 0 & 0 & i \sin(\Delta) \\\\ 0 & -i \sin(t) & \cos(t) & 0 \\\\ 0 & \cos(t) & -i \sin(t) & 0 \\\\ -\sin(\Delta) \cdot e^{-i U} & 0 & 0 & -\cos(\Delta) \cdot e^{-i U} \end{pmatrix}\end{split}\]- Parameters:
control (int) – The index of the most significant qubit in the unitary representation.
target (int) –
t (CalculatorFloat) – The hopping strength.
u (CalculatorFloat) – The interaction strength.
delta (CalculatorFloat) – The Bogoliubov interaction strength \(\Delta\).
Note: The qubits have to be adjacent, i.e., \(|i-j|=1\) has to hold. This is the only case in which the gate is valid as a two-qubit gate (due to the Jordan-Wigner transformation).
- __init__()
Methods
__init__
()control
()Returns control qubit of the two-qubit operation
delta
()Returns value of attribute delta
hqslang
()Returns hqslang name of Operation
List all involved Qubits
Returns true if operation contains symbolic parameters
remap_qubits
(mapping)Remap qubits
substitute_parameters
(substitution_parameters)Substitutes internal symbolic parameters with float values
t
()Returns value of attribute t
tags
()Returns tags identifying the Operation
target
()Returns target qubit of the two-qubit operation
u
()Returns value of attribute u
Return unitary matrix of gate.
- control()
Returns control qubit of the two-qubit operation
- delta()
Returns value of attribute delta
- hqslang()
Returns hqslang name of Operation
- Returns:
The name
- Return type:
str
- involved_qubits()
List all involved Qubits
- Returns:
The involved qubits as a set or ‘ALL’ if all qubits are involved
- Return type:
Union[set[int], str]
- is_parametrized()
Returns true if operation contains symbolic parameters
- Returns:
bool
- remap_qubits(mapping)
Remap qubits
- Parameters:
mapping (dict[int, int]) – The mapping
- Returns:
The operation with the remapped qubits
- Return type:
Operation
- Raises:
RuntimeError – Qubit remapping failed
- substitute_parameters(substitution_parameters)
Substitutes internal symbolic parameters with float values
Only available when all symbolic expressions can be evaluated to float with the provided parameters.
- Parameters:
substitution_parameters (dict[str, float]) – The substituted free parameters
- Returns:
The operation with the parameters substituted
- Return type:
Operation
- Raises:
RuntimeError – Parameter Substitution failed
- t()
Returns value of attribute t
- tags()
Returns tags identifying the Operation
- Returns:
The tags identifying the operation
- Return type:
list[str]
- target()
Returns target qubit of the two-qubit operation
- u()
Returns value of attribute u
- unitary_matrix()
Return unitary matrix of gate.
- Returns:
np.ndarray
- Raises:
ValueError – Error symbolic operation cannot return float unitary matrix