v2DM-DOCI  1.0
simanneal::LocalMinimizer Class Reference

#include <LocalMinimizer.h>

+ Collaboration diagram for simanneal::LocalMinimizer:

Public Member Functions

 LocalMinimizer (const CheMPS2::Hamiltonian &)
 
 LocalMinimizer (CheMPS2::Hamiltonian &&)
 
virtual ~LocalMinimizer ()
 
int Minimize (bool dist_choice=false, int start_iters=0)
 
double get_energy () const
 
double calc_new_energy ()
 
double calc_new_energy (const CheMPS2::Hamiltonian &)
 
void calc_energy ()
 
simanneal::UnitaryMatrixget_Optimal_Unitary ()
 
CheMPS2::HamiltoniangetHam () const
 
OrbitalTransformgetOrbitalTf () const
 
doci2DM::MethodgetMethod () const
 
void UseBoundaryPoint ()
 
void UsePotentialReduction ()
 
doci2DM::PotentialReductiongetMethod_PR () const
 
doci2DM::BoundaryPointgetMethod_BP () const
 
std::vector< std::tuple< int, int, double, double > > scan_orbitals ()
 
double get_conv_crit () const
 
void set_conv_crit (double)
 
void set_conv_steps (int)
 
int choose_orbitalpair (std::vector< std::tuple< int, int, double, double >> &)
 
int Minimize_noOpt (double stopcrit)
 
int Minimize_hybrid ()
 

Private Attributes

double conv_crit
 criteria for convergence of the minimizer More...
 
double energy
 
int conv_steps
 number of steps in convergence area More...
 
std::unique_ptr< doci2DM::Methodmethod
 
std::unique_ptr< CheMPS2::Hamiltonianham
 Holds the current hamiltonian. More...
 
std::unique_ptr< simanneal::OrbitalTransformorbtrans
 the actual orbital transform More...
 
std::unique_ptr< simanneal::UnitaryMatrixopt_unitary
 the current unitary More...
 
std::mt19937 mt
 our pseudo-random generator More...
 
std::vector< int > allow_irreps
 only rotation within these irreps (if not empty) More...
 

Detailed Description

Definition at line 44 of file LocalMinimizer.h.

Constructor & Destructor Documentation

simanneal::LocalMinimizer::LocalMinimizer ( const CheMPS2::Hamiltonian mol)
Parameters
molthe molecular data to use

Definition at line 45 of file LocalMinimizer.cpp.

simanneal::LocalMinimizer::LocalMinimizer ( CheMPS2::Hamiltonian &&  mol)

Definition at line 103 of file LocalMinimizer.cpp.

simanneal::LocalMinimizer::~LocalMinimizer ( )
virtualdefault

Member Function Documentation

void simanneal::LocalMinimizer::calc_energy ( )

Calculate the energy with the current molecular data

Definition at line 134 of file LocalMinimizer.cpp.

double simanneal::LocalMinimizer::calc_new_energy ( )

Calculate the energy with the current molecular data

Definition at line 146 of file LocalMinimizer.cpp.

double simanneal::LocalMinimizer::calc_new_energy ( const CheMPS2::Hamiltonian new_ham)

Definition at line 156 of file LocalMinimizer.cpp.

int simanneal::LocalMinimizer::choose_orbitalpair ( std::vector< std::tuple< int, int, double, double >> &  orbs)

Choose a pair of orbitals to rotate over, according to the distribution of their relative energy change.

Parameters
orbsthe list returned by scan_orbitals()
Returns
the index of the pair of orbitals in orbs

Definition at line 439 of file LocalMinimizer.cpp.

double simanneal::LocalMinimizer::get_conv_crit ( ) const

Definition at line 418 of file LocalMinimizer.cpp.

double simanneal::LocalMinimizer::get_energy ( ) const
Returns
the real energy (calculated + nuclear repulsion)

Definition at line 125 of file LocalMinimizer.cpp.

simanneal::UnitaryMatrix & simanneal::LocalMinimizer::get_Optimal_Unitary ( )

Definition at line 164 of file LocalMinimizer.cpp.

