# HamiltonianGate¶

class HamiltonianGate(data, time, label=None)[Quellcode]

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

Parameter
• data (matrix or Operator) – a hermitian operator.

• time (float) – time evolution parameter.

• label (str) – unitary name for backend [Default: None].

Verursacht

ExtensionError – if input data is not an N-qubit unitary operator.

Attributes

 HamiltonianGate.decompositions Get the decompositions of the instruction from the SessionEquivalenceLibrary. HamiltonianGate.definition Return definition in terms of other basic gates. HamiltonianGate.label Return gate label HamiltonianGate.params 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. DEPRECATED: use instruction.reverse_ops(). 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. For a composite instruction, reverse the order of sub-instructions. Return matrix for the unitary. Return the transpose of the Hamiltonian.