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)
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)
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 Distribution
waros-0.1.0.tar.gz
(51.9 kB
view details)
Built Distribution
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
waros-0.1.0-cp39-abi3-win_amd64.whl
(365.2 kB
view details)
File details
Details for the file waros-0.1.0.tar.gz.
File metadata
- Download URL: waros-0.1.0.tar.gz
- Upload date:
- Size: 51.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f08523e7e6bd401aa5d380bc9d7ec954c9d799cacc4b942b5e5b4c420a8658b5
|
|
| MD5 |
7ef2cce1fec6db5e3d4c871550ebfea1
|
|
| BLAKE2b-256 |
97dddd133182b843d597fbbfd5a97e1357a8999e73b58b3c86fd6cac0eb7d8ea
|
File details
Details for the file waros-0.1.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: waros-0.1.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 365.2 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
839e94ff634df9cee2fde52236e655685bf24989b9ef8a7afffc75645db8b7a9
|
|
| MD5 |
35f1114906b4dd8bb90d1ba6361adec8
|
|
| BLAKE2b-256 |
daba0bba879a7cbe29a00702b1c1f50f7e9debe8b9931d7eacf0336c0118d082
|