qiskit-documentation/docs/api/qiskit/0.36/qiskit.circuit.library.U1Ga...

163 lines
3.6 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: U1Gate
description: API reference for qiskit.circuit.library.U1Gate
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.circuit.library.U1Gate
---
# U1Gate
<Class id="qiskit.circuit.library.U1Gate" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.20/qiskit/circuit/library/standard_gates/u1.py" signature="U1Gate(theta, label=None)" modifiers="class">
Bases: `qiskit.circuit.gate.Gate`
Single-qubit rotation about the Z axis.
This is a diagonal gate. It can be implemented virtually in hardware via framechanges (i.e. at zero error and duration).
**Circuit symbol:**
```python
┌───────┐
q_0: ┤ U1(λ) ├
└───────┘
```
**Matrix Representation:**
$$
\begin{split}U1(\lambda) =
\begin{pmatrix}
1 & 0 \\
0 & e^{i\lambda}
\end{pmatrix}\end{split}
$$
**Examples:**
> $$
> U1(\lambda = \pi) = Z
> $$
>
> $$
> U1(\lambda = \pi/2) = S
> $$
>
> $$
> U1(\lambda = \pi/4) = T
> $$
<Admonition title="See also" type="note">
`RZGate`: This gate is equivalent to RZ up to a phase factor.
> $$
> U1(\lambda) = e^{i{\lambda}/2} RZ(\lambda)
> $$
`U3Gate`: U3 is a generalization of U2 that covers all single-qubit rotations, using two X90 pulses.
Reference for virtual Z gate implementation: [1612.00858](https://arxiv.org/abs/1612.00858)
</Admonition>
Create new U1 gate.
## Methods Defined Here
### control
<Function id="qiskit.circuit.library.U1Gate.control" signature="U1Gate.control(num_ctrl_qubits=1, label=None, ctrl_state=None)">
Return a (multi-)controlled-U1 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>
### inverse
<Function id="qiskit.circuit.library.U1Gate.inverse" signature="U1Gate.inverse()">
Return inverted U1 gate ($U1(\lambda){\dagger} = U1(-\lambda)$)
</Function>
## Attributes
### condition\_bits
<Attribute id="qiskit.circuit.library.U1Gate.condition_bits">
Get Clbits in condition.
**Return type**
`List`\[`Clbit`]
</Attribute>
### decompositions
<Attribute id="qiskit.circuit.library.U1Gate.decompositions">
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
</Attribute>
### definition
<Attribute id="qiskit.circuit.library.U1Gate.definition">
Return definition in terms of other basic gates.
</Attribute>
### duration
<Attribute id="qiskit.circuit.library.U1Gate.duration">
Get the duration.
</Attribute>
### label
<Attribute id="qiskit.circuit.library.U1Gate.label">
Return instruction label
**Return type**
`str`
</Attribute>
### name
<Attribute id="qiskit.circuit.library.U1Gate.name">
Return the name.
</Attribute>
### num\_clbits
<Attribute id="qiskit.circuit.library.U1Gate.num_clbits">
Return the number of clbits.
</Attribute>
### num\_qubits
<Attribute id="qiskit.circuit.library.U1Gate.num_qubits">
Return the number of qubits.
</Attribute>
### params
<Attribute id="qiskit.circuit.library.U1Gate.params">
return instruction params.
</Attribute>
### unit
<Attribute id="qiskit.circuit.library.U1Gate.unit">
Get the time unit of duration.
</Attribute>
</Class>