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
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
Return definition in terms of other basic gates.
Return gate label
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.
For a composite instruction, reverse the order of sub-gates.
HGate.power
(exponent)Creates a unitary gate as gate^exponent.
Return a default OpenQASM string for the instruction.
HGate.repeat
(n)Creates an instruction with gate repeated n amount of times.
Return a Numpy.array for the H gate.