SpinQit: A Quantum Computing Software Kit for More Open and Efficient Quantum Software Development

2023.08.11 · Blog

Similar to traditional computers, while computer hardware is fundamental in the field of quantum computing, without corresponding software, hardware resources cannot be effectively utilized to perform quantum computations. Therefore, software tools are essential for designing, optimizing, running, and understanding quantum programs.

 

At this stage, developers often require a quantum software development framework to accomplish these tasks.

A quantum software development framework, also known as a Software Development Kit (SDK), can be seen as a set of toolkits that provide the basic elements needed to perform quantum programming and design quantum algorithms. With a quantum SDK, developers can efficiently create, debug, and run quantum programs.

 

Early quantum SDKs only supported basic quantum algorithms and were primarily used for educational and research purposes. However, with the evolution of variational quantum algorithms and quantum machine learning, new algorithms and applications have emerged that can run on noisy machines, placing new demands on quantum SDKs, such as automated differentiation and the training of hybrid classical-quantum machine learning models.

 

Early SDKs struggled to support these needs well. Additionally, some existing quantum machine-learning platforms have various limitations, such as ignoring underlying fault-tolerant quantum algorithms or only integrating with their proprietary classical machine-learning platforms.

 

There is a growing demand for a quantum SDK that supports a broader range of quantum algorithms with higher compatibility and openness. In response, the engineers at SpinQ have designed, developed, and open-sourced the SpinQit Quantum Computing Programming Framework, with "openness" and "efficiency" at its core.

 

SpinQit Quantum Computing Programming Framework: Overall Architecture

 

In terms of overall architecture, SpinQit Quantum Computing Programming Framework is divided into three parts:

front-end API, compiler, and back-end execution platform.

·  The front end contains different syntaxes for quantum programming and supports interfacing with different classical software or development platforms;

·  Intermediate representation based on graph theory is the core of SpinQit Quantum Computing Programming Framework scalable architecture, different front-end programming syntaxes are converted into unified intermediate representation by corresponding compilers, and then converted into formats that can be executed by different back-end platforms;

·  Different back-end execution platforms can efficiently execute quantum programs to meet different application requirements.

 

 

The front end supports multiple syntaxes and quantum algorithms

API integration is easy to call, and more efficient development

 

1) Support for multiple front-end syntaxes

 

One of the open features of SpinQit Quantum Computing Programming Framework is reflected in its support for different front-end syntaxes, including support for Python, OpenQASM language, and compatibility with Qiskit quantum programming library.

 

SpinQit Quantum Computing Programming Framework supports three front-end syntaxes

 

SpinQ engineers have designed a Python-based quantum programming syntax for SpinQit Quantum Computing Programming Framework, which is capable of supporting the development needs of a variety of different quantum algorithms simultaneously.

 

Python is familiar to most users of quantum computing programming, and choosing Python reduces the cost of learning and the threshold of participation in the open-source community. At the same time, SpinQit Quantum Computing Programming Framework can be easily integrated with many classic machine learning platforms that support Python.

 

OpenQASM is one of the most widely used quantum assembly languages in the industry today, used in many quantum computing courses. Support for OpenQASM makes it easy to port quantum programs from other platforms to SpinQit Quantum Computing Programming Framework or to compare execution results across platforms.

 

In addition, SpinQit Quantum Computing Programming Framework is also compatible with IBM's quantum programming library Qiskit, which is familiar to many users, and this facilitates the reuse of programs to a large extent.

 

2)Support the direct call to the basic algorithm module

 

In the field of quantum computing, there are many basic quantum algorithm modules, which are often used in different application scenarios, or used to construct combined algorithms. For example, quantum Fourier transform is an important part of algorithms such as quantum phase estimation, HHL, and Shor.

 

Encapsulate basic algorithms for direct invocation

 

