WarOS Quantum Simulator & Post-Quantum Cryptography — Python SDK
Project description
WarOS - Quantum Computing & Post-Quantum Cryptography for Python
High-performance quantum circuit simulation and post-quantum cryptography, powered by Rust.
Install
pip install waros
Quick Start
import waros
circuit = waros.Circuit(2)
circuit.h(0)
circuit.cnot(0, 1)
circuit.measure_all()
simulator = waros.Simulator(seed=42)
result = simulator.run(circuit, shots=10_000)
print(result)
print(circuit.stats())
print(circuit.draw())
Realistic Noise
noise = waros.NoiseModel.ibm()
simulator = waros.Simulator(seed=42, noise=noise)
result = simulator.run(circuit, shots=10_000)
result.histogram()
Post-Quantum Cryptography
from waros import crypto
pk, sk = crypto.kem_keygen()
ct, shared_secret_a = crypto.kem_encapsulate(pk)
shared_secret_b = crypto.kem_decapsulate(sk, ct)
assert shared_secret_a == shared_secret_b
pk, sk = crypto.sign_keygen()
signature = crypto.sign(sk, b"Hello WarOS")
assert crypto.verify(pk, b"Hello WarOS", signature)
digest = crypto.sha3_256(b"WarOS")
random_data = crypto.random_bytes(32)
OpenQASM Support
qasm_source = """
OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
creg c[2];
h q[0];
cx q[0], q[1];
measure q[0] -> c[0];
measure q[1] -> c[1];
"""
circuit = waros.parse_qasm(qasm_source)
result = waros.Simulator(seed=42).run(circuit, shots=1_000)
Notebook and Compatibility Helpers
from waros.compat import QuantumCircuit
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])
result = qc.run(shots=1_000)
display(result)
One-Line Algorithm Demos
bell = waros.algorithms.run_bell_state(shots=1_000, seed=42)
grover = waros.algorithms.run_grover(shots=1_000, seed=42)
teleport = waros.algorithms.run_teleport(state_theta=1.047, shots=1_000, seed=42)
factors = waros.algorithms.shor_factor(15, seed=42)
energy = waros.algorithms.vqe_hydrogen(max_iterations=30, seed=42)
Part of the WarOS hybrid quantum-classical operating system project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file waros-0.2.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: waros-0.2.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 984.5 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
420d1d7398e5f3554a632815419e38a9e360fbacb08c91a389feed722133fab5
|
|
| MD5 |
ecf9900b82451e46d51496e9f336e5ef
|
|
| BLAKE2b-256 |
dba9bf5beec7376d686b71ec83fc3de8bc5d40429ebdc006ea75f625cb7e960f
|
Provenance
The following attestation bundles were made for waros-0.2.0-cp39-abi3-win_amd64.whl:
Publisher:
ci.yml on WarEnterprise/waros
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
waros-0.2.0-cp39-abi3-win_amd64.whl -
Subject digest:
420d1d7398e5f3554a632815419e38a9e360fbacb08c91a389feed722133fab5 - Sigstore transparency entry: 1156225349
- Sigstore integration time:
-
Permalink:
WarEnterprise/waros@ec2fe9b873ff932102cf2380ae9c7d799aaeacce -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/WarEnterprise
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@ec2fe9b873ff932102cf2380ae9c7d799aaeacce -
Trigger Event:
release
-
Statement type:
File details
Details for the file waros-0.2.0-cp39-abi3-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: waros-0.2.0-cp39-abi3-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.9+, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3818598db4b7bc9c7f2f08366152e38f191b799b59d16834f8385577626c5fb
|
|
| MD5 |
2d831d7a13342de5faef9c20ec678218
|
|
| BLAKE2b-256 |
a5e1db675499c5a45ebffd9997080f1dda8fddd578ff1cfe1ff6ccae0d0ad33d
|
Provenance
The following attestation bundles were made for waros-0.2.0-cp39-abi3-manylinux_2_35_x86_64.whl:
Publisher:
ci.yml on WarEnterprise/waros
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
waros-0.2.0-cp39-abi3-manylinux_2_35_x86_64.whl -
Subject digest:
c3818598db4b7bc9c7f2f08366152e38f191b799b59d16834f8385577626c5fb - Sigstore transparency entry: 1156225345
- Sigstore integration time:
-
Permalink:
WarEnterprise/waros@ec2fe9b873ff932102cf2380ae9c7d799aaeacce -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/WarEnterprise
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@ec2fe9b873ff932102cf2380ae9c7d799aaeacce -
Trigger Event:
release
-
Statement type:
File details
Details for the file waros-0.2.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: waros-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e59747b304578760029067276850af26c7c4b3c74d6cd2799635cca6534e14ed
|
|
| MD5 |
6c014abada09c89837b41693b1580162
|
|
| BLAKE2b-256 |
07ca1ad4e66e91a8d7cab6e76bd7b803f737ca9fc6ef93e25bf578c3862147bb
|
Provenance
The following attestation bundles were made for waros-0.2.0-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
ci.yml on WarEnterprise/waros
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
waros-0.2.0-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
e59747b304578760029067276850af26c7c4b3c74d6cd2799635cca6534e14ed - Sigstore transparency entry: 1156225343
- Sigstore integration time:
-
Permalink:
WarEnterprise/waros@ec2fe9b873ff932102cf2380ae9c7d799aaeacce -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/WarEnterprise
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@ec2fe9b873ff932102cf2380ae9c7d799aaeacce -
Trigger Event:
release
-
Statement type: