Skip to content

Nickpanek/cqs-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cqs-rs

A friendly quantum circuit simulator for everyone, written in Rust.

Features

  • 🚀 Sparse state tracking for efficient simulation
  • 🎲 Reproducible results with seed support
  • 🔧 State constraints (Hamming weight, parity)
  • 📊 Automatic telemetry logging
  • 🌫️ Noise models (dephasing, depolarizing, amplitude damping)

Installation

cargo build --release

Quick Start

Create a circuit file bell_state.json:

[
  {"op": "init", "n": 2},
  {"op": "h", "q": 0},
  {"op": "cnot", "ctrl": 0, "tgt": 1},
  {"op": "measure", "qubits": [0, 1]}
]

Run it:

./target/release/cqs run --program bell_state.json --shots 100

Example Circuits

Bell State (Entanglement)

Creates two entangled qubits - always measures 00 or 11, never mixed states!

GHZ State

[
  {"op": "init", "n": 3},
  {"op": "h", "q": 0},
  {"op": "cnot", "ctrl": 0, "tgt": 1},
  {"op": "cnot", "ctrl": 1, "tgt": 2},
  {"op": "measure", "qubits": [0, 1, 2]}
]

Deterministic Simulation

Use seeds for reproducible results:

[
  {
    "op": "init",
    "n": 3,
    "seed_hex": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
  },
  {"op": "h", "q": 0},
  {"op": "measure", "qubits": [0, 1, 2]}
]

Documentation

Full documentation available at: https://www.patternripple.com/cqs_rs_docs.html

Supported Gates

  • Single-qubit: H, X, Y, Z, RX, RY, RZ
  • Two-qubit: CNOT, CZ
  • Measurement and postselection
  • Noise models (dephasing, depolarizing, amplitude damping)

Benchmarking

cargo run --release --bin cqs_bench

License

MIT License - See LICENSE file for details


Developed by PatternRipple.com Labs • Created by Nick Panek

About

A friendly quantum circuit simulator in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages