RCCXGate¶
- class RCCXGate(label=None)[source]¶
The simplified Toffoli gate, also referred to as Margolus gate.
The simplified Toffoli gate implements the Toffoli gate up to relative phases. This implementation requires three CX gates which is the minimal amount possible, as shown in https://arxiv.org/abs/quant-ph/0312225. Note, that the simplified Toffoli is not equivalent to the Toffoli. But can be used in places where the Toffoli gate is uncomputed again.
This concrete implementation is from https://arxiv.org/abs/1508.03273, the dashed box of Fig. 3.
Create a new simplified CCX 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
RCCXGate.add_decomposition
(decomposition)Add a decomposition of the instruction to the SessionEquivalenceLibrary.
Assemble a QasmQobjInstruction
RCCXGate.broadcast_arguments
(qargs, cargs)Validation and handling of the arguments and its relationship.
RCCXGate.c_if
(classical, val)Add classical condition on register classical and value val.
RCCXGate.control
([num_ctrl_qubits, label, …])Return controlled version of gate.
RCCXGate.copy
([name])Copy of the instruction.
Invert this instruction.
Return True .IFF.
For a composite instruction, reverse the order of sub-gates.
RCCXGate.power
(exponent)Creates a unitary gate as gate^exponent.
Return a default OpenQASM string for the instruction.
Creates an instruction with gate repeated n amount of times.
Return a numpy.array for the simplified CCX gate.