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

UnitaryGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

UnitaryGate.definition

Return definition in terms of other basic gates.

UnitaryGate.label

Return gate label

UnitaryGate.params

return instruction params.

Methods

UnitaryGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

UnitaryGate.adjoint()

Return the adjoint of the unitary.

UnitaryGate.assemble()

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.

UnitaryGate.conjugate()

Return the conjugate of the unitary.

UnitaryGate.control([num_ctrl_qubits, …])

Return controlled version of gate

UnitaryGate.copy([name])

Copy of the instruction.

UnitaryGate.inverse()

Return the adjoint of the unitary.

UnitaryGate.is_parameterized()

Return True .IFF.

UnitaryGate.mirror()

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

UnitaryGate.power(exponent)

Creates a unitary gate as gate^exponent.

UnitaryGate.qasm()

The qasm for a custom unitary gate This is achieved by adding a custom gate that corresponds to the definition of this gate.

UnitaryGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

UnitaryGate.to_matrix()

Return matrix for the unitary.

UnitaryGate.transpose()

Return the transpose of the unitary.