Skip to main content

QuantaKit SDK — Book Edition 1.0

PyPI Python Tests License

Build, simulate and run quantum circuits in Python. Everything runs offline on the built-in simulator — no account, no token, no quota. QuantaKit Cloud (https://quantakit.my) is optional.

pip install quantakit==1.0.0          # the exact version the book uses
pip install "quantakit[visualization]==1.0.0"   # + matplotlib plots
from quantakit import QuantumCircuit, transpile, LocalSimulator
from quantakit.primitives import Sampler

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()
print(qc.draw())

backend = LocalSimulator()                       # free, offline
job = Sampler(backend).run([transpile(qc, backend)], shots=4000, seed=7)
print(job.result()[0].data.meas.get_counts())     # {'00': ~2000, '11': ~2000}

Switch to the cloud by changing one line: backend = CloudService(token="qk_...").least_busy(min_qubits=2).

What's inside

Module Contents
quantakit QuantumCircuit, registers, Parameter, ParameterVector, transpile, LocalSimulator
quantakit.circuit.library Bell, GHZ, QFT, Grover, phase estimation, real_amplitudes ansatz
quantakit.quantum_info Statevector, DensityMatrix, Operator, SparsePauliOp, partial_trace, state_fidelity, entropy
quantakit.primitives Sampler (counts) and Estimator (expectation values) — local or cloud
quantakit.qasm3 / qasm2 OpenQASM import/export
quantakit.visualization text_histogram (no dependencies), plot_histogram, plot_bloch_multivector
quantakit.cloud CloudService for QuantaKit Cloud (optional)

Bit strings are written with the highest qubit on the left ("01" means q0 = 1, q1 = 0).

data.c or data.meas? The name after data. is the circuit's classical register: QuantumCircuit(2, 2) with qc.measure(...) gives data.c; qc.measure_all() gives data.meas. result[0].join_data().get_counts() works for both. See https://quantakit.my/docs#register-names.

Noise on QuantaKit Cloud (1.1+)

from quantakit.cloud import CloudService, NoiseModel
backend = CloudService().backend("qk-sim-density")        # density-matrix simulator with noise
backend.set_options(noise=NoiseModel(depolarizing_2q=0.05, readout=0.02))
result = Sampler(backend).run([qc], shots=1000, seed=7).result()[0]
result.metadata["fidelity"], result.metadata["purity"]

Details: https://quantakit.my/docs#noise. Offline, build noise by hand with DensityMatrix and Operator, or use LocalSimulator(readout_error=...).

Stability promise (Book Edition)

  • Version 1.0.0 is frozen for the book. Pin it: pip install quantakit==1.0.0. Version 1.1.0 adds cloud noise settings and runs all 1.0 code unchanged.
  • Every 1.x release keeps every documented 1.0 API working. Anything deprecated keeps working for at least two minor releases.
  • Breaking changes only happen in 2.0, which will be announced and will never replace 1.x on existing installs.

Documentation: https://quantakit.my/docs · Licence: Apache 2.0

Metadata

Release files for quantakit 1.1.0

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

Source distribution (sdist)

Source distribution for quantakit 1.1.0
File Size Uploaded Provenance Actions
quantakit-1.1.0.tar.gz 44.5 kB Without provenance Details for quantakit-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quantakit 1.1.0
File Interpreter ABI Platform Actions
quantakit-1.1.0-py3-none-any.whl Python 3 none any Details for quantakit-1.1.0-py3-none-any.whl

Total release size: 92.5 kB

Release files / quantakit-1.1.0.tar.gz

Download URL quantakit-1.1.0.tar.gz
Size 44.5 kB
Tags Source
SHA-256 checksum
How to use checksums
75a056e3862617dcc2a53e3567275636b19bca8e98e4b83d405cb724345063cd
BLAKE2b-256 checksum
How to use checksums
65d6cf2721bd0dde4a96a64ce1db98ac6d48d035958d2370ea96853a54dd5c0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / quantakit-1.1.0-py3-none-any.whl

Download URL quantakit-1.1.0-py3-none-any.whl
Size 48.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8745ca2cd9c2e8a1fe82a158c529c9347238e7247541e50425378143bfb0ed3c
BLAKE2b-256 checksum
How to use checksums
3a4a0c0d908ef6b91906e9552c3037de0e766f9067b3628bfd158c65ca333b0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for quantakit 1.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

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