qiskit-documentation/docs/api/qiskit/0.38/qiskit.circuit.library.RCCX...

95 lines
2.8 KiB
Plaintext

---
title: RCCXGate
description: API reference for qiskit.circuit.library.RCCXGate
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.circuit.library.RCCXGate
---
# RCCXGate
<Class id="qiskit.circuit.library.RCCXGate" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.21/qiskit/circuit/library/standard_gates/x.py" signature="RCCXGate(label=None)" modifiers="class">
Bases: [`qiskit.circuit.gate.Gate`](qiskit.circuit.Gate "qiskit.circuit.gate.Gate")
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](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](https://arxiv.org/abs/1508.03273), the dashed box of Fig. 3.
Can be applied to a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") with the [`rccx()`](qiskit.circuit.QuantumCircuit#rccx "qiskit.circuit.QuantumCircuit.rccx") method.
Create a new simplified CCX gate.
## Attributes
### condition\_bits
<Attribute id="qiskit.circuit.library.RCCXGate.condition_bits">
Get Clbits in condition.
**Return type**
`List`\[[`Clbit`](qiskit.circuit.Clbit "qiskit.circuit.classicalregister.Clbit")]
</Attribute>
### decompositions
<Attribute id="qiskit.circuit.library.RCCXGate.decompositions">
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
</Attribute>
### definition
<Attribute id="qiskit.circuit.library.RCCXGate.definition">
Return definition in terms of other basic gates.
</Attribute>
### duration
<Attribute id="qiskit.circuit.library.RCCXGate.duration">
Get the duration.
</Attribute>
### label
<Attribute id="qiskit.circuit.library.RCCXGate.label">
Return instruction label
**Return type**
`str`
</Attribute>
### name
<Attribute id="qiskit.circuit.library.RCCXGate.name">
Return the name.
</Attribute>
### num\_clbits
<Attribute id="qiskit.circuit.library.RCCXGate.num_clbits">
Return the number of clbits.
</Attribute>
### num\_qubits
<Attribute id="qiskit.circuit.library.RCCXGate.num_qubits">
Return the number of qubits.
</Attribute>
### params
<Attribute id="qiskit.circuit.library.RCCXGate.params">
return instruction params.
</Attribute>
### unit
<Attribute id="qiskit.circuit.library.RCCXGate.unit">
Get the time unit of duration.
</Attribute>
</Class>