UnitaryGate¶
- class UnitaryGate(data, label=None)[source]¶
Class for representing unitary gates
Create a gate from a numeric unitary matrix.
- Parameters
data (matrix or Operator) – unitary operator.
label (str) – unitary name for backend [Default: None].
- Raises
ExtensionError – if input data is not an N-qubit unitary operator.
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
UnitaryGate.add_decomposition
(decomposition)Add a decomposition of the instruction to the SessionEquivalenceLibrary.
Return the adjoint of the unitary.
Assemble a QasmQobjInstruction
UnitaryGate.broadcast_arguments
(qargs, cargs)Validation and handling of the arguments and its relationship.
UnitaryGate.c_if
(classical, val)Add classical condition on register classical and value val.
Return the conjugate of the unitary.
UnitaryGate.control
([num_ctrl_qubits, …])Return controlled version of gate
UnitaryGate.copy
([name])Copy of the instruction.
Return the adjoint of the unitary.
Return True .IFF.
For a composite instruction, reverse the order of sub-gates.
UnitaryGate.power
(exponent)Creates a unitary gate as gate^exponent.
The qasm for a custom unitary gate This is achieved by adding a custom gate that corresponds to the definition of this gate.
Creates an instruction with gate repeated n amount of times.
Return matrix for the unitary.
Return the transpose of the unitary.