by Ferruccio Damiani, Luca Paolini and Luca Roversi (Università di Torino, Italia)
We point out the relevant features of the incoming quantum devices in a programming perspective. Then, we outline some issues that programming languages should face and some solution attempts. We conclude arguing how quantum programming language will ease the quantum spreading in the information and communications technology world.
Quantum computing, performed on devices that rely on quantum phenomena, will enable us to achieve computations that are intractable by means of classical computers. Quantum computers will speed up computational solutions in areas including chemistry (for example, materials science, pharmaceuticals), artificial intelligence (for instance, machine learning), biology, finance and more.
It is commonly accepted that such physical quantum devices must fulfil five criteria as identified by DiVincenzo [L1]. First, they must provide a set of well-behaving qubits that form the quantum memory. Second, they must be able to initialise the state of the quantum memory. Third, since quantum states lose information quickly (because of environmental interference), the decoherence time of quantum memory must be suitably long. Fourth, they must incorporate a set of quantum universal gates, i.e., a set that can approximate the result of any given quantum computation with arbitrary accuracy. Fifth, they must provide a suitable quantum measurement support. These constraints are the key hurdles that engineers must overcome, but there are others too. For example, additional issues are the satisfaction of adjacency/neighbouring constraints on the physical realisation of qubits and the reliability of quantum communication between different quantum computers or nodes.
The state of the art of quantum computers based on universal quantum gates is represented by Noisy Intermediate-Scale Quantum architectures (NISQ), which can supply some hundreds of noisy qubits, i.e., qubits with a limited capacity to preserve quantum coherence. The reason is that the current technology is not able to perfectly isolate qubits from the external environment.
In the context of quantum programming languages, the expected implementation of NISQ is typically idealised by means of quantum coprocessors. In this idealised situation, the programming activity evolves in a interacting dialogue between quantum coprocessors and classical computer: from the classical side, the programmer can invoke a sub-program that runs on the quantum coprocessor and waits it to terminate in order to measure the result. It is worth noticing that quantum algorithms are usually represented by means of classical information (quantum circuits) that are predisposed (i.e. meta-programmed) in the classical computer and, when ready, offloaded to a quantum coprocessor which executes it. Furthermore, quantum measurement outcomes are classical data. Figure 1 summarises the idea.
Figure 1: Quantum coprocessor interaction with a classical computer.
We recall that the purpose of programming languages is to syntactically and semantically abstract away from the overwhelming details typically required to govern the behaviour of hardware; the neat goal is a proactive support to software development, maintenance and its reliability. It is now widely accepted that embodying a typing discipline into a programming language simultaneously assures good computational properties of the language, and enhances readability, reliability and maintenance of software. Remarkably, strong typing disciplines allow us early detection, i.e., before program execution, of a possibly wide range of programming errors, the width depending on the expressiveness of the language of types available. Moreover, associating a type to a program can improve the efficiency, both in terms of memory allocation and reusability of software components.
So, a programming language for hardware that embodies both classical processors and quantum coprocessors is expected to ensure properties analogous to the ones listed here, but this introduces a relatively unexplored landscape due to fundamental differences between classical and quantum programs. Concretely, the interaction between the two programming paradigms becomes possible once the operational semantics of the two parts smoothly integrates the dialogue between the specific constructs that drive classical and quantum hardware. The standard example that exemplifies the problems to cope with is the no-cloning constraint that governs the quantum computations: no-cloning prescribes that quantum states stored in a quantum memory cannot be duplicated, while classical programming languages do not provide any support for non-clonable data.
Many proposals to overcome the issue are being considered in the literature. They span from the extension of classical type systems with linear typing features, to quantum stateless approaches that limit the freedom to express quantum algorithms, passing through the explicit management of quantum registers with very specific purpose and use. Our group, in collaboration with colleagues from the University of Verona, explored a stateless approach in  and an explicit management of quantum registers in .
The goal of developing programming languages with a smooth coexistence of the control over both classical processors and quantum coprocessors, supporting the quantum programming peculiarity, is shared by the main stakeholders that are developing quantum technologies. The reason is that such languages will positively impact on the discovery, the design, and the implementation of quantum algorithms thanks to the abstraction over the quantum hardware that they can assure. Last, they will be crucial at least for devising computational complexity models for quantum computations and for teaching quantum computing to newcomers and expert classical programmers.
A technical and recent survey on quantum programming language is in .
 L. Paolini, L. Roversi, M. Zorzi: “Quantum programming made easy”, Linearity-TLLA@FLoC 2018: 133-147. https://doi.org/10.4204/EPTCS.292.8
 L. Paolini, M. Piccolo, M. Zorzi: “QPCF: Higher-Order Languages and Quantum Circuits Journal of Automated Reasoning”, 2019, 63(4), pp. 941–966. https://doi.org/10.1007/s10817-019-09518-y
 B. Heim, M. Soeken, S. Marshall, et al.: „Quantum programming languages“, Nat Rev Phys 2, 709–722 (2020). https://doi.org/10.1038/s42254-020-00245-7
Università di Torino, Torino, Italia