In SpinQit Quantum Computing Programming Framework, many basic algorithms like Quantum Fourier Transform are encapsulated as primitives and algorithmic APIs for users to call, so that users do not have to build wheels over and over again, which is where its important value lies.

 

3) Support multiple quantum algorithms

 

In addition to the basic algorithm module, SpinQit Quantum Computing Programming Framework also supports variational quantum algorithms, a typical quantum-classical hybrid algorithm, which is widely used in quantum chemistry, combinatorial optimisation, and other fields. The general architecture of these algorithms is to model the problem as a Hamiltonian quantity and iteratively optimise it with parametric quantum lines.

 

SpinQit Quantum Computing Programming Framework supports variational quantum algorithms.

 

SpinQit Quantum Computing Programming Framework provides full support for the entire algorithmic process, including the handling of Hamiltonian quantities, parametric lines, classical/quantum objective functions, classical/quantum optimizers, and more.

 

In particular, SpinQit Quantum Computing Programming Framework implements pure quantum differentiation algorithms that run on real quantum computers, as well as backpropagation-based automatic differentiation in classical simulators.SpinQit Quantum Computing Programming Framework implements several quantum optimizers and also provides interface encapsulation to enable users to use classical optimizers with which they are familiar.

 

4) Support for quantum machine learning

 

Support for quantum machine learning is another highlight of SpinQit Quantum Computing Programming Framework.

 

The series of basic modules for quantum computing mentioned above form the underlying support for quantum machine learning. In addition, SpinQit Quantum Computing Programming Framework provides interfaces that can support the hybrid learning of quantum computing and classical machine learning frameworks such as PyTorch and TensorFlow.

 

Numerous application scenarios for quantum machine learning

 

On these foundations, SpinQit Quantum Computing Programming Framework can support many different types of quantum machine learning algorithms, such as quantum clustering, quantum neural networks, and quantum support vector machines. These quantum machine learning algorithms have been shown to be used in a variety of different scenarios, such as financial investment, anti-fraud, and assisted diagnosis in healthcare, as well as in areas of classical machine learning, including natural language processing and image recognition.

 

 

Multi-level compilation optimisation

Diversified back-end execution

 

After the front-end input of the designed quantum algorithm, the quantum program still needs to be translated into instructions that can be understood by the quantum computer and executed by the back-end in order to complete the quantum computing operation.

 

In the SpinQit Quantum Computing Programming Framework compiler system, which is specially designed for quantum computation, the three front-end syntaxes described in the previous section have corresponding compilers to compile the programme into a unified intermediate representation.

 

The "intermediate representation" can be regarded as a relay station where different source codes are converted into intermediate representations, which in turn are converted into the target back-end execution code.

 

With some exceptions, the front-end user-defined quantum gates are decomposed into some basic gates. In SpinQit Quantum Computing Programming Framework, the intermediate representation is based on a set of elementary quantum logic gates, representing the interrelationships as a graph.

 

SpinQit Quantum Computing Programming Framework's built-in compiler can perform different levels of compilation optimisation based on the intermediate representation, ranging from basic operator elimination and fusion to control bit simplification, etc. The optimisation level can be set by the user, and the corresponding compilation time is also different.

 

The basic quantum gates supported by different execution platforms are different. In order to be able to run quantum programs on different platforms, each execution platform has a corresponding assembler for further processing. These assemblers also make full use of the characteristics of the backend platforms to accelerate some operations, such as initial state preparation.

 

SpinQit Quantum Computing Programming Framework's diverse backend execution platforms

 

The rich back-end execution platform is one of the major advantages of SpinQit Quantum Computing Programming Framework. Relying on the powerful quantum computer hardware resources of Quantum SpinQit Quantum Computing Programming Framework, users can choose to run their programmes on different platforms including real machines and cloud platforms.

 

As for the real machine, SpinQit Quantum Computing Programming Framework is the only SDK in China that can be submitted to the local quantum computer for execution, and SpinQit Quantum Computing Programming Framework has already provided support for desktop magnetic quantum computers, and will further support superconducting quantum computers in the future.

 

