Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/panadestein/quant_clq
A quantum interpreter in Common Lisp
https://github.com/panadestein/quant_clq
common-lisp interpreter quantum-computing
Last synced: about 12 hours ago
JSON representation
A quantum interpreter in Common Lisp
- Host: GitHub
- URL: https://github.com/panadestein/quant_clq
- Owner: Panadestein
- Created: 2023-11-08T11:33:15.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-30T15:08:38.000Z (9 months ago)
- Last Synced: 2025-01-09T21:12:44.170Z (4 days ago)
- Topics: common-lisp, interpreter, quantum-computing
- Language: Jupyter Notebook
- Homepage:
- Size: 215 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A quantum interpreter written in Lisp
This repository contains `clq`, my implementation in Common Lisp of a quantum computer
interpreter. It is based on the excellent tutorial by Robert Smith, which you can find [here](https://www.stylewarning.com/posts/quantum-interpreter/).The interpreter's correctness has been tested by comparing with the results of the
IBM's Qiskit Aer simulator, and also the results in a real quantum computer
(IBM's Eagle QPU).I have made a literate programming implementation, so the code is embedded in the docs.
I guess if you are here I don't have to say it, but it is best to explore the
interpreter with Emacs, Slime and Org-mode.## Overview
The interpreter's idea is simple: evolve the wave function $\Psi_0^n$ in the full
Hilbert space, that means $2^n \times 2^n$ if we use $n$ qubits. Then construct
the full gates by lifting:$L_U = I \otimes \cdots U \cdots \otimes I$
and evolve it:
$$\Psi_m^n = \Psi_0^n \prod_i^m L_{U_i}$$
The measurement is done by sampling the CDF of the squared amplitudes of the states.
But please see the org-mode file for the gory details.