arrow left

The Landscape of Quantum Computing Programming Languages

calender icon
November 26, 2023
clock icon
min read
Technology
Share

Quantum computing is usually taught with mathematics. Using computer science terminology, equations have constants, variables, and functions. Matrices are data structures. Therefore, for educational purposes, such as solving relevant equations and conducting quantum computer simulations, the quantum computing languages available to choose from could be any classical computing languages that support the necessary mathematical functions.

For many applications, therefore, the best quantum programming language might be a simple case of personal preference. Searching through publicly available repositories on GitHub, for example, it is possible to find more than a dozen different classical programming languages in use. It is reasonable to assume that this list will grow as more and more enthusiasts apply their personal preferences to their exploration of quantum computing. In the near future, if not already today, your favorite quantum computing language and your favorite classical computing language could very well be the same.

Part of what makes this diversity possible, is the ability to call the libraries and functions of one language from a completely different language. For example, Python can import and use Julia language packages while Julia can import and use Python language libraries. Therefore, any other language that supports relevant crossovers might make quantum coding automatically plausible in that language.

While personal preferences are important, providers are playing a large role in guiding the development of the landscape. For example, anyone wishing to receive training on quantum computing with neutral atoms will be introduced to the Bloqade package. And although there is a Bloqade-Python library with which attendees can apply their knowledge, the Bloqade package introduces attendees to the Julia language. And notwithstanding the possibility of calling these libraries from other languages, support for Bloqade’s functions is going to be easier to come by for Julia and Python. Therefore, the training and support offered by QuEra and other providers greatly influence the overall landscape.

One thing that muddies up the landscape, however, is the confusion over what constitutes a quantum computing programming language. The Quantum Insider article titled “Top 5 Quantum Programming Languages In 2022,” for example, lists only two languages; the other three can best be classified as software development kits or frameworks or as some other term. One way to tell that something is not actually a language is that it is itself dependent on a language. For example, Bloqade is not a language. Julia and Python are languages, and Julia and Python environments enable the import and use of the Bloqade package and the Bloqade-Python library, respectively.

Top Quantum Programming Languages

The most popular quantum computing languages are probably the ones that permit access to real quantum computers. Secondarily to that, they permit access to various quantum computer simulators, emulators, compilers, visualizations, resource estimators, and other utilities. They may even grant access to other cloud-based quantum technologies. The most popular languages and standards are probably:

  • Python
  • Julia
  • C++
  • Q#
  • JSON
  • JavaScript

It’s worth noting that all of these are open-source programming languages and standards. If a developer has a preference, and that preference is missing an essential function, that developer can go ahead and make a contribution to it. And, again, it is important to note that this is not an exhaustive list of all the languages in use.

Python is easily the most popular quantum programming language. Part of the reason for that might be due to Python’s overall popularity. It is, after all, usually ranked as the most widely used language in the world at this time.  It also helps that the early popularization of cloud-based quantum computing was mostly, if not entirely, Python-based. The next generation of frameworks and utilities have built on top of those that came before, thus adding even more offerings that are available in Python. Even libraries that are independent of earlier frameworks, such as Bloqade-Python, take advantage of Python’s popularity, which facilitates easier widespread adoption.

Julia is possibly the second most popular quantum computing language. This is based on two observations: job specifications that list Julia as either required or desired, as well as the growing popularity of neutral atom quantum computing. For classical pre-processing and post-processing, as well as for simulations, Julia is faster and manages memory better than Python. Although Python is generally considered more user-friendly, that would be in regard to the entire language. For analog mode neutral atom quantum computing, for example, very little knowledge of either language is required.

C++ and Q# are probably the next tier, because either can be considered a quantum computing programming language for large enterprises. However, quantum computers are not yet large enough or fault-tolerant enough to solve full-scale real-world problems. It is likely that these languages will gain in popularity as the performance of the classical code that calls upon quantum computation becomes more of an issue. It is also worth noting that both languages favor a specific qubit modality, which is spin qubits and topological qubits, respectively. Therefore, either or both of these languages might grow in popularity simply depending on advancements with their respective modalities.

