Microsoft has launched an intermediate illustration for quantum applications, known as QIR (Quantum Intermediate Representation), to function a typical interface between programming languages for gate-based quantum computing and goal quantum computation platforms.
Introduced September 23 and primarily based on the LLVM intermediate language, QIR specifies guidelines to symbolize quantum constructs in LLVM. No extensions or modifications to LLVM are vital.
QIR helps Microsoft’s open supply Q# language for creating quantum algorithms however will not be particular to Q#. Any language for gate-based quantum computing may be represented. QIR is also hardware-agnostic, not specifying a quantum instruction or gate set.
One utility cited as being enabled by QIR entails utilizing the LLVM-based Clang compiler to compile QIR into executable machine code for a classical goal, offering a path to construct a simulator in C or C++ by implementing quantum instruction set capabilities.
Microsoft has made the draft QIR specification obtainable within the new Q# language repository on GitHub. The firm has additionally rolled out a compiler extension that generates QIR from Q#; it may be discovered within the function/QIR department of the Q# compiler repository. Directions for utilizing the extension have been posted, as properly.
Microsoft stated that as quantum computing capabilities mature, most large-scale quantum functions will benefit from each classical and quantum assets working collectively. LLVM presents QIR capabilities for describing wealthy classical computation built-in with quantum computation. LLVM additionally helps integration with many classical languages and instruments already supported by the LLVM device chain.
A typical sample in compilers is to start out by compiling the supply language into an intermediate illustration, usually designed to permit completely different supply languages to be represented. With this intermediate illustration, code may be optimized and remodeled. Once the precise goal execution platform is understood, the intermediate illustration may be compiled to executable code.
Through an intermediate illustration, many supply languages can share a typical set of optimizers and executable mills. Also, it turns into simple to compile a single supply language for a lot of completely different targets. The intermediate illustration offers a typical platform to be shared throughout sources and targets and permits re-use in compiler equipment.
Microsoft anticipates extra advances in how…