Metadata-Version: 2.4
Name: pyquantumkit-run
Version: 0.1.0
Summary: A cross-platform executor for quantum circuits and programs written by PyQuantumKit, supporting mainstream quantum cloud platforms.
Author-email: Wei Sun <sunwei@ihep.ac.cn>, Peixun Long <longpx@ihep.ac.cn>
License: MIT
Project-URL: Homepage, https://pyquantumkit.readthedocs.io/
Project-URL: Repository, https://github.com/hiquarc/pyquantumkit-run
Project-URL: Documentation, https://pyquantumkit.readthedocs.io/
Keywords: quantum cloud
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: pyquantumkit>=0.2.1
Provides-Extra: qiskit
Requires-Dist: qiskit; extra == "qiskit"
Requires-Dist: qiskit-aer; extra == "qiskit"
Provides-Extra: pyqpanda3
Requires-Dist: pyqpanda3; extra == "pyqpanda3"
Provides-Extra: quafu
Requires-Dist: pyquafu; extra == "quafu"
Provides-Extra: quafu-sdk
Requires-Dist: quafu-sdk; extra == "quafu-sdk"
Provides-Extra: cqlib
Requires-Dist: cqlib; extra == "cqlib"
Provides-Extra: iqm
Requires-Dist: iqm-client[qiskit]; extra == "iqm"
Provides-Extra: openquantum
Requires-Dist: openquantum-sdk; extra == "openquantum"
Provides-Extra: wuyue
Requires-Dist: wuyue; extra == "wuyue"
Requires-Dist: qiskit; extra == "wuyue"

# pyquantumkit-run

[English](README.md) | [简体中文](README.zh-CN.md)

A cross-platform executor for quantum circuits and programs written with PyQuantumKit, supporting mainstream quantum cloud platforms.

## Write Once, Run Anywhere

pyquantumkit-run provides a unified `run()` method. At runtime, it reads command-line arguments such as `-provider`, `-backend`, and `-shots`, so you can switch between local simulators and quantum processing units (QPUs) without modifying your program:

```python
import pyquantumkit as PQK
from pqk_run import run

circuit = PQK.CircuitIO(2, 2)
PQK.apply_gate(circuit, 'H', [0])
PQK.apply_gate(circuit, 'CX', [0, 1])
PQK.apply_measure(circuit, [0, 1], [0, 1])

result = run(circuit)
print(result.counts)
```

Run with the Qiskit or Quafu local simulator:

```sh
python test.py -provider qiskit -backend local -shots 1024
python test.py -provider quafu -backend local -shots 1024
```

To use the Origin Quantum or Quafu cloud platform, first set `PK_API_KEY`, then specify the provider and QPU name:

```sh
export PK_API_KEY=xxx
python test.py -provider originq -backend WK_C180
python test.py -provider quafu -backend Shenglian
```

You can also read the API key from a file using `-api-key-file <path>`. Before submitting a cloud job, the program calls the corresponding platform's API to query currently available devices. If the name specified by `-backend` does not exist, it reports an error and lists the available names without submitting the job.

Run `python test.py -h` to view all runtime arguments. You can also explicitly pass `provider`, `backend`, `shots`, `api_key`, and `api_key_file` in your code; explicit arguments take precedence over command-line arguments.
