So, you want to start developing quantum programs and begin your journey into quantum programming to develop programs for quantum computers? Heart about this cool quantum computing technology and don’t know where to begin? Here, we outline some of the best ways to start in the field of quantum computing practically, and what better way than by developing your quantum circuits that run on either actual quantum computing hardware or can be simulated by one of the many quantum frameworks? Let’s begin!
What is Quantum Programming?
Quantum programming is a type tailored explicitly for quantum computers, which operate based on the principles of quantum mechanics, a fundamental theory in physics that describes nature at the smallest scales, such as that of particles like electrons and photons. Quantum computers use qubits instead of the traditional bits seen in classical computing. While a classical bit can be in a state of 0 or 1, a qubit can be in a state of 0, 1, or any superposition of these states, allowing for a vast range of possibilities. For traditional developers, understanding quantum programming involves grasping key concepts that are similar to and different from classical programming.
How does Quantum Programming Differ from Classical Programming?
Basic Principles: Bits vs. Qubits
Similarities: At their core, both traditional and quantum programming involve writing instructions for computers to process data. As conventional programming relies on bits, quantum programming revolves around manipulating qubits. Both require a clear understanding of logic and algorithms to accomplish specific tasks or solve problems.
Differences: The fundamental difference lies in the basic data unit. Qubits operate according to the principles of quantum mechanics, which means they can be in multiple states simultaneously (a phenomenon known as superposition). This property, along with entanglement (where qubits in a shared state can instantaneously affect each other regardless of distance), introduces new programming constructs and necessitates a different way of thinking about algorithms and data processing.
Quantum Programming Languages and Frameworks
Similarities: Just as traditional programming can be done in various languages (like Python, Java, or C++), quantum programming also has multiple languages and frameworks, such as Qiskit, Q#, and Cirq. These quantum programming languages and frameworks share features with their classical counterparts, like variables, conditionals, and loops, allowing developers to write and control the behavior of a quantum computer.
Differences: Quantum languages are designed to describe qubits’ operations and handle quantum phenomena like superposition and entanglement. They require functions like quantum gates (the quantum version of logic gates) and measurements that don’t have direct analogs in classical programming. As a result, even though the structure of the code might look familiar, the underlying logic can be significantly different and often more abstract.
Problem-Solving Approach
Similarities: Both traditional and quantum programming involve algorithmic thinking, a systematic approach to problem-solving, and debugging to ensure the correct functioning of the code.
Differences: Quantum computers can solve certain types of problems much more efficiently than classical computers, like factoring large numbers, simulating quantum physical processes, and optimizing complex systems. The algorithms used in quantum programming, such as Shor’s algorithm for factoring, are structured fundamentally differently from classical algorithms due to the nature of qubits. Developers need to learn new algorithmic techniques that harness the unique properties of quantum computing.
Development Environment
Similarities: Quantum programming can be done in integrated development environments (IDEs) and uses libraries and frameworks like traditional programming. Developers can write, test, and debug their code in these environments. Just about all the tools you need are already within the cloud. Services like IBM Quantum Experience are available through your browser, just like some programming environments like Jupyter Notebooks, Julia Notebooks, or Databricks.
Differences: Given the limited access to quantum computers and limited qubit size, much of quantum programming is done in simulators that mimic the behavior of quantum computers. These quantum environments often require substantial classical computing resources, especially as the number of simulated qubits grows – the whole point of developing quantum computers!
Understand the Qubit
The key to understanding quantum programming is the qubit or quantum bit. There are plenty of books and resources, but here we’ll outline the basics of the qubit so you can get a brief understanding.
In a classical system, a bit is a binary unit, representing a logical state with one of two possible values. However, a qubit extends this concept: it can represent 0, a 1, or any quantum superposition of these states. A qubit can perform more complex operations and carry more information than a classical bit.
The power of qubits comes from two fundamental principles of quantum mechanics:
- Superposition: A qubit can exist not only in a state corresponding to the logical state 0 or 1, but also in states corresponding to a blend or superposition of these classical states. In other words, it can exist in multiple states at once, holding an amplitude (which can be thought of as a probability) for being a 0 and an amplitude for being a 1.
- Entanglement: When qubits are entangled, the state of one qubit is directly related to the state of another, no matter how far apart they are. Changing the state of one qubit instantaneously changes the state of the other qubit it’s entangled with, which is a resource used for many quantum algorithms.
The Bloch sphere is a geometrical representation of the quantum state of a single qubit. Imagine a sphere where any point on the surface represents a possible qubit state. The Bloch sphere is a powerful visualization tool because it helps to conceptualize the behavior of qubits, which is essential in understanding how quantum algorithms work. It helps imagine operations on qubits (like single-qubit gates), representing rotations around the Bloch sphere.
- The north pole of the Bloch sphere represents the classical value | 0 ⟩, and the south pole represents the classical value | 1 ⟩.
- Points on the sphere’s surface represent the superposition of | 0 ⟩ and | 1 ⟩, with the specific point indicating the relative probabilities (amplitudes) of the qubit collapsing to either state when measured. The exact position on the sphere is determined by two angles, theta ( θ ) and phi ( φ ), which are standard spherical coordinates.
- The axes of the Bloch sphere are often described in terms of the Pauli matrices, which are a set of complex matrices fundamental in quantum computing.
Choosing the Right Quantum Programming Language
Choosing the right quantum programming language is crucial as it lays the foundation for your work or research in quantum computing. The decision should be based on several factors, including your project requirements, existing programming skills, the specific quantum hardware you plan to use, and your educational or professional goals. Here are some aspects you can consider:
Your Programming Background and Goals
If you’re already skilled in a particular programming language, you might want to choose a quantum language based on similarity to what you know. For instance, if you’re familiar with Python, you might find Qiskit or Cirq more comfortable because they’re Python-based. On the other hand, if you’re coming from a C# background, Q# from Microsoft might be a closer match regarding tools and technologies. Of course, the decision is yours as to what you choose. Some syntax might be that much easier, or you might prefer the challenge of learning something completely new.
Also, consider what you aim to achieve. Are you looking to experiment with quantum concepts, develop new algorithms, or simulate quantum systems? Or are you aiming to run programs on actual quantum hardware eventually? Are you looking for plenty of examples? Are there use cases and libraries for what you want to achieve? Nothing is more frustrating than developing to find that the libraries you need are unavailable.
Quantum Ecosystem
Richer ecosystems, including comprehensive libraries, extensive documentation, active community support, and robust development tools, support some quantum programming languages. For beginners and even advanced users, these resources can be invaluable. Check forums, social media, GitHub repositories, and other platforms to gauge each language’s community’s activity and support levels. We have conducted a study on the most popular quantum programming languages and quantum frameworks. Without wanting to bias your decision, Qiskit is the overall winner across multiple domains.
Quantum Hardware
If you plan to run your quantum programs on actual quantum hardware, you need to consider hardware compatibility. Different quantum computers use different sets of quantum gates and might have unique architectural constraints. For example, D-Wave‘s quantum computers use a technique known as quantum annealing, suitable for specific problems. D-Wave is developing a ‘gate-based’ machine that will work analogously to other quantum computers like IBM, Rigetti, and IonQ. Partly, the choice will be down to the problem, which may dictate the tools.
Some programming languages are designed specifically for particular quantum hardware. But many are agnostic and increasingly so. For instance, Leap is designed to work on D-wave machines, and whilst the principles may be universal, you won’t find it portable to, say, an IBM Quantum Computer.
Quantum Jobs and Employment
If you aim to get a job, then it’s likely that there is safety in numbers. Choosing a language that is widely used will be a wise choice. But also, a popular language will likely build momentum in your learning and understanding of the quantum space. You might even contribute some features or open-source code to many existing projects. It’s important to note that while companies such as IBM and Microsoft have backed languages and frameworks like Qiskit and Q#, they are often open-source projects.
Experiment and Play with Differing Quantum Programming Languages
You may not hit it off with the first language. Don’t be afraid to swap and change. Often, seeing how languages contrast each other provides good learning in itself. We would say that after learning one language, look at another quantum language, as it will help cement your understanding of some fundamental concepts.
The Art of the Start
The best way, we think, to begin is to start. You don’t need too much to start. But before you get lost in the programming, we recommend beginning with some quantum understanding of the qubit and some quantum fundamentals.
Quantum Physics, the beginning
Here is the elephant in the room. It’s really up to you how much you delve into the basics of quantum physics and quantum mechanics. You could choose to do very little, but you’ll likely struggle with a sense of the point of quantum computers. Therefore, we recommend understanding the qubit, Bloch-sphere, and some basic quantum gate operations. You can learn this from books, Wikipedia pages, or online courses. There’s plenty to choose from online, especially in terms of free quantum computing resources—even free courses.
Quantum Mathematics
Linear Algebra is perhaps the most crucial mathematical skill in quantum computing. Vectors represent quantum states, and matrices represent quantum operations. Understanding how to manipulate vectors and matrices is essential for understanding how quantum algorithms work. Key concepts include complex vector spaces, eigenvalues and eigenvectors, tensor products, and Hermitian operators. Don’t be overwhelmed because some of these will be pretty familiar to you, and you can begin with quite a rudimentary knowledge of LA (Linear Algebra). Again, there are plenty of courses or books. Several books are catering to just the maths knowledge needed to understand quantum computing without any programming.

