qiskit-documentation/docs/api/qiskit/0.43/qiskit.circuit.library.YGat...

155 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: YGate
description: API reference for qiskit.circuit.library.YGate
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.circuit.library.YGate
---
# YGate
<Class id="qiskit.circuit.library.YGate" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.24/qiskit/circuit/library/standard_gates/y.py" signature="YGate(label=None)" modifiers="class">
Bases: [`Gate`](qiskit.circuit.Gate "qiskit.circuit.gate.Gate")
The single-qubit Pauli-Y gate ($\sigma_y$).
Can be applied to a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") with the [`y()`](qiskit.circuit.QuantumCircuit#y "qiskit.circuit.QuantumCircuit.y") method.
**Matrix Representation:**
$$
\begin{split}Y = \begin{pmatrix}
0 & -i \\
i & 0
\end{pmatrix}\end{split}
$$
**Circuit symbol:**
```python
┌───┐
q_0: ┤ Y ├
└───┘
```
Equivalent to a $\pi$ radian rotation about the Y axis.
<Admonition title="Note" type="note">
A global phase difference exists between the definitions of $RY(\pi)$ and $Y$.
$$
\begin{split}RY(\pi) = \begin{pmatrix}
0 & -1 \\
1 & 0
\end{pmatrix}
= -i Y\end{split}
$$
</Admonition>
The gate is equivalent to a bit and phase flip.
$$
\begin{split}|0\rangle \rightarrow i|1\rangle \\
|1\rangle \rightarrow -i|0\rangle\end{split}
$$
Create new Y gate.
## Methods Defined Here
<span id="qiskit-circuit-library-ygate-control" />
### control
<Function id="qiskit.circuit.library.YGate.control" signature="YGate.control(num_ctrl_qubits=1, label=None, ctrl_state=None)">
Return a (multi-)controlled-Y gate.
One control returns a CY 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-ygate-inverse" />
### inverse
<Function id="qiskit.circuit.library.YGate.inverse" signature="YGate.inverse()">
Return inverted Y gate ($Y^{\dagger} = Y$)
</Function>
## Attributes
### condition\_bits
<Attribute id="qiskit.circuit.library.YGate.condition_bits">
Get Clbits in condition.
</Attribute>
### decompositions
<Attribute id="qiskit.circuit.library.YGate.decompositions">
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
</Attribute>
### definition
<Attribute id="qiskit.circuit.library.YGate.definition">
Return definition in terms of other basic gates.
</Attribute>
### duration
<Attribute id="qiskit.circuit.library.YGate.duration">
Get the duration.
</Attribute>
### label
<Attribute id="qiskit.circuit.library.YGate.label">
Return instruction label
</Attribute>
### name
<Attribute id="qiskit.circuit.library.YGate.name">
Return the name.
</Attribute>
### num\_clbits
<Attribute id="qiskit.circuit.library.YGate.num_clbits">
Return the number of clbits.
</Attribute>
### num\_qubits
<Attribute id="qiskit.circuit.library.YGate.num_qubits">
Return the number of qubits.
</Attribute>
### params
<Attribute id="qiskit.circuit.library.YGate.params">
return instruction params.
</Attribute>
### unit
<Attribute id="qiskit.circuit.library.YGate.unit">
Get the time unit of duration.
</Attribute>
</Class>