GetDensFromFock Class Reference

GetDensFromFock class containing parameters and functions for computing density matrix. More...

#include <GetDensFromFock.h>

List of all members.

Public Member Functions

void create_checkpoint (symmMatrix &Finput, symmMatrix &F_ort_prev, generalVector *eigVecLUMO, generalVector *eigVecHOMO, std::string IDstr)
 Function save all needed data to files in order to repeat recursive expansion in a desired SCF cycle later.
 GetDensFromFock ()
int get_dens_from_fock (symmMatrix &Finput, symmMatrix &resultDens, symmMatrix &F_ort_prev, generalVector *eigVecLUMO=0, generalVector *eigVecHOMO=0)
 Choose which method to use for computing the density matrix from Fock matrix.
int get_dens_from_fock_sparse (symmMatrix &F, symmMatrix &resultDens, symmMatrix &F_ort_prev, generalVector *eigVecLUMO=0, generalVector *eigVecHOMO=0)
 Use recursive expansion for computing the density matrix from Fock matrix.
void clean_eigs_intervals ()
 Set bounds for HOMO and LUMO eigenvalues to -/+ inf, thus remove any known bounds.
void set_SCF_step (int step)
void unset_SCF_step ()
void set_generate_figures (std::string str="")
 Plot figures from the recursive expansion.
void unset_generate_figures ()
 Do not plot figures from the recursive expansion.
void set_general_params (const int n_, mat::SizesAndBlocks const &matrixSizesAndBlocks_)
void set_cht_matrix_params (const int leavesSizeMax_, const int blocksize_)
void get_SizesAndBlocks (mat::SizesAndBlocks &matrixSizesAndBlocks_) const
void set_truncationNormPurification (mat::normType const truncationNormPurification_)
 Set truncation norm used in the recursive expansion.
void set_stopCriterionNormPurification (mat::normType const stopCriterionNormPurification_)
 Set stopping criterion norm used in the recursive expansion.
void do_restricted_calculations ()
void do_unrestricted_calculations ()
void set_no_occupied_orbs (int noOfOccupiedOrbs_)
void clean_puri_stats ()
void set_invCholFactor (triangMatrix const &invCholFactor_, ergo_real invCholFactor_euclnorm_)
void set_gap_expected_lower_bound (ergo_real gap_expected_lower_bound_)
void set_purification_maxmul (ergo_real purification_maxmul_)
 Set maximum allowed number of iterations in recursive expansion.
int get_purification_create_m_files () const
void set_purification_create_m_files ()
void unset_purification_create_m_files ()
int get_output_homo_and_lumo_eigenvectors () const
void set_output_homo_and_lumo_eigenvectors ()
void unset_output_homo_and_lumo_eigenvectors ()
int get_purification_ignore_failure () const
void set_purification_ignore_failure ()
void unset_purification_ignore_failure ()
int get_use_rand_perturbation_for_alleigsint () const
void set_purification_use_rand_perturbation_for_alleigsint ()
void unset_purification_use_rand_perturbation_for_alleigsint ()
int get_use_diagonalization () const
void set_use_diagonalization ()
void unset_use_diagonalization ()
int get_use_purification () const
void set_use_purification ()
void unset_use_purification ()
int get_use_diag_on_error_guess () const
void set_use_diag_on_error_guess ()
void unset_use_diag_on_error_guess ()
int get_use_diag_on_error () const
void set_use_diag_on_error ()
void unset_use_diag_on_error ()
std::string get_stats_prefix () const
void set_stats_prefix (std::string stats_prefix_)
void unset_stats_prefix ()
int get_use_acceleration () const
void set_use_acceleration ()
void unset_use_acceleration ()
int get_use_new_stopping_criterion () const
void set_use_new_stopping_criterion ()
void unset_use_new_stopping_criterion ()
int get_store_all_eigenvalues_to_file () const
void set_store_all_eigenvalues_to_file ()
void unset_store_all_eigenvalues_to_file ()
int get_save_permuted_F_matrix_in_bin ()
void set_save_permuted_F_matrix_in_bin ()
void unset_save_permuted_F_matrix_in_bin ()
int get_puri_compute_eigv_in_each_iteration ()
void set_puri_compute_eigv_in_each_iteration ()
void unset_puri_compute_eigv_in_each_iteration ()
int get_run_shift_and_square_method_on_F ()
void set_run_shift_and_square_method_on_F ()
void unset_run_shift_and_square_method_on_F ()
int get_try_eigv_on_next_iteration_if_fail ()
void set_try_eigv_on_next_iteration_if_fail ()
void unset_try_eigv_on_next_iteration_if_fail ()
int get_use_prev_vector_as_initial_guess ()
void set_use_prev_vector_as_initial_guess ()
void unset_use_prev_vector_as_initial_guess ()
void set_diagonalization_params (ergo_real electronicTemperature_, symmMatrix &overlapMatrix_)
void set_overlapMatrix (symmMatrix &overlapMatrix_)
void set_purification_limits (ergo_real subspaceErrorLimit_, ergo_real eigvalueErrorLimit_=0, ergo_real puri_eig_acc_factor_for_guess=0)
void set_eigvalueErrorLimit (ergo_real eigvalueErrorLimit_)
 Set maximum allowed error in eigenvalues of the density matrix.
