ergo
densfromf_general.cc File Reference

Routine get_dens_from_fock_general() for getting density matrix from a given Fock matrix. More...

#include "densfromf_general.h"
#include "densfromf_sparse.h"
#include "densfromf_full.h"
#include "output.h"
#include "utilities.h"

Functions

int get_dens_from_fock_general (int n, int noOfOccupiedOrbs, int use_diagonalization, int use_diag_on_error, ergo_real electronicTemperature, symmMatrix &resultDens, ergo_real factor, symmMatrix &Finput, intervalType &homoInterval_Finput, intervalType &lumoInterval_Finput, symmMatrix &overlapMatrix, triangMatrix const &invCholFactor, ergo_real invCholFactor_euclnorm, ergo_real gap_expected_lower_bound, mat::SizesAndBlocks const &matrixSizesAndBlocks, symmMatrix &F_ort_prev, intervalType &homoInterval_F_ort_prev, intervalType &lumoInterval_F_ort_prev, ergo_real eigvalueErrorLimit, ergo_real subspaceErrorLimit, mat::normType const truncationNormPurification, int maxMul, int create_m_files, int ignore_purification_failure, int use_rand_perturbation_for_alleigsint, std::string stats_prefix, std::map< std::string, double > &puri_stats, int do_sparsity_investigation, int sparsity_plots_resolution_m, int do_comparison_to_simple_purification, generalVector *eigVecLUMO, generalVector *eigVecHOMO)

Detailed Description

Routine get_dens_from_fock_general() for getting density matrix from a given Fock matrix.

This routine calls either get_dens_from_fock_sparse() or get_dens_from_fock_full().

Author:
: Elias Rudberg responsible.

Function Documentation

int get_dens_from_fock_general ( int  n,
int  noOfOccupiedOrbs,
int  use_diagonalization,
int  use_diag_on_error,
ergo_real  electronicTemperature,
symmMatrix resultDens,
ergo_real  factor,
symmMatrix Finput,
intervalType homoInterval_Finput,
intervalType lumoInterval_Finput,
symmMatrix overlapMatrix,
triangMatrix const &  invCholFactor,
ergo_real  invCholFactor_euclnorm,
ergo_real  gap_expected_lower_bound,
mat::SizesAndBlocks const &  matrixSizesAndBlocks,
symmMatrix F_ort_prev,
intervalType homoInterval_F_ort_prev,
intervalType lumoInterval_F_ort_prev,
ergo_real  eigvalueErrorLimit,
ergo_real  subspaceErrorLimit,
mat::normType const  truncationNormPurification,
int  maxMul,
int  create_m_files,
int  ignore_purification_failure,
int  use_rand_perturbation_for_alleigsint,
std::string  stats_prefix,
std::map< std::string, double > &  puri_stats,
int  do_sparsity_investigation,
int  sparsity_plots_resolution_m,
int  do_comparison_to_simple_purification,
generalVector eigVecLUMO,
generalVector eigVecHOMO 
)
Parameters:
nSystem size.
noOfOccupiedOrbsNumber of occupied orbitals.
use_diagonalizationFlag to turn on diagonalization.
use_diag_on_errorFlag to fall back on diagonalization if purification fails.
electronicTemperatureElectronic temperature.
resultDensDensity matrix. (output)
factorFactor to scale the resulting density matrix. (for restricted vs unrestricted calc)
FinputEffective Hamiltonian matrix (input, written to file)
homoInterval_Finput(out) Output: Contains the homo eigenvalue of Finput.
lumoInterval_Finput(out) Output: Contains the lumo eigenvalue of Finput.
overlapMatrixOverlap matrix.
invCholFactorInverse Cholesky factor (input, written to file)
invCholFactor_euclnormEuclidean norm of inverse Cholesky factor.
gap_expected_lower_boundExpected lower bound for the gap to be used in early iterations.
matrixSizesAndBlocksInformation about HML matrix block sizes etc.
F_ort_prev(in/out) Input: Previous F matrix in orthogonal basis. (written to file) Output: New F matrix in orthogonal basis ( ZT*Finput*Z ). (written to file)
homoInterval_F_ort_prev(in/out) Input: Contains the homo eigenvalue of F_ort_prev. Output: Contains the homo eigenvalue of F_ort_prev.
lumoInterval_F_ort_prev(in/out) Input: Contains the lumo eigenvalue of F_ort_prev. Output: Contains the lumo eigenvalue of F_ort_prev.
eigvalueErrorLimitTolerated deviation of eigenvalues from 0 and 1 in the computed density matrix.
subspaceErrorLimitTolerated error in the occupied subspace as measured by the sinus of the largest canonical angle.
truncationNormPurificationNorm to be used for truncation.
maxMulMaximum allowed number of matrix multiplications.
create_m_filesFlag to create m-files with information about the purification process.
ignore_purification_failureContinue even if purification fails to converge.
use_rand_perturbation_for_alleigsintApply a random perturbation to (try to) improve the convergence speed of Lanczos calculation of extremal eigenvalues.
stats_prefixPrefix to be added to statistics files.
puri_statsMap to store stats for purification.
do_sparsity_investigationFlag to turn on sparsity investigation.
sparsity_plots_resolution_mResolution in element magnitude histograms.
do_comparison_to_simple_purificationFlag to turn on comparison to simple purification.
eigVecLUMOLUMO eigenvector
eigVecHOMOHOMO eigenvector

References mat::VectorGeneral< Treal, Tvector >::assign_from_full(), mat::MatrixSymmetric< Treal, Tmatrix >::assignFromFull(), mat::MatrixBase< Treal, Tmatrix >::clear(), do_output(), mat::MatrixGeneral< Treal, Tmatrix >::fullMatrix(), get_dens_from_fock_full(), get_dens_from_fock_sparse(), LOG_AREA_SCF, LOG_CAT_ERROR, LOG_CAT_INFO, mat::FileWritable::readFromFile(), and mat::FileWritable::writeToFile().

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