Common Lisp, Development, LISP, Quantum Computing, Quantum Programming, Technology

Quantum Computing and Lisp

Quantum Computing is a fascinating field, but currently a contentious one. The only examples we have of real-world, hardware quantum computers are the line of adiabatic quantum computers from D-Wave Systems—and many voices in the scientific community still protest its identification as such simply because it is not a full-fledged gate-model quantum computer complete with persistent quantum data storage and QRAM. However, by the strictest definition, any machine which exploits quantum mechanical phenomena for the purpose of computation is a quantum computer, and the D-Wave One and Two meet this definition.

For us in the Lisp community, Quantum Computing is even more important; one of the most surprising secrets of the D-Wave line of adiabatic quantum computers is that their low-level operating system is programmed in Common Lisp. Specifically, D-Wave uses SBCL. This choice is not accidental or arbitrary—Common Lisp is uniquely suited to the task of quantum computer programming.

Lambda Calculus, Functional Programming, and Quantum Computing

Peter Selinger, a Professor of Mathematics at Dalhousie University, has been publishing papers regarding Quantum Computer programming languages and Lambda Calculus for a number of years, extending the work of van Tonder and others. In particular, he formalized his argument in favor of Lambda Calculus as a natural expression of quantum algorithms for classically-controlled quantum computers in the following papers:

Selinger made one mistake, in my opinion: he chose Haskell to implement his quantum computer simulator and quantum computer programming language, Quipper. While he could have chosen Scheme without any complaint, he should have chosen Common Lisp, just like D-Wave—and to prove this point, I took my work on a Quantum Common Lisp I originally designed for my science-fiction novel and started the BLACK-STONE open-source project to create a faster quantum computer simulator and programming environment, in less lines of code. While the BLACK-STONE project is still in its infancy (and I haven’t had the time to work on it at all in recent months), the simplicity, elegance, clarity, and succinctness of the Common Lisp source compared to Haskell is already heavily apparent.

D-Wave One and Two are rudimentary Quantum Lisp Machines

I was surprised and pleased to discover in my personal conversations with the lead physicists, engineers, and developers at D-Wave, that they had come to the same conclusion as me, but had the means to act on those insights. They had already accomplished what I set out to do with Quantum Common Lisp and BLACK-STONE; unfortunately, their source code is very much proprietary, and even as a registered D-Wave developer, I had no access to their Lisp operating system for the D-Wave One and Two.

All I can do, as an outsider looking in, is make certain informed assumptions. I could easily be completely wrong, but it seems to me fairly self-evident that the D-Wave platforms qualify as rudimentary prototype Quantum Lisp Machines. The D-Wave hardware was clearly designed with Lisp in mind, and the low-level Operating System of the D-Wave hardware is written entirely in Common Lisp. Personally, I don’t think it would have even been possible for them to build a quantum computer at all without Lisp.

As I understand the integration model, the D-Wave platforms rely on classical supercomputers for their interface, memory, and persistent storage—so that limits the types of quantum algorithms that can be run to those that must accept from and return measured, classical data to the interface; algorithms which expect unmeasured, raw quantum data for input, and persistence of such data existing unmeasured in memory are not currently possible.

Still, any quantum computer at all is an amazing feat—and certainly D-Wave’s customer base seems quite happy with the platform. They are purpose built for a specific class of optimization problems, which classical computers have a great deal of difficulty solving.

Regarding their former developer program, which has now been closed for some time, it is interesting to ponder why—when the core platform is 100% Lisp—they would only release a Python Pack as their developer API and not a Lisp interface. I suspect it came down to the matter of perceived value and a hope for rapid adoption: they put a lot of time and effort into writing a quantum computer simulator for Python, and a number of excellent tutorials to go with it, but still they did not get the adoption they hoped for—and as a result, they closed the developer program and scrapped the Quantum Cloud platform that I was relying on and waiting for, to finish some of my more interesting (to me at least), software projects.

