Top Quantum Computing Programming Languages from 0 to 1

Quantum Computing Programming

Just like conventional programming languages, where there is a choice of languages. In the quantum computing space, there is also a choice. But just as classical languages serve different purposes, so do the other quantum programming languages. We look at the available quantum computing programming languages and frameworks and compare and contrast those languages and frameworks.

Quantum Programming Languages vs. Quantum Frameworks

Quantum computing programming languages are specialized languages that describe and manipulate quantum algorithms and operations. These languages provide syntax and semantics for expressing quantum computations, much like classical programming languages, which allow developers to write software for classical computers. Examples of quantum programming languages include Q# (developed by Microsoft) and Quipper. These languages are tailored to the unique characteristics of quantum mechanics, such as superposition and entanglement, and they enable developers to define and execute quantum circuits, operations, and algorithms.

On the other hand, quantum frameworks are software libraries or platforms that provide tools, resources, and interfaces for developing, simulating, and executing quantum programs. These frameworks often have pre-built functions, modules, and utilities that simplify building quantum applications. They can be used with classical programming languages, allowing developers to integrate quantum operations within classical code. Examples of quantum frameworks include Qiskit (developed by IBM), Cirq (by Google), and the Quantum Development Kit (by Microsoft). These frameworks support the development of quantum algorithms and offer simulation capabilities and interfaces to actual quantum hardware, although typically interfaced with Q#, a language specifically created by Microsoft for Quantum Computing.

In essence, while quantum programming languages focus on the linguistic aspect of expressing quantum computations, quantum frameworks provide a broader set of tools and infrastructure for building, testing, and running quantum applications. Both are essential components in the evolving landscape of quantum computing, with the former offering a means to describe quantum logic and the latter providing the environment and resources to bring that logic to life. See our previous article on what quantum programming is for a more detailed, deeper dive.

How to Choose a Quantum Computing Programming Language

Choosing a quantum language depends on several factors. First, the specific quantum hardware or platform you intend to use might dictate your choice. Some quantum hardware providers offer proprietary languages or specific SDKs (Software Development Kits) tailored to their machines. That said, most of the time a user spends will be simulating rather than running on individual hardware and for the most part, languages and frameworks are hardware agnostic.

Some quantum languages provide a higher-level abstraction, making it easier for those who might not have a deep understanding of quantum mechanics. These languages hide the intricate details and allow developers to focus on algorithm design. On the other hand, low-level quantum assembly languages give more control over individual quantum gates but require a deeper understanding of quantum operations.

Lastly, the community and ecosystem surrounding a quantum language can influence the decision. A language with a robust community, extensive documentation, and many libraries can expedite the learning process and provide necessary support. We looked at different aspects of the quantum computing language ecosystem and found the more popular languages and frameworks.

Which Quantum Language is best for beginners?

This is contentious, but we think the user base is one of the biggest reasons for choosing a framework language. Beyond safety in numbers, there is much to be said for selecting a supportive and diverse community of quantum developers.

Syntax and grammar might play a part, and probably one of the driving factors of the Qiskit framework is its ability to interface directly with Python, one of the most popular programming languages. Using an existing language means that beginners can learn the quantum part without having to learn a new language.

Every use case differs, but users would be better off staying with the more popular quantum programming languages.

Should I learn quantum physics before I learn to program a quantum computer?

Learning to program a quantum computer doesn’t require an advanced degree in physics. Of course, understanding the basics is helpful. However, those basics can be covered by various means, such as courses and books learned outside of the university setting.

The physics that will help the most are around a qubit works, and the various gate operators work on those qubits. Consider learning about the Bloch Sphere, which isn’t very necessarily physics-like. Instead, it is a way of understanding how quantum operators interact with the fundamental unit of quantum computing: the qubit. There is no need to understand more than vectors, matrices, operators, and linear algebra, but some key physics ideas would be constructive.

Superposition: At its core, quantum computing revolves around the idea that a quantum bit (qubit) can simultaneously exist in a combination of 0 and 1 states. This is unlike classical bits, which are either 0 or 1. Understanding superposition is crucial.

Entanglement is a uniquely quantum phenomenon in which qubits become interconnected, and the state of one qubit depends on the form of another, no matter the distance between them. Entanglement enables powerful quantum algorithms and is a crucial resource in quantum computing.

Quantum Interference: In quantum systems, probability amplitudes can interfere constructively (adding up) or destructively (canceling out). This property is harnessed in algorithms like Grover’s and Shor’s to amplify correct solutions and diminish incorrect ones.

Measurement: In quantum mechanics, measurement collapses a qubit’s state to 0 or 1 based on specific probabilities. This differs from classical systems, where the measure doesn’t change the system. Understanding the probabilistic nature of quantum measurement is essential.

Introductory Linear Algebra: While not strictly physics, understanding vectors, matrices, and operations on them is crucial. Quantum states can be represented as vectors, and quantum operations (like gates) as matrices.