void set_subspaceErrorLimit (ergo_real subspaceErrorLimit_)
 Set maximum allowed error in invariant subspaces of the density matrix.
void set_puri_eig_acc_factor_for_guess (ergo_real puri_eig_acc_factor_for_guess_)
 Set puri_eig_acc_factor_for_guess parameter.
ergo_real get_result_entropy_term () const
void get_puri_stats (std::map< std::string, double > &puri_stats_) const
void set_eigs_Fprev (intervalType &homoInterval_Finput_, intervalType &lumoInterval_Finput_)
void get_eigs_Fprev (intervalType &homoInterval_Finput_, intervalType &lumoInterval_Finput_) const
void set_eigs_F_ort_prev (intervalType &homoInterval_F_ort_prev_, intervalType &lumoInterval_F_ort_prev_)
void get_eigs_F_ort_prev (intervalType &homoInterval_F_ort_prev_, intervalType &lumoInterval_F_ort_prev_) const
ergo_real get_eigvalueErrorLimit () const
ergo_real get_subspaceErrorLimit () const
ergo_real get_puri_eig_acc_factor_for_guess () const
void compute_eigenvectors (std::string eigenvectors_method_, std::string eigenvectors_iterative_method_, ergo_real eigensolver_accuracy_, int eigensolver_maxiter_, int use_prev_vector_as_initial_guess_, int try_eigv_on_next_iteration_if_fail_)
void compute_eigenvectors_extra (int puri_compute_eigv_in_each_iteration_, int run_shift_and_square_method_on_F_)

Static Public Member Functions

static void restore_from_checkpoint (GetDensFromFock &DensFromFock, symmMatrix &Finput, symmMatrix &F_ort_prev, generalVector *eigVecLUMO, generalVector *eigVecHOMO, std::string checkpoint_path, std::string IDstr, int SCF_step)
 Function restores data from files in order to repeat recursive expansion in a desired SCF cycle.

Static Public Attributes

static const int UNDEF_VALUE = -1
static const int UNDEF_VALUE_UINT = -1
static const ergo_real UNDEF_VALUE_REAL = -1
static const std::string UNDEF_VALUE_STRING = ""
static const int SET = 1
static const int UNSET = 0

Private Attributes

int SCF_step
int use_diagonalization
 Flag to turn on diagonalization.
int use_purification
 Flag to turn on purification.
int store_all_eigenvalues_to_file
 Store eigenvalues to the file when doing diagonalization.
int try_eigv_on_next_iteration_if_fail
 For square method: if eigenvector is not computed in iteration i, try to compute it in iteration i+1.
ergo_real electronicTemperature
 Electronic temperature.
ergo_real gap_expected_lower_bound
 Expected lower bound for the gap to be used in early iterations.
ergo_real eigvalueErrorLimit
 Tolerated deviation of eigenvalues from 0 and 1 in the computed density matrix.
ergo_real subspaceErrorLimit
 Tolerated error in the occupied subspace as measured by the sinus of the largest canonical angle.
ergo_real puri_eig_acc_factor_for_guess
 With this number will be multiplied the tolerated deviation of eigenvalues from 0 and 1 in the computed density matrix for the initial guess density matrix.
int use_diag_on_error
 Flag to fall back on diagonalization if purification fails.
int use_diag_on_error_guess
int create_m_files
 Flag to create m-files with information about the purification process.
int output_homo_and_lumo_eigenvectors
 Compute homo and lumo eigenvectors and write them to the file.
int use_prev_vector_as_initial_guess
 Use eigenvector from the previous SCF cycle as an initial guess in this cycle.
int puri_compute_eigv_in_each_iteration
 Compute eigenvectors in each iteration of the recursive expansion.
int run_shift_and_square_method_on_F
 (for comparison) Run shift_and_square method to get eigenvectors of the matrix F for various shifts.
int save_permuted_F_matrix_in_bin
 Save sparse matrix F into bin file in the current permutation of rows and columns.
int ignore_purification_failure
 Continue even if purification fails to converge.
int use_rand_perturbation_for_alleigsint
 Apply a random perturbation to (try to) improve the convergence speed of Lanczos calculation of extremal eigenvalues.
std::string stats_prefix
 Prefix to be added to statistics files.
int plot_puri_results
 Plot results of the purification from this function call.
std::string plot_puri_results_str
int use_acceleration
 Use acceleration in the purification.
int use_new_stopping_criterion
 Use new parameterless stopping criterion.
std::string eigenvectors_method
 Method for computing eigenvectors: square or projection.
std::string eigenvectors_iterative_method
 Iterative method for computing eigenvectors: power or lanczos.
ergo_real eigensolver_accuracy
 The accuracy for the eigenvalue problem solver.
int eigensolver_maxiter
 Maximum number of iterations for the eigenvalue problem solver.
int n
 System size.
int noOfOccupiedOrbs
 Number of occupied orbitals.
ergo_real factor
 Factor to scale the resulting density matrix.
symmMatrix overlapMatrix
 Overlap matrix (written to file).
symmMatrix D_ort_prev
 Density matrix from previous SCF cycle (written to file).
triangMatrix invCholFactor
 Inverse Cholesky factor (written to file).
