quantrs2_core/api/
prelude.rs

1//! Organized prelude modules for different use cases
2
3pub mod essentials {
4    //! Essential types for basic quantum programming
5    //!
6    //! This is the recommended starting point for most users.
7    //! Provides core types needed for basic quantum circuit programming.
8
9    // Fundamental quantum types
10    pub use crate::api::quantum::{GateOp, QubitId, Register};
11    pub use crate::api::quantum::{MeasurementOutcome, QuantumOperation};
12    pub use crate::api::quantum::{QuantRS2Error, QuantRS2Result};
13
14    // Basic mathematical operations
15    pub use crate::api::math::{tensor_product_many, DenseMatrix, QuantumMatrix};
16
17    // Essential synthesis tools
18    pub use crate::api::synthesis::{synthesize_unitary, SingleQubitDecomposition};
19
20    // Re-export num_complex for convenience
21    pub use scirs2_core::Complex64;
22}
23
24pub mod algorithms {
25    //! Complete API for quantum algorithm development
26    //!
27    //! Everything needed for developing quantum algorithms
28
29    pub use super::essentials::*;
30
31    // Variational algorithms
32    pub use crate::api::variational::*;
33
34    // Advanced algorithms
35    pub use crate::api::algorithms::*;
36
37    // Optimization tools
38    pub use crate::api::optimization::{OptimizationChain, OptimizationPass};
39
40    // ML integration
41    pub use crate::api::quantum_ml::*;
42
43    // Symbolic computation
44    pub use crate::api::symbolic::*;
45}
46
47pub mod hardware {
48    //! Hardware programming and device interfaces
49    //!
50    //! Types for programming quantum hardware
51
52    pub use super::essentials::*;
53
54    // Hardware interfaces
55    pub use crate::api::hardware::*;
56
57    // Backends and GPU support
58    pub use crate::api::backends::*;
59
60    // Error correction
61    pub use crate::api::error_correction::*;
62}
63
64pub mod research {
65    //! Advanced simulation and research tools
66    //!
67    //! Advanced features for quantum computing research
68
69    pub use super::algorithms::*;
70
71    // Tensor networks
72    pub use crate::api::tensor_networks::*;
73
74    // Topological computing
75    pub use crate::api::topological::*;
76
77    // Networking and distributed computing
78    pub use crate::api::networking::*;
79
80    // ZX-calculus
81    pub use crate::api::zx_calculus::*;
82
83    // Batch processing
84    pub use crate::api::batch::*;
85}
86
87pub mod dev_tools {
88    //! Developer tools and debugging utilities
89    //!
90    //! Tools for debugging and development
91
92    pub use super::essentials::*;
93
94    // Debugging and profiling
95    pub use crate::api::dev_tools::*;
96
97    // SciRS2 enhanced tools
98    pub use crate::api::scirs2::*;
99}
100
101#[cfg(feature = "python")]
102pub mod python {
103    //! Python integration (when feature enabled)
104    //!
105    //! Python bindings and Jupyter notebook integration
106
107    pub use crate::api::python::*;
108}
109
110#[deprecated(
111    since = "1.0.0",
112    note = "Use organized modules like `essentials`, `algorithms`, etc."
113)]
114pub mod legacy {
115    //! Legacy compatibility - provides the old flat API
116    //!
117    //! This module re-exports all types in the old flat structure
118    //! for backward compatibility. Use is discouraged for new code.
119    //!
120    //! This module provides the old flat API structure for compatibility.
121    //! New code should use the organized modules instead.
122
123    pub use crate::api::algorithms::*;
124    pub use crate::api::backends::*;
125    pub use crate::api::batch::*;
126    pub use crate::api::dev_tools::*;
127    pub use crate::api::error_correction::*;
128    pub use crate::api::hardware::*;
129    pub use crate::api::math::*;
130    pub use crate::api::networking::*;
131    pub use crate::api::optimization::*;
132    pub use crate::api::quantum::*;
133    pub use crate::api::quantum_ml::*;
134    pub use crate::api::scirs2::*;
135    pub use crate::api::symbolic::*;
136    pub use crate::api::synthesis::*;
137    pub use crate::api::tensor_networks::*;
138    pub use crate::api::topological::*;
139    pub use crate::api::variational::*;
140    pub use crate::api::zx_calculus::*;
141
142    #[cfg(feature = "python")]
143    pub use crate::api::python::*;
144}
145
146pub mod full {
147    //! Full API re-export (non-deprecated flat access)
148    //!
149    //! This provides access to all functionality in a flat namespace
150    //! while maintaining the new naming conventions.
151    //!
152    //! Complete API access with new naming conventions
153
154    pub use crate::api::algorithms::*;
155    pub use crate::api::backends::*;
156    pub use crate::api::batch::*;
157    pub use crate::api::dev_tools::*;
158    pub use crate::api::error_correction::*;
159    pub use crate::api::hardware::*;
160    pub use crate::api::math::*;
161    pub use crate::api::networking::*;
162    pub use crate::api::optimization::*;
163    pub use crate::api::quantum::*;
164    pub use crate::api::quantum_ml::*;
165    pub use crate::api::scirs2::*;
166    pub use crate::api::symbolic::*;
167    pub use crate::api::synthesis::*;
168    pub use crate::api::tensor_networks::*;
169    pub use crate::api::topological::*;
170    pub use crate::api::variational::*;
171    pub use crate::api::zx_calculus::*;
172
173    #[cfg(feature = "python")]
174    pub use crate::api::python::*;
175}