143 lines
3.7 KiB
Plaintext
143 lines
3.7 KiB
Plaintext
---
|
|
title: RXXGate
|
|
description: API reference for qiskit.circuit.library.RXXGate
|
|
in_page_toc_min_heading_level: 1
|
|
python_api_type: class
|
|
python_api_name: qiskit.circuit.library.RXXGate
|
|
---
|
|
|
|
# RXXGate
|
|
|
|
<Class id="qiskit.circuit.library.RXXGate" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.21/qiskit/circuit/library/standard_gates/rxx.py" signature="RXXGate(theta, label=None)" modifiers="class">
|
|
Bases: [`qiskit.circuit.gate.Gate`](qiskit.circuit.Gate "qiskit.circuit.gate.Gate")
|
|
|
|
A parametric 2-qubit $X \otimes X$ interaction (rotation about XX).
|
|
|
|
This gate is symmetric, and is maximally entangling at $\theta = \pi/2$.
|
|
|
|
Can be applied to a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") with the [`rxx()`](qiskit.circuit.QuantumCircuit#rxx "qiskit.circuit.QuantumCircuit.rxx") method.
|
|
|
|
**Circuit Symbol:**
|
|
|
|
```python
|
|
┌─────────┐
|
|
q_0: ┤1 ├
|
|
│ Rxx(ϴ) │
|
|
q_1: ┤0 ├
|
|
└─────────┘
|
|
```
|
|
|
|
**Matrix Representation:**
|
|
|
|
$$
|
|
\begin{align}\begin{aligned}\newcommand{\th}{\frac{\theta}{2}}\\\begin{split}R_{XX}(\theta) = \exp\left(-i \th X{\otimes}X\right) =
|
|
\begin{pmatrix}
|
|
\cos\left(\th\right) & 0 & 0 & -i\sin\left(\th\right) \\
|
|
0 & \cos\left(\th\right) & -i\sin\left(\th\right) & 0 \\
|
|
0 & -i\sin\left(\th\right) & \cos\left(\th\right) & 0 \\
|
|
-i\sin\left(\th\right) & 0 & 0 & \cos\left(\th\right)
|
|
\end{pmatrix}\end{split}\end{aligned}\end{align}
|
|
$$
|
|
|
|
**Examples:**
|
|
|
|
> $$
|
|
> R_{XX}(\theta = 0) = I
|
|
> $$
|
|
>
|
|
> $$
|
|
> R_{XX}(\theta = \pi) = i X \otimes X
|
|
> $$
|
|
>
|
|
> $$
|
|
> \begin{split}R_{XX}\left(\theta = \frac{\pi}{2}\right) = \frac{1}{\sqrt{2}}
|
|
> \begin{pmatrix}
|
|
> 1 & 0 & 0 & -i \\
|
|
> 0 & 1 & -i & 0 \\
|
|
> 0 & -i & 1 & 0 \\
|
|
> -i & 0 & 0 & 1
|
|
> \end{pmatrix}\end{split}
|
|
> $$
|
|
|
|
Create new RXX gate.
|
|
|
|
## Methods Defined Here
|
|
|
|
### inverse
|
|
|
|
<Function id="qiskit.circuit.library.RXXGate.inverse" signature="RXXGate.inverse()">
|
|
Return inverse RXX gate (i.e. with the negative rotation angle).
|
|
</Function>
|
|
|
|
## Attributes
|
|
|
|
### condition\_bits
|
|
|
|
<Attribute id="qiskit.circuit.library.RXXGate.condition_bits">
|
|
Get Clbits in condition.
|
|
|
|
**Return type**
|
|
|
|
`List`\[[`Clbit`](qiskit.circuit.Clbit "qiskit.circuit.classicalregister.Clbit")]
|
|
</Attribute>
|
|
|
|
### decompositions
|
|
|
|
<Attribute id="qiskit.circuit.library.RXXGate.decompositions">
|
|
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
|
|
</Attribute>
|
|
|
|
### definition
|
|
|
|
<Attribute id="qiskit.circuit.library.RXXGate.definition">
|
|
Return definition in terms of other basic gates.
|
|
</Attribute>
|
|
|
|
### duration
|
|
|
|
<Attribute id="qiskit.circuit.library.RXXGate.duration">
|
|
Get the duration.
|
|
</Attribute>
|
|
|
|
### label
|
|
|
|
<Attribute id="qiskit.circuit.library.RXXGate.label">
|
|
Return instruction label
|
|
|
|
**Return type**
|
|
|
|
`str`
|
|
</Attribute>
|
|
|
|
### name
|
|
|
|
<Attribute id="qiskit.circuit.library.RXXGate.name">
|
|
Return the name.
|
|
</Attribute>
|
|
|
|
### num\_clbits
|
|
|
|
<Attribute id="qiskit.circuit.library.RXXGate.num_clbits">
|
|
Return the number of clbits.
|
|
</Attribute>
|
|
|
|
### num\_qubits
|
|
|
|
<Attribute id="qiskit.circuit.library.RXXGate.num_qubits">
|
|
Return the number of qubits.
|
|
</Attribute>
|
|
|
|
### params
|
|
|
|
<Attribute id="qiskit.circuit.library.RXXGate.params">
|
|
return instruction params.
|
|
</Attribute>
|
|
|
|
### unit
|
|
|
|
<Attribute id="qiskit.circuit.library.RXXGate.unit">
|
|
Get the time unit of duration.
|
|
</Attribute>
|
|
</Class>
|
|
|