# HGate¶

class HGate(label=None)[source]

This gate is a pi rotation about the X+Z axis, and has the effect of changing computation basis from $$|0\rangle,|1\rangle$$ to $$|+\rangle,|-\rangle$$ and vice-versa.

Circuit symbol:

     ┌───┐
q_0: ┤ H ├
└───┘


Matrix Representation:

$\begin{split}H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\end{split}$

Create new H gate.

Attributes

 HGate.decompositions Get the decompositions of the instruction from the SessionEquivalenceLibrary. HGate.definition Return definition in terms of other basic gates. HGate.label Return gate label HGate.params return instruction params.

Methods

 HGate.add_decomposition(decomposition) Add a decomposition of the instruction to the SessionEquivalenceLibrary. Assemble a QasmQobjInstruction HGate.broadcast_arguments(qargs, cargs) Validation and handling of the arguments and its relationship. HGate.c_if(classical, val) Add classical condition on register classical and value val. HGate.control([num_ctrl_qubits, label, …]) Return a (multi-)controlled-H gate. HGate.copy([name]) Copy of the instruction. Return inverted H gate (itself). Return True .IFF. DEPRECATED: use instruction.reverse_ops(). HGate.power(exponent) Creates a unitary 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. Return a Numpy.array for the H gate.