Skip to main content

pennylane-zksf

CI PyPI Python PennyLane License: MIT DOI Quantum computing mobile app on Google Play

A PennyLane device for the ZKSF quantum simulation service.

Run PennyLane circuits past the ~30-qubit statevector wall, and get an accuracy statement with every approximate result rather than a bare number.

pip install pennylane-zksf
import pennylane as qml

dev = qml.device("zksf.simulator", wires=3, shots=1024, token=YOUR_TOKEN)

@qml.qnode(dev)
def ghz():
    qml.Hadamard(0)
    qml.CNOT([0, 1])
    qml.CNOT([1, 2])
    return qml.counts()

ghz()              # {'000': 512, '111': 512}
dev.error_info()   # how far that result can be from the truth

Your token is on the dashboard at app.zksf.org. It can also come from the ZKSF_TOKEN environment variable.

Why run here

default.qubit is faster for small circuits and costs nothing, so use it. This device is for the two things it cannot do:

  • Reach. Stabilizer circuits at thousands of qubits, tensor networks past 100, Pauli propagation for expectation values at ~200. An exact statevector stops around 30 because the memory doubles per qubit.
  • Evidence. Every approximate run reports a measured error bound under the open ZCC-v0.1 protocol, and any finished job can be exported as a certificate that anyone can check with zcc-verify without an account and without calling this service.

Engines

Leave engine unset and a rule-based router picks the cheapest one that fits. Name it to pin the choice:

engine qubits returns
exact.cpu 30 counts, exact
exact.gpu 32 counts, exact
clifford 5000 counts, exact (Clifford gates only)
mps.quimb.cpu 128 counts, with a certified error bound
mps.aer.cpu 128 counts, with a certified error bound
pauli.cpu 200 expectation values only
noisy.cpu 20 counts, with device-noise modelling

An oversized circuit is refused before it is submitted, not after it is billed.

Real quantum hardware

Name a processor the same way. These run on the machine rather than a model of it, and are billed at the provider's list price:

engine qubits processor
qpu.rigetti 108 Rigetti Cepheus-1-108Q, superconducting
qpu.iqm.emerald 54 IQM Emerald, superconducting
qpu.ionq 36 IonQ Forte Enterprise 1, trapped ion
qpu.iqm.garnet 20 IQM Garnet, superconducting
qpu.aqt.ibex 12 AQT IBEX Q1, trapped ion
dev = qml.device("zksf.simulator", wires=2, shots=1000,
                 engine="qpu.iqm.garnet", token=TOKEN)

Hardware results carry a ZHF-v0.1 fidelity rather than a simulation error bound, readable through dev.error_info() like any other run. The service also offers neutral-atom and photonic processors, which take pulse sequences and linear optics rather than gate circuits, so they are reachable from qsim-sdk and not from a PennyLane device.

Batching

PennyLane hands execute a sequence of tapes whenever it broadcasts or differentiates. Those go to the service as one request, not one per tape:

from pennylane.tape import QuantumScript

tapes = [QuantumScript(ops(v), [qml.counts()], shots=1024) for v in values]
dev.execute(tapes)      # one round trip

This matters more than it looks. A round trip to the service is on the order of a second, so a sweep issued one point at a time spends most of its wall clock waiting rather than simulating.

Measurements

qml.counts, qml.sample, qml.probs and qml.expval of a Pauli observable. One measurement per circuit.

qml.expval needs an engine that computes expectation values, so an unpinned device routes those runs to pauli.cpu. Pinning a counts-only engine and asking for an expectation raises rather than returning a plausible-looking zero.

No gradients

supports_derivatives() returns False, deliberately. Each execution is a billed cloud job, so differentiating through it would issue shifted tapes and spend money without the cost being visible. PennyLane falls back to its own gradient handling. Compute gradients on a local device and use this one for the runs that need the reach or the bound.

Licence

MIT

Metadata

Release files for pennylane-zksf 0.2.1

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

Source distribution (sdist)

Source distribution for pennylane-zksf 0.2.1
File Size Uploaded Provenance Actions
pennylane_zksf-0.2.1.tar.gz 15.7 kB With provenance Details for pennylane_zksf-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pennylane-zksf 0.2.1
File Interpreter ABI Platform Actions
pennylane_zksf-0.2.1-py3-none-any.whl Python 3 none any Details for pennylane_zksf-0.2.1-py3-none-any.whl

Total release size: 27.4 kB

Release files / pennylane_zksf-0.2.1.tar.gz

Download URL pennylane_zksf-0.2.1.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cb9d7bc95e2ec223045ef2ac5e5a1912ff25f1777c093d9d4a48ff6194fc72ea
BLAKE2b-256 checksum
How to use checksums
bf9087edc130b9056dd0440eb944c56cb8cb8140235ec5d707e90885734a56c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / pennylane_zksf-0.2.1-py3-none-any.whl

Download URL pennylane_zksf-0.2.1-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
113d75467aeaa3a5fd5d390233c51ebe052adb6a307d152289e04921a37f47e7
BLAKE2b-256 checksum
How to use checksums
95e9c594c42cc5010ff3a72d95ecc8f3482464a2f3e6095f18f1a2df88cbd017
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for pennylane-zksf 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pennylane_zksf-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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