The problem with the choice of Python, however, is that Quantum Computer programming only actually makes sense in Lisp, and as a result only Lisp Hackers can understand Quantum Computer Programming. Other programming languages only serve to conflate the simple elegance of quantum energy programming into a terrifying, obtuse, impenetrable subject, while in Lisp it is expressed so naturally and intuitively—it’s almost as if Lisp itself was purpose designed for quantum computing.

You can see this for yourself in my project SILVER-SWORD, a Common Lisp bridge to the D-Wave Python Pack. Unfortunately, as I’ve said before, you can’t actually use the library since D-Wave no longer distributes their Python Pack, but you can view the translated tutorial examples in the repo and see for yourself—quantum energy programming is really easy in Lisp. And SILVER-SWORD would be even better if the underlying Lisp–Python bridge, BURGLED-BATTERIES, supported Python Class to CLOS translation.

Cons-cells, qubits, chimera-graphs, and the human brain

The reason I say that only Lispers can understand Quantum Computer programming is based on the observation of the fundamental structural similarities between a generalized model Lisp program, the D-Wave hardware, and the human brain. From an experiential perspective, learning and using one of the many Lisp-family languages offers the individual programmer specific insight into the functioning of their own internal platform.

Consider a general, recursive function in Common Lisp. Its internal representation within the Lisp run-time is an acyclic graph of cons-cells, pairs of pointers that map to memory or other cons-cells. Every Lisper eventually learns to think in terms of cons-cells, and is concerned about the efficiency of their code in terms of tree-walking—which path through all possible cons-cells to the desired return value is the shortest?—and, which path reduces the number of conses to the absolute minimum?

Now consider a learned skill, such as the art of programming; it can be a lengthy process for some, a seemingly effortless task for others. Many people brush this off as a simple matter of intelligence—but in fact, it is due to another learned skill: the art of learning itself, whereby the individual learns to integrate and categorize new information more efficiently than others, thus appearing smarter. Technically speaking, as we have been learning from the field of neuroscience, all human beings are born with roughly equal potential, but they are shaped and molded into individuals by their experiences and environment; in short, since so few of us know any better, we allow ourselves and our children to be automatically programmed by effectively random, chaotic, and unpredictable perceptions, instead of learning and teaching a methodology of self-mastery where the individual programs themselves. At the moment, intelligence and an aptitude for the sciences, engineering, mathematics and programming in individuals is more or less an accident, much like all talents; but in the near future, all talents could easily be engineered by the individual into themselves.

Then consider the concept of Quantum Computer energy programming, introduced by D-Wave as the programming paradigm to support their novel adiabatic quantum computer hardware. Because the underlying flux-qubits of the D-Wave processors exist in superposition until they are measured, they effectively process every probable result of a program simultaneously. The most efficient answer, the lowest energy solution, is returned first; even though all other results returned are also correct, from a traditional standpoint, the lowest energy solution is the most correct, even when other results have a higher probability. This point corresponds to both the question of intelligence, and the most efficient recursive function in Lisp, above. The most obvious path is not always the most correct, but a strong case can always be made to favor efficiency over all other factors.

These three points correspond to a psychological/computational Occam’s Razor—when faced with multiple solutions of high probability, the most efficient solution is the most correct.

Alongside a cursory study of neuroscience and theoretical physics, you can begin to see the similarities between the structure of Lisp programs, the implementation of the D-Wave quantum annealing processor, and the structure of the human brain itself.

As I have said before, Lisp is the language of the Universe, the Voice and Will of the True Self. This is simply a poetic expression of super-symmetry, and how it relates to the concept of Grokking in the Lisp community. The point is, the acyclic graph structure of cons-cells allows for a natural description of the fundamental (and inherently quantum) phenomenon of the physical universe, as well as of the humain brain itself.

Thus, when programmed in Lisp, a sufficiently complex neural-net application running natively on D-Wave style hardware of equal complexity and efficiency as the human brain is capable of emergent machine intelligence. The less it is programmed to behave intelligently, the better—it only requires a diverse selection of sensory input to perceive its external environment, a means to differentiate the internal from the external, and a core low-level operating system to manage its internal state. Experiments at D-Wave have already confirmed this.

