LBFGS

Struct LBFGS 

Source
pub struct LBFGS { /* private fields */ }
Expand description

L-BFGS (Limited-memory BFGS) optimizer.

A quasi-Newton method that approximates the inverse Hessian using a limited number of past gradient differences.

§Best For

  • Smooth, well-conditioned objectives
  • VQE with hardware-efficient ansätze
  • When second-order information is beneficial

Implementations§

Source§

impl LBFGS

Source

pub fn new() -> Self

Create a new L-BFGS optimizer.

Source

pub fn with_memory_size(self, size: usize) -> Self

Set the memory size (number of past gradients to store).

Source

pub fn with_learning_rate(self, lr: f64) -> Self

Set the learning rate (step size multiplier).

Source

pub fn with_convergence(self, criteria: ConvergenceCriteria) -> Self

Set convergence criteria.

Source

pub fn minimize<F: ObjectiveFunction>( &self, objective: &F, initial_params: &[f64], ) -> Result<OptimizationResult, OptimizerError>

Minimize an objective function.

Trait Implementations§

Source§

impl Default for LBFGS

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Optimizer for LBFGS

Source§

fn step( &self, params: &mut [f64], gradients: &[f64], _iteration: usize, ) -> Result<(), OptimizerError>

Perform a single optimization step. Read more
Source§

fn name(&self) -> &str

Get the optimizer name.
Source§

fn reset(&mut self)

Reset internal state (for optimizers with momentum).
Source§

fn current_learning_rate(&self, _iteration: usize) -> f64

Get current learning rate (may be adaptive).

Auto Trait Implementations§

§

impl !Freeze for LBFGS

§

impl RefUnwindSafe for LBFGS

§

impl Send for LBFGS

§

impl Sync for LBFGS

§

impl Unpin for LBFGS

§

impl UnwindSafe for LBFGS

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V