As part of SpinQit Quantum Computing Programming Framework's ecosystem, the cloud resources within Quantum SpinQit Quantum Computing Programming Framework's SPINQ Cloud Quantum Computing Cloud Platform are also available for use, and users can also submit their programmes to the cloud platform for execution.

 

In terms of simulators, SpinQit Quantum Computing Programming Framework provides support for both local CPU simulators and large-scale GPU simulators.

 

The local CPU simulator is convenient for users to verify small-scale programs or meet the needs of teaching scenarios, while the GPU simulator can increase the scale of simulation to more than 30 quantum qubits, supporting high-performance large-scale simulation.

 

In addition, SpinQit Quantum Computing Programming Framework has a special backend that converts quantum computing code into OpenQASM code output. In this way, all third-party platforms that support OpenQASM can execute quantum programs developed using SpinQit Quantum Computing Programming Framework.

 

Supported by Quantum Cloud Platform

open-source sharing, open building

 

SpinQit Quantum Computing Programming Framework has been open-sourced at GitHub

 

Currently, SpinQit Quantum Computing Programming Framework has been open-sourced on GitHub with online documentation containing API descriptions and some basic use cases. The engineers at SpinQ hope to build SpinQit Quantum Computing Programming Framework into an open-source community for quantum computing, creating an efficient platform for quantum algorithm research and software development.

 

Not only will it help innovation and collaboration, but SpinQit Quantum Computing Programming Framework's open-source will also help to promote open standards for quantum SDKs and improve compatibility between different systems and tools.

 

In addition to open APIs and interfaces, as well as open-source code, SpinQit Quantum Computing Programming Framework's openness is also reflected in the support of the Quantum Computing Cloud Platform. The Quantum Computing Cloud Platform provides the public with open access to and the ability to use quantum hardware, so that people can connect to these resources over the network, no matter where they are.

 

SPINQ Cloud Quantum Computing Cloud Platform

 

The SPINQ Cloud Quantum Computing Cloud Platform is a cloud service platform built by SpinQ that opens up the control of the physical substrate and links to a variety of real quantum computing systems. It is equipped with multiple quantum computing systems, supporting 2, 3, 5, and 8 qubits of quantum computation at the same time, as well as high-performance simulation platforms with up to 24 qubits.

 

Currently, the SPINQ Cloud Quantum Computing Cloud Platform provides three different levels of services: first, it provides hardware infrastructure, both SpinQit Quantum Computing Programming Framework and online can submit computing tasks to SpinQ's quantum computers or simulator platforms for execution; second, it provides an online programming environment, where users can construct quantum circuits for experiments in the form of interactive interfaces and codes; and third, it is on-line a batch of quantum algorithmic applications, with cases showing how to solve practical application problems with quantum programs.

 

About quantum algorithm applications and their cases, we will introduce them in detail in the next issue.

 

Next, SpinQit Quantum Computing Programming Framework plans to make continuous improvements from the three levels of algorithm, compilation system, and execution platform, including but not limited to:

·  Continuously update the latest quantum algorithms, especially quantum machine learning algorithms, to provide more comprehensive support for users.

·  Introducing on-the-fly compilation technology to improve the processing of parameter-containing quantum lines, avoiding repeated compilation of quantum lines during the iterative optimization of variational quantum algorithms or quantum machine learning algorithms, etc.

·  Support for more back-end execution platforms, including support for superconducting quantum computers and improved classical simulators, etc.

 

It is believed that with continuous upgrading and iteration, SpinQit Quantum Computing Programming Framework, as a quantum software development framework, will further promote the birth of more quantum software and play a greater role in quantum computing. And, with the support of more quantum algorithms, SpinQit Quantum Computing Programming Framework will also help quantum computers in medical, financial, artificial intelligence, and other fields of scientific research and application.

 

Contact Us