This repository contains a quantum experiment simulation using Qiskit on IBM Quantum backend. The script initializes a quantum environment, loads experiment configurations as the choice of the user, and runs various attack scenarios to analyze fidelities. For more details regarding the experiment, refer to Defending crosstalk-mediated quantum attacks using dynamical decoupling.
Ensure you have the following installed:
- Python 3.8+
- Qiskit
- Qiskit IBM Runtime
- NumPy
- Matplotlib
- Jupyter Notebook
You can install the dependencies using:
pip install qiskit qiskit-ibm-runtime numpy matplotlib jupyter
- Clone this repository:
git clone https://github.com/yourusername/quantum-experiment.git cd quantum-experiment
- Configure your IBM Quantum account:
from qiskit_ibm_runtime import QiskitRuntimeService QiskitRuntimeService.save_account(channel="ibm_quantum", token="YOUR_IBM_TOKEN", overwrite=True, set_as_default=True)
- Ensure the
config.json
file exists. If missing, the script will generate a default one that needs to be updated.
Use the jupyter notebook:
TestCircuitQualityDegradation.ipynb
The script will prompt you to choose different attack scenarios. Enter Yes
or No
accordingly.
- The experiment results (fidelities) are plotted using Matplotlib.
- Results are stored in JSON files:
ExperimentResult_Count.json
(circuit counts)ExperimentResult_Fidelities.json
(fidelity values)
.
├── TestCircuitQualityDegradation.ipynb # Main interface which helps in executing the menu for selecting required scenarios
├── config.json # Configuration file (create/update before running the code)
├── ExperimentClass.py # Experiment class implementation with code of all the scenarios
Feel free to open an issue or submit a pull request to improve the experiment! 🚀
For queries, contact: devikamhr5@gmail.com