ergo_real invCholFactor_euclnorm
 Euclidean norm of inverse Cholesky factor.
mat::normType truncationNormPurification
 Norm to be used for truncation.
mat::normType stopCriterionNormPurification
 Norm to be used for stopping criterion.
int maxMul
 Maximum allowed number of matrix multiplications in the purification.
mat::SizesAndBlocks matrixSizesAndBlocks
 Information about HML matrix block sizes etc.
int leavesSizeMax
 Information about leavesSizeMax and blocksize for CHTMatrix.
int blocksize
 Information about leavesSizeMax and blocksize for CHTMatrix.
intervalType homoInterval_Finput
intervalType lumoInterval_Finput
intervalType homoInterval_F_ort_prev
intervalType lumoInterval_F_ort_prev
ergo_real resultEntropyTerm
std::map< std::string, double > puri_stats
const char * filenameFinput
const char * filenameF_ort_prev
const char * filenameeigVecLUMO
const char * filenameeigVecHOMO
const char * filenameOverlap
const char * filenameD_ort_prev
const char * filenameinvCholFactor
const char * file_for_basic_types

Detailed Description

GetDensFromFock class containing parameters and functions for computing density matrix.

Flags are set to undefined value by default. User should define them explicitly, otherwise exception is thrown if undefined flag is used.


Constructor & Destructor Documentation

GetDensFromFock::GetDensFromFock (  )  [inline]

Member Function Documentation

void GetDensFromFock::clean_eigs_intervals (  )  [inline]
void GetDensFromFock::clean_puri_stats (  )  [inline]
void GetDensFromFock::compute_eigenvectors ( std::string  eigenvectors_method_,
std::string  eigenvectors_iterative_method_,
ergo_real  eigensolver_accuracy_,
int  eigensolver_maxiter_,
int  use_prev_vector_as_initial_guess_,
int  try_eigv_on_next_iteration_if_fail_ 
) [inline]
void GetDensFromFock::compute_eigenvectors_extra ( int  puri_compute_eigv_in_each_iteration_,
int  run_shift_and_square_method_on_F_ 
) [inline]
void GetDensFromFock::create_checkpoint ( symmMatrix Finput,
symmMatrix F_ort_prev,
generalVector eigVecLUMO,
generalVector eigVecHOMO,
std::string  IDstr 
)

Function save all needed data to files in order to repeat recursive expansion in a desired SCF cycle later.

The purpose of the function is mainly testing.

Parameters:
[in] Finput Effective Hamiltonian matrix (written to file)
[in,out] F_ort_prev Input: Previous F matrix in orthogonal basis. (written to file) Output: New F matrix in orthogonal basis ( ZT*Finput*Z ). (written to file)
[out] eigVecLUMO LUMO eigenvector
[out] eigVecHOMO HOMO eigenvector
[in] IDstr File identificator; added to the name of each file

References blocksize, mat::FileWritable::copyToFile(), create_m_files, eigensolver_accuracy, eigensolver_maxiter, eigenvectors_iterative_method, eigenvectors_method, eigvalueErrorLimit, electronicTemperature, mat::euclNorm, factor, file_for_basic_types, filenameeigVecHOMO, filenameeigVecLUMO, filenameF_ort_prev, filenameFinput, filenameinvCholFactor, filenameOverlap, mat::frobNorm, gap_expected_lower_bound, mat::SizesAndBlocks::getBlockSizeVector(), homoInterval_F_ort_prev, homoInterval_Finput, ignore_purification_failure, invCholFactor, invCholFactor_euclnorm, mat::VectorGeneral< Treal, Tvector >::is_empty(), leavesSizeMax, mat::Interval< Treal >::low(), lumoInterval_F_ort_prev, lumoInterval_Finput, matrixSizesAndBlocks, maxMul, mat::mixedNorm, n, noOfOccupiedOrbs, output_homo_and_lumo_eigenvectors, overlapMatrix, plot_puri_results, plot_puri_results_str, mat::FileWritable::readFromFile(), SCF_step, SET, stats_prefix, stopCriterionNormPurification, store_all_eigenvalues_to_file, subspaceErrorLimit, truncationNormPurification, try_eigv_on_next_iteration_if_fail, mat::Interval< Treal >::upp(), use_acceleration, use_diag_on_error, use_diag_on_error_guess, use_diagonalization, use_new_stopping_criterion, use_prev_vector_as_initial_guess, use_purification, use_rand_perturbation_for_alleigsint, and mat::FileWritable::writeToFile().

Referenced by SCF_restricted::get_new_density_matrix().

void GetDensFromFock::do_restricted_calculations (  )  [inline]
void GetDensFromFock::do_unrestricted_calculations (  )  [inline]

References factor.

Referenced by SCF_unrestricted::SCF_unrestricted().

int GetDensFromFock::get_dens_from_fock ( symmMatrix Finput,
symmMatrix resultDens,
symmMatrix F_ort_prev,
generalVector eigVecLUMO = 0,
generalVector eigVecHOMO = 0 
)

Choose which method to use for computing the density matrix from Fock matrix.

Possible alternatives:

  • use recursive expansion
  • use diagonalization
