I wrote something similar a couple of years ago - https://github.com/adamisntdead/QuSimPy Happy to answer any questions people have, including on other simulation methods other than state vector!
A tutorial quantum interpreter in 150 lines of Lisp
11–20 of 46 posts
Re: A tutorial quantum interpreter in 150 lines of Lisp
#12Re: A tutorial quantum interpreter in 150 lines of Lisp
#13Recently, I have been working on some things that sometimes overlap with quantum computation and I have realized that the way all the quantum languages approach this wrong. If you are programming explicitly with CNOT gates, you are doing it wrong. A Python programmer doesn't care about logical gates, and neither should a quantum programmer. To that end, I'm convinced that the interplay between coinduction and inducti…
Re: A tutorial quantum interpreter in 150 lines of Lisp
#14Recently, I have been working on some things that sometimes overlap with quantum computation and I have realized that the way all the quantum languages approach this wrong. If you are programming explicitly with CNOT gates, you are doing it wrong. A Python programmer doesn't care about logical gates, and neither should a quantum programmer. To that end, I'm convinced that the interplay between coinduction and inducti…
This very well may be true, in the same sense that a Python programmer doesn't (usually) care about assembly language. But at their lowest levels, quantum computers are executing a sequence of gates, and much of the work and sophistication of a quantum compiler is to optimize said sequences for rapid and accurate execution. So while gate sequences may not be the end-game to the programmers of tomorrow, they're undoub…
Re: A tutorial quantum interpreter in 150 lines of Lisp
#15Recently, I have been working on some things that sometimes overlap with quantum computation and I have realized that the way all the quantum languages approach this wrong. If you are programming explicitly with CNOT gates, you are doing it wrong. A Python programmer doesn't care about logical gates, and neither should a quantum programmer. To that end, I'm convinced that the interplay between coinduction and inducti…
Re: A tutorial quantum interpreter in 150 lines of Lisp
#16Any recommendations on a textbook to understand this kind of math?
Ronald de Wolf:
https://arxiv.org/abs/1907.09415
David Bacon:
https://courses.cs.washington.edu/courses/cse599d/06wi/
Scott Aaronson:
https://en.wikipedia.org/wiki/Quantum_Computing_Since_Democr...
Re: A tutorial quantum interpreter in 150 lines of Lisp
#17I wrote something similar a couple of years ago - https://github.com/adamisntdead/QuSimPy Happy to answer any questions people have, including on other simulation methods other than state vector!
One of the aspects emphasized in TFA is being able to simulate gates of any dimension/number of qubits (like a 3-qubit Toffoli or a 5-qubit Molmer-Sorensen), instead of just 1- and 2-qubit gates. Have you thought about extending your simulator to support gates of greater than two qubits?
Re: A tutorial quantum interpreter in 150 lines of Lisp
#18Re: A tutorial quantum interpreter in 150 lines of Lisp
#19Earlier quoted context omitted.
This very well may be true, in the same sense that a Python programmer doesn't (usually) care about assembly language. But at their lowest levels, quantum computers are executing a sequence of gates, and much of the work and sophistication of a quantum compiler is to optimize said sequences for rapid and accurate execution. So while gate sequences may not be the end-game to the programmers of tomorrow, they're undoub…
I never said that they weren't. It's just that most programming language don't deal with gates as a part of their API.
That is, at the end of the day, something like Shor's algorithm can be reduced to some math constructs we roughly know. The speedup comes from these only being efficient using quantum gates. Implementing the code using abstract quantum gates isn't to try and compete, but to try and understand the gates and how they work at a logical level.
This is like learning how boolean gates work to understand some ideas of how computers work. The only people that really think in many of those terms are the CPU designers. Teaching the next round of the designers does so by working with boolean models to get there.
And you are correct that we may have other quantum constructs someday. Just like much of what goes into a CPU isn't strictly OR/AND/etc. With the way gates are wired, it can be confusing to folks as the input signal can also be seen as destroyed in the circuit, but a deterministic signal is captured on the other side.
Now, the above is all from my weak intuition here. I would not be shocked to find I'm wrong on parts.
Re: A tutorial quantum interpreter in 150 lines of Lisp
#20Recently, I have been working on some things that sometimes overlap with quantum computation and I have realized that the way all the quantum languages approach this wrong. If you are programming explicitly with CNOT gates, you are doing it wrong. A Python programmer doesn't care about logical gates, and neither should a quantum programmer. To that end, I'm convinced that the interplay between coinduction and inducti…
If you have not already seen it, you may be interested in Squiggol (to get an idea of its age, it probably had some indirect influence upon Python)
cf Charity: https://prism.ucalgary.ca/server/api/core/bitstreams/756b50a...