pub struct QMLAccelerator {
pub device: Arc<RwLock<dyn QuantumDevice + Send + Sync>>,
pub config: QMLConfig,
pub training_history: Vec<TrainingEpoch>,
pub model_registry: ModelRegistry,
pub hardware_manager: HardwareAccelerationManager,
pub is_connected: bool,
}Expand description
Quantum Machine Learning Accelerator
Fields§
§device: Arc<RwLock<dyn QuantumDevice + Send + Sync>>Quantum device backend
config: QMLConfigQML configuration
training_history: Vec<TrainingEpoch>Training history
model_registry: ModelRegistryModel registry
hardware_manager: HardwareAccelerationManagerHardware acceleration manager
is_connected: boolConnection status
Implementations§
Source§impl QMLAccelerator
impl QMLAccelerator
Sourcepub fn new(
device: Arc<RwLock<dyn QuantumDevice + Send + Sync>>,
config: QMLConfig,
) -> DeviceResult<Self>
pub fn new( device: Arc<RwLock<dyn QuantumDevice + Send + Sync>>, config: QMLConfig, ) -> DeviceResult<Self>
Create a new QML accelerator
Sourcepub async fn connect(&mut self) -> DeviceResult<()>
pub async fn connect(&mut self) -> DeviceResult<()>
Connect to quantum hardware
Sourcepub async fn disconnect(&mut self) -> DeviceResult<()>
pub async fn disconnect(&mut self) -> DeviceResult<()>
Disconnect from hardware
Sourcepub async fn train_model(
&mut self,
model_type: QMLModelType,
training_data: TrainingData,
validation_data: Option<TrainingData>,
) -> DeviceResult<TrainingResult>
pub async fn train_model( &mut self, model_type: QMLModelType, training_data: TrainingData, validation_data: Option<TrainingData>, ) -> DeviceResult<TrainingResult>
Train a quantum machine learning model
Sourcepub async fn inference(
&self,
model_id: &str,
input_data: InferenceData,
) -> DeviceResult<InferenceResult>
pub async fn inference( &self, model_id: &str, input_data: InferenceData, ) -> DeviceResult<InferenceResult>
Perform inference with a trained model
Sourcepub async fn optimize_parameters(
&mut self,
initial_parameters: Vec<f64>,
objective_function: Box<dyn ObjectiveFunction + Send + Sync>,
) -> DeviceResult<OptimizationResult>
pub async fn optimize_parameters( &mut self, initial_parameters: Vec<f64>, objective_function: Box<dyn ObjectiveFunction + Send + Sync>, ) -> DeviceResult<OptimizationResult>
Optimize quantum circuit parameters
Sourcepub async fn compute_gradients(
&self,
circuit: ParameterizedQuantumCircuit,
parameters: Vec<f64>,
) -> DeviceResult<Vec<f64>>
pub async fn compute_gradients( &self, circuit: ParameterizedQuantumCircuit, parameters: Vec<f64>, ) -> DeviceResult<Vec<f64>>
Compute gradients using quantum methods
Sourcepub fn get_training_statistics(&self) -> TrainingStatistics
pub fn get_training_statistics(&self) -> TrainingStatistics
Get training statistics
Sourcepub async fn export_model(
&self,
model_id: &str,
format: ModelExportFormat,
) -> DeviceResult<Vec<u8>>
pub async fn export_model( &self, model_id: &str, format: ModelExportFormat, ) -> DeviceResult<Vec<u8>>
Export trained model
Sourcepub async fn import_model(
&mut self,
model_data: Vec<u8>,
format: ModelExportFormat,
) -> DeviceResult<String>
pub async fn import_model( &mut self, model_data: Vec<u8>, format: ModelExportFormat, ) -> DeviceResult<String>
Import trained model
Sourcepub async fn get_acceleration_metrics(&self) -> HardwareAccelerationMetrics
pub async fn get_acceleration_metrics(&self) -> HardwareAccelerationMetrics
Get hardware acceleration metrics
Sourcepub async fn benchmark_performance(
&self,
model_type: QMLModelType,
problem_size: usize,
) -> DeviceResult<PerformanceBenchmark>
pub async fn benchmark_performance( &self, model_type: QMLModelType, problem_size: usize, ) -> DeviceResult<PerformanceBenchmark>
Benchmark quantum vs classical performance
Sourcepub async fn get_diagnostics(&self) -> QMLDiagnostics
pub async fn get_diagnostics(&self) -> QMLDiagnostics
Get QML accelerator diagnostics
Auto Trait Implementations§
impl Freeze for QMLAccelerator
impl !RefUnwindSafe for QMLAccelerator
impl Send for QMLAccelerator
impl Sync for QMLAccelerator
impl Unpin for QMLAccelerator
impl !UnwindSafe for QMLAccelerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.