# tiGate

Inverse T gate

Since R2023a

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

## Syntax

``g = tiGate(targetQubit)``

## Description

example

````g = tiGate(targetQubit)` applies an inverse T gate to a single target qubit and returns a `quantum.gate.SimpleGate` object.If `targetQubit` is a vector of qubit indices, `tiGate` returns a column vector of gates, where `g(i)` represents an inverse T gate applied to a qubit with index `targetQubit(i)`.Applying this gate is equivalent to applying the R1 gate with a rotation angle of –π/4, meaning that `tiGate(targetQubit)` is equivalent to `r1Gate(targetQubit,-pi/4)`.```

## Examples

collapse all

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

`g = tiGate(1)`
```g = SimpleGate with properties: Type: "ti" 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.7071 - 0.7071i```

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

`g = tiGate(1:4)`
```g = 4×1 SimpleGate array with gates: Id Gate Control Target 1 ti 1 2 ti 2 3 ti 3 4 ti 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`

collapse all

### Matrix Representation of Inverse T Gate

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

`$\left[\begin{array}{cc}1& 0\\ 0& \mathrm{exp}\left(-i\text{\hspace{0.17em}}\frac{\pi }{4}\right)\end{array}\right]=\left[\begin{array}{cc}1& 0\\ 0& \frac{1-i}{\sqrt{2}}\end{array}\right].$`

Applying this gate is equivalent to applying the R1 gate with a rotation angle of –π/4. Applying the inverse T gate four times is equivalent to applying the Pauli Z gate.

## Version History

Introduced in R2023a