
I’ll be brutally honest. When I set out to write this post, I was going to talk about IBM’s Q Experience — the website where you can run real code on some older IBM quantum computing hardware. I am going to get to that — I promise — but that’s going to have to wait for another time.
It turns out that quantum computing is mindbending and — to make matters worse — there are a lot of oversimplifications floating around that make it even harder to understand than it ought to be. Because the IBM system matches up with real hardware, it is has a lot more limitations than a simulator — think of programming a microcontroller with on debugging versus using a software emulator. You can zoom into any level of detail with the emulator but with the bare micro you can toggle a line, use a scope, and hope things don’t go too far wrong.So before we get to the real quantum hardware, I am going to show you a simulator written by [Craig Gidney]. He wrote it and promptly got a job with Google, who took over the project. Sort of. Even if you don’t like working in a browser, [Craig’s] simulator is easy enough, you don’t need an account, and a bookmark will save your work.
It isn’t the only available simulator, but as [Craig] immodestly (but correctly) points out, his simulator is much better than IBM’s. Starting with the simulator avoids tripping on the hardware limitations. For example, IBM’s devices are not fully connected, like a CPU where only some registers can get to other registers. In addition, real devices have to deal with noise and the quantum states not lasting very long. If your algorithm is too slow, your program will collapse and invalidate your results. These aren’t issues on a simulator. You can find a list of other simulators, but I’m focusing on Quirk.
What Quantum Computing Is
As I mentioned, there is a lot of misinformation about quantum computing (QC) floating around. I think part of it revolves around the word computing. If you are old enough to remember analog computers, QC is much more like that. You build “circuits” to create results. There’s also a lot of difficult math — mostly linear algebra — that I’m going to try to avoid as much as possible. However, if you can dig into the math, it is worth your time to do so. However, just like you can design a resonant circuit without solving differential equations about inductors, I think you can do QC without some of the bigger math by just using results. We’ll see how well that holds up in practice.
QC doesn’t use bits, but qubits. Unsurprisingly a qubit can take a state of 0 or 1. If that was all, then there wouldn’t be much reason to continue the conversation. However, qubits are quantum, so they have two unique properties that QC can exploit. First, a qubit can be some combination of 0 and 1 at the same time. There are famously multiple interpretations of uncertainty in quantum mechanics, but you can think of it as a probability of the qubit being a 0 or a 1. Those probabilities will always add up to 1 and the idea extends to groups of qubits, too. So four qubits have some probability that their state is 0010. If you add up all the probabilities for all the states, you get one. When a qubit is in a combination of states, each with a given probability, that’s called superposition.
You probably know that in quantum mechanics, the state appears to change based on observation. Qubits are the same. While they can be in a superposed state, the instant you measure that state, it becomes either 0 or 1. If you know about Schrödinger’s cat, it is the same principle. In the thought experiment, until you peek, the cat is half dead and half alive just as our qubits can be both 0 and 1.
The other key concept is entanglement. The idea is you can take one qubit and make its state dependent on another qubit’s state even though we don’t know the state of either of them. As a simple example, we can create a qubit that we don’t know the state of, but we know it is opposite of some other qubit that we might also not know about.
Confused? Good. If this makes sense to you, you are probably ahead of where this post is going anyway. Even [Niels Bohr] once said (paraphrasing from Danish), “Anyone who is not shocked by quantum theory has not understood it.”
What Quantum Computing Isn’t
Quantum computing isn’t going to run wordprocessing applications any time soon, if ever. Like I said, it is more like analog computing where you set up a problem and get an answer. Part of that may be the early stage we are in. Part of it is just how it works.
Speaking of how it works, QC is usually probabilistic. So when you search for something, for example, you get the answer to a certain probability. Again, this is like an analog computer. Maybe that probability is 0.99999, but it isn’t going to be 1.0000.
There aren’t many practical quantum algorithms known, and the ones…
The post Quantum Weirdness in Your Browser appeared first on FeedBox.