111 lines
2.3 KiB
Plaintext
111 lines
2.3 KiB
Plaintext
---
|
|
title: DCXGate
|
|
description: API reference for qiskit.circuit.library.DCXGate
|
|
in_page_toc_min_heading_level: 1
|
|
python_api_type: class
|
|
python_api_name: qiskit.circuit.library.DCXGate
|
|
---
|
|
|
|
# DCXGate
|
|
|
|
<Class id="qiskit.circuit.library.DCXGate" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.20/qiskit/circuit/library/standard_gates/dcx.py" signature="DCXGate" modifiers="class">
|
|
Bases: `qiskit.circuit.gate.Gate`
|
|
|
|
Double-CNOT gate.
|
|
|
|
A 2-qubit Clifford gate consisting of two back-to-back CNOTs with alternate controls.
|
|
|
|
```python
|
|
┌───┐
|
|
q_0: ──■──┤ X ├
|
|
┌─┴─┐└─┬─┘
|
|
q_1: ┤ X ├──■──
|
|
└───┘
|
|
```
|
|
|
|
This is a classical logic gate, equivalent to a CNOT-SWAP (CNS) sequence, and locally equivalent to an iSWAP.
|
|
|
|
$$
|
|
\begin{split}DCX\ q_0, q_1 =
|
|
\begin{pmatrix}
|
|
1 & 0 & 0 & 0 \\
|
|
0 & 0 & 0 & 1 \\
|
|
0 & 1 & 0 & 0 \\
|
|
0 & 0 & 1 & 0
|
|
\end{pmatrix}\end{split}
|
|
$$
|
|
|
|
Create new DCX gate.
|
|
|
|
## Attributes
|
|
|
|
### condition\_bits
|
|
|
|
<Attribute id="qiskit.circuit.library.DCXGate.condition_bits">
|
|
Get Clbits in condition.
|
|
|
|
**Return type**
|
|
|
|
`List`\[`Clbit`]
|
|
</Attribute>
|
|
|
|
### decompositions
|
|
|
|
<Attribute id="qiskit.circuit.library.DCXGate.decompositions">
|
|
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
|
|
</Attribute>
|
|
|
|
### definition
|
|
|
|
<Attribute id="qiskit.circuit.library.DCXGate.definition">
|
|
Return definition in terms of other basic gates.
|
|
</Attribute>
|
|
|
|
### duration
|
|
|
|
<Attribute id="qiskit.circuit.library.DCXGate.duration">
|
|
Get the duration.
|
|
</Attribute>
|
|
|
|
### label
|
|
|
|
<Attribute id="qiskit.circuit.library.DCXGate.label">
|
|
Return instruction label
|
|
|
|
**Return type**
|
|
|
|
`str`
|
|
</Attribute>
|
|
|
|
### name
|
|
|
|
<Attribute id="qiskit.circuit.library.DCXGate.name">
|
|
Return the name.
|
|
</Attribute>
|
|
|
|
### num\_clbits
|
|
|
|
<Attribute id="qiskit.circuit.library.DCXGate.num_clbits">
|
|
Return the number of clbits.
|
|
</Attribute>
|
|
|
|
### num\_qubits
|
|
|
|
<Attribute id="qiskit.circuit.library.DCXGate.num_qubits">
|
|
Return the number of qubits.
|
|
</Attribute>
|
|
|
|
### params
|
|
|
|
<Attribute id="qiskit.circuit.library.DCXGate.params">
|
|
return instruction params.
|
|
</Attribute>
|
|
|
|
### unit
|
|
|
|
<Attribute id="qiskit.circuit.library.DCXGate.unit">
|
|
Get the time unit of duration.
|
|
</Attribute>
|
|
</Class>
|
|
|