Quantum circuits simulating fundamental QM experiments. This is for a lecture I'm teaching.
- OpenQASM 59.2%
- Python 28.8%
- Just 9.4%
- Shell 2.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| 01_sg_spin.qasm | ||
| 02_sg_path.qasm | ||
| 03_sg_wigner_coherent.qasm | ||
| 04_chsh.qasm | ||
| justfile | ||
| README.md | ||
| requirements.txt | ||
| shell.fish | ||
| visualize_circuit.py | ||
Fundamental QM experiments
Prerequisites
You will need Python 3, Just and Fish installed.
Upon first download of this repository, run:
just install
Upon subsequent uses, run just shell to spin up the shell with the correct
Python environment.
Running the experiments
To run an experiment a 100 times, execute oqi followed by the filename, for
example:
oqi 01_sg_spin.qasm
Sometimes, you might need better precision and less fluctuation in results. To do that, run the experiment with more iterations, for example:
oqi 04_chsh.qasm 10000
Visualization
To visualize the quantum circuits, open IBM's quantum composer, enable Freeform alignment and then copy-paste the OpenQASM code to the editor.
Alternatively, run just visualize followed by the filename of the circuit you
want to visuialize.