Interaction¶
- class Interaction(num_modes, u, label=None)[source]¶
On-site interaction of particles of opposite spin species on the same site.
The generating Hamiltonian of the interaction gate is
\(H = U \sum_{i=1}^{L} n_{i,\uparrow} n_{i,\downarrow}\)
where \(i\) indexes the mode, \(L\) gives the total number of sites and \(U\) is the interaction strength
Initialize interaction gate.
- Parameters:
num_modes (
int
) – number of modes on which the gate actsu (
float
) – global interaction strength parameterlabel – optional
- Raises:
QiskitColdAtomError – If the number of wires the gate acts on is uneven
Attributes
Get Clbits in condition.
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
Return definition in terms of other basic gates.
Get the duration.
The generating Hamiltonian of the interaction gate.
Return instruction label
Return the name.
Return the number of clbits.
Return the number of qubits.
return instruction params.
Get the time unit of duration.
Methods
Interaction.add_decomposition
(decomposition)Add a decomposition of the instruction to the SessionEquivalenceLibrary.
Assemble a QasmQobjInstruction
Interaction.broadcast_arguments
(qargs, cargs)Validation and handling of the arguments and its relationship.
Interaction.c_if
(classical, val)Set a classical equality condition on this instruction between the register or cbit
classical
and valueval
.Interaction.control
([num_ctrl_qubits, ...])Overwrite control method which is supposed to return a controlled version of the gate.
Interaction.copy
([name])Copy of the instruction.
Get inverse gate by reversing the sign of the interaction parameter
Return True .IFF.
Interaction.operator_to_mat
(generator, ...)Compute the matrix representation of the fermion operator.
Interaction.power
(exponent)Creates a fermionic gate as gate^exponent
Return a default OpenQASM string for the instruction.
Creates an instruction with gate repeated n amount of times.
For a composite instruction, reverse the order of sub-instructions.
Interaction.soft_compare
(other)Soft comparison between gates.
Interaction.to_matrix
([num_species, basis])Return a Numpy.array for the gate unitary matrix.
Interaction.validate_parameter
(parameter)Gate parameters should be int, float, or ParameterExpression