quantrs2_device/ml_optimization/
features.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct FeatureExtractionConfig {
8 pub enable_syndrome_history: bool,
10 pub history_length: usize,
12 pub enable_spatial_features: bool,
14 pub enable_temporal_features: bool,
16 pub enable_correlation_features: bool,
18 pub enable_auto_extraction: bool,
20 pub circuit_features: CircuitFeatureConfig,
22 pub hardware_features: HardwareFeatureConfig,
24 pub temporal_features: TemporalFeatureConfig,
26 pub statistical_features: StatisticalFeatureConfig,
28 pub graph_features: GraphFeatureConfig,
30 pub feature_selection: FeatureSelectionConfig,
32 pub dimensionality_reduction: DimensionalityReductionConfig,
34}
35
36#[derive(Debug, Clone, Serialize, Deserialize)]
38pub struct CircuitFeatureConfig {
39 pub basic_properties: bool,
41 pub gate_distributions: bool,
43 pub depth_analysis: bool,
45 pub connectivity_patterns: bool,
47 pub entanglement_measures: bool,
49 pub symmetry_analysis: bool,
51 pub critical_path_analysis: bool,
53}
54
55#[derive(Debug, Clone, Serialize, Deserialize)]
57pub struct HardwareFeatureConfig {
58 pub topology_features: bool,
60 pub calibration_features: bool,
62 pub error_rate_features: bool,
64 pub timing_features: bool,
66 pub resource_features: bool,
68 pub environmental_features: bool,
70}
71
72#[derive(Debug, Clone, Serialize, Deserialize)]
74pub struct TemporalFeatureConfig {
75 pub time_series_analysis: bool,
77 pub trend_detection: bool,
79 pub seasonality_analysis: bool,
81 pub autocorrelation_features: bool,
83 pub fourier_features: bool,
85}
86
87#[derive(Debug, Clone, Serialize, Deserialize)]
89pub struct StatisticalFeatureConfig {
90 pub moment_features: bool,
92 pub distribution_fitting: bool,
94 pub correlation_features: bool,
96 pub outlier_features: bool,
98 pub normality_tests: bool,
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104pub struct GraphFeatureConfig {
105 pub centrality_measures: bool,
107 pub community_features: bool,
109 pub spectral_features: bool,
111 pub path_features: bool,
113 pub clustering_features: bool,
115}
116
117#[derive(Debug, Clone, Serialize, Deserialize)]
119pub struct FeatureSelectionConfig {
120 pub enable_selection: bool,
122 pub selection_methods: Vec<FeatureSelectionMethod>,
124 pub num_features: Option<usize>,
126 pub selection_threshold: f64,
128}
129
130#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
132pub enum FeatureSelectionMethod {
133 VarianceThreshold,
134 UnivariateSelection,
135 RecursiveFeatureElimination,
136 FeatureImportance,
137 MutualInformation,
138 CorrelationFilter,
139 LassoSelection,
140}
141
142#[derive(Debug, Clone, Serialize, Deserialize)]
144pub struct DimensionalityReductionConfig {
145 pub enable_reduction: bool,
147 pub reduction_methods: Vec<DimensionalityReductionMethod>,
149 pub target_dimensions: Option<usize>,
151 pub variance_threshold: f64,
153}
154
155#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
157pub enum DimensionalityReductionMethod {
158 PCA,
159 ICA,
160 LDA,
161 TSNE,
162 UMAP,
163 AutoEncoder,
164 VariationalAutoEncoder,
165}