Welcome to QPanda3 Runtime#
QPanda3 Runtime is a tool package for Origin Quantum’s real quantum computing services, providing a concise and efficient programming interface for submitting and managing quantum computing tasks (sampling tasks and expectation estimation tasks). By encapsulating and optimizing the underlying quantum computing workflow, QPanda3 Runtime can significantly reduce the cost of quantum application development and execution overhead, allowing researchers and developers to focus more on the algorithms themselves rather than the infrastructure.
In iterative variational quantum algorithms (such as VQE, QAOA) and quantum multi-objective decision-making scenarios that require frequent interaction with quantum devices, QPanda3 Runtime can provide a smooth development experience and efficient execution performance.
QPanda3 Runtime also provides a series of utility tools to enhance the user experience: FakeBackend can perform pre-validation before submitting tasks to real quantum computers, helping users quickly troubleshoot compilation issues of quantum circuits; flexible credential management mechanisms simplify the workflow of credential updates in large-scale systems; Tracker and CheckPoint functions support tracking the task execution process and saving state, facilitating debugging and recovering long-running computing tasks.
Quick Start#
Installation#
pip install qpanda3-runtime
Example#
Define and submit an expectation estimation task.
from qpanda3_runtime import RuntimeService
from pyqpanda3.core import *
from pyqpanda3.hamiltonian import Hamiltonian
# Login is performed when generating the RuntimeService object
service = RuntimeService()
service.login('your_valid_api_key')
# Design/Define quantum circuit
prog = QProg()
prog << X(0)<<CNOT(0,1)
ham = Hamiltonian([('XZ', [0, 1], 3.14),('XZ', [0, 1], 1.14), ('ZY', [0, 1], 5.14)])
# Use RuntimeService.estimate to generate a local management object task for the computing task
task = service.estimate(
circuit_with_observable=(prog,ham),
# For QPU, use RuntimeService.device interface to return the device object, the parameter is the QPU id
device=service.device('WK_C180'),
)
# Query computing task execution result
res = task.get_result_sync()
print(f'res:{res}')
Example Output
res:[[-0.18844]]
License#
Copyright © 2026 Origin Quantum. All rights reserved.
Licensed under the Apache 2.0.