- Quantum image dataset loading
- This project converts given image dataset to quantum processable data(qubits) by utilizing PCA for dimensionality reduction and initial states for generating qubits. It can analyze the number of PCA components and produce the transformed qubits of an image dataset for a chosen IBM quantum device or simulator. The variance percentage that is being kept by PCA is also given as feedback to the user.
You need to have the following installed on your system
- Git clone the repo
git clone https://github.com/moswil/Qiskit-Hackathon
- Change directory to
Qiskit-Hackathon
, I will refer to this directory asproject-root-directory
from now
cd Qiskit-Hackathon
- Run the following command to have project set up
- Create virtual environment
python -m venv qiskit-env
- For
Linux or Mac Users
activate it as below
source qiskit-env/bin/activate
- For
Windows Users
, activate it as follows
qiskit-env\\Scripts\\activate.bat
- Install the project dependencies
pip install -r requirements.txt
- Online
- If you want to Experiment the
IBM Q Experience
, you need to create an account on IBM Quantum Computing - Then go to settings and copy your token
- Create a file name as
.env
in yourproject-root-directory
- In the
.env file
create a key-value pair as shown below
TOKEN='your-token`
- Replace
'your-token'
with the actual account token - Just run the code on the next section
- If you want to Experiment the
- Offline / Local
- Just follow the next section
- Change the
DIR
variable to the directory that contains your images - Then run
python main.py
- bloch
- circuit
- Image preprocessing
- Image reading
- Image resizing (cropping)
- normalization
- dimensionality reduction (PCA)
- Quantum Encoding
- done in q_circuit.py