One might even be so bold as to say that the super-symmetry is so perfectly expressed, that we human beings are naturally-occurring, organic quantum lisp machines. And this point holds whether you are an evolutionist, creationist, or otherwise.

The Future of Computing and Lisp

If quantum computing is the future of computer science as a whole, then by extension, so is Lisp. As Lisp Hackers, we have a responsibility to push computing to its limits, remind the world that Common Lisp is still the most advanced and powerful programming language, and ensure that the next generation of consumer-grade computers are all—every single one of them—Quantum Lisp Machines.

The inherent super-symmetry of Lisp programs, the central nervous system, and the physical universe is perhaps the strongest argument in favor of this. After all, human evolution has been marked out since the beginning of history not by advantageous genetic mutation, but by technological innovation—and what tool is more powerful than a language which can naturally express the fundamental laws of physics, the underlying structure of the human brain, and the ultimate model of computation?

Together, Quantum Computing and Lisp can help us better understand ourselves, our true nature, the universe we live in, and the limitless potential of our species—that the combination will almost certainly lead to emergent machine intelligence and the technological singularity is pure gravy, after that. Some days it is truly staggering to live in such a time in human history, living with the knowledge that we Lisp Hackers hold the future of the entire human race in our hands, at our keyboards.

The next time you fire up Emacs and type M-x slime, remember this. Hack like the whole world is counting on you and every line of code you write; hack like you’re channeling the Will of the universe itself. Because the future is here, now—the future is Quantum Common Lisp.

