Skip to main content

quantrs2_sim/pennylane/
mod.rs

1//! PennyLane device backend for QuantRS2.
2//!
3//! This module provides a JSON-protocol device that PennyLane can call to
4//! execute quantum circuits on QuantRS2's state-vector simulator.
5//!
6//! ## Usage (from Python via PyO3 or via the Rust API)
7//!
8//! ```no_run
9//! use quantrs2_sim::pennylane::device::{PennyLaneCircuit, QuantRS2Device};
10//!
11//! let device = QuantRS2Device::new();
12//! let json = r#"{"num_wires":2,"operations":[{"name":"Hadamard","wires":[0],"params":[]},{"name":"CNOT","wires":[0,1],"params":[]}],"observables":[]}"#;
13//! let result_json = device.execute_json(json).unwrap();
14//! ```
15
16pub mod device;
17pub mod wire;
18
19pub use device::{
20    DeviceError, PennyLaneCircuit, PennyLaneObservable, PennyLaneOperation, PennyLaneResult,
21    QuantRS2Device,
22};
23pub use wire::WireMap;