Parameters:
[in] Finput Effective Hamiltonian matrix. (written to file)
[out] resultDens Density matrix. (written to file)
[in,out] F_ort_prev Input: Previous F matrix in orthogonal basis. (written to file) Output: New F matrix in orthogonal basis ( ZT*Finput*Z ). (written to file)
[out] eigVecLUMO LUMO eigenvector
[out] eigVecHOMO HOMO eigenvector

References mat::VectorGeneral< Treal, Tvector >::assign_from_full(), do_output(), electronicTemperature, factor, get_dens_from_fock_full(), get_dens_from_fock_sparse(), LOG_AREA_DENSFROMF, LOG_CAT_ERROR, LOG_CAT_INFO, matrixSizesAndBlocks, n, noOfOccupiedOrbs, overlapMatrix, Util::TimeMeter::print(), resultEntropyTerm, SET, store_all_eigenvalues_to_file, subspaceErrorLimit, UNDEF_VALUE, use_diag_on_error, use_diagonalization, and mat::FileWritable::writeAndReadAll().

Referenced by SCF_restricted::disturb_dens_matrix_exact_try(), SCF_restricted::disturb_fock_matrix(), get_HML_dens_matrix(), SCF_unrestricted::get_new_density_matrix(), SCF_restricted::get_new_density_matrix(), SCF_unrestricted::get_starting_guess_density(), SCF_restricted::get_starting_guess_density(), and load_density_and_project_sparse().

int GetDensFromFock::get_dens_from_fock_sparse ( symmMatrix F,
symmMatrix resultDens,
symmMatrix F_ort_prev,
generalVector eigVecLUMO = 0,
generalVector eigVecHOMO = 0 
)

Use recursive expansion for computing the density matrix from Fock matrix.

Construct approximation of the step function by recursive application of low order polynomials. Sparsity is preserved using truncation (see J. Chem. Phys. 128, 074106, 2008), which can be done using spectral, Frobenius or mixed norms (see J. Comput. Chem. 30.6 (2009): 974-977.).

Possible alternatives (use_acceleration parameter):

  • SP2 recursive expansion
  • SP2 accelerated recursive expansion
Parameters:
[in] F Effective Hamiltonian matrix. (written to file)
[out] resultDens Density matrix. (written to file)
[in,out] F_ort_prev Input: Previous F matrix in orthogonal basis. (written to file) Output: New F matrix in orthogonal basis ( ZT*Finput*Z ). (written to file)
[out] eigVecLUMO HOMO eigenvector
[out] eigVecHOMO HOMO eigenvector

References PuriInfo::accumulated_error_subspace, blocksize, PurificationGeneral< MatrixType >::clear(), PurificationGeneral< MatrixType >::compute_eigenvectors_without_diagonalization_on_F(), PuriInfo::converged, do_output(), eigensolver_accuracy, eigensolver_maxiter, eigenvectors_iterative_method, eigenvectors_method, PuriInfo::eigValHOMO, PuriInfo::eigValLUMO, eigvalueErrorLimit, mat::euclNorm, factor, mat::frobNorm, gap_expected_lower_bound, PurificationGeneral< MatrixType >::gen_matlab_file_eigs(), PurificationGeneral< MatrixType >::gen_matlab_file_nnz(), PurificationGeneral< MatrixType >::gen_matlab_file_norm_diff(), PurificationGeneral< MatrixType >::gen_matlab_file_threshold(), PurificationGeneral< MatrixType >::gen_matlab_file_time(), get_eucl_diff_with_adapted_accuracy(), get_machine_epsilon(), mat::getNormTypeString(), mat::Params::getNProcs(), mat::FileWritable::getStatsCountCopyAndAssign(), mat::FileWritable::getStatsCountRead(), mat::FileWritable::getStatsCountWrite(), mat::FileWritable::getStatsTimeCopyAndAssign(), mat::FileWritable::getStatsTimeRead(), mat::FileWritable::getStatsTimeWrite(), PuriInfo::homo_eigensolver_iter, PuriInfo::homo_eigensolver_time, PuriInfo::homo_eigenvector_is_computed, PuriInfo::homo_eigenvector_is_computed_in_iter, PuriInfo::homo_estim_low_F, PuriInfo::homo_estim_upp_F, homoInterval_F_ort_prev, homoInterval_Finput, ignore_purification_failure, mat::Interval< Treal >::increase(), PurificationGeneral< MatrixType >::info, PurificationGeneral< MatrixType >::initialize(), mat::Interval< ergo_real >::intersect(), invCholFactor, mat::VectorGeneral< Treal, Tvector >::is_empty(), leavesSizeMax, LOG_AREA_DENSFROMF, LOG_CAT_ERROR, LOG_CAT_INFO, LOG_CAT_TIMINGS, LOG_CAT_WARNING, mat::Interval< Treal >::low(), PuriInfo::lumo_eigensolver_iter, PuriInfo::lumo_eigensolver_time, PuriInfo::lumo_eigenvector_is_computed, PuriInfo::lumo_eigenvector_is_computed_in_iter, PuriInfo::lumo_estim_low_F, PuriInfo::lumo_estim_upp_F, lumoInterval_F_ort_prev, lumoInterval_Finput, maxMul, mat::mixedNorm, n, noOfOccupiedOrbs, output_current_memory_usage(), output_homo_and_lumo_eigenvectors, plot_puri_results, plot_puri_results_str, Util::TimeMeter::print(), PuriInfo::print_collected_info(), puri_compute_eigv_in_each_iteration, puri_stats, PurificationGeneral< MatrixType >::PurificationStart(), mat::FileWritable::resetStats(), run_shift_and_square_method_on_F, save_permuted_F_matrix_in_bin, SCF_step, SET, PurificationGeneral< MatrixType >::set_compute_eigenvectors_in_each_iteration(), PurificationGeneral< MatrixType >::set_eigenvectors_params(), set_stopCriterionNormPurification(), set_truncationNormPurification(), stats_prefix, stopCriterionNormPurification, subspaceErrorLimit, template_blas_fabs(), template_blas_sqrt(), mat::Gblas::time, mat::Gblas::timekeeping, PuriInfo::total_it, PuriInfo::total_time, mat::trace(), transform_matrix_from_to(), mat::transpose(), truncationNormPurification, try_eigv_on_next_iteration_if_fail, UNDEF_VALUE, UNDEF_VALUE_REAL, UNDEF_VALUE_UINT, UNIT_one_eV, UNSET, mat::Interval< Treal >::upp(), use_acceleration, use_new_stopping_criterion, use_prev_vector_as_initial_guess, write_matrix_to_bin(), mat::FileWritable::writeAndReadAll(), and PurificationGeneral< MatrixType >::X.

