Skip to content

SPA-QIN Gates Class

This part of the project documentation focuses on a Gates class containing implementation of quantum gates.

Usage

In your code:

from spq_qin.gates import Gates 

Class members

You can access Gates class members:

Available gates:

  • Hadamard: $$ H = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1\ 1 & -1 \end{bmatrix} $$
  • CNOT: $$ CNOT = \begin{bmatrix} 1 & 0 & 0 & 0\ 0 & 1 & 0 & 0\ 0 & 0 & 0 & 1\ 0 & 0 & 1 & 0\ \end{bmatrix} $$

Example usage:

from spq_qin.gates import Gates

print(Gates.Hadamard)
print(Gates.CNOT)