Qutrit Gates API Reference
This page documents the qutrit gates available in the skq.gates.qutrit
module. Qutrits are quantum systems with 3 basis states (|0⟩, |1⟩, |2⟩) and can model spin-1 particles like photons and gluons.
Qutrit Gate Base Class
The QutritGate
class serves as the foundation for all qutrit-based quantum gates in SKQ.
skq.gates.qutrit.base.QutritGate
Bases: BaseGate
Base class for Qutrit gates. These are quantum systems with a basis of 3 states. |0>, |1>, |2>. Models spin-1 particles like photons and gluons.
Source code in src/skq/gates/qutrit/base.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
is_multi_qutrit()
Check if the gate involves multiple qutrits.
Source code in src/skq/gates/qutrit/base.py
26 27 28 |
|
num_qutrits()
Return the number of qutrits involved in the gate.
Source code in src/skq/gates/qutrit/base.py
22 23 24 |
|
qutrit_to_qubit()
Convert the qutrit gate to an equivalent qubit gate. :return: CustomQubitGate object
Source code in src/skq/gates/qutrit/base.py
30 31 32 33 34 35 36 37 38 39 40 41 |
|
to_pennylane(wires=None, qutrit_gate=False)
Convert gate to a PennyLane QubitUnitary. PennyLane only supports qubit gates, so we convert the qutrit gate to a qubit gate first. :param wires: List of wires the gate acts on :param qutrit_gate: If True, return a QutritUnitary gate instead of a qubit gate :return: If qutrit_gate is True, return a PennyLane QutritUnitary object. If qutrit_gate is False, return a PennyLane QubitUnitary object.
Source code in src/skq/gates/qutrit/base.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
to_qiskit()
Convert Qutrit gate to a Qiskit Gate object. Qiskit only supports qubit gates, so we convert the qutrit gate to a qubit gate first. :return: Qiskit UnitaryGate object
Source code in src/skq/gates/qutrit/base.py
43 44 45 46 47 48 49 50 |
|
Single-Qutrit Gates
Identity Gate (QutritI)
The Identity gate leaves the qutrit state unchanged.
Matrix Representation:
skq.gates.qutrit.single.QutritI
Bases: QutritGate
Identity gate for a qutrit. [[1, 0, 0][0, 1, 0] [0, 0, 1]]
Source code in src/skq/gates/qutrit/single.py
6 7 8 9 10 11 12 13 14 15 |
|
X Gate (QutritX)
The X gate for a qutrit performs a cyclic permutation of the basis states: |0⟩ → |1⟩ → |2⟩ → |0⟩.
Matrix Representation:
skq.gates.qutrit.single.QutritX
Bases: QutritGate
X gate for a qutrit. |0> -> |1> |1> -> |2> |2> -> |0>
Source code in src/skq/gates/qutrit/single.py
18 19 20 21 22 23 24 25 26 27 |
|
Y Gate (QutritY)
The Y gate for a qutrit performs a cyclic permutation with phase: |0⟩ → -i|1⟩ → -i|2⟩ → -i|0⟩.
Matrix Representation:
skq.gates.qutrit.single.QutritY
Bases: QutritGate
Y gate for a qutrit. |0> -> -i|1> |1> -> -i|2> |2> -> -i|0>
Source code in src/skq/gates/qutrit/single.py
30 31 32 33 34 35 36 37 38 39 |
|
Z Gate (QutritZ)
The Z gate for a qutrit applies different phases to each basis state.
Matrix Representation:
skq.gates.qutrit.single.QutritZ
Bases: QutritGate
Z gate for a qutrit. |0> -> |0> |1> -> exp(2pii/3)|1> |2> -> exp(-2pii/3)|2>
Source code in src/skq/gates/qutrit/single.py
42 43 44 45 46 47 48 49 50 51 |
|
Hadamard Gate (QutritH)
The Hadamard gate for a qutrit creates a superposition of the three basis states.
Matrix Representation:
Where \(e^{2\pi i/3}\) is the cube root of unity.
skq.gates.qutrit.single.QutritH
Bases: QutritGate
Hadamard gate for a qutrit. |0> -> (|0> + |1> + |2>)/sqrt(3) |1> -> (|0> + e^(2πi/3)|1> + e^(4πi/3)|2>)/sqrt(3) |2> -> (|0> + e^(4πi/3)|1> + e^(2πi/3)|2>)/sqrt(3)
Source code in src/skq/gates/qutrit/single.py
54 55 56 57 58 59 60 61 62 63 64 |
|
T Gate (QutritT)
The T gate for a qutrit applies smaller phase shifts than the Z gate.
Matrix Representation:
skq.gates.qutrit.single.QutritT
Bases: QutritGate
T gate for a qutrit. |0> -> |0> |1> -> exp(2pii/9)|1> |2> -> exp(-2pii/9)|2>
Source code in src/skq/gates/qutrit/single.py
67 68 69 70 71 72 73 74 75 76 |
|
R Gate (QutritR)
The R gate for a qutrit is a non-Clifford gate that applies a phase flip to the |2⟩ state.
Matrix Representation:
skq.gates.qutrit.single.QutritR
Bases: QutritGate
R gate for a qutrit (non-Clifford gate).
Source code in src/skq/gates/qutrit/single.py
79 80 81 82 83 |
|
Phase Gate (QutritPhase)
The general Phase gate for qutrits applies arbitrary phase shifts to each basis state.
Matrix Representation:
skq.gates.qutrit.single.QutritPhase
Bases: QutritGate
General phase gate for qutrits. Applies phase shifts to the qutrit basis states.
Source code in src/skq/gates/qutrit/single.py
86 87 88 89 90 91 92 93 |
|
S Gate (QutritS)
The S gate for qutrits is a special case of the Phase gate.
Matrix Representation:
skq.gates.qutrit.single.QutritS
Bases: QutritPhase
S gate for qutrits. |0> -> |0> |1> -> exp(2pii/3)|1> |2> -> exp(4pii/3)|2>
Source code in src/skq/gates/qutrit/single.py
96 97 98 99 100 101 102 103 104 105 |
|
Multi-Qutrit Gates
Multi-Qutrit Identity (QutritMI)
The Identity gate for multiple qutrits.
Matrix Representation (for 1 qutrit):
skq.gates.qutrit.multi.QutritMI
Bases: QutritGate
Multi-qutrit Identity gate. :param num_qutrits: Number of qutrits in the gate.
Source code in src/skq/gates/qutrit/multi.py
6 7 8 9 10 11 12 13 14 |
|
Controlled-X Type A (QutritCXA)
The CNOT gate for qutrits with control on |1⟩. This gate performs a cyclic permutation on the target qutrit if the control qutrit is in state |1⟩.
Matrix Representation (9×9 matrix):
skq.gates.qutrit.multi.QutritCXA
Bases: QutritGate
CNOT gate for qutrits. More information on Qutrit CNOT: https://www.iosrjournals.org/iosr-jap/papers/Vol10-issue6/Version-2/D1006021619.pdf Control on |1>
Source code in src/skq/gates/qutrit/multi.py
17 18 19 20 21 22 23 24 25 26 27 |
|
Controlled-X Type B (QutritCXB)
The CNOT gate for qutrits with control on |2⟩. This gate performs a cyclic permutation on the target qutrit if the control qutrit is in state |2⟩.
Matrix Representation (9×9 matrix):
skq.gates.qutrit.multi.QutritCXB
Bases: QutritGate
CNOT gate for qutrits. More information on Qutrit CNOT: https://www.iosrjournals.org/iosr-jap/papers/Vol10-issue6/Version-2/D1006021619.pdf Control on |2>
Source code in src/skq/gates/qutrit/multi.py
30 31 32 33 34 35 36 37 38 39 40 |
|
Controlled-X Type C (QutritCXC)
The CNOT gate for qutrits with control on |0⟩. This gate performs a cyclic permutation on the target qutrit if the control qutrit is in state |0⟩.
Matrix Representation (9×9 matrix):
skq.gates.qutrit.multi.QutritCXC
Bases: QutritGate
CNOT gate for qutrits. More information on Qutrit CNOT: https://www.iosrjournals.org/iosr-jap/papers/Vol10-issue6/Version-2/D1006021619.pdf Control on |0>
Source code in src/skq/gates/qutrit/multi.py
43 44 45 46 47 48 49 50 51 52 53 |
|
SWAP Gate (QutritSWAP)
The SWAP gate for qutrits exchanges the states of two qutrits.
Matrix Representation (9×9 matrix):
skq.gates.qutrit.multi.QutritSWAP
Bases: QutritGate
SWAP gate for qutrits. |01> -> |10> |10> -> |01>
Source code in src/skq/gates/qutrit/multi.py
56 57 58 59 60 61 62 63 64 65 |
|