Metadata-Version: 2.4
Name: zentroq
Version: 0.4.0
Summary: ZentroQ SDK — certify quantum software releases from your Qrisp/Qiskit pipeline (a SecQDevOps MOD-08 service).
Author: SecQDevOps / ZentroQ
License: Apache-2.0
Project-URL: Homepage, https://certify.zortenet.eu
Keywords: quantum,qiskit,qrisp,compliance,certification,cra,qbom,sbom
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: quantum
Requires-Dist: qiskit<3,>=2.0; extra == "quantum"
Requires-Dist: qiskit-qasm3-import>=0.5; extra == "quantum"
Provides-Extra: qrisp
Requires-Dist: qrisp<1,>=0.8; extra == "qrisp"
Provides-Extra: cirq
Requires-Dist: cirq-core<2,>=1.4; extra == "cirq"
Provides-Extra: braket
Requires-Dist: amazon-braket-sdk<2,>=1.80; extra == "braket"
Provides-Extra: pennylane
Requires-Dist: pennylane<1,>=0.41; extra == "pennylane"
Provides-Extra: cudaq
Requires-Dist: cudaq<1,>=0.9; extra == "cudaq"
Provides-Extra: ibm
Requires-Dist: qiskit-ibm-runtime>=0.20; extra == "ibm"
Provides-Extra: verify
Requires-Dist: mqt.qcec>=3.0; extra == "verify"
Provides-Extra: sim
Requires-Dist: qiskit-aer>=0.15; extra == "sim"
Provides-Extra: qir
Requires-Dist: qdk<2,>=1.30; extra == "qir"
Requires-Dist: pyqir<1,>=0.10; extra == "qir"
Requires-Dist: qirrunner<1,>=0.9; extra == "qir"
Dynamic: license-file

# ZentroQ SDK

Certify a quantum software release straight from your **Qrisp / Qiskit / Cirq / Braket / PennyLane** pipeline.
Evidence is collected locally (your source never leaves the machine) and sent to
the ZentroQ service, which returns a signed, independently-verifiable CRA
certificate — also mirrored to `./.zentroq/<release>/`.

ZentroQ is a [SecQDevOps](https://certify.zortenet.eu) MOD-08 service.

## Install

```bash
pip install "zentroq[quantum]"     # Qiskit + OpenQASM3 evidence collection
# pip install "zentroq[quantum,qrisp]"   # also collect from Qrisp circuits
# pip install "zentroq[quantum,cirq]"    # Cirq   — likewise [braket], [pennylane], [cudaq] (Linux only)
# pip install "zentroq[quantum,ibm]"     # real IBM Runtime execution evidence
# pip install "zentroq[quantum,qir]"     # also emit QIR (QDK) and check it against the program (QNT-07)
# Each frontend extra pins the version range the conformance suite holds for
# (harness_manifest.json `requires`); `zentroq actions --framework <name>` shows
# the recorded run, or that conformance is still pending.
```

The core install is a lightweight, stdlib-only client; the `quantum` extra adds
the toolchain needed to build the evidence (QBOM).

## Use

Set your API key (generate it in the ZentroQ dashboard):

```bash
export ZENTROQ_API_KEY=zq_live_...
export ZENTROQ_API_URL=https://certify.zortenet.eu   # default
```

**Post-run call**

```python
import zentroq
result = zentroq.certify(my_circuit, release="portfolio-opt@1.2.3")
print(result["overall_status"], result["certificate"]["certificate_id"])
```

**Decorator** — certifies the circuit a function returns:

```python
@zentroq.certified(release="vqe@2.1")
def build(): ...   # returns a qiskit/qrisp circuit
```

**Qiskit primitive wrapper** — certify transparently on `.run()`:

```python
sampler = zentroq.wrap(SamplerV2(mode=backend), release="vqe@2.1")
job = sampler.run([circuit])   # certifies, then runs as normal
```

**CLI / CI**

```bash
zentroq certify --qpy circuit.qpy --release my-app@1.0 --mode gate
zentroq certify --qasm3 program.qasm3 --release my-app@1.0
zentroq certify --demo --release smoke-test     # needs the [qrisp] extra

# any supported framework, straight from your code (module:attr or file.py:attr;
# a function is called, an object such as a PennyLane QNode is passed as is)
zentroq certify --entry my_pkg.circuits:build --release my-app@1.0 --expect 10=1.0
```

`--mode gate` exits non-zero on a non-compliant release (use it to fail CI);
`--mode report` (default) never fails your pipeline. `--expect` outcomes are
read in your framework's own bit order (`--expected-order qiskit` to override).
For Qrisp that depends on what you hand over: a `QuantumCircuit` reads like
`run()` (qubit 0 rightmost), a `QuantumSession` like `get_measurement()` and a
Jasp program like `measure()` (qubit 0 leftmost) — declare what Qrisp shows you.

**Adding evidence from other modules** — collect, add, then certify the bundle:

```bash
zentroq collect --entry my_pkg.circuits:build --release my-app@1.0 --out bundle/
#   ... partner tools add their evidence to bundle/, and the release is signed
zentroq certify --bundle bundle/ --release my-app@1.0
```

In Python: `zentroq.collect(circuit, release=..., out_dir="bundle")`, then
`zentroq.certify(bundle="bundle", release=...)`.

**What can the harness do for me?**

```bash
zentroq actions --framework cirq          # every action, its status for Cirq, how to turn it on
zentroq actions --requirement CRA-II-3    # which actions produce evidence for this requirement
```

Answered offline from the index shipped in the package — the same answer the
service gives at `GET /v1/harness`.

## Behaviour

- **Non-intrusive & fail-soft.** If the service is unreachable or credits are
  exhausted, a warning is logged and your quantum run continues. Certifying is
  additive (unless you opt into `gate` mode).
- **Privacy by design.** Only the QBOM/evidence (hashes, metrics, backend
  binding) is uploaded — not your program source.
- **Local mirror.** Every result is written to `./.zentroq/<release>/`
  (CSNAP, certificate, attestation, public key, verification) so you keep your
  own audit bundle and can re-verify offline.

| Env var | Purpose |
|---|---|
| `ZENTROQ_API_KEY` | your API key (required for actions) |
| `ZENTROQ_API_URL` | service base URL (default `https://certify.zortenet.eu`) |
