📝 Finalising

This commit is contained in:
0x6f736f646f
2021-01-21 17:55:12 +03:00
parent f3891a1876
commit 1f8717604d
2 changed files with 12 additions and 5 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
# My Quantum Open Source Foundation Project
Hello world, I'm Rodney Osodo. An undergrad student at Jomo Kenyatta University of Agriculture and Technology in Kenya. I've been interested in quantum computing for a while now and am so excited to share my learnings from my most recent experience with quantum computing.
This is my quantum open source foundation project on building a quantum variational classifier using a heart attack dataset. The purpose of this project was to help me gain insight into the actual construction of a quantum model, applied to real data. By sharing these insights, I hope to help many of you undersand and learn much of the dynamics accompanied with quantum machine learning, which I grasped whilst doing this project. This will be a series of blogs in the order of:
This is my quantum open source foundation project on building a quantum variational classifier using a heart attack dataset. The purpose of this project was to help me gain insight into the actual construction of a quantum model, applied to real data. By sharing these insights, I hope to help many of you understand and learn much of the dynamics accompanied with quantum machine learning, which I grasped whilst doing this project. This will be a series of blogs in the order of:
1. Classical preprocessing of data, `this one`
2. Explaining the workings of a variational quantum model
3. Explain my finds and look at the best models
@@ -10,10 +10,10 @@ This is my quantum open source foundation project on building a quantum variatio
Ultimately, we will:
- Learn how a variational circuit works
- Explore the different types of optimizers in Qiskit
- Get a firmer understaning of quantum machine learning (hopefully!)
- Get a firmer understaning of quantum machine learning (hopefully! 😁)
My project plan is to:
1. Explore a specific dataset and preprocess it. For this project, we decided to use the heart attack data as our baseline. This is because, in medical aspects, heart attack is the leading disease that causes death. In computation aspect, the data was rather small and could easily be fitted on NISQ computers.
1. Explore a specific dataset and preprocess it. For this project, we decided to use the heart attack data as our baseline. This is because, in medical aspects, heart attack is the leading disease that causes death. In computation aspect, the data was rather small and could easily be fitted on NISQ computers. We also used the iris dataset and wine datasets for validation.
2. Create a quantum neural network (AKA variational classifier) by combining a featuremap, variational circuit and measurement component (don't worry, I will explain what these components mean in detail).
3. Explore different types of optimizers, featuremaps, depths of featuremaps and depths of the variational circuit.
4. Explain my observations based on the best 10 model configurations.
+9 -2
View File
@@ -35,7 +35,8 @@ In general, there are three steps to this type of quantum machine learning model
When we want to encode our classical data into quantum states, we perform certain operations to help us work with the data in quantum circuits. One of the steps is called data embedding which is the representation of classical data as a quantum state in Hilbert space via a quantum feature map. A feature map is a mathematical mapping that helps us embed our data into (usually) higher dimensional spaces, or in this case, quantum states. It can be thought of as a variational quantum circuit in which the parameters depend on the input data, which for our case is the classical heart attack data. We will need to define a variational quantum circuit before going any further. Recall that a variational quantum circuit depends on parameters that can be optimised by classical methods.
For embedding we take a classical data point, $x$, and encode it by applying a set of gate parameters in the quantum circuit where gate operations depend on the value of $x$, hence creating the desired quantum state:
$x \rightarrow \left| \psi_x \right\rangle $
![](../Notes/explanation/math-5.png)
Here are some examples of well known data embedding methods:
@@ -75,7 +76,13 @@ Feature maps encode our classical data $x_i$ into quantum states $\left|\phi(x_i
*Z feature map*
### 2. Model circuit
The second step is the model circuit, or the classifier strictly speaking. A parameterised unitary operator $U(w)$ is created such that $\left| \psi(x: \theta)\right\rangle = U(w) \left| \psi(x)\right\rangle$ . The model circuit is constructed from gates that evolve the input state. The circuit is based on unitary operations and depends on external parameters which will be adjustable. Given a prepared state $\left| \psi_i\right\rangle$ the model circuit, $U(w)$ maps $\left| \psi_i\right\rangle$ to another vector $\left| \psi_i\right\rangle = U(w)\left| \psi_i\right\rangle$. In turn $U(w)$ consists of a series of unitary gates.
The second step is the model circuit, or the classifier strictly speaking. A parameterised unitary operator $U(w)$ is created such that
![](../Notes/explanation/math-16.png)
$\left| \psi(x: \theta)\right\rangle = U(w) \left| \psi(x)\right\rangle$ .
The model circuit is constructed from gates that evolve the input state. The circuit is based on unitary operations and depends on external parameters which will be adjustable. Given a prepared state $\left| \psi_i\right\rangle$ the model circuit, $U(w)$ maps $\left| \psi_i\right\rangle$ to another vector $\left| \psi_i\right\rangle = U(w)\left| \psi_i\right\rangle$. In turn $U(w)$ consists of a series of unitary gates.
We used the RealAmplitudes variational circuit from Qiskit for this. Increasing the depth of the variational circuit introduces more trainable parameters into the model.