HamiltonianGate¶
-
class
HamiltonianGate
(data, time, label=None)[source]¶ Bases:
qiskit.circuit.gate.Gate
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.
Methods
Add a decomposition of the instruction to the SessionEquivalenceLibrary.
Return the adjoint of the unitary.
Assemble a QasmQobjInstruction
Validation and handling of the arguments and its relationship.
Add classical condition on register or cbit classical and value val.
Return the conjugate of the Hamiltonian.
Return controlled version of gate.
Copy of the instruction.
Return the adjoint of the unitary.
Return True .IFF.
DEPRECATED: use instruction.reverse_ops().
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.
For a composite instruction, reverse the order of sub-instructions.
Soft comparison between gates.
Return a Numpy.array for the gate unitary matrix.
Return the transpose of the Hamiltonian.
Hamiltonian parameter has to be an ndarray, operator or float.
Attributes
-
decompositions
¶ Get the decompositions of the instruction from the SessionEquivalenceLibrary.
-
definition
¶ Return definition in terms of other basic gates.
-
duration
¶ Get the duration.
-
label
¶ Return instruction label
- Return type
str
-
params
¶ return instruction params.
-
unit
¶ Get the time unit of duration.