pub struct HybridOptimizationProblem<const N: usize> {
pub quantum_circuits: Vec<ParameterizedQuantumComponent<N>>,
pub classical_steps: Vec<ClassicalProcessingStep>,
pub data_flow: DataFlowGraph,
pub global_parameters: Vec<f64>,
pub objective: ObjectiveFunction,
}Expand description
A hybrid quantum-classical optimization problem
This combines quantum circuits with classical processing steps, allowing for co-optimization of both quantum parameters and classical algorithms.
Fields§
§quantum_circuits: Vec<ParameterizedQuantumComponent<N>>Quantum circuit components
classical_steps: Vec<ClassicalProcessingStep>Classical processing steps
data_flow: DataFlowGraphData flow between quantum and classical components
global_parameters: Vec<f64>Global optimization parameters
objective: ObjectiveFunctionObjective function for optimization
Implementations§
Source§impl<const N: usize> HybridOptimizationProblem<N>
impl<const N: usize> HybridOptimizationProblem<N>
Sourcepub fn add_quantum_component(
&mut self,
id: String,
circuit: Circuit<N>,
parameter_indices: Vec<usize>,
) -> QuantRS2Result<()>
pub fn add_quantum_component( &mut self, id: String, circuit: Circuit<N>, parameter_indices: Vec<usize>, ) -> QuantRS2Result<()>
Add a quantum circuit component
Sourcepub fn add_classical_step(
&mut self,
id: String,
step_type: ClassicalStepType,
inputs: Vec<String>,
outputs: Vec<String>,
) -> QuantRS2Result<()>
pub fn add_classical_step( &mut self, id: String, step_type: ClassicalStepType, inputs: Vec<String>, outputs: Vec<String>, ) -> QuantRS2Result<()>
Add a classical processing step
Sourcepub fn add_data_flow(
&mut self,
source: String,
target: String,
data_type: DataType,
) -> QuantRS2Result<()>
pub fn add_data_flow( &mut self, source: String, target: String, data_type: DataType, ) -> QuantRS2Result<()>
Add data flow edge between components
Sourcepub fn set_global_parameters(&mut self, parameters: Vec<f64>)
pub fn set_global_parameters(&mut self, parameters: Vec<f64>)
Set global parameters
Sourcepub fn add_regularization(
&mut self,
reg_type: RegularizationType,
strength: f64,
parameter_indices: Vec<usize>,
) -> QuantRS2Result<()>
pub fn add_regularization( &mut self, reg_type: RegularizationType, strength: f64, parameter_indices: Vec<usize>, ) -> QuantRS2Result<()>
Add regularization term
Sourcepub fn validate(&self) -> QuantRS2Result<()>
pub fn validate(&self) -> QuantRS2Result<()>
Validate the optimization problem
Trait Implementations§
Source§impl<const N: usize> Clone for HybridOptimizationProblem<N>
impl<const N: usize> Clone for HybridOptimizationProblem<N>
Source§fn clone(&self) -> HybridOptimizationProblem<N>
fn clone(&self) -> HybridOptimizationProblem<N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const N: usize> Debug for HybridOptimizationProblem<N>
impl<const N: usize> Debug for HybridOptimizationProblem<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for HybridOptimizationProblem<N>
impl<const N: usize> !RefUnwindSafe for HybridOptimizationProblem<N>
impl<const N: usize> Send for HybridOptimizationProblem<N>
impl<const N: usize> Sync for HybridOptimizationProblem<N>
impl<const N: usize> Unpin for HybridOptimizationProblem<N>
impl<const N: usize> !UnwindSafe for HybridOptimizationProblem<N>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<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.