REU Project exploring how causal inference can be used to understand and explain quantum computing workflows. The project uses IBM Qiskit to run controlled quantum circuit experiments, collects structured execution data, builds causal graphs, and performs causal and counterfactual analysis using DoWhy's graphical causal model (GCM) module.
TASK_1/- Qiskit learning notebookTASK_2/- Quantum benchmark circuit libraryTASK_3_4/- Experiment runner and metrics evaluationTASK_5/- Constructing Causal Models, with explanationsTASK_6/- Conducting DoWhy Causal and Counterfactual AnalysisTASK_7/- Streamlit ToolTASK_8/- Final Report
- Does increasing configured depth cause a measurable decrease in output quality under a fixed noise model?
- Does Qiskit’s transpilation optimization level reduce gate count or transpiled depth enough to improve output quality?
- How does the number of shots affect the stability of the measured output distribution?
- Which has a stronger effect on output quality: transpiled depth, two-qubit gate count, or simulated noise rate?
- Can a simple causal graph help explain how quantum workflow configurations influence observed outcomes?
- What would the output quality have been if the same circuit had been run with a lower noise rate or a different optimization level?
noise_rateis the most consequential causal variable for output quality and target-state success probability, approximately 2 times stronger than transpiled depth and 5 times stronger than two-qubit gate count.optimization_levelhas a negligible direct effect on output quality (TVD) for the simple set of benchmark circuits tested (~1% change).shotshas the weakest causal effect on output quality, with diminishing returns on TVD past ~2000 shots.- DoWhy's GCM Counterfactual analysis shows that fixing the
noise_rateto 0.001 (low noise) would reduce mean TVD by ~67.3% (0.10445 to 0.03412), which is a significant increase in output quality. - Grover's
success_probabilityimproves by ~28% (0.57483 to 0.73580) under low noise conditions.
- Python 3.11+
First, clone the repo and navigate into the directory:
git clone [https://github.com/VigneshT24/AISys_QC_Exploring_Causality.git](https://github.com/VigneshT24/AISys_QC_Exploring_Causality.git)Then:
cd AISys_QC_Exploring_Causality
Then install all required dependencies:
pip install -r requirements.txtTo ensure stable causal estimates and reproducible simulator results, a fixed random seed (42) is utilized throughout the entire pipeline. This explicit seed is passed to the Qiskit AerSimulator measurement executions (in evaluate_circuit.py) and is used for the DoWhy causal mechanism fitting and bootstrap resampling (in TASK_6/analysis_notebook.ipynb).
To regenerate the experiment_results.csv dataset from scratch:
cd TASK_3_4
python test_suite.pyNote: This utilizes parallel processing but may still take several minutes. It generates exactly 12,672 execution rows across the 5 benchmark circuits and all configuration combinations.
The project splits analysis into two parts: standard metrics visualization and DoWhy causal/counterfactual analysis.
- Visualizing Metrics: Run
visual_view.pyto regenerate the high-quality Matplotlib/Seaborn boxplots and line charts used in the report. - Causal Analysis: Navigate to
TASK_6/and execute theanalysis_notebook.ipynbJupyter Notebook. This notebook imports the NetworkX graph fromTASK_5, builds the Invertible Structural Causal Models (GCM), calculates arrow strengths, and performs the counterfactual sampling.
You do not need to download the repository to explore the causal findings. You can visit the live deployed dashboard here: https://aisys-quantumcausality.streamlit.app/
However, if you wish to run the dashboard locally:
cd TASK_7
streamlit run app.pyThe causal graph connects workflow configurations (column 1) to outcome metrics (column 3) through two mediator variables (column 2):
Causal Variables: shots, noise_rate, optimization_level, num_qubits, circuit_name
Mediators: depth, count_2q
Outcome Metrics: tvd, runtime, success_probability (Grover only)
See TASK_5/causal_explanation.md for full justification of every edge.
- Pooyan Jamshidi, University of South Carolina
- Mohammad Ali Javidian, Appalachian State University
For a comprehensive breakdown of the methodology, background, and experimental explanations, please refer to the complete report located in the TASK_8/ directory.