Blog

Quantum Software Development: A Similar but New Paradigm

5
May
,
2022
Ofek Kirzner, VP R&D, Classiq

How does one go about creating a new programming language, compiler, or toolchain? When designing software platforms for a new field, we can lean on our vast past experience yet combine it with creativity, breakthrough research, and engineering.

Classiq develops a set of tools for creating software for quantum computers. In this article, we will use the analogy of classical programming in C to explain how we are building a new language and platform for this new computing paradigm.

As many readers know, quantum computers are based on a mathematical model derived from quantum physics. Without going into the full details, imagine a set of logical gates that have different semantics from classical programming. Instead of operating on a string of 0’s and 1’s, quantum gates work on linear combinations of these strings. Quantum programming interconnects quantum gates and can also be combined with classical logic gates.

Building a quantum computer is a formidable engineering challenge, considered a fantasy until not too long ago. But in recent years, driven by breakthroughs from computing giants like IBM with their 127-qubit processor and Google’s quantum supremacy experiment, industrial uses of quantum computers became a question of “how soon?” as opposed to “will it ever happen?”.

The motivation for building quantum computers is very clear: if a computer can be built and appropriate software can be written for it, we could solve critical problems that classical computers can’t and never will. For example, we could develop new vaccines, optimize our supply chain, simulate large-scale molecules, discover new machine learning algorithms, protect information in better ways, and more.

If we were to look back to the 1950s, we’d see a long research and engineering process that took us from the first computing prototypes to the advanced processors we know today. Modern processors are characterized by an instruction set architecture (ISA) that specifies the instructions, data types, and registers that they use. Certain instructions have a binary representation as well as human-readable assembly language instructions. But today, no one is developing large software projects in assembly language, not even Linus. Starting from the 60s and 70s, programming languages like Fortran and then C were developed to provide an abstraction layer above assembly. These languages revolutionized software development and allowed software engineers to express their creativity.

Quantum computers today have no more than about 100 qubits. They have many limitations and companies would be challenged to use them to perform complex calculations. Programming these quantum computers is done in languages like QASM (Quantum Assembly) or Q#. These languages require the software engineer to explicitly declare which quantum gates need to be used, and many would consider this even closer to the hardware than assembly language. However, when in 2023, computers with 1000 qubits would be available, offering the opportunity to create more sophisticated code; such low-level programming would become a Sisyphean task, bordering on impossible.

To address this issue, Classiq is developing the next layers in the quantum software stack.

How does programming a classical computer look today? Let’s take C as an example and assume that our goal is to deliver an executable file. Broadly speaking, the software engineer creates “.c” and “.h” files and compiles them to “.o” files. These are then linked with pre-existing libraries (such as libc) into an executable. The engineer can execute the code but is likely to encounter bugs. To debug the code, the engineer could use a debugger such as gdb, or static code analysis tools like objdump or IDA. This is an iterative process: write code, compile, link, run and debug.

How is this similar to writing quantum software? The Classiq platform provides engineers and quantum algorithm designers with a functional and declarative interface. Thus, they need to ‘declare’ what is the designer logic or functionality that they wish to generate and then specify the constraints that the code needs to meet - such as not exceeding a certain circuit length, the number of available qubits, the desired accuracy, and more. To help our users, Classiq provides a library of quantum building blocks such as state preparation, quantum arithmetic, and machine learning operations. These declarations are collected into a model (.qmod) and sent to our backend servers. Together with our predefined blocks, this model undergoes a synthesis process - the creation of quantum code that optimally meets the requirements. Users can analyze the result and verify that it meets the specifications or quickly execute it on a variety of quantum computers or simulators. As part of this interactive and iterative process, users can change the constraints or the functional definition until they get the desired result. Finally, as in classical compilation, the output code is much better than could be achieved manually.

In spite of these similarities, there are some differences between classical and quantum programming:

  • Quantum logic is more complex than classical logic, and thus the synthesis of quantum circuits is more sophisticated both in the algorithmic design process and also in the implementation.
  • Quantum software is approximated, meaning that part of the requirements is the level of accuracy of the final code, allowing it to accommodate today’s and tomorrow’s hardware limitations.
  • The synthesis process is done over a networked API, unlike a local classical compiler. This is done so as to simplify the interface and to take advantage of a SaaS model (seamless software upgrades, expandable capacity, and more)
  • The ability to debug quantum code is limited because the process of measuring a qubit is irreversible. Thus, the process of analyzing and validating quantum code is a difficult algorithmic problem.
  • Quantum software is graphical in nature. An appropriate design environment needs to provide both textual as well as graphical methods and also present the synthesized code in a textual as well as graphical way.

The quantum software world is still in its infancy. There are many parallels to classical software design, but the road is mostly unpaved and requires deep research, innovation, and ingenuity. Some of the challenges that Classiq tackles are:

  • The research and implementation of synthesis algorithms that allow breakthrough quantum software.
  • Developing a rich declarative language that can help express pure and hybrid (classical/quantum) algorithms and allow engineers to express their creativity. 
  • Creating algorithmic building blocks that provide flexible accuracy and can adjust to the available quantum resources.
  • Tools for the analysis and debugging of quantum code within a reasonable time.
  • A scalable infrastructure to accommodate the next generations of quantum computers.

Interested in joining us? We are seeking top-notch software engineers of all disciplines: DevOps, algorithmic experts, quantum information scientists, front-end designers, and more. We are looking for pioneers that are not afraid to break through the limits of imagination and technology and are interested in building the future of computing.

How does one go about creating a new programming language, compiler, or toolchain? When designing software platforms for a new field, we can lean on our vast past experience yet combine it with creativity, breakthrough research, and engineering.

