Along with quingo compilers, the Quingo runtime system which provides users the capability to program and simulate Quingo programs.
The Quingo installation comprises of two main steps:
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.
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
quingo-compiler-0.1.4.sh -prefix=/home/user/.local
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.
class Quingo_task
:
called_qu_fn
: Path
,qu文件路径。called_func
: str
,调用 quingo 函数名。debug_mode
(optional): True
or False
。qisa
(optional): 前端指令集类型。backend
(optional): 后端模拟器类型。function compile()
:
Quingo_task
: 待编译 qu 任务params
: Quingo_task
中调用函数 called_func
所需参数qasm_fn
:输出对应指令集文件(.qcis / .qi)function execute()
:
qasm_fn
: Path
,对应指令集文件(.qcis / .qi)be_type
: BackendType
,模拟器后端类型exe_config
: 执行模式,ExeMode.SimShots
、ExeMode.SimFinalResult
、ExeMode.SimStateVector
sim_result
:具体输出格式详见src/quingo/backend/quingo_result_format_spec.md
At present, Qingguo runtime system has included sample programs such as Bell_state
, GHZ
, VQE
, etc. Details can be found here.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。