147 lines
4.3 KiB
Plaintext
147 lines
4.3 KiB
Plaintext
---
|
||
title: ECRGate
|
||
description: API reference for qiskit.circuit.library.ECRGate
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.circuit.library.ECRGate
|
||
---
|
||
|
||
# ECRGate
|
||
|
||
<Class id="qiskit.circuit.library.ECRGate" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.24/qiskit/circuit/library/standard_gates/ecr.py" signature="ECRGate" modifiers="class">
|
||
Bases: [`Gate`](qiskit.circuit.Gate "qiskit.circuit.gate.Gate")
|
||
|
||
An echoed cross-resonance gate.
|
||
|
||
This gate is maximally entangling and is equivalent to a CNOT up to single-qubit pre-rotations. The echoing procedure mitigates some unwanted terms (terms other than ZX) to cancel in an experiment. More specifically, this gate implements $\frac{1}{\sqrt{2}}(IX-XY)$.
|
||
|
||
Can be applied to a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") with the [`ecr()`](qiskit.circuit.QuantumCircuit#ecr "qiskit.circuit.QuantumCircuit.ecr") method.
|
||
|
||
**Circuit Symbol:**
|
||
|
||
```python
|
||
┌─────────┐ ┌────────────┐┌────────┐┌─────────────┐
|
||
q_0: ┤0 ├ q_0: ┤0 ├┤ RX(pi) ├┤0 ├
|
||
│ ECR │ = │ RZX(pi/4) │└────────┘│ RZX(-pi/4) │
|
||
q_1: ┤1 ├ q_1: ┤1 ├──────────┤1 ├
|
||
└─────────┘ └────────────┘ └─────────────┘
|
||
```
|
||
|
||
**Matrix Representation:**
|
||
|
||
$$
|
||
\begin{split}ECR\ q_0, q_1 = \frac{1}{\sqrt{2}}
|
||
\begin{pmatrix}
|
||
0 & 1 & 0 & i \\
|
||
1 & 0 & -i & 0 \\
|
||
0 & i & 0 & 1 \\
|
||
-i & 0 & 1 & 0
|
||
\end{pmatrix}\end{split}
|
||
$$
|
||
|
||
<Admonition title="Note" type="note">
|
||
In Qiskit’s convention, higher qubit indices are more significant (little endian convention). In the above example we apply the gate on (q\_0, q\_1) which results in the $X \otimes Z$ tensor order. Instead, if we apply it on (q\_1, q\_0), the matrix will be $Z \otimes X$:
|
||
|
||
```python
|
||
┌─────────┐
|
||
q_0: ┤1 ├
|
||
│ ECR │
|
||
q_1: ┤0 ├
|
||
└─────────┘
|
||
```
|
||
|
||
$$
|
||
\begin{split}ECR\ q_0, q_1 = \frac{1}{\sqrt{2}}
|
||
\begin{pmatrix}
|
||
0 & 0 & 1 & i \\
|
||
0 & 0 & i & 1 \\
|
||
1 & -i & 0 & 0 \\
|
||
-i & 1 & 0 & 0
|
||
\end{pmatrix}\end{split}
|
||
$$
|
||
</Admonition>
|
||
|
||
Create new ECR gate.
|
||
|
||
## Methods Defined Here
|
||
|
||
<span id="qiskit-circuit-library-ecrgate-inverse" />
|
||
|
||
### inverse
|
||
|
||
<Function id="qiskit.circuit.library.ECRGate.inverse" signature="ECRGate.inverse()">
|
||
Return inverse ECR gate (itself).
|
||
</Function>
|
||
|
||
<span id="qiskit-circuit-library-ecrgate-to-matrix" />
|
||
|
||
### to\_matrix
|
||
|
||
<Function id="qiskit.circuit.library.ECRGate.to_matrix" signature="ECRGate.to_matrix()">
|
||
Return a numpy.array for the ECR gate.
|
||
</Function>
|
||
|
||
## Attributes
|
||
|
||
### condition\_bits
|
||
|
||
<Attribute id="qiskit.circuit.library.ECRGate.condition_bits">
|
||
Get Clbits in condition.
|
||
</Attribute>
|
||
|
||
### decompositions
|
||
|
||
<Attribute id="qiskit.circuit.library.ECRGate.decompositions">
|
||
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
|
||
</Attribute>
|
||
|
||
### definition
|
||
|
||
<Attribute id="qiskit.circuit.library.ECRGate.definition">
|
||
Return definition in terms of other basic gates.
|
||
</Attribute>
|
||
|
||
### duration
|
||
|
||
<Attribute id="qiskit.circuit.library.ECRGate.duration">
|
||
Get the duration.
|
||
</Attribute>
|
||
|
||
### label
|
||
|
||
<Attribute id="qiskit.circuit.library.ECRGate.label">
|
||
Return instruction label
|
||
</Attribute>
|
||
|
||
### name
|
||
|
||
<Attribute id="qiskit.circuit.library.ECRGate.name">
|
||
Return the name.
|
||
</Attribute>
|
||
|
||
### num\_clbits
|
||
|
||
<Attribute id="qiskit.circuit.library.ECRGate.num_clbits">
|
||
Return the number of clbits.
|
||
</Attribute>
|
||
|
||
### num\_qubits
|
||
|
||
<Attribute id="qiskit.circuit.library.ECRGate.num_qubits">
|
||
Return the number of qubits.
|
||
</Attribute>
|
||
|
||
### params
|
||
|
||
<Attribute id="qiskit.circuit.library.ECRGate.params">
|
||
return instruction params.
|
||
</Attribute>
|
||
|
||
### unit
|
||
|
||
<Attribute id="qiskit.circuit.library.ECRGate.unit">
|
||
Get the time unit of duration.
|
||
</Attribute>
|
||
</Class>
|
||
|