Skip to main content

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.

Project description

English | 简体中文

Quantum Leaf (in Chinese: 量易伏) - QComputeSDK

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.

In recent updates, QComputeSDK has added a photonic quantum computing simulator (LocalBaiduSimPhotonic). Unlike traditional quantum circuit, photonic quantum computing has its own unique way of running. QComputeSDK supports the optical system on the architecture, and also becomes the first quantum development kit that integrates quantum computing and photonic quantum computing. Interested readers can refer to Photonic Quantum Computing Simulator Tutorial.

API Documentation

To learn more about how to use QComputeSDK, please refer to the API documentation, which contains detailed descriptions and usage of all functions and classes available to users.

Development

QComputeSDK includes quantum computing architecture, quantum computing simulator, tutorials, and extensions. For developers who need to involve the code of the architecture or simulator, it is recommended to install from sources. For developers or researchers who use QComputeSDK to develop quantum algorithm applications, it is recommended to use GHZ_Cloud.py as the code framework. Modifying and using this file can effectively help you learn the syntax of this quantum development kit. It is recommended that developers be familiar with the circuit construction of QComputeSDK, and pay attention to the qubit output order.

Discussion and Feedbacks

Develop with QComputeSDK

We welcome developers to use QComputeSDK for quantum application development. If your work uses QComputeSDK, we also welcome you to contact us. The following are quantum applications developed based on QComputeSDK:

  • QEP (Quantum Error Processing), a set of quantum noise processing tools developed by the Institute for Quantum Computing at Baidu Research. It offers four powerful functions: performance evaluation, quantum error characterization, quantum error mitigation, and quantum error correction.
  • UBQC (Universal Blind Quantum Computation), a blind quantum computing proxy service based on the UBQC protocol developed by the Institute for Quantum Computing at Baidu Research.
  • QAPP is a set of quantum computing solution tools developed based on QComputeSDK, providing quantum computing solution services for a variety of field problems including quantum chemistry, combinatorial optimization, and machine learning.
  • QSVT (Quantum Singular Value Transformation), a set of quantum singular value transformation tools developed by the Institute for Quantum Computing at Baidu Research, with main functions including quantum singular value transformation, symmetric quantum signal processing, and Hamiltonian quantum simulation.
  • QFinance, a quantum finance library developed by the Institute for Quantum Computing at Baidu Research, providing a Quantum Monte Carlo method for price European options.
  • PQS (Photonic Quantum Simulator), a photonic quantum computing simulator developed by the Institute for Quantum Computing at Baidu Research, supporting photonic quantum circuit simulation based on Gaussian state and Fock state.

FAQ

  1. Question: What can be done with QComputeSDK? What are the applications?

    Answer: QComputeSDK is a quantum computing development framework based on Python that can be used to build, run, and optimize quantum circuits. We have built a comprehensive and complete infrastructure in QComputeSDK to support the implementation of various quantum algorithms, it has a wide range of application scenarios in the development of quantum applications. Specific work can be referred to but not limited to the Extensions in QComputeSDK.

  2. Question:I want to use QComputeSDK for quantum programming, but I don't know much about quantum computing. How do I get started?

    Answer: Quantum Computation and Quantum Information by Nielsen & Chuang is the classic introductory textbook to QC. We recommend readers to study Chapter 1, 2, and 4 of this book first. These chapters introduce the basic concepts, provide solid mathematical and physical foundations, and discuss the quantum circuit model widely used in QC. Readers can also learn on QuLearn, which is an online quantum learning knowledge base that not only contains quantum computing tutorials, but also rich video sources. Readers can also download the Quantum Leaf APP (https://quantum-hub.baidu.com/qmobile), and the Playground on the APP contains a wealth of interesting quantum examples to help readers learn anytime, anywhere.

  3. Question: Is QComputeSDK free?

    Answer: QComputeSDK is free. QComputeSDK is an open source SDK. It is free for users to execute local simulation tasks. When the user submits the task to the cloud simulator or the real machine through QComputeSDK, a certain number of points will be deducted. For detailed deduction rules, please refer to the User Guide. When the user creates an account, we will give away points. The point balance can be viewed in the Personal Center.

  4. Question: How can I get more points?

    Answer: Points are currently only used for resource control. If the points are insufficient, you can submit an application from the Feedback on the Quantum Leaf website or the User Feedback of Quantum Leaf APP. We will deal with your request in three working days.

Copyright and License

QComputeSDK uses Apache-2.0 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qcompute-3.3.5.tar.gz (174.4 kB view details)

Uploaded Source

Built Distribution

qcompute-3.3.5-py3-none-any.whl (277.0 kB view details)

Uploaded Python 3

File details

Details for the file qcompute-3.3.5.tar.gz.

File metadata

  • Download URL: qcompute-3.3.5.tar.gz
  • Upload date:
  • Size: 174.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for qcompute-3.3.5.tar.gz
Algorithm Hash digest
SHA256 bacdfec0a584229961320b4867ade18a4bedb58f72b94ef996152598aa5bc783
MD5 895f817464fc01a15db8d16589c051f6
BLAKE2b-256 cbdf34edd9675a7ed5441253b263c84021ddc6bb04f21d7400a0b341741d2c5d

See more details on using hashes here.

File details

Details for the file qcompute-3.3.5-py3-none-any.whl.

File metadata

  • Download URL: qcompute-3.3.5-py3-none-any.whl
  • Upload date:
  • Size: 277.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for qcompute-3.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c1f5ba0010449645e5c1e3cf80a9e755d27b75f7d4e785f56f10fde109e974ac
MD5 6db66c2dcf776ffc9e7d58483e2eb83e
BLAKE2b-256 9da8e7f4c3dc5d85418a5a6dc352de27bfe76da479ed0f23803e83cd74d335c3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page