Referenced by get_dens_from_fock().

void GetDensFromFock::get_eigs_F_ort_prev ( intervalType homoInterval_F_ort_prev_,
intervalType lumoInterval_F_ort_prev_ 
) const [inline]
void GetDensFromFock::get_eigs_Fprev ( intervalType homoInterval_Finput_,
intervalType lumoInterval_Finput_ 
) const [inline]
ergo_real GetDensFromFock::get_eigvalueErrorLimit (  )  const [inline]
int GetDensFromFock::get_output_homo_and_lumo_eigenvectors (  )  const [inline]
int GetDensFromFock::get_puri_compute_eigv_in_each_iteration (  )  [inline]
ergo_real GetDensFromFock::get_puri_eig_acc_factor_for_guess (  )  const [inline]
void GetDensFromFock::get_puri_stats ( std::map< std::string, double > &  puri_stats_  )  const [inline]
int GetDensFromFock::get_purification_create_m_files (  )  const [inline]

References create_m_files, and SET.

int GetDensFromFock::get_purification_ignore_failure (  )  const [inline]

References ignore_purification_failure, and SET.

ergo_real GetDensFromFock::get_result_entropy_term (  )  const [inline]
int GetDensFromFock::get_run_shift_and_square_method_on_F (  )  [inline]
int GetDensFromFock::get_save_permuted_F_matrix_in_bin (  )  [inline]
void GetDensFromFock::get_SizesAndBlocks ( mat::SizesAndBlocks matrixSizesAndBlocks_  )  const [inline]
Parameters:
[out] matrixSizesAndBlocks_ Matrix library parameters.

References matrixSizesAndBlocks.

std::string GetDensFromFock::get_stats_prefix (  )  const [inline]

References stats_prefix.

int GetDensFromFock::get_store_all_eigenvalues_to_file (  )  const [inline]
ergo_real GetDensFromFock::get_subspaceErrorLimit (  )  const [inline]

References subspaceErrorLimit.

int GetDensFromFock::get_try_eigv_on_next_iteration_if_fail (  )  [inline]
int GetDensFromFock::get_use_acceleration (  )  const [inline]

References SET, and use_acceleration.

int GetDensFromFock::get_use_diag_on_error (  )  const [inline]
int GetDensFromFock::get_use_diag_on_error_guess (  )  const [inline]
int GetDensFromFock::get_use_diagonalization (  )  const [inline]
int GetDensFromFock::get_use_new_stopping_criterion (  )  const [inline]

References SET, and use_new_stopping_criterion.

int GetDensFromFock::get_use_prev_vector_as_initial_guess (  )  [inline]
int GetDensFromFock::get_use_purification (  )  const [inline]
int GetDensFromFock::get_use_rand_perturbation_for_alleigsint (  )  const [inline]
void GetDensFromFock::restore_from_checkpoint ( GetDensFromFock DensFromFock,
symmMatrix Finput,
symmMatrix F_ort_prev,
generalVector eigVecLUMO,
generalVector eigVecHOMO,
std::string  checkpoint_path,
std::string  IDstr,
int  SCF_step 
) [static]

Function restores data from files in order to repeat recursive expansion in a desired SCF cycle.

The purpose of the function is mainly testing.

Parameters:
[out] DensFromFock Instance of GetDensFromFock class contatining all data for computing the density matrix
[out] Finput Effective Hamiltonian matrix (written to file)
[out] F_ort_prev F matrix in orthogonal basis ( ZT*Finput*Z ). (written to file)
[out] eigVecLUMO LUMO eigenvector
[out] eigVecHOMO HOMO eigenvector
[out] checkpoint_path HOMO eigenvector
[in] IDstr File identificator; added to the name of each file.
[in] SCF_step SCF step which should be restored; added to the name of each file in given SCF cycle.

