Skip to main content

Quingo Runtime System

Project description

Quingo Runtime System

Along with quingo compilers, the Quingo runtime system which provides users the capability to program and simulate Quingo programs.

Installation

The Quingo installation comprises of two main steps:

Install the Runtime system and simulator

Install Quingo runtime system with required simulators using the following command:

pip install -e .
# for simulators used:
# The Tequila backend is not yet open source and needs to be installed separately.
git clone https://gitee.com/hpcl_quanta/tequila.git
pip install -e .

Upon success, it will automatically install the Quingo runtime system (this package), the SymQC simulator, the PyQCISim simulator and the QuaLeSim simulator.

Install the Quingo compiler

We can install mlir-based quingo compiler in two ways:

  • Install the mlir-based Quingo compiler using the following command:

    python -m quingo.install_quingoc
    
  • Download mlir-based Quingo compiler

    • Windows: unzip .zip file, add directory which contains the quingoc executable file to system environment PATH.
    • Linux: as the following sample usage, Quingoc will be installed to user defined directory, then add directory which contains the quingoc executable file to system environment PATH.
     quingo-compiler-0.1.4.sh -prefix=/home/user/.local
    
    • Macos: uncompress .dmg file, copy quingoc executable file to user defined directory, then add directory which contains the quingoc executable file to system environment PATH.

Usage

A simple example can be found in the directory src/examples. You can simply run the bell_state example by running:

cd src/examples/bell_state
python host.py

If everything runs correctly, you should see the following output:

sim res:  (['Q1', 'Q2'], [[0, 0], [0, 0], [1, 1], [1, 1], [0, 0], [0, 0], [0, 0], [1, 1], [0, 0], [1, 1]])

For different simulation backend, please refer to src/examples/sim_backend, which shows the use of SymQC, QuantumSim, and Tequila backend that are currently running stably.

For different simulation modes, please refer to src/examples/sim_exemode, which displays the output of two different simulation results currently available.

APIs of the Quingo runtime system

  1. class Quingo_task:
    • 输入:
      • called_qu_fn: Path,qu文件路径。
      • called_func: str,调用 quingo 函数名。
      • debug_mode(optional): True or False
      • qisa(optional): 前端指令集类型。
      • backend(optional): 后端模拟器类型。
  2. function compile():
    • 输入:
      • Quingo_task: 待编译 qu 任务
      • params: Quingo_task 中调用函数 called_func 所需参数
    • 输出:qasm_fn:输出对应指令集文件(.qcis / .qi)
  3. function execute():
    • 输入:
      • qasm_fn: Path,对应指令集文件(.qcis / .qi)
      • be_type: BackendType,模拟器后端类型
      • exe_config: 执行模式,ExeMode.SimShotsExeMode.SimFinalResultExeMode.SimStateVector
    • 输出:sim_result:具体输出格式详见src/quingo/backend/quingo_result_format_spec.md

Quingo programming tutorial

At present, Qingguo runtime system has included sample programs such as Bell_state, GHZ, VQE, etc. Details can be found here.

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

quingo-0.3.1.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

quingo-0.3.1-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file quingo-0.3.1.tar.gz.

File metadata

  • Download URL: quingo-0.3.1.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for quingo-0.3.1.tar.gz
Algorithm Hash digest
SHA256 7f76f340e3993498f97fe73ccdc31b186f6f5823dc19d2f03cb9d5a44e774d74
MD5 e64809c06bcc7136960366baa5329876
BLAKE2b-256 fe4a148a9e5c16a549eb97c5e0453def14200d93fe8a869337bc0d9502bfea14

See more details on using hashes here.

File details

Details for the file quingo-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: quingo-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for quingo-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7aad5f6f8b8e0841e1f23f31d90eaee871e54a0259657415e46b6025cbbd7a93
MD5 83920d2a4deb0c883875b68a003250c4
BLAKE2b-256 c8c1f7be18d15f27ad16a59ec42b911ec1857a4714d57742dd0e78b5673d43e8

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