128 lines
2.8 KiB
Plaintext
128 lines
2.8 KiB
Plaintext
---
|
|
title: SGate
|
|
description: API reference for qiskit.circuit.library.SGate
|
|
in_page_toc_min_heading_level: 1
|
|
python_api_type: class
|
|
python_api_name: qiskit.circuit.library.SGate
|
|
---
|
|
|
|
# SGate
|
|
|
|
<Class id="qiskit.circuit.library.SGate" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.23/qiskit/circuit/library/standard_gates/s.py" signature="SGate(label=None)" modifiers="class">
|
|
Bases: [`qiskit.circuit.gate.Gate`](qiskit.circuit.Gate "qiskit.circuit.gate.Gate")
|
|
|
|
Single qubit S gate (Z\*\*0.5).
|
|
|
|
It induces a $\pi/2$ phase, and is sometimes called the P gate (phase).
|
|
|
|
This is a Clifford gate and a square-root of Pauli-Z.
|
|
|
|
Can be applied to a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") with the [`s()`](qiskit.circuit.QuantumCircuit#s "qiskit.circuit.QuantumCircuit.s") method.
|
|
|
|
**Matrix Representation:**
|
|
|
|
$$
|
|
\begin{split}S = \begin{pmatrix}
|
|
1 & 0 \\
|
|
0 & i
|
|
\end{pmatrix}\end{split}
|
|
$$
|
|
|
|
**Circuit symbol:**
|
|
|
|
```python
|
|
┌───┐
|
|
q_0: ┤ S ├
|
|
└───┘
|
|
```
|
|
|
|
Equivalent to a $\pi/2$ radian rotation about the Z axis.
|
|
|
|
Create new S gate.
|
|
|
|
## Methods Defined Here
|
|
|
|
### inverse
|
|
|
|
<Function id="qiskit.circuit.library.SGate.inverse" signature="SGate.inverse()">
|
|
Return inverse of S (SdgGate).
|
|
</Function>
|
|
|
|
### power
|
|
|
|
<Function id="qiskit.circuit.library.SGate.power" signature="SGate.power(exponent)">
|
|
Raise gate to a power.
|
|
</Function>
|
|
|
|
## Attributes
|
|
|
|
### condition\_bits
|
|
|
|
<Attribute id="qiskit.circuit.library.SGate.condition_bits">
|
|
Get Clbits in condition.
|
|
|
|
**Return type**
|
|
|
|
`List`\[[`Clbit`](qiskit.circuit.Clbit "qiskit.circuit.classicalregister.Clbit")]
|
|
</Attribute>
|
|
|
|
### decompositions
|
|
|
|
<Attribute id="qiskit.circuit.library.SGate.decompositions">
|
|
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
|
|
</Attribute>
|
|
|
|
### definition
|
|
|
|
<Attribute id="qiskit.circuit.library.SGate.definition">
|
|
Return definition in terms of other basic gates.
|
|
</Attribute>
|
|
|
|
### duration
|
|
|
|
<Attribute id="qiskit.circuit.library.SGate.duration">
|
|
Get the duration.
|
|
</Attribute>
|
|
|
|
### label
|
|
|
|
<Attribute id="qiskit.circuit.library.SGate.label">
|
|
Return instruction label
|
|
|
|
**Return type**
|
|
|
|
`str`
|
|
</Attribute>
|
|
|
|
### name
|
|
|
|
<Attribute id="qiskit.circuit.library.SGate.name">
|
|
Return the name.
|
|
</Attribute>
|
|
|
|
### num\_clbits
|
|
|
|
<Attribute id="qiskit.circuit.library.SGate.num_clbits">
|
|
Return the number of clbits.
|
|
</Attribute>
|
|
|
|
### num\_qubits
|
|
|
|
<Attribute id="qiskit.circuit.library.SGate.num_qubits">
|
|
Return the number of qubits.
|
|
</Attribute>
|
|
|
|
### params
|
|
|
|
<Attribute id="qiskit.circuit.library.SGate.params">
|
|
return instruction params.
|
|
</Attribute>
|
|
|
|
### unit
|
|
|
|
<Attribute id="qiskit.circuit.library.SGate.unit">
|
|
Get the time unit of duration.
|
|
</Attribute>
|
|
</Class>
|
|
|