References blocksize, mat::FileWritable::copyFromFile(), create_m_files, eigensolver_accuracy, eigensolver_maxiter, eigenvectors_iterative_method, eigenvectors_method, eigvalueErrorLimit, electronicTemperature, mat::euclNorm, factor, file_exist(), file_for_basic_types, filenameeigVecHOMO, filenameeigVecLUMO, filenameF_ort_prev, filenameFinput, filenameinvCholFactor, filenameOverlap, mat::frobNorm, gap_expected_lower_bound, homoInterval_F_ort_prev, homoInterval_Finput, ignore_purification_failure, invCholFactor, invCholFactor_euclnorm, leavesSizeMax, lumoInterval_F_ort_prev, lumoInterval_Finput, matrixSizesAndBlocks, maxMul, mat::mixedNorm, n, noOfOccupiedOrbs, output_homo_and_lumo_eigenvectors, overlapMatrix, plot_puri_results, plot_puri_results_str, mat::FileWritable::readFromFile(), mat::VectorGeneral< Treal, Tvector >::resetSizesAndBlocks(), SCF_step, stats_prefix, stopCriterionNormPurification, store_all_eigenvalues_to_file, subspaceErrorLimit, truncationNormPurification, try_eigv_on_next_iteration_if_fail, use_acceleration, use_diag_on_error, use_diag_on_error_guess, use_diagonalization, use_new_stopping_criterion, use_prev_vector_as_initial_guess, use_purification, and use_rand_perturbation_for_alleigsint.

void GetDensFromFock::set_cht_matrix_params ( const int  leavesSizeMax_,
const int  blocksize_ 
) [inline]
Parameters:
[in] leavesSizeMax_ CHTMatrix library parameter leavesSizeMax.
[in] blocksize_ CHTMatrix library parameter blocksize.

References blocksize, and leavesSizeMax.

Referenced by SCF_general::SCF_general().

void GetDensFromFock::set_diagonalization_params ( ergo_real  electronicTemperature_,
symmMatrix overlapMatrix_ 
) [inline]
void GetDensFromFock::set_eigs_F_ort_prev ( intervalType homoInterval_F_ort_prev_,
intervalType lumoInterval_F_ort_prev_ 
) [inline]
void GetDensFromFock::set_eigs_Fprev ( intervalType homoInterval_Finput_,
intervalType lumoInterval_Finput_ 
) [inline]
void GetDensFromFock::set_eigvalueErrorLimit ( ergo_real  eigvalueErrorLimit_  )  [inline]

Set maximum allowed error in eigenvalues of the density matrix.

References eigvalueErrorLimit.

Referenced by load_density_and_project_sparse(), and set_purification_limits().

void GetDensFromFock::set_gap_expected_lower_bound ( ergo_real  gap_expected_lower_bound_  )  [inline]
void GetDensFromFock::set_general_params ( const int  n_,
mat::SizesAndBlocks const &  matrixSizesAndBlocks_ 
) [inline]
Parameters:
[in] n_ Number of basis functions.
[in] matrixSizesAndBlocks_ Matrix library parameters.

References matrixSizesAndBlocks, and n.

Referenced by get_HML_dens_matrix(), and SCF_general::SCF_general().

void GetDensFromFock::set_generate_figures ( std::string  str = ""  )  [inline]

Plot figures from the recursive expansion.

Parameters:
[in] str String added to each generated file.

References create_m_files, plot_puri_results, plot_puri_results_str, SCF_step, SET, and UNDEF_VALUE.

Referenced by SCF_unrestricted::get_new_density_matrix(), SCF_restricted::get_new_density_matrix(), and load_density_and_project_sparse().

void GetDensFromFock::set_invCholFactor ( triangMatrix const &  invCholFactor_,
ergo_real  invCholFactor_euclnorm_ 
) [inline]
void GetDensFromFock::set_no_occupied_orbs ( int  noOfOccupiedOrbs_  )  [inline]
void GetDensFromFock::set_output_homo_and_lumo_eigenvectors (  )  [inline]
void GetDensFromFock::set_overlapMatrix ( symmMatrix overlapMatrix_  )  [inline]

References overlapMatrix.

Referenced by set_diagonalization_params().

void GetDensFromFock::set_puri_compute_eigv_in_each_iteration (  )  [inline]
void GetDensFromFock::set_puri_eig_acc_factor_for_guess ( ergo_real  puri_eig_acc_factor_for_guess_  )  [inline]

Set puri_eig_acc_factor_for_guess parameter.

Obsolete parameter needed for the old stopping criterion for creating the initial guess.

References puri_eig_acc_factor_for_guess.

Referenced by set_purification_limits().

void GetDensFromFock::set_purification_create_m_files (  )  [inline]

References create_m_files, and SET.

Referenced by SCF_general::SCF_general().

void GetDensFromFock::set_purification_ignore_failure (  )  [inline]
void GetDensFromFock::set_purification_limits ( ergo_real  subspaceErrorLimit_,
ergo_real  eigvalueErrorLimit_ = 0,
ergo_real  puri_eig_acc_factor_for_guess = 0 
) [inline]
void GetDensFromFock::set_purification_maxmul ( ergo_real  purification_maxmul_  )  [inline]

Set maximum allowed number of iterations in recursive expansion.

References maxMul.

