C4XGate

class C4XGate(label=None, ctrl_state=None)[source]

The 4-qubit controlled X gate.

This implementation is based on Page 21, Lemma 7.5, of [1].

References

[1] Barenco et al., 1995. https://arxiv.org/pdf/quant-ph/9503016.pdf

Create a new 4-qubit controlled X gate.

Attributes

C4XGate.ctrl_state

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

C4XGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

C4XGate.definition

Return definition in terms of other basic gates.

C4XGate.label

Return gate label

C4XGate.num_ctrl_qubits

Get number of control qubits.

C4XGate.params

return instruction params.

Methods

C4XGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

C4XGate.assemble()

Assemble a QasmQobjInstruction

C4XGate.broadcast_arguments(qargs, cargs)

Validation and handling of the arguments and its relationship.

C4XGate.c_if(classical, val)

Add classical condition on register classical and value val.

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

Controlled version of this gate.

C4XGate.copy([name])

Copy of the instruction.

C4XGate.inverse()

Invert this gate.

C4XGate.is_parameterized()

Return True .IFF.

C4XGate.mirror()

DEPRECATED: use instruction.reverse_ops().

C4XGate.power(exponent)

Creates a unitary gate as gate^exponent.

C4XGate.qasm()

Return a default OpenQASM string for the instruction.

C4XGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

C4XGate.reverse_ops()

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

C4XGate.to_matrix()

Return a numpy.array for the C4X gate.