This repository contains the implementation of the Variational Quantum Eigensolver (VQE) algorithm with noise mitigation methods. It is designed to run on IBM Quantum hardware through the Qiskit runtime service but also includes a simulation mode for local testing and development.
main.py
: The main script to setup, run, and process the VQE computations.mitigation_method.py
: Contains specific implementations for error mitigation techniques.Utils.py
: Helper functions and utilities for logging, data loading, and service interaction.requirements.txt
: Python dependencies required for the project.pauli_strings/
: Directory containing Pauli operators in string form.result/
: Directory where the outputs and intermediate results will be saved.
- Python 3.7+
- pip
- Virtual environment (recommended)
Create and activate a virtual environment (optional but recommended):
python -m venv venv_name
source venv_name/bin/activate
Install the required Python modules:
pip install -r requirements.txt
Before running the main.py
script, ensure that you have set up your Qiskit runtime service correctly and that you have the necessary credentials configured in your environment (refer to Qiskit documentation for more details).
To run the main VQE program, use the following command from the terminal:
python main.py --backend ibmq_qasm_simulator --optimizer DISQ
--backend
: The quantum backend to use (default:ibmq_qasm_simulator
).--iter
: Number of iterations for the optimizer (default: 20).--output
: Name for the output directory (default:temp
).--seed
: Random seed for reproducibility (optional).--ansatz
: The type of ansatz to use (SU2
orRA
, default:RA
).--rep
: Number of repetitions for the ansatz (default: 6).--optimizer
: The optimizer to use (DISQ
orSPSA
, default:DISQ
).--upload
: Flag to upload the script to the runtime (0: no upload, 1: run existing program, 2: create new program, default: 2).
For a full list of options, use the -h
or --help
flag when running the script.
Results and logs will be stored in the result/
directory specified by the --output
flag. This includes intermediate computational results and final outcomes.
Junyao Zhang Email, Github issue
- Zhang, Junyao, Hanrui Wang, Gokul Subramanian Ravi, Frederic T. Chong, Song Han, Frank Mueller, and Yiran Chen. "Disq: Dynamic iteration skipping for variational quantum algorithms." In 2023 IEEE International Conference on Quantum Computing and Engineering (QCE), vol. 1, pp. 1062-1073. IEEE, 2023. (Link)
@inproceedings{zhang2023disq,
title={Disq: Dynamic iteration skipping for variational quantum algorithms},
author={Zhang, Junyao and Wang, Hanrui and Ravi, Gokul Subramanian and Chong, Frederic T and Han, Song and Mueller, Frank and Chen, Yiran},
booktitle={2023 IEEE International Conference on Quantum Computing and Engineering (QCE)},
volume={1},
pages={1062--1073},
year={2023},
organization={IEEE}
}