#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include "density_description_file_2.h"
#include "density_projection.h"
#include "densfromf_full.h"
#include "densfromf_sparse.h"
#include "densfromf_general.h"
#include "integrals_general.h"
#include "operator_matrix.h"
#include "matrix_algebra.h"
#include "memorymanag.h"
#include "output.h"
#include "utilities.h"
#include "matrix_utilities.h"
Functions | |
int | load_density_and_project_full (const char *densityFileName, int noOfDensityMatrices, const IntegralInfo *integralInfo, const BasisInfoStruct &basisInfo, ergo_real **densityMatrixList, int do_purification, const int *noOfElectronsList, ergo_real electronic_temperature) |
load_density_and_project_full loads one or two density matrices (depending on value of noOfDensityMatrices) from the file specified by densityFileName. | |
static int | compute_R_matrix_sparse (const BasisInfoStruct &basisInfo_A, const BasisInfoStruct &basisInfo_B, normalMatrix &result_R, ergo_real sparse_threshold, std::vector< int > const &matrixPermutationVec, std::vector< int > const &matrixPermutationVec_sg) |
int | load_density_and_project_sparse (const char *densityFileName, int noOfDensityMatrices, const IntegralInfo *integralInfo, const BasisInfoStruct &basisInfo, symmMatrix &S_symm, symmMatrix **densityMatrixList, const int *noOfElectronsList, mat::SizesAndBlocks matrix_size_block_info, std::vector< int > const &matrixPermutationVec, ergo_real sparse_threshold, triangMatrix &invCholFactor, ergo_real invCholFactor_euclnorm, ergo_real gap_expected_lower_bound, ergo_real purification_eigvalue_err_limit, ergo_real purification_subspace_err_limit, mat::normType const purification_truncation_norm, int purification_maxmul, int purification_create_m_files, int use_diagonalization, int use_diag_on_error, int purification_ignore_failure, int purification_use_rand_perturbation_for_alleigsint, ergo_real electronic_temperature) |
load_density_and_project_sparse loads one or two density matrices (depending on value of noOfDensityMatrices) from the file specified by densityFileName. |
static int compute_R_matrix_sparse | ( | const BasisInfoStruct & | basisInfo_A, | |
const BasisInfoStruct & | basisInfo_B, | |||
normalMatrix & | result_R, | |||
ergo_real | sparse_threshold, | |||
std::vector< int > const & | matrixPermutationVec, | |||
std::vector< int > const & | matrixPermutationVec_sg | |||
) | [static] |
int load_density_and_project_full | ( | const char * | densityFileName, | |
int | noOfDensityMatrices, | |||
const IntegralInfo * | integralInfo, | |||
const BasisInfoStruct & | basisInfo, | |||
ergo_real ** | densityMatrixList, | |||
int | do_purification, | |||
const int * | noOfElectronsList, | |||
ergo_real | electronic_temperature | |||
) |
load_density_and_project_full loads one or two density matrices (depending on value of noOfDensityMatrices) from the file specified by densityFileName.
densityFileName | Name of file to load density matrices from | |
noOfDensityMatrices | Number of density matrices to load | |
integralInfo | static helper object for integral evaluation. | |
basisInfo | the basis set that the density is to be expanded into (if the original density was expressed with help of other basis set, an apriopriate projection will be performed). | |
densityMatrixList | must be already allocated and have proper dimension. | |
do_purification | determines whether an additional purification is to be run after the projection. | |
noOfElectronsList | is an one or two element array specyfying the number of total electrons (one element) or alpha and beta electrons (two elements). | |
electronic_temperature | Electronic temperature |
int load_density_and_project_sparse | ( | const char * | densityFileName, | |
int | noOfDensityMatrices, | |||
const IntegralInfo * | integralInfo, | |||
const BasisInfoStruct & | basisInfo, | |||
symmMatrix & | S_symm, | |||
symmMatrix ** | densityMatrixList, | |||
const int * | noOfElectronsList, | |||
mat::SizesAndBlocks | matrix_size_block_info, | |||
std::vector< int > const & | matrixPermutationVec, | |||
ergo_real | sparse_threshold, | |||
triangMatrix & | invCholFactor, | |||
ergo_real | invCholFactor_euclnorm, | |||
ergo_real | gap_expected_lower_bound, | |||
ergo_real | purification_eigvalue_err_limit, | |||
ergo_real | purification_subspace_err_limit, | |||
mat::normType const | purification_truncation_norm, | |||
int | purification_maxmul, | |||
int | purification_create_m_files, | |||
int | use_diagonalization, | |||
int | use_diag_on_error, | |||
int | purification_ignore_failure, | |||
int | purification_use_rand_perturbation_for_alleigsint, | |||
ergo_real | electronic_temperature | |||
) |
load_density_and_project_sparse loads one or two density matrices (depending on value of noOfDensityMatrices) from the file specified by densityFileName.
The projection is done as follows: First, a matrix R is computed. R is the overlap matrix between the two basis sets. Then RT * P * R is computed, where P is the starting guess density matrix read from file. To get a final projected density one could then multiply by S_inv from both sides, but to prepare for purification the matrix S*D*S is needed, so we skip multiplication by S_inv since it will anyway be cancelled out.
densityFileName | Name of file to load density matrices from | |
noOfDensityMatrices | Number of density matrices to load | |
integralInfo | static helper object for integral evaluation. | |
basisInfo | the basis set that the density is to be expanded into (if the original density was expressed with help of other basis set, an apriopriate projection will be performed). | |
S_symm | Overlap matrix | |
densityMatrixList | pointers to one or two empty matrices that will contain the result. Purification is always run after the projection. | |
noOfElectronsList | is an one or two element array specyfying the number of total electrons (one element) or alpha and beta electrons (two elements). | |
matrix_size_block_info | Information about HML matrix block sizes etc. | |
matrixPermutationVec | Permutation vector used when calling matrix lib. | |
sparse_threshold | Threshold used when truncating matrices. | |
invCholFactor | Inverse Cholesky factor of S. | |
invCholFactor_euclnorm | Euclidean norm of inverse Cholesky factor. | |
gap_expected_lower_bound | Expected lower bound for the band gap. | |
purification_eigvalue_err_limit | Requested accuracy in eigenvalues of D_ort. | |
purification_subspace_err_limit | Requested accuracy in the occupied subspace. | |
purification_truncation_norm | Norm to be used for truncation in purification. | |
purification_maxmul | Maximum allowed number of matrix multiplications. | |
purification_create_m_files | Flag to create m-files with information about the purification process. | |
use_diagonalization | Flag to turn on diagonalization. | |
use_diag_on_error | Flag to fall back on diagonalization if purification fails. | |
purification_ignore_failure | Continue even if purification fails to converge. | |
purification_use_rand_perturbation_for_alleigsint | Apply a random perturbation to (try to) improve the convergence speed of Lanczos calculation of extremal eigenvalues. | |
electronic_temperature | Electronic temperature. |