HGate

class HGate(label=None)[source]

Single-qubit Hadamard gate.

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.

HGate.assemble()

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.

HGate.inverse()

Return inverted H gate (itself).

HGate.is_parameterized()

Return True .IFF.

HGate.mirror()

DEPRECATED: use instruction.reverse_ops().

HGate.power(exponent)

Creates a unitary gate as gate^exponent.

HGate.qasm()

Return a default OpenQASM string for the instruction.

HGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

HGate.reverse_ops()

For a composite instruction, reverse the order of sub-instructions.

HGate.to_matrix()

Return a Numpy.array for the H gate.