Main Content

siGate

Inverse S gate

Since R2023a

Installation Required: This functionality requires MATLAB Support Package for Quantum Computing.

Description

example

g = siGate(targetQubit) applies an inverse S gate to a single target qubit and returns a quantum.gate.SimpleGate object.

If targetQubit is a vector of qubit indices, siGate returns a column vector of gates, where g(i) represents an inverse S gate applied to a qubit with index targetQubit(i).

Applying this gate is equivalent to applying an R1 gate with a rotation angle of –π/2, meaning that siGate(targetQubit) is equivalent to r1Gate(targetQubit,-pi/2).

Examples

collapse all

Create an inverse S gate that acts on a single qubit.

g = siGate(1)
g = 

  SimpleGate with properties:

             Type: "si"
    ControlQubits: [1×0 double]
     TargetQubits: 1
           Angles: [1×0 double]

Get the matrix representation of the gate.

M = getMatrix(g)
M =

   1.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i   0.0000 - 1.0000i

Create an array of inverse S gates that act on qubits with indices 1 to 4.

g = siGate(1:4)
g = 

  4×1 SimpleGate array with gates:

    Id   Gate   Control   Target
     1   si               1     
     2   si               2     
     3   si               3     
     4   si               4     

Input Arguments

collapse all

Target qubit of the gate, specified as a positive integer scalar index or vector of qubit indices.

Example: 1

Example: 3:5

More About

collapse all

Matrix Representation of Inverse S Gate

The matrix representation of an inverse S gate applied to a single qubit is

[100exp(iπ2)]=[100i].

Applying this gate is equivalent to applying an R1 gate with a rotation angle of –π/2. Applying the inverse S gate twice is equivalent to applying the Pauli Z gate.

Version History

Introduced in R2023a