Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

waros-0.2.0-cp39-abi3-win_amd64.whl (984.5 kB view details)

Uploaded CPython 3.9+Windows x86-64

waros-0.2.0-cp39-abi3-manylinux_2_35_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.35+ x86-64

waros-0.2.0-cp39-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

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

Hashes for waros-0.2.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 420d1d7398e5f3554a632815419e38a9e360fbacb08c91a389feed722133fab5
MD5 ecf9900b82451e46d51496e9f336e5ef
BLAKE2b-256 dba9bf5beec7376d686b71ec83fc3de8bc5d40429ebdc006ea75f625cb7e960f

See more details on using hashes here.

Provenance

The following attestation bundles were made for waros-0.2.0-cp39-abi3-win_amd64.whl:

Publisher: ci.yml on WarEnterprise/waros

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file waros-0.2.0-cp39-abi3-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for waros-0.2.0-cp39-abi3-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 c3818598db4b7bc9c7f2f08366152e38f191b799b59d16834f8385577626c5fb
MD5 2d831d7a13342de5faef9c20ec678218
BLAKE2b-256 a5e1db675499c5a45ebffd9997080f1dda8fddd578ff1cfe1ff6ccae0d0ad33d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for waros-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e59747b304578760029067276850af26c7c4b3c74d6cd2799635cca6534e14ed
MD5 6c014abada09c89837b41693b1580162
BLAKE2b-256 07ca1ad4e66e91a8d7cab6e76bd7b803f737ca9fc6ef93e25bf578c3862147bb

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page