ObjectiveFunction

Trait ObjectiveFunction 

Source
pub trait ObjectiveFunction: Send + Sync {
    // Required methods
    fn evaluate(&self, parameters: &[f64]) -> DeviceResult<f64>;
    fn gradient(&self, parameters: &[f64]) -> DeviceResult<Option<Vec<f64>>>;
    fn metadata(&self) -> HashMap<String, String>;
}
Expand description

Objective function trait for quantum optimization

Required Methods§

Source

fn evaluate(&self, parameters: &[f64]) -> DeviceResult<f64>

Evaluate the objective function

Source

fn gradient(&self, parameters: &[f64]) -> DeviceResult<Option<Vec<f64>>>

Compute gradients (if available)

Source

fn metadata(&self) -> HashMap<String, String>

Get function metadata

Implementors§