Referenced by get_HML_dens_matrix(), and SCF_general::SCF_general().

void GetDensFromFock::set_purification_use_rand_perturbation_for_alleigsint (  )  [inline]
void GetDensFromFock::set_run_shift_and_square_method_on_F (  )  [inline]
void GetDensFromFock::set_save_permuted_F_matrix_in_bin (  )  [inline]
void GetDensFromFock::set_SCF_step ( int  step  )  [inline]
void GetDensFromFock::set_stats_prefix ( std::string  stats_prefix_  )  [inline]

References stats_prefix.

void GetDensFromFock::set_stopCriterionNormPurification ( mat::normType const   stopCriterionNormPurification_  )  [inline]

Set stopping criterion norm used in the recursive expansion.

Possible norms: spectral, Frobenius or mixed.

Parameters:
[in] stopCriterionNormPurification_ Norm used in the stopping criterion.

References stopCriterionNormPurification.

Referenced by get_dens_from_fock_sparse(), get_HML_dens_matrix(), and SCF_general::SCF_general().

void GetDensFromFock::set_store_all_eigenvalues_to_file (  )  [inline]
void GetDensFromFock::set_subspaceErrorLimit ( ergo_real  subspaceErrorLimit_  )  [inline]

Set maximum allowed error in invariant subspaces of the density matrix.

References subspaceErrorLimit.

Referenced by set_purification_limits().

void GetDensFromFock::set_truncationNormPurification ( mat::normType const   truncationNormPurification_  )  [inline]

Set truncation norm used in the recursive expansion.

Possible norms: spectral, Frobenius or mixed.

Parameters:
[in] truncationNormPurification_ Norm used in truncation.

References truncationNormPurification.

Referenced by get_dens_from_fock_sparse(), get_HML_dens_matrix(), and SCF_general::SCF_general().

void GetDensFromFock::set_try_eigv_on_next_iteration_if_fail (  )  [inline]
void GetDensFromFock::set_use_acceleration (  )  [inline]

References SET, and use_acceleration.

Referenced by SCF_general::SCF_general().

void GetDensFromFock::set_use_diag_on_error (  )  [inline]
void GetDensFromFock::set_use_diag_on_error_guess (  )  [inline]

References SET, and use_diag_on_error_guess.

Referenced by SCF_general::SCF_general().

void GetDensFromFock::set_use_diagonalization (  )  [inline]
void GetDensFromFock::set_use_new_stopping_criterion (  )  [inline]
void GetDensFromFock::set_use_prev_vector_as_initial_guess (  )  [inline]
void GetDensFromFock::set_use_purification (  )  [inline]

References SET, and use_purification.

Referenced by SCF_general::SCF_general().

void GetDensFromFock::unset_generate_figures (  )  [inline]
void GetDensFromFock::unset_output_homo_and_lumo_eigenvectors (  )  [inline]
void GetDensFromFock::unset_puri_compute_eigv_in_each_iteration (  )  [inline]
void GetDensFromFock::unset_purification_create_m_files (  )  [inline]
void GetDensFromFock::unset_purification_ignore_failure (  )  [inline]
void GetDensFromFock::unset_purification_use_rand_perturbation_for_alleigsint (  )  [inline]
void GetDensFromFock::unset_run_shift_and_square_method_on_F (  )  [inline]
void GetDensFromFock::unset_save_permuted_F_matrix_in_bin (  )  [inline]
void GetDensFromFock::unset_SCF_step (  )  [inline]

References SCF_step, and UNDEF_VALUE_UINT.

void GetDensFromFock::unset_stats_prefix (  )  [inline]

References stats_prefix.

void GetDensFromFock::unset_store_all_eigenvalues_to_file (  )  [inline]
void GetDensFromFock::unset_try_eigv_on_next_iteration_if_fail (  )  [inline]
void GetDensFromFock::unset_use_acceleration (  )  [inline]
void GetDensFromFock::unset_use_diag_on_error (  )  [inline]
void GetDensFromFock::unset_use_diag_on_error_guess (  )  [inline]
void GetDensFromFock::unset_use_diagonalization (  )  [inline]
void GetDensFromFock::unset_use_new_stopping_criterion (  )  [inline]
void GetDensFromFock::unset_use_prev_vector_as_initial_guess (  )  [inline]
void GetDensFromFock::unset_use_purification (  )  [inline]

Member Data Documentation

Information about leavesSizeMax and blocksize for CHTMatrix.

Referenced by create_checkpoint(), get_dens_from_fock_sparse(), GetDensFromFock(), restore_from_checkpoint(), and set_cht_matrix_params().

Density matrix from previous SCF cycle (written to file).

The accuracy for the eigenvalue problem solver.

Referenced by compute_eigenvectors(), create_checkpoint(), get_dens_from_fock_sparse(), GetDensFromFock(), and restore_from_checkpoint().

Maximum number of iterations for the eigenvalue problem solver.

Referenced by compute_eigenvectors(), create_checkpoint(), get_dens_from_fock_sparse(), GetDensFromFock(), and restore_from_checkpoint().

Iterative method for computing eigenvectors: power or lanczos.

Referenced by compute_eigenvectors(), create_checkpoint(), get_dens_from_fock_sparse(), GetDensFromFock(), and restore_from_checkpoint().