Pauli Matrices & Basic Quantum Gates: These fundamental quantum operations manipulate qubits. Familiarity with the X, Y, and Z Pauli matrices and gates like Hadamard and CNOT is beneficial. There are some gates that everyone should know.

Quantum Tunneling (for specific architectures): Some quantum computing architectures, like quantum annealers, leverage quantum tunneling, where particles move through barriers they classically shouldn’t be able to.

How to quickly get started with quantum computing programming with Python as an accelerant

To Python or not to use Python. That is the Question. For many, Python has become the language of choice for learning, beginning, and production. For that reason, many will want to continue to develop the language to learn quantum computing. And the fact is that you can now.

Frameworks such as Qiskit and Cirq both enable users to interact with a quantum library to create and develop quantum circuits using a library. Qiskit is undoubtedly one of the most popular frameworks and originated from IBM. Cirq originated from Google. Both have their merits, but what suits you best will likely come down to preferences, syntax, user base, tutorials and some of the libraries available in each framework.

One of the best ways to give the biggest bang for the buck is to learn or use Python and pick Qiskit or Cirq. PyTket is another framework that you can drive from Python.

Qiskit

Developed by IBM Quantum, Qiskit is one of the most well-known quantum computing libraries/frameworks written in Python. It offers a high-level programming interface tailored for complex quantum hardware. Qiskit provides a comprehensive set of tools for quantum computing, from basic quantum circuit design to advanced quantum algorithms. One of its key features is the Aer simulator, which allows users to test and debug their quantum algorithms on classical computers. Additionally, Qiskit provides seamless integration with IBM’s quantum hardware, enabling users to run their quantum programs on real quantum devices.

Qiskit Is An Open-Source Quantum Computing Framework By Ibm That Allows Researchers And Developers To Build And Execute Quantum Algorithms On Simulated Quantum Computers And Real Quantum Hardware.

Qiskit is an open-source quantum computing framework by IBM that allows researchers and developers to build and execute quantum algorithms on simulated quantum computers and real quantum hardware.

PyQuil

PyQuil is a quantum computing programming language developed by Rigetti Computing. It allows users to write and execute quantum programs on quantum processors and classical simulators. One of its key features is the Quantum Virtual Machine (QVM), which simulates the execution of quantum programs on a classical computer. Additionally, PyQuil provides a comprehensive library of quantum gates and supports the definition of custom gates. It integrates seamlessly with the Forest SDK, which provides tools for quantum algorithm design, optimization, and simulation.

t|ket

t|ket⟩ is a quantum software development kit (SDK) developed by Cambridge Quantum Computing (now Quantinuum). It is designed to help users write and execute quantum algorithms on various quantum hardware platforms. One of the standout features of t|ket⟩ is its ability to optimize quantum circuits for specific quantum devices, considering its architecture and noise characteristics. This results in more efficient and reliable quantum computations. Additionally, t|ket⟩ supports a wide range of quantum programming languages and integrates with many popular quantum platforms, making it a versatile tool for quantum developers.

Tket Is A Quantum Software Development Kit (Sdk) Designed To Serve As A Hardware-Agnostic Platform For The Development Of Quantum Applications. Developed By Cambridge Quantum Computing (Cqc), Now Named Quantinuum.

tket is a quantum software development kit (SDK) designed to serve as a hardware-agnostic platform for developing quantum applications. It was created by Cambridge Quantum Computing (CQC), now named Quantinuum.

Q# from Microsoft

Microsoft’s quantum computing programming language, Q#, can be run using a Python host program or Jupyter Notebook. This allows for the invocation of Q# code and further processing of its return values within a Python environment.

Q# (Pronounced As &Quot;Q-Sharp&Quot;) Is A Domain-Specific Programming Language Used For Expressing Quantum Algorithms. It Was Developed By Microsoft As Part Of The Quantum Development Kit (Qdk) To Enable Developers And Researchers To Write Programs That Can Be Run On Simulated Quantum Computers And, Eventually, Actual Quantum Hardware.

Q# (pronounced as “Q-sharp”) is a domain-specific programming language for expressing quantum algorithms. Microsoft developed it as part of the Quantum Development Kit (QDK) to enable developers and researchers to write programs that can be run on simulated quantum computers and, eventually, actual quantum hardware.

Cirq from Google

Cirq is a Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits. As a product under the quantumlib repository on GitHub, Cirq provides a platform for researchers and developers to work with quantum circuits, especially in the NISQ regime. The framework is designed to make quantum algorithms accessible and understandable, allowing users to define quantum circuits, simulate their results, and eventually run them on real quantum hardware.

Cirq Is An Open-Source Quantum Computing Software Library Developed By Google'S Quantum Ai Team.

Cirq is an open-source quantum computing software library developed by Google’s Quantum AI team.

TensorFlow Quantum (TFQ)

TensorFlow Quantum (TFQ) is a Python framework developed for quantum machine learning. As an application framework, TFQ provides a platform for quantum algorithm researchers and ML application researchers to utilize Google’s quantum computing frameworks, all integrated within TensorFlow. The primary focus of TensorFlow Quantum is on quantum data and the development of hybrid quantum-classical models. TFQ offers tools to combine quantum algorithms and logic, which are designed in Cirq, with TensorFlow.

