QCompute
QCompute is a Python-based quantum software development kit (SDK). It provides a full-stack programming experience for advanced users via hybrid quantum programming language features and a high-performance simulator.
Install / Use
/learn @baidu/QComputeREADME
English | 简体中文
Quantum Leaf (in Chinese: 量易伏) - QComputeSDK
- Features
- Install
- Introduction and Developments
- Discussion and Feedbacks
- Develop with QComputeSDK
- Frequently Asked Questions
- Copyright and License
Quantum Leaf is the world's first cloud-native quantum computing platform developed by the Institute for Quantum Computing at Baidu Research. Users can use the Quantum Leaf for quantum programming, quantum simulation and running real quantum computers. Quantum Leaf aims to provide a quantum foundation development environment for QaaS (Quantum infrastructure as a Service).

The QComputeSDK installation package is a complete open-source quantum computing framework implemented in Python. It adopts the classic quantum hybrid programming method and presets various advanced modules. Users can use the quantum environment object (QEnv) to quickly build quantum circuits, and can also use it to develop various complex quantum algorithms. QComputeSDK has multiple interfaces for local simulators, cloud simulators and real machines, allowing users to quickly simulate and verify quantum algorithms in local, and submit circuit tasks to real quantum hardware (superconductors, ion traps) or high-performance simulators on cloud.
Features
- Easy-to-use
- Nearly 50 tutorial cases, and still increasing.
- Quantum circuit local visualization.
- Automatically call modules to complete quantum circuit compilation.
- Versatile
- Support quantum circuit modularization.
- The local high-performance simulator supports the simulation of 32 qubits.
- The high-performance heterogeneous simulators on the cloud supports more qubit simulations.
- Support the simulation of various quantum noise models.
- Local GPU simulator based on NVIDIA cuQuantum.
- Local photonic quantum simulator supports the Gaussian/Fork state.
- Real quantum computing power
- Access to QPUQian, Baidu's superconducting quantum computer.
- Access to IonAPM, the ion trap quantum computer of the Innovation Academy for Precision Measurement Science and Technology, CAS.
- Access to IoPCAS, the superconducting quantum computer of the Institute of Physics, CAS.
Install
Environment Setup
We recommend using conda to manager virtual environments,
conda create -n qcompute_env python=3.10
conda activate qcompute_env
Please refer to Anaconda's official installation.
Note: Python version >= 3.9
Install QComputeSDK
Install QComputeSDK with pip,
pip install qcompute
or download all the files to install from sources. We recommend this installation. You can download from GitHub,
git clone https://github.com/baidu/QCompute.git
cd QCompute
pip install -e .
or download from Gitee,
git clone https://gitee.com/baidu/qcompute.git
cd qcompute
pip install -e .
Run Example
If all the files have been downloaded, you can now try to run a program to verify whether the installation is successful. Here we run the test script provided by QComputeSDK,
python -m Test.PostInstall.PostInstall_test
User Token needs to be given on the command line before cloud testing, You can log in to Quantum Leaf to check your Token. If you don't need to do cloud testing, please type Ctrl+c.
Note: Please skip this step if you installed with
pip.
Breaking Change
Starting with QComputeSDK 3.0.0, developers can run Baidu's superconducting quantum computer through QComputeSDK (device identifier: CloudBaiduQPUQian). The device provides services regularly, which can be viewed from the Services Status.
Introduction and Developments
Tutorials
QComputeSDK is a quantum computing development framework that implements backend access to real quantum hardware. It builds a bridge between quantum computing and quantum hardware, providing strong support for the research and development of quantum algorithms and applications, and also providing a wealth of cases for developers to learn from.
Here we provide primary, intermediate and advanced cases. With primary case, you can quickly get started with QComputeSDK, it includes quantum state preparation, classical quantum hybrid programming, circuit task submission to quantum computers, etc. The intermediate case is the use of QComputeSDK, including the calling of modules, the use of convertors, etc. The advanced case is the implementation of advanced quantum algorithms on QComputeSDK. We have provided detailed tutorial documents for these algorithms.
-
- GHZ state preparation (local)
- GHZ state preparation (cloud)
- Bell state preparation (local)
- Bell state preparation (cloud)
- Classical quantum hybrid language (local)
- Classical quantum hybrid language (cloud)
- Classical quantum information interaction (local)
- Classical quantum information interaction (cloud)
- QPU - BaiduQPUQian
- QPU - IonAPM
- QPU - IoPCAS
- Photonic quantum circuit simulation based on Fock state
- Photonic quantum circuit simulation based on Gaussian state
- GPU simulator based on cuQuantum
- Universal blind quantum computation
-
- Quantum Superdense Coding
- Deutsch-Jozsa Algorithm
- Quantum Phase Estimation (QPE)
- Grover's Search Algorithm
- Shor's Algorithm
- Variational Quantum Eigensolver (VQE)
- [Variational Quantum State Diagonalization (VQSD)](./Ex