Classiq develops a set of tools for creating software for quantum computers. In this article, we will use the analogy of classical programming in C to explain how we are building a new language and platform for this new computing paradigm.

As many readers know, quantum computers are based on a mathematical model derived from quantum physics. Without going into the full details, imagine a set of logical gates that have different semantics from classical programming. Instead of operating on a string of 0’s and 1’s, quantum gates work on linear combinations of these strings. Quantum programming interconnects quantum gates and can also be combined with classical logic gates.

Building a quantum computer is a formidable engineering challenge, considered a fantasy until not too long ago. But in recent years, driven by breakthroughs from computing giants like IBM with their 127-qubit processor and Google’s quantum supremacy experiment, industrial uses of quantum computers became a question of “how soon?” as opposed to “will it ever happen?”.

The motivation for building quantum computers is very clear: if a computer can be built and appropriate software can be written for it, we could solve critical problems that classical computers can’t and never will. For example, we could develop new vaccines, optimize our supply chain, simulate large-scale molecules, discover new machine learning algorithms, protect information in better ways, and more.

If we were to look back to the 1950s, we’d see a long research and engineering process that took us from the first computing prototypes to the advanced processors we know today. Modern processors are characterized by an instruction set architecture (ISA) that specifies the instructions, data types, and registers that they use. Certain instructions have a binary representation as well as human-readable assembly language instructions. But today, no one is developing large software projects in assembly language, not even Linus. Starting from the 60s and 70s, programming languages like Fortran and then C were developed to provide an abstraction layer above assembly. These languages revolutionized software development and allowed software engineers to express their creativity.

Quantum computers today have no more than about 100 qubits. They have many limitations and companies would be challenged to use them to perform complex calculations. Programming these quantum computers is done in languages like QASM (Quantum Assembly) or Q#. These languages require the software engineer to explicitly declare which quantum gates need to be used, and many would consider this even closer to the hardware than assembly language. However, when in 2023, computers with 1000 qubits would be available, offering the opportunity to create more sophisticated code; such low-level programming would become a Sisyphean task, bordering on impossible.

To address this issue, Classiq is developing the next layers in the quantum software stack.

How does programming a classical computer look today? Let’s take C as an example and assume that our goal is to deliver an executable file. Broadly speaking, the software engineer creates “.c” and “.h” files and compiles them to “.o” files. These are then linked with pre-existing libraries (such as libc) into an executable. The engineer can execute the code but is likely to encounter bugs. To debug the code, the engineer could use a debugger such as gdb, or static code analysis tools like objdump or IDA. This is an iterative process: write code, compile, link, run and debug.

How is this similar to writing quantum software? The Classiq platform provides engineers and quantum algorithm designers with a functional and declarative interface. Thus, they need to ‘declare’ what is the designer logic or functionality that they wish to generate and then specify the constraints that the code needs to meet - such as not exceeding a certain circuit length, the number of available qubits, the desired accuracy, and more. To help our users, Classiq provides a library of quantum building blocks such as state preparation, quantum arithmetic, and machine learning operations. These declarations are collected into a model (.qmod) and sent to our backend servers. Together with our predefined blocks, this model undergoes a synthesis process - the creation of quantum code that optimally meets the requirements. Users can analyze the result and verify that it meets the specifications or quickly execute it on a variety of quantum computers or simulators. As part of this interactive and iterative process, users can change the constraints or the functional definition until they get the desired result. Finally, as in classical compilation, the output code is much better than could be achieved manually.

In spite of these similarities, there are some differences between classical and quantum programming:

  • Quantum logic is more complex than classical logic, and thus the synthesis of quantum circuits is more sophisticated both in the algorithmic design process and also in the implementation.
  • Quantum software is approximated, meaning that part of the requirements is the level of accuracy of the final code, allowing it to accommodate today’s and tomorrow’s hardware limitations.
  • The synthesis process is done over a networked API, unlike a local classical compiler. This is done so as to simplify the interface and to take advantage of a SaaS model (seamless software upgrades, expandable capacity, and more)
  • The ability to debug quantum code is limited because the process of measuring a qubit is irreversible. Thus, the process of analyzing and validating quantum code is a difficult algorithmic problem.
  • Quantum software is graphical in nature. An appropriate design environment needs to provide both textual as well as graphical methods and also present the synthesized code in a textual as well as graphical way.

The quantum software world is still in its infancy. There are many parallels to classical software design, but the road is mostly unpaved and requires deep research, innovation, and ingenuity. Some of the challenges that Classiq tackles are:

  • The research and implementation of synthesis algorithms that allow breakthrough quantum software.
  • Developing a rich declarative language that can help express pure and hybrid (classical/quantum) algorithms and allow engineers to express their creativity. 
  • Creating algorithmic building blocks that provide flexible accuracy and can adjust to the available quantum resources.
  • Tools for the analysis and debugging of quantum code within a reasonable time.
  • A scalable infrastructure to accommodate the next generations of quantum computers.

Interested in joining us? We are seeking top-notch software engineers of all disciplines: DevOps, algorithmic experts, quantum information scientists, front-end designers, and more. We are looking for pioneers that are not afraid to break through the limits of imagination and technology and are interested in building the future of computing.

About "The Qubit Guy's Podcast"

Hosted by The Qubit Guy (Yuval Boger, our Chief Marketing Officer), the podcast hosts thought leaders in quantum computing to discuss business and technical questions that impact the quantum computing ecosystem. Our guests provide interesting insights about quantum computer software and algorithm, quantum computer hardware, key applications for quantum computing, market studies of the quantum industry and more.

If you would like to suggest a guest for the podcast, please contact us.

Start Creating Quantum Software Without Limits

contact us