pub struct VariationalQuantumEigensolver {
pub hamiltonian: Array2<Complex<f64>>,
pub ansatz: VariationalCircuit,
pub energy_history: Vec<f64>,
pub gradient_history: Vec<Vec<f64>>,
pub tolerance: f64,
pub max_iterations: usize,
/* private fields */
}Expand description
Variational Quantum Eigensolver (VQE) with improved optimization
Fields§
§hamiltonian: Array2<Complex<f64>>Hamiltonian to diagonalize
ansatz: VariationalCircuitAnsatz circuit
energy_history: Vec<f64>Energy history
gradient_history: Vec<Vec<f64>>Gradient history
tolerance: f64Convergence tolerance
max_iterations: usizeMaximum iterations
Implementations§
Source§impl VariationalQuantumEigensolver
impl VariationalQuantumEigensolver
Sourcepub fn new(
hamiltonian: Array2<Complex<f64>>,
ansatz: VariationalCircuit,
learning_rate: f64,
tolerance: f64,
max_iterations: usize,
) -> Self
pub fn new( hamiltonian: Array2<Complex<f64>>, ansatz: VariationalCircuit, learning_rate: f64, tolerance: f64, max_iterations: usize, ) -> Self
Create a new VQE instance
Sourcepub fn optimize(&mut self) -> QuantRS2Result<f64>
pub fn optimize(&mut self) -> QuantRS2Result<f64>
Run VQE optimization to find ground state energy
Sourcepub fn get_optimal_parameters(&self) -> FxHashMap<String, f64>
pub fn get_optimal_parameters(&self) -> FxHashMap<String, f64>
Get the optimized parameters
Sourcepub fn get_ground_state(&self) -> QuantRS2Result<Array1<Complex<f64>>>
pub fn get_ground_state(&self) -> QuantRS2Result<Array1<Complex<f64>>>
Get the final ground state
Trait Implementations§
Source§impl Clone for VariationalQuantumEigensolver
impl Clone for VariationalQuantumEigensolver
Source§fn clone(&self) -> VariationalQuantumEigensolver
fn clone(&self) -> VariationalQuantumEigensolver
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 moreAuto Trait Implementations§
impl Freeze for VariationalQuantumEigensolver
impl !RefUnwindSafe for VariationalQuantumEigensolver
impl Send for VariationalQuantumEigensolver
impl Sync for VariationalQuantumEigensolver
impl Unpin for VariationalQuantumEigensolver
impl !UnwindSafe for VariationalQuantumEigensolver
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.