117 lines
2.8 KiB
Plaintext
117 lines
2.8 KiB
Plaintext
---
|
|
title: RGate
|
|
description: API reference for qiskit.circuit.library.RGate
|
|
in_page_toc_min_heading_level: 1
|
|
python_api_type: class
|
|
python_api_name: qiskit.circuit.library.RGate
|
|
---
|
|
|
|
# RGate
|
|
|
|
<Class id="qiskit.circuit.library.RGate" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.25/qiskit/circuit/library/standard_gates/r.py" signature="qiskit.circuit.library.RGate(theta, phi, label=None)" modifiers="class">
|
|
Bases: [`Gate`](qiskit.circuit.Gate "qiskit.circuit.gate.Gate")
|
|
|
|
Rotation θ around the cos(φ)x + sin(φ)y axis.
|
|
|
|
Can be applied to a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") with the [`r()`](qiskit.circuit.QuantumCircuit#r "qiskit.circuit.QuantumCircuit.r") method.
|
|
|
|
**Circuit symbol:**
|
|
|
|
```python
|
|
┌──────┐
|
|
q_0: ┤ R(ϴ) ├
|
|
└──────┘
|
|
```
|
|
|
|
**Matrix Representation:**
|
|
|
|
$$
|
|
\begin{align}\begin{aligned}\newcommand{\th}{\frac{\theta}{2}}\\\begin{split}R(\theta, \phi) = e^{-i \th \left(\cos{\phi} x + \sin{\phi} y\right)} =
|
|
\begin{pmatrix}
|
|
\cos\left(\th\right) & -i e^{-i \phi} \sin\left(\th\right) \\
|
|
-i e^{i \phi} \sin\left(\th\right) & \cos\left(\th\right)
|
|
\end{pmatrix}\end{split}\end{aligned}\end{align}
|
|
$$
|
|
|
|
Create new r single-qubit gate.
|
|
|
|
## Attributes
|
|
|
|
### condition\_bits
|
|
|
|
<Attribute id="qiskit.circuit.library.RGate.condition_bits">
|
|
Get Clbits in condition.
|
|
</Attribute>
|
|
|
|
### decompositions
|
|
|
|
<Attribute id="qiskit.circuit.library.RGate.decompositions">
|
|
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
|
|
</Attribute>
|
|
|
|
### definition
|
|
|
|
<Attribute id="qiskit.circuit.library.RGate.definition">
|
|
Return definition in terms of other basic gates.
|
|
</Attribute>
|
|
|
|
### duration
|
|
|
|
<Attribute id="qiskit.circuit.library.RGate.duration">
|
|
Get the duration.
|
|
</Attribute>
|
|
|
|
### label
|
|
|
|
<Attribute id="qiskit.circuit.library.RGate.label">
|
|
Return instruction label
|
|
</Attribute>
|
|
|
|
### name
|
|
|
|
<Attribute id="qiskit.circuit.library.RGate.name">
|
|
Return the name.
|
|
</Attribute>
|
|
|
|
### num\_clbits
|
|
|
|
<Attribute id="qiskit.circuit.library.RGate.num_clbits">
|
|
Return the number of clbits.
|
|
</Attribute>
|
|
|
|
### num\_qubits
|
|
|
|
<Attribute id="qiskit.circuit.library.RGate.num_qubits">
|
|
Return the number of qubits.
|
|
</Attribute>
|
|
|
|
### params
|
|
|
|
<Attribute id="qiskit.circuit.library.RGate.params">
|
|
return instruction params.
|
|
</Attribute>
|
|
|
|
### unit
|
|
|
|
<Attribute id="qiskit.circuit.library.RGate.unit">
|
|
Get the time unit of duration.
|
|
</Attribute>
|
|
|
|
## Methods
|
|
|
|
### inverse
|
|
|
|
<Function id="qiskit.circuit.library.RGate.inverse" signature="inverse()">
|
|
Invert this gate.
|
|
|
|
r(θ, φ)^dagger = r(-θ, φ)
|
|
</Function>
|
|
|
|
### power
|
|
|
|
<Function id="qiskit.circuit.library.RGate.power" signature="power(exponent)">
|
|
Raise gate to a power.
|
|
</Function>
|
|
</Class>
|
|
|