quantrs2-sim 0.1.3

Quantum circuit simulators for the QuantRS2 framework
Documentation
//! Simple test for the stabilizer simulator

use quantrs2_sim::stabilizer::{StabilizerGate, StabilizerSimulator};

fn main() {
    println!("=== Testing Stabilizer Simulator ===\n");

    // Test 1: Bell State
    println!("1. Bell State:");
    let mut sim = StabilizerSimulator::new(2);
    sim.apply_gate(StabilizerGate::H(0))
        .expect("Failed to apply H gate");
    sim.apply_gate(StabilizerGate::CNOT(0, 1))
        .expect("Failed to apply CNOT gate");
    println!("Stabilizers: {:?}\n", sim.get_stabilizers());

    // Test 2: GHZ State
    println!("2. GHZ State:");
    let mut sim = StabilizerSimulator::new(3);
    sim.apply_gate(StabilizerGate::H(0))
        .expect("Failed to apply H gate");
    sim.apply_gate(StabilizerGate::CNOT(0, 1))
        .expect("Failed to apply CNOT gate");
    sim.apply_gate(StabilizerGate::CNOT(1, 2))
        .expect("Failed to apply CNOT gate");
    println!("Stabilizers: {:?}\n", sim.get_stabilizers());

    println!("=== Test Complete ===");
}