| Crates.io | quantrs2-symengine-pure |
| lib.rs | quantrs2-symengine-pure |
| version | 0.1.2 |
| created_at | 2026-01-10 15:24:52.021245+00 |
| updated_at | 2026-01-23 00:12:00.387031+00 |
| description | Pure Rust symbolic mathematics for quantum computing - a replacement for C++-based symengine |
| homepage | |
| repository | https://github.com/cool-japan/quantrs |
| max_upload_size | |
| id | 2034329 |
| size | 364,118 |
Pure Rust symbolic mathematics library for quantum computing.
quantrs2-symengine-pure provides symbolic computation capabilities for the QuantRS2 quantum computing framework. Unlike C++-based alternatives, this crate is implemented entirely in Rust, ensuring portability and seamless integration with the Rust ecosystem.
This crate uses egg (e-graphs good) for advanced expression simplification via equality saturation.
Add to your Cargo.toml:
[dependencies]
quantrs2-symengine-pure = "0.1.2"
use quantrs2_symengine_pure::Expression;
// Create symbolic expressions
let x = Expression::symbol("x");
let y = Expression::symbol("y");
// Perform operations
let expr = x.clone() * x.clone() + x.clone() * 2.0 * y.clone() + y.clone() * y.clone();
let expanded = expr.expand();
// Compute derivatives
let dx = expr.diff(&x);
println!("Expression: {}", expr);
println!("Derivative wrt x: {}", dx);
| Module | Description |
|---|---|
expr |
Core symbolic expression types |
diff |
Automatic differentiation |
eval |
Expression evaluation |
simplify |
Expression simplification |
optimization |
E-graph based optimization |
parser |
Parse strings to expressions |
matrix |
Symbolic matrix operations |
quantum |
Quantum-specific symbolic types |
cache |
Expression caching |
serialize |
Serialization support |
| Feature | Default | Description |
|---|---|---|
simd |
Yes | SIMD acceleration via scirs2-core |
parallel |
Yes | Parallel operations via scirs2-core |
serde |
No | Serialization support |
This crate follows QuantRS2/COOLJAPAN policies:
scirs2-core for complex numbers, arrays, and random generationoxicode for serialization (not bincode)This crate is part of the QuantRS2 quantum computing framework.
Licensed under either of:
at your option.
COOLJAPAN OU (Team Kitasan)