Skip to content

Qupent Gates API Reference

This page documents the qupent gates available in the skq.gates.qupent module. Qupents are quantum systems with 5 basis states (|0⟩, |1⟩, |2⟩, |3⟩, |4⟩) and can model spin-2 particles like the graviton.

Qupent Gate Base Class

The QupentGate class serves as the foundation for all qupent-based quantum gates in SKQ.

skq.gates.qupent.base.QupentGate

Bases: BaseGate

Base class for Qupent gates. These are quantum systems with a basis of 5 states. |0>, |1>, |2>, |3>, |4>. Models spin-2 particles like the graviton.

Source code in src/skq/gates/qupent/base.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class QupentGate(BaseGate):
    """
    Base class for Qupent gates.
    These are quantum systems with a basis of 5 states. |0>, |1>, |2>, |3>, |4>.
    Models spin-2 particles like the graviton.
    """

    def __new__(cls, input_array):
        obj = super().__new__(cls, input_array)
        assert obj.is_at_least_nxn(n=5), "Gate must be at least a 5x5 matrix"
        assert obj.is_power_of_n_shape(n=5), "Gate shape must be a power of 5"
        return obj

    def num_qupents(self) -> int:
        """Return the number of qupents involved in the gate."""
        return int(np.log(self.shape[0]) / np.log(5))

    def is_multi_qupent(self) -> bool:
        """Check if the gate involves multiple qupents."""
        return self.num_qupents() > 1

is_multi_qupent()

Check if the gate involves multiple qupents.

Source code in src/skq/gates/qupent/base.py
22
23
24
def is_multi_qupent(self) -> bool:
    """Check if the gate involves multiple qupents."""
    return self.num_qupents() > 1

num_qupents()

Return the number of qupents involved in the gate.

Source code in src/skq/gates/qupent/base.py
18
19
20
def num_qupents(self) -> int:
    """Return the number of qupents involved in the gate."""
    return int(np.log(self.shape[0]) / np.log(5))

Single-Qupent Gates

Identity Gate (QupentI)

The Identity gate leaves the qupent state unchanged.

Matrix Representation:

\[ \text{QupentI} = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \end{pmatrix} \]

skq.gates.qupent.single.QupentI

Bases: QupentGate

Identity gate for qupents.

Source code in src/skq/gates/qupent/single.py
 6
 7
 8
 9
10
11
class QupentI(QupentGate):
    """Identity gate for qupents."""

    def __new__(cls):
        obj = super().__new__(cls, np.eye(5))
        return obj

X Gate (QupentX)

The X gate for a qupent performs a cyclic permutation of the basis states: |0⟩ → |1⟩ → |2⟩ → |3⟩ → |4⟩ → |0⟩.

Matrix Representation:

\[ \text{QupentX} = \begin{pmatrix} 0 & 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \end{pmatrix} \]

skq.gates.qupent.single.QupentX

Bases: QupentGate

X gate for qupents.

Source code in src/skq/gates/qupent/single.py
14
15
16
17
18
19
class QupentX(QupentGate):
    """X gate for qupents."""

    def __new__(cls):
        obj = super().__new__(cls, np.array([[0, 0, 0, 0, 1], [1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0]]))
        return obj

Z Gate (QupentZ)

The Z gate for a qupent applies different phases to each basis state, using the fifth roots of unity.

Matrix Representation:

\[ \text{QupentZ} = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 \\ 0 & e^{2\pi i/5} & 0 & 0 & 0 \\ 0 & 0 & e^{4\pi i/5} & 0 & 0 \\ 0 & 0 & 0 & e^{6\pi i/5} & 0 \\ 0 & 0 & 0 & 0 & e^{8\pi i/5} \end{pmatrix} \]

Where \(e^{2\pi i/5}\) is the fifth root of unity.

skq.gates.qupent.single.QupentZ

Bases: QupentGate

Z gate for qupents.

Source code in src/skq/gates/qupent/single.py
22
23
24
25
26
27
28
29
30
class QupentZ(QupentGate):
    """Z gate for qupents."""

    def __new__(cls):
        d = 5
        omega = np.exp(2j * np.pi / d)
        phases = [omega**k for k in range(d)]
        obj = super().__new__(cls, np.diag(phases))
        return obj

Hadamard Gate (QupentH)

The Hadamard gate for a qupent creates a superposition of the five basis states with different phases.

Matrix Representation:

\[ \text{QupentH} = \frac{1}{\sqrt{5}} \begin{pmatrix} 1 & 1 & 1 & 1 & 1 \\ 1 & e^{2\pi i/5} & e^{4\pi i/5} & e^{6\pi i/5} & e^{8\pi i/5} \\ 1 & e^{4\pi i/5} & e^{8\pi i/5} & e^{2\pi i/5} & e^{6\pi i/5} \\ 1 & e^{6\pi i/5} & e^{2\pi i/5} & e^{8\pi i/5} & e^{4\pi i/5} \\ 1 & e^{8\pi i/5} & e^{6\pi i/5} & e^{4\pi i/5} & e^{2\pi i/5} \end{pmatrix} \]

This is a generalized Fourier transform matrix for dimension 5.

skq.gates.qupent.single.QupentH

Bases: QupentGate

Hadamard gate for qupents.

Source code in src/skq/gates/qupent/single.py
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class QupentH(QupentGate):
    """Hadamard gate for qupents."""

    def __new__(cls):
        obj = super().__new__(
            cls,
            np.array(
                [
                    [1, 1, 1, 1, 1],
                    [1, np.exp(2j * np.pi / 5), np.exp(4j * np.pi / 5), np.exp(6j * np.pi / 5), np.exp(8j * np.pi / 5)],
                    [1, np.exp(4j * np.pi / 5), np.exp(8j * np.pi / 5), np.exp(2j * np.pi / 5), np.exp(6j * np.pi / 5)],
                    [1, np.exp(6j * np.pi / 5), np.exp(2j * np.pi / 5), np.exp(8j * np.pi / 5), np.exp(4j * np.pi / 5)],
                    [1, np.exp(8j * np.pi / 5), np.exp(6j * np.pi / 5), np.exp(4j * np.pi / 5), np.exp(2j * np.pi / 5)],
                ]
            )
            / np.sqrt(5),
        )
        return obj

T Gate (QupentT)

The T gate for a qupent applies smaller phase shifts than the Z gate.

Matrix Representation:

\[ \text{QupentT} = \begin{pmatrix} e^{0\pi i/10} & 0 & 0 & 0 & 0 \\ 0 & e^{\pi i/10} & 0 & 0 & 0 \\ 0 & 0 & e^{2\pi i/10} & 0 & 0 \\ 0 & 0 & 0 & e^{3\pi i/10} & 0 \\ 0 & 0 & 0 & 0 & e^{4\pi i/10} \end{pmatrix} \]

skq.gates.qupent.single.QupentT

Bases: QupentGate

T gate for qupents.

Source code in src/skq/gates/qupent/single.py
53
54
55
56
57
58
59
class QupentT(QupentGate):
    """T gate for qupents."""

    def __new__(cls):
        phases = [np.exp(1j * k * np.pi / 10) for k in range(5)]
        obj = super().__new__(cls, np.diag(phases))
        return obj