130 lines
3.1 KiB
Plaintext
130 lines
3.1 KiB
Plaintext
---
|
||
title: U3Gate (v0.29)
|
||
description: API reference for qiskit.circuit.library.U3Gate in qiskit v0.29
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.circuit.library.U3Gate
|
||
---
|
||
|
||
# U3Gate
|
||
|
||
<Class id="qiskit.circuit.library.U3Gate" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.18/qiskit/circuit/library/standard_gates/u3.py" signature="U3Gate(theta, phi, lam, label=None)" modifiers="class">
|
||
Bases: `qiskit.circuit.gate.Gate`
|
||
|
||
Generic single-qubit rotation gate with 3 Euler angles.
|
||
|
||
Implemented using two X90 pulses on IBM Quantum systems:
|
||
|
||
$$
|
||
U3(\theta, \phi, \lambda) =
|
||
RZ(\phi) RX(-\pi/2) RZ(\theta) RX(\pi/2) RZ(\lambda)
|
||
$$
|
||
|
||
**Circuit symbol:**
|
||
|
||
```python
|
||
┌───────────┐
|
||
q_0: ┤ U3(ϴ,φ,λ) ├
|
||
└───────────┘
|
||
```
|
||
|
||
**Matrix Representation:**
|
||
|
||
$$
|
||
\begin{align}\begin{aligned}\newcommand{\th}{\frac{\theta}{2}}\\\begin{split}U3(\theta, \phi, \lambda) =
|
||
\begin{pmatrix}
|
||
\cos(\th) & -e^{i\lambda}\sin(\th) \\
|
||
e^{i\phi}\sin(\th) & e^{i(\phi+\lambda)}\cos(\th)
|
||
\end{pmatrix}\end{split}\end{aligned}\end{align}
|
||
$$
|
||
|
||
**Examples:**
|
||
|
||
$$
|
||
U3(\theta, -\frac{\pi}{2}, \frac{\pi}{2}) = RX(\theta)
|
||
$$
|
||
|
||
$$
|
||
U3(\theta, 0, 0) = RY(\theta)
|
||
$$
|
||
|
||
Create new U3 gate.
|
||
|
||
## Methods Defined Here
|
||
|
||
<span id="qiskit-circuit-library-u3gate-control" />
|
||
|
||
### control
|
||
|
||
<Function id="qiskit.circuit.library.U3Gate.control" signature="U3Gate.control(num_ctrl_qubits=1, label=None, ctrl_state=None)">
|
||
Return a (multi-)controlled-U3 gate.
|
||
|
||
**Parameters**
|
||
|
||
* **num\_ctrl\_qubits** (*int*) – number of control qubits.
|
||
* **label** (*str or None*) – An optional label for the gate \[Default: None]
|
||
* **ctrl\_state** (*int or str or None*) – control state expressed as integer, string (e.g. ‘110’), or None. If None, use all 1s.
|
||
|
||
**Returns**
|
||
|
||
controlled version of this gate.
|
||
|
||
**Return type**
|
||
|
||
[ControlledGate](qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate")
|
||
</Function>
|
||
|
||
<span id="qiskit-circuit-library-u3gate-inverse" />
|
||
|
||
### inverse
|
||
|
||
<Function id="qiskit.circuit.library.U3Gate.inverse" signature="U3Gate.inverse()">
|
||
Return inverted U3 gate.
|
||
|
||
$U3(\theta,\phi,\lambda)^{\dagger} =U3(-\theta,-\lambda,-\phi)$)
|
||
</Function>
|
||
|
||
## Attributes
|
||
|
||
### decompositions
|
||
|
||
<Attribute id="qiskit.circuit.library.U3Gate.decompositions">
|
||
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
|
||
</Attribute>
|
||
|
||
### definition
|
||
|
||
<Attribute id="qiskit.circuit.library.U3Gate.definition">
|
||
Return definition in terms of other basic gates.
|
||
</Attribute>
|
||
|
||
### duration
|
||
|
||
<Attribute id="qiskit.circuit.library.U3Gate.duration">
|
||
Get the duration.
|
||
</Attribute>
|
||
|
||
### label
|
||
|
||
<Attribute id="qiskit.circuit.library.U3Gate.label">
|
||
Return instruction label
|
||
|
||
**Return type**
|
||
|
||
`str`
|
||
</Attribute>
|
||
|
||
### params
|
||
|
||
<Attribute id="qiskit.circuit.library.U3Gate.params">
|
||
return instruction params.
|
||
</Attribute>
|
||
|
||
### unit
|
||
|
||
<Attribute id="qiskit.circuit.library.U3Gate.unit">
|
||
Get the time unit of duration.
|
||
</Attribute>
|
||
</Class>
|
||
|