WarOS is a hybrid quantum-classical operating system project from War Enterprise. The repository runs entirely on classical hardware today and provides a validated quantum SDK, realistic noise simulation, an OpenQASM toolchain, a CLI, and post-quantum cryptography primitives.
kernel/Bare-metalno_stdkernel bootstrap for x86_64 using thebootloadercrate, with a framebuffer console, serial debug output, GDT/IDT/PIC setup, a bitmap frame allocator, a 4 MiB kernel heap, WarFS in-memory files, cooperative background tasks, COM2 serial networking primitives, WarShell commands, and a kernel-resident quantum simulator.crates/waros-quantumState-vector and MPS simulators, circuit builder, QFT, Monte Carlo noise, QEC helpers, Qiskit-compatibleOpenQASMimport support, an optional IBM Quantum Runtime hardware backend, advanced algorithms (QPE, Shor, VQE, QAOA, Simon, random walk), examples, and benchmarks.crates/waros-cliCommand-line interface for running QASM files, inspecting circuits, benchmarking, REPL usage, simulatedqstat, and IBM Quantum Runtime login/backends/run/status/result flows.crates/waros-cryptoML-KEM, ML-DSA / SLH-DSA wrappers viapqcrypto, SHA-3 / SHAKE helpers, and a simulated QRNG backed by the quantum SDK.crates/waros-pythonPyO3 + maturin bindings exposing the quantum simulator, IBM Quantum Runtime access, QASM utilities, a Qiskit-style compatibility layer, advanced algorithms, noise models, and post-quantum cryptography to Python aswaros.
git clone https://github.com/warenterprise/waros.git
cd waros
cargo test --workspace
cargo run --example noise_simulation
cargo run --example shor_demo
cargo run --example vqe_demo
cargo run --example qaoa_demo
cargo run --example pqc_demo
cargo run -p waros-cli -- qstat
cargo run -p waros-cli -- run examples/qasm/bell.qasm --shots 1000
cargo build -p waros-quantum --features ibm
cd crates/waros-python
maturin develop --release
python -c "import waros; print(waros.__version__)"The kernel is intentionally kept outside the Cargo workspace because it uses a custom no_std
target and nightly-only build settings.
cd kernel
cargo +nightly build --release --target x86_64-unknown-none
.\tools\create_image.ps1
.\tools\run_qemu.ps1On Linux/macOS:
cd kernel
cargo +nightly build --release --target x86_64-unknown-none
./tools/create_image.sh
./tools/run_qemu.shNotes:
kernel/tools/create_image.*produceskernel/target/waros.img(UEFI) andkernel/target/waros-bios.img.kernel/tools/run_qemu.*expectsqemu-system-x86_64inPATH.kernel/tools/run_qemu_pair.*prints a two-node COM2 serial-link setup fornet send,net qsend, andpingtesting.- Set
WAROS_OVMF_PATHon Windows orOVMF_PATHon Unix if the default OVMF firmware path does not exist. - In the shell,
help quantumlists the kernel quantum commands:qalloc,qrun,qstate,qmeasure,qcircuit,qsave,qexport,qresult, andqinfo. - WarFS system files are created automatically at boot:
/readme.txtand/sysinfo.txt.
use waros_quantum::{Circuit, NoiseModel, Simulator, WarosError};
fn main() -> Result<(), WarosError> {
let mut circuit = Circuit::new(2)?;
circuit.h(0)?;
circuit.cnot(0, 1)?;
circuit.measure_all()?;
let simulator = Simulator::builder()
.seed(42)
.noise(NoiseModel::ibm_like())
.build();
let result = simulator.run(&circuit, 10_000)?;
result.print_histogram();
Ok(())
}- Validated gate library with unitarity regression tests and normalization assertions.
- Shot-based execution and state-vector inspection.
- Built-in QFT / inverse QFT, circuit composition, depth analysis, and ASCII diagrams.
- Monte Carlo depolarizing, damping, phase, and readout noise profiles.
- Advanced algorithm demos and APIs for Quantum Phase Estimation, Shor factoring, VQE chemistry, QAOA MaxCut, Simon's algorithm, and quantum random walks.
- State-vector layout selection (
AoSorSoA) plus an MPS backend for low-entanglement larger-qubit workloads. OpenQASM2.0 parsing/serialization plus runnable QASM fixtures inexamples/qasm.- Qiskit-oriented import support including
u1/u2/u3, custom gates, conditionals, and a Python compatibility wrapper. - Feature-gated IBM Quantum Runtime hardware backend for Rust, Python, and CLI userspace execution.
- Quantum error-correction helpers with repetition-code and Steane-code circuit builders.
- Post-quantum cryptography using maintained
pqcryptocrates and SHA-3 / SHAKE. - Python bindings via PyO3 and maturin with
Circuit,Simulator,NoiseModel,QuantumResult, QASM helpers, awaros.cryptosubmodule, and awaros.algorithmssubmodule. - Python
IBMBackendbindings with saved-credential helpers for IBM Quantum Runtime jobs. - Python convenience helpers for circuit stats, notebook HTML rendering, and one-line Bell/Grover/teleport demos via
waros.algorithms. - Bootable x86_64 kernel bootstrap with framebuffer output, interrupt handling, memory initialization, PS/2 keyboard input, and a minimal interactive shell.
- Kernel-resident
no_stdquantum simulator with 18-qubit registers, shell-driven gate execution, state/probability inspection, histogram measurement, and built-in Bell/GHZ/Grover/teleport/QFT/Deutsch/Bernstein-Vazirani/superdense/Shor/VQE/QAOA demos. - Kernel WarFS commands (
ls,cat,write,rm,touch,stat,df), task commands (tasks,spawn,kill), and serial networking commands (net status,net send,net qsend,net listen,ping).
import waros
from waros import crypto
circuit = waros.Circuit(2)
circuit.h(0)
circuit.cnot(0, 1)
circuit.measure_all()
print(circuit.stats())
print(circuit.draw())
result = waros.Simulator(seed=42).run(circuit, shots=10_000)
print(result.counts)
public_key, secret_key = crypto.kem_keygen()
ciphertext, shared_secret_a = crypto.kem_encapsulate(public_key)
shared_secret_b = crypto.kem_decapsulate(secret_key, ciphertext)
assert shared_secret_a == shared_secret_b
shor = waros.algorithms.shor_factor(15, seed=42)
vqe = waros.algorithms.vqe_hydrogen(seed=42)
qaoa = waros.algorithms.qaoa_maxcut("square", seed=42)
bell = waros.algorithms.run_bell_state(shots=1_000, seed=42)IBM Quantum integration is userspace-only. The kernel remains simulation-only and does not perform HTTPS requests.
Current IBM Quantum Runtime authentication requires both an API key and a service CRN:
export WAROS_IBM_TOKEN="your-ibm-api-key"
export WAROS_IBM_INSTANCE_CRN="your-service-crn"
cargo run -p waros-cli -- ibm backends
cargo run -p waros-cli -- ibm run examples/qasm/bell.qasm --backend ibm_brisbane --shots 1000
cargo run -p waros-quantum --example ibm_real_hardware --features ibmimport waros
circuit = waros.Circuit(2)
circuit.h(0)
circuit.cnot(0, 1)
circuit.measure_all()
ibm = waros.IBMBackend(token="your-ibm-api-key", instance_crn="your-service-crn")
print(ibm.backends())
print(ibm.run(circuit, shots=1000, backend="ibm_brisbane"))cargo test --workspace
cargo clippy --workspace --all-targets -- -W clippy::all -W clippy::pedantic -A clippy::module_name_repetitions -A clippy::cast_possible_truncation
cargo doc --no-deps --workspace
cargo build --release --workspaceKernel validation:
cd kernel
cargo +nightly build --release --target x86_64-unknown-none
.\tools\create_image.ps1Apache-2.0