How to Start Quantum Coding

What you need to start writing quantum programs and running them on real quantum computers

Gregory Wickham
Coinmonks
Published in
3 min readJun 24, 2018

--

You’ve probably heard all the hype about quantum computing and how amazing it is etc. That’s all well and good, but now you want to start writing some quantum programs. For that, you have a few options.

Option #1: IBM Q Experience

This is probably your best option. The main advantages of using the IBM Q Experience are that it gives you the opportunity to run your program on up to five different quantum computers, some with as many as 20 qubits, and there are multiple ways to write the quantum programs. There is a visual program editor or “Composer” where you can drag and drop quantum gates to create a program, or if you prefer text-based programming, you can use the “Qasm Editor” to write programs. Once you’ve written a program, you can easily simulate it, or you can run it on one of their quantum computers. (There is also a useful SDK called QISKit. I’m not exactly sure what it does, but you should look into if intend to use IBM Q a lot.)

Everything is done in your browser, there are no downloads required, so it is extremely easy to get started. The only disadvantage is that there aren’t very many quantum gates to use, so your capabilities are fairly limited.

If IBM Q sound good to you, you can start using it here. If you want the opportunity more complexity in your programs, read on.

Option #2: Microsoft’s Q#

If you want a full programming language with documentation and detailed, mathematical explanations of the fundamental properties of qubits and how they interact, or just want a more traditional way of writing programs, Q# and the Microsoft Quantum Development Kit are for you.

Q# is a programming language for quantum computers, which you can use to write quantum programs. The QDK also comes with a simulator allowing you to run simulations of your program, letting you understand what quantum programming will be like.

To program with Q#, you write a Q# program which will essentially run on a quantum processor, and that program is run by a C# driver which is also what manages the output. I suggesting reading through at least the first few sections of the documentation before starting.

Currently no quantum computers run Q# programs, but the simulator should be sufficiently satisfying, for most users.

You can download the Quantum Development kit here. It is available for Windows, macOS, and Linux.

Option #3: University of Bristol’s “Quantum in the Cloud

If you need to start with the basics, Quantum in the Cloud is a good tool to explore. The online Quantum in the Cloud simulator is analogous to the University of Bristol’s small quantum processor which uses photons and phase shifters for processing. Once you’ve played around with their simulator however, you can run your program on their quantum computer.

This is good for first explorations with quantum computing, but it is nothing compared to options 1 and 2. There is no way to save programs or represent them textually, and there is essentially only one operation you can do to the photons.

You can start using the simulator here.

Final Thoughts

I’ve shown you what are, in my opinion, your best options to start writing quantum programs. There are, of course some other options which you can read about on Wikipedia, but few of them compare to these. You have what you need.

Have fun learning quantum programming!

--

--