pub struct VqeOptimizer {
pub energy: Expression,
pub params: Vec<Expression>,
pub learning_rate: f64,
}Expand description
VQE optimizer state
Fields§
§energy: ExpressionEnergy expression (symbolic Hamiltonian expectation value)
params: Vec<Expression>Parameters
learning_rate: f64Learning rate
Implementations§
Source§impl VqeOptimizer
impl VqeOptimizer
Sourcepub fn new(
energy: Expression,
params: Vec<Expression>,
learning_rate: f64,
) -> Self
pub fn new( energy: Expression, params: Vec<Expression>, learning_rate: f64, ) -> Self
Create a new VQE optimizer
Sourcepub fn compute_gradient(
&self,
values: &HashMap<String, f64>,
) -> SymEngineResult<Vec<f64>>
pub fn compute_gradient( &self, values: &HashMap<String, f64>, ) -> SymEngineResult<Vec<f64>>
Compute gradient at current parameter values
Auto Trait Implementations§
impl Freeze for VqeOptimizer
impl RefUnwindSafe for VqeOptimizer
impl Send for VqeOptimizer
impl Sync for VqeOptimizer
impl Unpin for VqeOptimizer
impl UnwindSafe for VqeOptimizer
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> 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 more