Skip to main content

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:
git clone https://gitee.com/hpcl_quanta/tequila.git
git checkout xbackend
pip install -e .

git clone https://gitee.com/quingo/pyqcisim.git
git checkout bug-fix
pip install -e .

git clone https://gitee.com/quingo/SymQC.git
pip install -e .

Upon success, it will automatically install the Quingo runtime system (this package), the PyQCAS simulator and the PyQCISim 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

The Quingo_interface class expose the following methods:

  • set_log_level(<log_level>): <log_level> can be one of DEBUG, INFO, WARNING, ERROR, or CRITICAL.
  • connect_backend(<backend>): <backend> currently can be 'pyqcas_quantumsim' or 'pyqcisim_quantumsim'.
  • get_backend_name(): return the name of the backend that is being used. An empty string will be returned if no backend has been set.
  • get_last_qasm(): get the qasm code generated by the last execution.
  • config_execution(<mode>, <num_shots>):
    • Configure the execution mode to 'one_shot' or 'state_vector'.
    • When the execution mode is 'one_shot', the number of times to run the uploaded quantum circuit can be configured using the parameter num_shots at the same time.
  • call_quingo(<qg_filename>, <qg_func_name>, *args):
    • the main entry to call Quingo operation.
    • <qg_filename (str)> : the name of the Qingo file which contains the quantum function called by the host program.
    • <qg_func_name (str)> : the name of the quantum function
    • <args (dict)>: a variable length of parameters used to call the Quingo operation in the form qg_func_name(<args>).
  • read_result(): read the computation result from the quantum kernel.
    • For eQASM-based backend, the result is a binary block which encodes the quantum computation result.
    • For QCIS-based backend, the result format is defined by PyQCISim. Please refer to the docstring of quingo.if_backend.non_arch_backend.pyqcisim_quantumsim.PyQCISim_quantumsim::execute()

Quingo programming tutorial

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

Release files for quingo 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quingo 0.2.2
File Size Uploaded
quingo-0.2.2.tar.gz 24.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quingo 0.2.2
File Interpreter ABI Platform
quingo-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 54.5 kB

Release files / quingo-0.2.2.tar.gz

Download URL quingo-0.2.2.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
deb1b92f9e4dd6e08c0760a2c98a8e6e3cc476793f26fa7fb6be34392fc08601
BLAKE2b-256 checksum
How to use checksums
c2570d6a97e03a24fbdaeef4deaa53f966b6ac389d5f237dafdd51eaf6b082a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release files / quingo-0.2.2-py3-none-any.whl

Download URL quingo-0.2.2-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd54f55846599a3131ea70a22439d8bb4e441b17b792589a857d45a4d31fc658
BLAKE2b-256 checksum
How to use checksums
5604a5b9e9d7e37cf7c2c47f5c607c8b46fbb2dcbb6ba808770dcb1845c6fc28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page