CheMPS2::Hamiltonian & simanneal::LocalMinimizer::getHam ( ) const

Definition at line 169 of file LocalMinimizer.cpp.

doci2DM::Method & simanneal::LocalMinimizer::getMethod ( ) const

Definition at line 179 of file LocalMinimizer.cpp.

doci2DM::BoundaryPoint & simanneal::LocalMinimizer::getMethod_BP ( ) const

Return a reference to a BoundaryPoint object. Only works if the actual method is BoundaryPoint. You should always wrap this in a try/catch block and check for a std::bad_cast exception

Returns
BoundaryPoint object of the current method

Definition at line 203 of file LocalMinimizer.cpp.

doci2DM::PotentialReduction & simanneal::LocalMinimizer::getMethod_PR ( ) const

Return a reference to a PotentialReduction object. Only works if the actual method is PotentialReduction. You should always wrap this in a try/catch block and check for a std::bad_cast exception

Returns
PotentialReduction object of the current method

Definition at line 190 of file LocalMinimizer.cpp.

simanneal::OrbitalTransform & simanneal::LocalMinimizer::getOrbitalTf ( ) const

Definition at line 174 of file LocalMinimizer.cpp.

int simanneal::LocalMinimizer::Minimize ( bool  dist_choice = false,
int  start_iters = 0 
)

Do the local minimization

Parameters
dist_choiceif set to true, we use choose_orbitals to choose which pair of orbitals to use (instead of the lowest one)
start_itersstart number the iterations from this number (defaults to 0)

Definition at line 275 of file LocalMinimizer.cpp.

+ Here is the call graph for this function:

int simanneal::LocalMinimizer::Minimize_hybrid ( )
int simanneal::LocalMinimizer::Minimize_noOpt ( double  stopcrit)

Definition at line 462 of file LocalMinimizer.cpp.

std::vector< std::tuple< int, int, double, double > > simanneal::LocalMinimizer::scan_orbitals ( )

Definition at line 220 of file LocalMinimizer.cpp.

void simanneal::LocalMinimizer::set_conv_crit ( double  crit)

Definition at line 423 of file LocalMinimizer.cpp.

void simanneal::LocalMinimizer::set_conv_steps ( int  steps)

Definition at line 428 of file LocalMinimizer.cpp.

void simanneal::LocalMinimizer::UseBoundaryPoint ( )

Definition at line 210 of file LocalMinimizer.cpp.

void simanneal::LocalMinimizer::UsePotentialReduction ( )

Definition at line 215 of file LocalMinimizer.cpp.

Member Data Documentation

std::vector<int> simanneal::LocalMinimizer::allow_irreps
private

only rotation within these irreps (if not empty)

Definition at line 118 of file LocalMinimizer.h.

double simanneal::LocalMinimizer::conv_crit
private

criteria for convergence of the minimizer

Definition at line 96 of file LocalMinimizer.h.

int simanneal::LocalMinimizer::conv_steps
private

number of steps in convergence area

Definition at line 101 of file LocalMinimizer.h.

double simanneal::LocalMinimizer::energy
private

Definition at line 98 of file LocalMinimizer.h.

std::unique_ptr<CheMPS2::Hamiltonian> simanneal::LocalMinimizer::ham
private

Holds the current hamiltonian.

Definition at line 106 of file LocalMinimizer.h.

std::unique_ptr<doci2DM::Method> simanneal::LocalMinimizer::method
private

Definition at line 103 of file LocalMinimizer.h.

std::mt19937 simanneal::LocalMinimizer::mt
private

our pseudo-random generator

Definition at line 115 of file LocalMinimizer.h.

std::unique_ptr<simanneal::UnitaryMatrix> simanneal::LocalMinimizer::opt_unitary
private

the current unitary

Definition at line 112 of file LocalMinimizer.h.

std::unique_ptr<simanneal::OrbitalTransform> simanneal::LocalMinimizer::orbtrans
private

the actual orbital transform

Definition at line 109 of file LocalMinimizer.h.


The documentation for this class was generated from the following files: