MCXGate

class MCXGate(num_ctrl_qubits=None, label=None, ctrl_state=None)[source]

The general, multi-controlled X gate.

Create new MCX gate.

Attributes

MCXGate.ctrl_state

Return the control state of the gate as a decimal integer.

MCXGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

MCXGate.definition

Return definition in terms of other basic gates.

MCXGate.label

Return gate label

MCXGate.num_ancilla_qubits

The number of ancilla qubits.

MCXGate.num_ctrl_qubits

Get number of control qubits.

MCXGate.params

return instruction params.

Methods

MCXGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

MCXGate.assemble()

Assemble a QasmQobjInstruction

MCXGate.broadcast_arguments(qargs, cargs)

Validation and handling of the arguments and its relationship.

MCXGate.c_if(classical, val)

Add classical condition on register classical and value val.

MCXGate.control([num_ctrl_qubits, label, …])

Return a multi-controlled-X gate with more control lines.

MCXGate.copy([name])

Copy of the instruction.

MCXGate.get_num_ancilla_qubits(num_ctrl_qubits)

Get the number of required ancilla qubits without instantiating the class.

MCXGate.inverse()

Invert this gate.

MCXGate.is_parameterized()

Return True .IFF.

MCXGate.mirror()

DEPRECATED: use instruction.reverse_ops().

MCXGate.power(exponent)

Creates a unitary gate as gate^exponent.

MCXGate.qasm()

Return a default OpenQASM string for the instruction.

MCXGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

MCXGate.reverse_ops()

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

MCXGate.to_matrix()

Return a Numpy.array for the gate unitary matrix.