131 lines
3.1 KiB
Plaintext
131 lines
3.1 KiB
Plaintext
---
|
||
title: RZGate
|
||
description: API reference for qiskit.circuit.library.RZGate
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.circuit.library.RZGate
|
||
---
|
||
|
||
# RZGate
|
||
|
||
<Class id="qiskit.circuit.library.RZGate" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.19/qiskit/circuit/library/standard_gates/rz.py" signature="RZGate(phi, 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: ┤ Rz(λ) ├
|
||
└───────┘
|
||
```
|
||
|
||
**Matrix Representation:**
|
||
|
||
$$
|
||
\begin{split}RZ(\lambda) = exp(-i\frac{\lambda}{2}Z) =
|
||
\begin{pmatrix}
|
||
e^{-i\frac{\lambda}{2}} & 0 \\
|
||
0 & e^{i\frac{\lambda}{2}}
|
||
\end{pmatrix}\end{split}
|
||
$$
|
||
|
||
<Admonition title="See also" type="note">
|
||
`U1Gate` This gate is equivalent to U1 up to a phase factor.
|
||
|
||
> $$
|
||
> U1(\lambda) = e^{i{\lambda}/2}RZ(\lambda)
|
||
> $$
|
||
|
||
Reference for virtual Z gate implementation: [1612.00858](https://arxiv.org/abs/1612.00858)
|
||
</Admonition>
|
||
|
||
Create new RZ gate.
|
||
|
||
## Methods Defined Here
|
||
|
||
### control
|
||
|
||
<Function id="qiskit.circuit.library.RZGate.control" signature="RZGate.control(num_ctrl_qubits=1, label=None, ctrl_state=None)">
|
||
Return a (multi-)controlled-RZ 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.RZGate.inverse" signature="RZGate.inverse()">
|
||
Return inverted RZ gate
|
||
|
||
$RZ(\lambda){\dagger} = RZ(-\lambda)$
|
||
</Function>
|
||
|
||
## Attributes
|
||
|
||
### condition\_bits
|
||
|
||
<Attribute id="qiskit.circuit.library.RZGate.condition_bits">
|
||
Get Clbits in condition.
|
||
|
||
**Return type**
|
||
|
||
`List`\[`Clbit`]
|
||
</Attribute>
|
||
|
||
### decompositions
|
||
|
||
<Attribute id="qiskit.circuit.library.RZGate.decompositions">
|
||
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
|
||
</Attribute>
|
||
|
||
### definition
|
||
|
||
<Attribute id="qiskit.circuit.library.RZGate.definition">
|
||
Return definition in terms of other basic gates.
|
||
</Attribute>
|
||
|
||
### duration
|
||
|
||
<Attribute id="qiskit.circuit.library.RZGate.duration">
|
||
Get the duration.
|
||
</Attribute>
|
||
|
||
### label
|
||
|
||
<Attribute id="qiskit.circuit.library.RZGate.label">
|
||
Return instruction label
|
||
|
||
**Return type**
|
||
|
||
`str`
|
||
</Attribute>
|
||
|
||
### params
|
||
|
||
<Attribute id="qiskit.circuit.library.RZGate.params">
|
||
return instruction params.
|
||
</Attribute>
|
||
|
||
### unit
|
||
|
||
<Attribute id="qiskit.circuit.library.RZGate.unit">
|
||
Get the time unit of duration.
|
||
</Attribute>
|
||
</Class>
|
||
|