1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Allow HashMap without generic hasher for simpler API
//! # QuantRS2 SymEngine Pure
//!
//! A pure Rust symbolic mathematics library for quantum computing.
//!
//! This crate provides symbolic computation capabilities without any C/C++ dependencies,
//! using [egg](https://egraphs-good.github.io/) for e-graph based simplification and
//! optimization.
//!
//! ## Features
//!
//! - **Pure Rust**: No C/C++ dependencies, fully portable
//! - **Symbolic Expressions**: Create and manipulate symbolic mathematical expressions
//! - **Automatic Differentiation**: Compute symbolic gradients and Hessians
//! - **E-Graph Optimization**: Advanced expression simplification via equality saturation
//! - **Quantum Computing**: Specialized support for quantum gates, operators, and states
//! - **SciRS2 Integration**: Seamless integration with the SciRS2 scientific computing ecosystem
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! 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);
//! ```
//!
//! ## Policy Compliance
//!
//! This crate follows the QuantRS2 policies:
//! - **Pure Rust Policy**: No C/C++/Fortran dependencies
//! - **SciRS2 Policy**: Uses `scirs2_core` for complex numbers, arrays, and random generation
//! - **COOLJAPAN Policy**: Uses `oxicode` for serialization (not bincode)
//! - **No unwrap Policy**: All fallible operations return Result types
// Re-export main types
pub use ;
pub use Expression;
pub use SymbolicMatrix;
// Re-export SciRS2 types for convenience (following SciRS2 POLICY)
pub use Complex64;
/// Library version
pub const VERSION: &str = env!;
/// Check if the library is available (always true for pure Rust implementation)
pub const
/// Check if this is the pure Rust implementation
pub const