5 thoughts on “Quantum Computing and Lisp

  1. I would like to believe you and experience what you are talking about. The symmetry between Lisp, the laws of physics, and our brain, sounds like an amazing combination, but I haven’t yet experienced it. The Common Lisp community is a major turn off for me. The #lisp channel is very dead and overall, I don’t feel warm on the inside when I engage with the community. Clojure on the other hand gives me the great communal feeling that I seek, while also offering a lisp dialect, although on the jvm. What are your thoughts on Clojure’s potential to offer symmetry between programming language, the laws of physics, and our brain? The language is also homioiconic, contains reader macros, but it also has a vibrant community and interop with the large Java ecosystem. I’m just curious on your opinions, no flame intended.

    1. I do like Clojure a lot, so far—but I only started using it this summer. Certainly, the Clojure community is more friendly, welcoming, and engaging than the Common Lisp community at the moment. But the arguments I was making in favour of Lisp for quantum computing, and the symmetry between it, the laws of physics, and the human brain, revealed by a study of Fractal Cosmology and Neuroscience, applies to Lisp languages in general, not only Common Lisp—and it’s most applicable to the functional programming paradigm. So in some respects Clojure might be considered a better fit than CL, because of its emphasis on functional programming. That was one of the main motivators for Selinger to build Quipper on top of Haskell, as I understand it, because it allowed him to implement a mathematically rigorous and functionally pure version of his Quantum Lambda Calculus; I like pure functional programming, but I also like to have the additional options that a multi-paradigm language provides.

      One downside to Clojure, at least as far as Quantum Computing is concerned, is that the JVM doesn’t run on any quantum computer that currently exists; so neither can Clojure. I’m sure, though, that once someone comes out with a full gate-model QC, it won’t be long before they get Java running on it. So that may be a moot point.

  2. Colin JE Lupton – Lisp Jedi Knight

    I found you over on looking for some Quantum Computing Collaborators and tracked you back to your wordpress lair.

    Your enthusiasm for Lisp as the natural choice for QC has me utterly fascinated, I was in the Python camp until I heard the liquid light of your words!

    I am trying to pull together a new hitech startup over at

    I believe the barriers to achieving a working QC are not just technical but theoretical they won’t get there without a working Grand Unified Theory of physics, Einstein’s God doesn’t just play dice he has a fully blown gambling addiction.

    I’m not just a devotee of string theory but a full blown convert who has taken it it the next level .. but I’m raving.

    Qubits are too hard to model on their own we need two of them to create a qubyte which has two degrees of freedom and can be modeled in a RS Flip Flop in the dreaded illegal state Reset-Low Set-Low (just jam in some capacitors and FET trannies to create a free running multivibrator and your away) so we use the energy of the Not Q to create a fully adiabtic reversible computing device and not just dump the not Q to Earth carting away half the energy of the calculation. This Qubyte can be translated from Hilbert Space to the Bloch sphere as a Quaternion.

    If we use the Qubyte we can use the Photon as the analogue of the quantum information unit a much more robust unit than those pissant single magnetic fields Dwave is trying to use (que Candle in the Wind song).

    I wrote an blog piece” and I am in the process of writing a new one to publish the results of my research I am slowly documenting.

    Hope I don’t sound like a complete nutter, we need to talk, contact me please.

    1. Hi Shayne,

      Glad to hear from you. It’s funny you mention both quantum computing and the grand unified theory in the same context, most people don’t see the connection(s). I’ve actually already cracked the grand unified theory, and I was able to correctly predict the relation of the Higgs Boson and the graviton with it back in 2010 which has since been verified independently by CERN—without (as far as I know) knowledge of my predictions—as well as demonstrate the emergence of m-theory, quantum mechanics, classical mechanics, and general relativity in an ultimately fractal cosmology. I teased all this in my 2011 novel, but I was careful not to give away any of the big secrets. I’m currently looking for a university that will sponsor me for this as my PhD thesis in the near future, once my start-ups are successful enough that I can afford to spend the time on pure research and experimentation. Even though I already have results, I want to be able to spend the time fleshing this out in full. It’s kind of a big deal, and I think it’s important enough that it merits my full attention.

      As for your start-up, I’m unfortunately not available. I have my own quantum machine learning and universal quantum computing companies. I can’t really say any more than that, but good luck with your ventures! I’m sure we’ll cross paths again—as Feynman said, there’s plenty of room at the bottom.

      1. Colin
        Well we have two things in common a love of GUT and QC.

        My first love is GUT and I have had some success determining the masses of the Standard Model Particles they follow a Bessel or Sinc Function Function the with matter on the real number line and the Bosons on the imaginary and if we accept the existence of a mono-pole particle such as the Neutrino populates the magnetic field just as the electron populates the electric field then the four Maxwell equations line up with the Gravitational, Strong, Weak and Electro Magnetic forces. The universe is finite in size, torus shaped with a circumference equal to the inverse of the Planck Wavelength with a frequency between big bangs equal to the inverse of the Planck frequency. Our universe exists in the volume of the torus like a hologram or video on the Calabi Yau pixel field. So we are living inside a black hole with the event horizon the surface of the torus but like fish that live at the bottom of the deepest sea trench are oblivious to the tension of the crushing gravitational forces and balancing electric. Anti-matter exhibits anti gravity and is the reason it’s not observed on Einstein scale structures as it doesn’t clump together but flies apart. The ancients were right there is an stationary aether but trying to detect it would be like two actors on a video trying to measure the refresh rate of the big screen TV they are acting on. It can be done though you will need some huge fibre optic gyroscopes to detect our Galactic motion through it.

        But as a non academic I quickly realized I wouldn’t find any collaborators to publish what would be considered size fiction.

        So I’m running with an extension of theses ideas into QC as my own PhD thesis. The collapse of traditional investment markets post US property bubble burst /world recession have the super funds awash with cash looking for solid business plans of the next big thing and apart from Elon Musk there is not a lot happening. My business plan is based on following the DWave model they can be the Coke and Qbitrex will be the Pepsi. We don’t hand over our QC’s we only let the researchers use them behind multiple firewalls.

        I’ve chosen the mathematica cloud to connect with a team of interested persons by starting a QC group and you would be a highly regarded guest expert if you wanted to expound on your lisp theories without letting your Core IP out.

        My core IP is protected as a trade secret the circuit I put on my website is general in nature and the real secret is in the Photonic Circuit design which I will work exclusively on until an equity partner shows up. I have to have something to offer up to the Vulture Capitalists for patents after the small bickies of a crowd funding exercise.

        Best of Luck with your Ventures.

        Hope you’ll keep in touch.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s