We have chosen to tackle the IBM challenge of the application of qutrits. In our project, we expand on the proposal of a single qubit as a universal classifier by Pérez-Salinas et al. (https://arxiv.org/pdf/1907.02085.pdf) by using a single qutrit instead of a qubit, which should have a higher expressive power because of its higher dimensionality, thus making for a more powerful classifier. The proposed strategy in the paper consists on the re-uploading of the data points in order to train our model (check out the aforementioned reference for more details). This is implemented by applying unitary gates to the qutrit, parameterized by the rotation angles, that can be understood as the hidden layers of a neural network. Those rotation angles also include the data that must be re-uploaded in each layer of the classifier. We first tested the classifier by doing some simulations where we trained the model using data generated by us, and we tried implementing it in real quantum hardware. Since the training process is rather time consuming for our current time limit, we could not afford to do the actual training of the physical device. As an attempt to get something closer to the actual experiment, we have generated some predictions with IBM's hardware using the optimal parametrization we have found in our simulations, although these turned out unsuccesful.
-
src/qutrit_classif.ipynb
is the hardware implementation of the experiment. -
Qutrit_Classifier_Simulation.ipynb
is the simulated qutrit classifier trained with test data.
Most quantum applications use qubits to process the information, that means we work on a 2n-dimensional Hilbert space since each qubit has 2 accessible states, |0〉 and |1〉. The state of these qubits can be easily modified using gates acting con that Hilbert space. However, we could also use higher energy states, for example we could use qutrits that can be in the states |0〉, |1〉 and |2〉 (or a superposition of those), but now the dimension of the Hilbert space becomes 2n3m where n is the number of qubits and m is the number of qutrits we have in our system.
In order to manipulate the state of the qutrits we can program directly the microwave pulses that we must apply to the qutrits. When the frequency of the pulse is ressonant with the gap between two energy levels, the population of these states will vary. This can be done using Qiskit Pulse which lets us program the frequency, amplitude and duration of the pulses we want to apply to our qubits/qutrits.
The goal of this project is to build a quantum classifier that uses qutrits to distinguish the different classes. The reason for that is because a classifier can be made using a single qubit by checking the fidelity with a set of maximally orthogonal states, if instead we use a qutrit, these states will have a larger orthogonality (for the same number of classes > 2) and therefore we will have less errors.
This classifier uses machine learning techniques, it consists on a set of unitary gates parameterized with some coefficients in the rotation angles that must be optimized during the training process via the minimization of a loss function. Each gate will take the previous state and the data of the element we want to classify as inputs and returns a quantum state as the output after weighting these values to get the angle of the unitary rotation. Note that the classical data must be re-uploaded in each gate due to the no-cloning theorem of quantum mechanics that doesn't allow us to copy the data points which are needed in every layer. The class of the elements is determined as the most probable state outcome of the pulse schedule.
Additionally, it is important to mention that it is a good idea to minimize the quantum resources when trying to solve a given problem. In our case, we built a quantum classifier using a single qutrit, and that was possible because of the re-uploading data technique. It would also be possible to build a multi-qutrit classifier with a higher efficiency, but it would be more sophisticated and difficult to implement in larger algorithms.
The size of the circuit grows linearly with the number of layers, and the number of gates of those layers also grows linearly with the size of the data. The classifier will perform better as we add more layers.
Applying unitary gates to qutrits is a bit more complex than in qubits, for qubits we have the general U3 matrix given by
That can be decomposed as
We can obtain unitary gates for qutrits by applying 2-dimensional gates to the subspaces {|0〉,|1〉} and {|1〉,|2〉}. By doing so, we can decompose unitary qutrit gates as
The reason for doing that is because it is not trivial to find the pulses needed for applying a unitary gate to a qutrit, but it is easier to find the pulses corresponding to 2-dimensional X, Y, Z gates. Each subspace has a particular pulse frequency and π-pulse amplitude which need to be determined experimentally. Adressing any of the subspaces is made by setting the correct frequency, and tuning the amplitude and an additional phase allows us to implement a rotation in that subspace.
For our layers we have used only 4 gates:
Where the angles will be determined by the classical data and the weights obtained from the training.
We started doing some simulations using the qutrit classifier, for that we first generated the training data from the three-class annulus problem. We then used these data points to train our model with 3 layers.
We wanted to check the accuracy of the model depending on the number of layers, for that we took the percentage of the data that was correctly predicted.
Finally, as a comparison we plotted the results from a 5 layer model to see the improvement.
- Make sure to have an IBMid account (which can be created here) that allows you to access the IBM Quantum Dashboard in order to find your personal token, which is required to access the IBM Quantum resources used in this project (qpus and simulators).
- Set up your preferred virtual environment.
- Run the command
pip install -r requirements.txt
in theQilimanjaro
directory to install all the required dependencies.
Run the command jupyter notebook
in the Qilimanjaro
directory, inside the src
folder you will find our two notebooks:
Qutrit_Classifier_Simulation.ipynb
is the simulated qutrit classifier trained with test data.qutrit_classif.ipynb
is the hardware implementation of the experiment.
- Further walkthrough of what you did
- Links to any Jupyter notebooks/scripts
- Business applications
- Link to Presentation
Qilimanjaro team