Quantum computing is a strange and charming discipline. In normal computing we have bits. They're 1 or 0. Quantum computing has qubits. Like Noah, you might ask, "What's a qubit?" It's a bit that’s like Schroedinger's cat, which can be alive and dead at the same time. It can be 1, 0, or both at once.
This makes a big difference in the computing architecture. With quantum algorithms, the same qubit can be used in multiple computations at once. The power of a quantum computer goes up exponentially with the number of qubits it has. The trouble is that only a quantum physicist can understand how that works, so where does it leave mere coders? Even more, what about those just now learning to code?
So far that's mostly a hypothetical question. Quantum computers are still the realm of scientists rather than programmers. No one has built a really practical quantum computer yet, but companies like Google and Microsoft are working hard on it.
To go mainstream, quantum computers will need programming environments that normal humans — at least normal geeky humans, the ones who go to coding schools — can understand. They'll need operating systems and programming languages. There are some, and they try to come closer to the traditional programming mindset, but they still require, shall we say, a quantum leap in thinking.
There's LanQ, which looks like C in some ways, but it has qubit variables and EPR pairs. EPR stands for Einstein-Podolsky-Rosen, and the concept is at least as intimidating as it sounds. It has normal operators such as plus and minus, but also qubit operators with names like Hadamard, sigma_x, and sigma_y.
Another language is Quipper, which includes "extensible quantum data types" and "quantum Fourier transforms." An article in New Scientist calls it "the first practical, high-level programming language for quantum computers."
Quipper is based on the Haskell programming language, which is a purely functional language. That is, code consists entirely of functions and function calls, not statements. Unlike procedural programming, which consists of one statement after another, functional programming is great at supporting parallelism. It describes what needs to be done rather than giving a sequence of instructions.
Where to start?
It isn't practical for most students in coding schools to dive into these languages yet. Unless they're connected with a physics research department, they wouldn't be able to get their hands on the hardware. But it's worth thinking ahead to when quantum computing becomes available. We can start to see how programming paradigms will change so we can get ready for them.
The big move will certainly be away from procedural coding. Even without quantum computers, multi-core machines open up opportunities for parallelism. Not every kind of code benefits from it, but scientific programming certainly does.
It's unlikely that more than a chosen few will ever understand the math of quantum programming. Those who do will get really good pay. Most likely they'll write code libraries that take advantage of qubits, so the rest of us can call them to do calculations. We'll just need to understand how to write code that doesn't create performance bottlenecks around them.
Functional programming is just one of several ways to get parallelism, and understanding a variety of concepts is the best bet. Coders should understand:
- threads, independent code streams within a process
- callback functions, which do something when a sequence is completed
- message passing, where one task can send information to another
- locks and semaphores, which control access to a resource
Quantum computing is full of Heisenberg-like uncertainty. We know where it is, but not how fast it's getting anywhere. There might be practical machines next year or in twenty years. The best we can do is watch the trends and try to be ready for them as we look ahead to where our programming school here in Westminster will go.