JSON and JavaScript are the most niche languages on this short list. JSON can be found standalone as the language for at least one framework, but it is more commonly found defining parameters for some other framework or software. JavaScript, meanwhile, can be found behind the scenes of quite a few online simulators and utilities. Unlike the previously mentioned languages, JavaScript is unlikely to be used as the development language for any quantum application, even though JavaScript has enabled the development of drag-and-drop quantum circuit builders, quantum computer simulators, interactive visualizations, and other utilities.

A special mention has to be made for quantum assembly languages, which are referred to as QASM, which is pronounced like the word “chasm.” They each have a name that includes the letters “QASM,” such as OpenQASM, which enjoys the most widespread adoption. These languages are not classical programming languages at all, even though they tend to resemble some hybrid of C and Assembly Language. QASM is used to design quantum circuits, specifically. And even the code from the classical languages above often call upon libraries and packages to define the QASM for quantum circuits. The advantage of using the aforementioned languages would be using features that are not in QASM to build quantum circuits with QASM. For example, a simple Python loop could add two-qubit entangling gates to a virtually unlimited number of qubits with as little as one line of code, whereas QASM may require as many as one instruction per gate, depending on factors that are beyond the scope of this article. Without question, the languages mentioned above are more feature-rich than any QASM in that sense.

{{Bloqade}}

Quantum Programming Languages in Action

The most common application of quantum coding is likely education. This includes all of the courses, workshops, webinars, hackathons, and summer schools that are growing in number annually. A growing number are online with participants registering literally from around the world. And then there are the countless Jupyter-based tutorials that most providers make available, including QuEra. This also includes formal workforce development for all of the enterprises that have chosen to become quantum-ready before their competitors catch on.

Another common application is prototyping. As previously mentioned, quantum computers are not yet large enough or fault-tolerant enough to solve full-scale real-world problems. Nonetheless, they are large enough to allow the demonstration of proofs-of-concept. Depending on the scale of these demonstrations, these proofs-of-concept might run on ideal simulators, with the tradeoff being that real hardware is noisy but simulators have more-limited qubit counts. For proofs-of-concept on real hardware, the largest publicly-available quantum computer at this time is the 256-qubit Aquila.

Yet another application is abstraction. This might be through libraries and functions, or this might be through API calls, but the proposition is that developers can use quantum algorithms with little-to-no specialized knowledge of quantum computing, quantum information, or quantum mechanics. Imagine, for example, a function called shor() which accepts as an argument an integer to be factored. No knowledge of Shor’s Factoring Algorithm is required to type shor(15) and retrieve 3 and 5 as its factors.  

The Future of Quantum Programming Languages

As quantum computers become larger and more fault-tolerant, enterprise integration will eventually take center stage. There will likely be enterprise-class applications running business process software that will need to solve some computationally intensive problems. Instead of approximating solutions with classical resources, the software will need to be able to call on a quantum processor, whether that QPU is co-located in an on-premises data center or whether it is accessed via the cloud in some quantum-as-a-service (QaaS) model. QuEra’s neutral atom quantum computers, for example, are already available in both models.

The future will also likely involve translations between languages. Python might be used, for example, for rapid development and troubleshooting of algorithms and applications, and then the final code might be translated to C++ for use in an actual production environment. There are enterprises, after all, that take this approach today with classical applications, although the languages of choice may obviously vary.

Exceptions are likely for scientific endeavors, however. Neutral atoms, for example, have many use cases that are of interest to Academia, for which Jupyter notebooks running Julia and Python should continue to be applicable. The use of compiled languages, such as C++, are of particular interest for problems that are time sensitive, such as financial optimization problems. The quantum computation remains the same, but the classical processing around the quantum computation would be a primary motivator to switch to a compiled language.

Finally, quantum computers are eventually expected to be integrated into high performance computing (HPC) environments, and the language(s) in use will need to support that. HPC actually has multiple applications in quantum computing, as discussed in our article titled “Hybrid Quantum Computing: Bridging Classical and Quantum Worlds.” For additional reading, our article titled “What does it mean for quantum computers to be HPC ready?” links to an article that discusses this topic a little more from an HPC perspective.


machine learning
with QuEra

Listen to the podcast

Explore our Bloqade emulator

Check it out now