The framework introduces two datatype primitives: Quantum circuit, which represents a Cirq-defined quantum circuit within TensorFlow, and Pauli sum, which represents linear combinations of tensor products of Pauli operators defined in Cirq. With these primitives, TensorFlow Quantum supports operations such as sampling from output distributions of batches of circuits, calculating the expectation value of batches of Pauli sums on batches of circuits, and simulating batches of circuits and states.


Tensorflow Quantum (Tfq) Is An Open-Source Library For Quantum Machine Learning, Bridging The Gap Between Quantum Computing And Machine Learning.


TensorFlow Quantum (TFQ) is an open-source library for quantum machine learning, bridging the gap between quantum computing and machine learning.

OpenFermion

OpenFermion is a Python-based framework designed as an electronic structure package for quantum computers. This framework provides tools and functionalities that facilitate the development of algorithms for quantum simulations of molecular and materials systems. OpenFermion aims to bridge the gap between quantum algorithms and real-world chemistry and materials science applications. By offering a platform to convert electronic structure problems into a format amenable to quantum algorithms, OpenFermion plays a pivotal role in advancing quantum computing applications in the scientific domain. Source

ReCirq

ReCirq is another Python framework that emphasizes research using Cirq. While Cirq provides the foundational tools for creating and manipulating quantum circuits, ReCirq extends these capabilities to facilitate experimental research. The framework is designed to support the development, testing, and deployment of quantum algorithms on real quantum hardware. By providing a platform that integrates seamlessly with Cirq, ReCirq enables researchers to delve deeper into the intricacies of quantum computing, explore novel algorithms, and push the boundaries of what’s achievable with current quantum hardware.

Blueqat

Blueqat is a Python-based quantum computing software framework. It is designed to cater to both beginners and seasoned quantum computing professionals. The framework provides an intuitive interface for designing and simulating quantum circuits. Its user-friendly design and comprehensive documentation make it a suitable choice for those just starting their quantum computing journey.

PennyLane

PennyLane is a cross-platform Python library that stands out for its focus on quantum machine learning. It integrates with multiple quantum computing frameworks, allowing users to run their quantum circuits on various backends. One of PennyLane’s key features is its ability to compute gradients of quantum circuits, which is crucial for optimization tasks in quantum machine learning. Its modular design and integration capabilities make it a versatile tool for quantum researchers.

QuTiP

QuTiP, or Quantum Toolbox in Python, is one of the original quantum frameworks written in Python. It is widely used in the quantum sciences community. QuTiP provides tools for simulating the dynamics of open quantum systems, making it a valuable resource for researchers in quantum mechanics and information theory. Its comprehensive features and active community support make it a staple in the quantum computing world.

QuNetSim

QuNetSim is a quantum network simulation framework in Python. It is designed to simulate quantum networks, including quantum communication protocols and quantum algorithms. One of the standout features of QuNetSim is its ability to simulate quantum entanglement and quantum teleportation over network topologies.

Strawberry Fields (Xanadu)

Developed by Xanadu, Strawberry Fields is a full-stack Python library designed for photonic quantum computing. It focuses on quantum computations based on light manipulation. Strawberry Fields provides tools for designing, optimizing, and utilizing photonic quantum computers. It also supports hybrid quantum-classical machine learning models.

Perceval

Developed by Quandela, Perceval is a software library designed for programming photonic quantum computers. It offers tools and functionalities for building and simulating quantum circuits based on light manipulation.

PyQudit

PyQudit is a Python package that offers generalized and universal versions of quantum gates in N-dimensions. It provides tools for building and simulating multi-dimensional quantum circuits.

Quipper

Quipper is an embedded, scalable functional quantum computing programming language specifically tailored for quantum computing. It offers a high-level circuit description language that not only provides gate-by-gate descriptions of circuit fragments but also includes powerful operators for assembling and manipulating circuits. This makes it particularly suitable for expressing complex quantum algorithms and computations. The language is designed to be both expressive and functional, allowing for a more intuitive approach to quantum programming.

Quipper’s design is rooted in the Quantum Lambda Calculus, which provides a theoretical foundation for the language. Furthermore, the language is capable of generating families of quantum operations indexed by parameters, making it versatile for various quantum computing tasks. The Quipper platform has been instrumental in advancing the field of quantum programming by providing a robust and scalable environment for quantum algorithm design and simulation.

Quantum Computing Programming should be Fun!

There is plenty of choice when it comes to picking a quantum computing programming language or framework. Which one you go for can depend on a multitude of factors, but we hope that we have given an oversight which can help motivate which quantum language or quantum framework suits any usecase. We have ranked languages and frameworks by popularity.

But remember that it should be a fun and rewarding journey. Feel free to experiment and play – thats the secret to getting good at just about anything, including learning to program a quantum computer!