std::string GetDensFromFock::eigenvectors_method [private]

Method for computing eigenvectors: square or projection.

Referenced by compute_eigenvectors(), create_checkpoint(), get_dens_from_fock_sparse(), GetDensFromFock(), and restore_from_checkpoint().

Tolerated deviation of eigenvalues from 0 and 1 in the computed density matrix.

Referenced by create_checkpoint(), get_dens_from_fock_sparse(), get_eigvalueErrorLimit(), GetDensFromFock(), restore_from_checkpoint(), and set_eigvalueErrorLimit().

Factor to scale the resulting density matrix.

(for restricted vs unrestricted calc)

Referenced by create_checkpoint(), do_restricted_calculations(), do_unrestricted_calculations(), get_dens_from_fock(), get_dens_from_fock_sparse(), GetDensFromFock(), and restore_from_checkpoint().

const char* GetDensFromFock::filenameD_ort_prev [private]

Referenced by GetDensFromFock().

const char* GetDensFromFock::filenameeigVecHOMO [private]
const char* GetDensFromFock::filenameeigVecLUMO [private]
const char* GetDensFromFock::filenameF_ort_prev [private]
const char* GetDensFromFock::filenameFinput [private]
const char* GetDensFromFock::filenameOverlap [private]

Expected lower bound for the gap to be used in early iterations.

Referenced by create_checkpoint(), get_dens_from_fock_sparse(), GetDensFromFock(), restore_from_checkpoint(), and set_gap_expected_lower_bound().

Inverse Cholesky factor (written to file).

Referenced by create_checkpoint(), get_dens_from_fock_sparse(), restore_from_checkpoint(), and set_invCholFactor().

Euclidean norm of inverse Cholesky factor.

Referenced by create_checkpoint(), GetDensFromFock(), restore_from_checkpoint(), and set_invCholFactor().

Information about leavesSizeMax and blocksize for CHTMatrix.

Referenced by create_checkpoint(), get_dens_from_fock_sparse(), GetDensFromFock(), restore_from_checkpoint(), and set_cht_matrix_params().

Information about HML matrix block sizes etc.

Referenced by create_checkpoint(), get_dens_from_fock(), get_SizesAndBlocks(), restore_from_checkpoint(), and set_general_params().

int GetDensFromFock::maxMul [private]

Maximum allowed number of matrix multiplications in the purification.

Referenced by create_checkpoint(), get_dens_from_fock_sparse(), GetDensFromFock(), restore_from_checkpoint(), and set_purification_maxmul().

int GetDensFromFock::n [private]

Overlap matrix (written to file).

Referenced by create_checkpoint(), get_dens_from_fock(), restore_from_checkpoint(), and set_overlapMatrix().

With this number will be multiplied the tolerated deviation of eigenvalues from 0 and 1 in the computed density matrix for the initial guess density matrix.

Referenced by get_puri_eig_acc_factor_for_guess(), GetDensFromFock(), set_puri_eig_acc_factor_for_guess(), and set_purification_limits().

std::map<std::string, double> GetDensFromFock::puri_stats [private]

(for comparison) Run shift_and_square method to get eigenvectors of the matrix F for various shifts.

Referenced by get_dens_from_fock_sparse(), get_run_shift_and_square_method_on_F(), GetDensFromFock(), set_run_shift_and_square_method_on_F(), and unset_run_shift_and_square_method_on_F().

Save sparse matrix F into bin file in the current permutation of rows and columns.

Referenced by get_dens_from_fock_sparse(), get_save_permuted_F_matrix_in_bin(), GetDensFromFock(), set_save_permuted_F_matrix_in_bin(), and unset_save_permuted_F_matrix_in_bin().

const int GetDensFromFock::SET = 1 [static]
std::string GetDensFromFock::stats_prefix [private]

Store eigenvalues to the file when doing diagonalization.

NOTE: works just with diagonalization

Referenced by create_checkpoint(), get_dens_from_fock(), get_store_all_eigenvalues_to_file(), GetDensFromFock(), restore_from_checkpoint(), set_store_all_eigenvalues_to_file(), and unset_store_all_eigenvalues_to_file().

Tolerated error in the occupied subspace as measured by the sinus of the largest canonical angle.

Referenced by create_checkpoint(), get_dens_from_fock(), get_dens_from_fock_sparse(), get_subspaceErrorLimit(), GetDensFromFock(), restore_from_checkpoint(), and set_subspaceErrorLimit().

const int GetDensFromFock::UNDEF_VALUE = -1 [static]
const string GetDensFromFock::UNDEF_VALUE_STRING = "" [static]

Referenced by GetDensFromFock().

const int GetDensFromFock::UNDEF_VALUE_UINT = -1 [static]
const int GetDensFromFock::UNSET = 0 [static]

Apply a random perturbation to (try to) improve the convergence speed of Lanczos calculation of extremal eigenvalues.

Referenced by create_checkpoint(), get_use_rand_perturbation_for_alleigsint(), GetDensFromFock(), restore_from_checkpoint(), set_purification_use_rand_perturbation_for_alleigsint(), and unset_purification_use_rand_perturbation_for_alleigsint().


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

Generated on 10 Jul 2018 for ergo by  doxygen 1.6.1