HamiltonianGate¶
- class HamiltonianGate(data, time, label=None)[source]¶
Class for representing evolution by a Hermitian Hamiltonian operator as a gate. This gate resolves to a UnitaryGate U(t) = exp(-1j * t * H), which can be decomposed into basis gates if it is 2 qubits or less, or simulated directly in Aer for more qubits.
Create a gate from a hamiltonian operator and evolution time parameter t
- Parameters
data (matrix or Operator) – a hermitian operator.
time (float) – time evolution parameter.
label (str) – unitary name for backend [Default: None].
- Raises
ExtensionError – if input data is not an N-qubit unitary operator.
Attributes
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
Return definition in terms of other basic gates.
Return gate label
return instruction params.
Methods
HamiltonianGate.add_decomposition
(decomposition)Add a decomposition of the instruction to the SessionEquivalenceLibrary.
Return the adjoint of the unitary.
Assemble a QasmQobjInstruction
HamiltonianGate.broadcast_arguments
(qargs, cargs)Validation and handling of the arguments and its relationship.
HamiltonianGate.c_if
(classical, val)Add classical condition on register classical and value val.
Return the conjugate of the Hamiltonian.
HamiltonianGate.control
([num_ctrl_qubits, …])Return controlled version of gate.
HamiltonianGate.copy
([name])Copy of the instruction.
Return the adjoint of the unitary.
Return True .IFF.
For a composite instruction, reverse the order of sub-gates.
HamiltonianGate.power
(exponent)Creates a unitary gate as gate^exponent.
Raise an error, as QASM is not defined for the HamiltonianGate.
Creates an instruction with gate repeated n amount of times.
Return matrix for the unitary.
Return the transpose of the Hamiltonian.