Go to the documentation of this file.
38 #ifndef SCF_UNRESTRICTED_HEADER
39 #define SCF_UNRESTRICTED_HEADER
53 const char* guessDmatFileName_,
59 int alpha_beta_diff_input);
108 const char *vector_name,
109 const char *filename_id)
const;
void get_FDSminusSDF()
Definition: SCF_unrestricted.cc:558
int determine_number_of_electrons_unrestricted(int noOfElectrons, int alpha_beta_diff, int *noOfElectrons_alpha, int *noOfElectrons_beta)
Definition: scf_utils.cc:2201
symmMatrix S_symm
Definition: SCF_general.h:114
GetDensFromFock DensFromFock
Definition: SCF_general.h:125
void clear_diis_list()
Definition: SCF_unrestricted.cc:720
void set_no_occupied_orbs(int noOfOccupiedOrbs_)
Definition: GetDensFromFock.h:282
void get_no_of_electrons(int &noOfElectrons_a, int &noOfElectrons_b)
Definition: SCF_unrestricted.cc:105
ergo_real coeffList[MAX_NO_OF_CONTR_GAUSSIANS]
Definition: basisinfo.h:72
Provides temporary storage for compute_integral_of_square_of_basis_func.
Definition: basisinfo.h:189
void set_use_diag_on_error()
Definition: GetDensFromFock.h:386
Definition: SCF_general.h:52
void report_final_results()
Definition: SCF_unrestricted.cc:1127
void get_dipole_moment(const symmMatrix &densityMatrix, const BasisInfoStruct &basisInfo, mat::SizesAndBlocks const &matrix_size_block_info, std::vector< int > const &permutationHML, const Molecule &molecule, int logArea, const char *label)
Definition: dipole_moment.cc:74
void get_S2(ergo_real &S2_exact, ergo_real &S2)
Definition: SCF_unrestricted.cc:1135
#define LOG_CAT_RESULTS
Definition: output.h:51
ergo_real nuclearEnergy
Definition: SCF_general.h:98
void get_eigs_Fprev(intervalType &homoInterval_Finput_, intervalType &lumoInterval_Finput_) const
Definition: GetDensFromFock.h:523
ergo_real sparse_threshold
threshold value for sparse matrix truncation.
Definition: scf.h:280
ergo_real starting_guess_disturbance
Definition: scf.h:89
static const int DISTURB_ELEMENT_MAX_COUNT
Definition: scf.h:51
int get_output_homo_and_lumo_eigenvectors() const
Definition: GetDensFromFock.h:337
int noOfBasisFuncs
Definition: basisinfo.h:120
std::vector< ergo_real > eigValUNOCC_alpha
Definition: SCF_unrestricted.h:155
void set_SCF_step(int step)
Definition: GetDensFromFock.h:212
int eigensolver_maxiter
Definition: scf.h:156
Functionality for computing the dipole moment of a molecule for a given density matrix.
Definition: density_description_file.h:50
void disturb_dens_matrix(ergo_real subspaceError)
Definition: SCF_unrestricted.cc:1677
int noOfElectrons_alpha
Definition: SCF_unrestricted.h:149
std::vector< ergo_real > eigValOCC_alpha
Definition: SCF_unrestricted.h:154
void output_sparsity(int n, const normalMatrix &M, const char *matrixName)
Definition: scf_utils.cc:371
intervalType homoInterval_Fprev_alpha
Definition: SCF_unrestricted.h:143
void create_gabedit_file() const
Definition: SCF_unrestricted.cc:1496
void write_density_to_file()
Definition: SCF_unrestricted.cc:900
int disturbedElementIndexVector[DISTURB_ELEMENT_MAX_COUNT]
Definition: scf.h:91
void get_Fock_matrices(symmMatrix &FockMatrix_a, symmMatrix &FockMatrix_b)
Definition: SCF_unrestricted.cc:94
symmMatrix bestFockMatrixSoFar2_beta
Definition: SCF_unrestricted.h:132
#define UNIT_one_Angstrom
Definition: units.h:43
symmMatrix FockMatrix_beta
Definition: SCF_unrestricted.h:120
void add_random_disturbance_to_starting_guess()
Definition: SCF_unrestricted.cc:286
#define LOG_CAT_ERROR
Definition: output.h:47
#define LOG_CAT_WARNING
Definition: output.h:48
void add_to_DIIS_list()
Definition: SCF_unrestricted.cc:619
ergo_real GetEuclideanNormOfMatrix(const symmMatrix &A)
Definition: SCF_general.cc:493
symmMatrix H_core_Matrix
Definition: SCF_general.h:117
static void printMat(const T &m, const char *msg, int nbast)
Definition: SCF_unrestricted.cc:354
Provides a way to map atom labels to their charges. The main procedure provided by this file is get_c...
double ergo_real
Definition: realtype.h:69
intervalType lumoInterval_F_ort_prev_beta
Definition: SCF_unrestricted.h:142
ergo_real eigensolver_accuracy
Definition: scf.h:155
static void output_orbital_coeffs_in_gabedit_order(const BasisInfoStruct &basisInfo, std::vector< int > const &shellIdxList, std::ofstream &ff, std::vector< ergo_real > const &orbital_vec)
Definition: SCF_unrestricted.cc:1443
SCF_unrestricted(const Molecule &molecule_, const Molecule &extraCharges_, const BasisInfoStruct &basisInfo_, const IntegralInfo &integralInfo_, const char *guessDmatFileName_, const JK::Params &J_K_params_, const Dft::GridParams &gridParams_, const SCF::Options &scfopts, const SCF::MatOptions &matOpts, ergo_real threshold_integrals_1el_input, int alpha_beta_diff_input)
Definition: SCF_unrestricted.cc:54
void create_eigvec_file(const generalVector &eigVec_alpha, const generalVector &eigVec_beta, const char *vector_name, const char *filename_id) const
Definition: SCF_unrestricted.cc:1387
static void prep_matrix_description_struct(matrix_description_struct &mat, int nvalues, std::vector< int > &rowind, std::vector< int > &colind, std::vector< ergo_real > &values)
Definition: SCF_unrestricted.cc:882
symmMatrix Dprev_beta
Definition: SCF_unrestricted.h:124
std::string calculation_identifier
Definition: scf.h:54
void disturb_fock_matrix(ergo_real subspaceError)
Definition: SCF_unrestricted.cc:1672
int shellType
Definition: basisinfo.h:78
void use_diis_to_get_new_fock_matrix()
Definition: SCF_unrestricted.cc:695
void check_params()
Definition: SCF_unrestricted.cc:154
MatrixSymmetric< real, matri > symmMatrix
Definition: test_LanczosSeveralLargestEig.cc:69
int min_number_of_iterations
Definition: scf.h:109
void get_new_density_matrix()
Definition: SCF_unrestricted.cc:756
symmMatrix bestFockMatrixSoFar2_alpha
Definition: SCF_unrestricted.h:131
ShellSpecStruct * shellList
Definition: basisinfo.h:119
ergo_real errorMeasure
Definition: SCF_general.h:110
normalMatrix ErrorMatrix_beta
Definition: SCF_unrestricted.h:134
ergo_real centerCoords[3]
Definition: basisinfo.h:76
Definition: basisinfo.h:112
const JK::Params & J_K_params
Definition: SCF_general.h:84
Definition: SCF_statistics.h:57
int getNoOfAtoms() const
Definition: molecule.h:114
ergo_real exponentList[MAX_NO_OF_CONTR_GAUSSIANS]
Definition: basisinfo.h:73
void clear_error_matrices()
Definition: SCF_unrestricted.cc:728
void create_mtx_files_D(int const scfIter)
Definition: SCF_unrestricted.cc:1279
int ddf_writeShellListAndDensityMatricesToFile_sparse(const BasisInfoStruct &basisInfo, int noOfDensityMatrices, matrix_description_struct *densityMatrixList, const char *fileName)
Writes basisInfo and sparse matrices in a format that can be later read by ddf_load_density.
Definition: density_description_file.cc:640
Definition: diis_unrestricted.h:45
int get_atom_label_from_charge_int(int charge, char *atomLabelString, size_t bufferSize)
Definition: atom_labels.cc:141
void do_mulliken_spin_densities(const symmMatrix &spinDensityMatrix, const symmMatrix &S_symm, const BasisInfoStruct &basisInfo, mat::SizesAndBlocks const &matrix_size_block_info, std::vector< int > const &permutationHML, std::vector< int > const &inversePermutationHML, const Molecule &molecule)
Definition: scf_utils.cc:2325
Definition: integrals_2el.h:45
std::string eigenvectors_iterative_method
Definition: scf.h:154
Treal template_blas_fabs(Treal x)
std::vector< generalVector > eigVecOCC_alpha
Definition: SCF_unrestricted.h:152
int get_diag_matrix_from_file(int n, symmMatrix &M, const char *fileName, std::vector< int > const &permutationHML)
Definition: scf_utils.cc:840
symmMatrix F_ort_prev_alpha
Definition: SCF_unrestricted.h:125
void unset_use_diag_on_error()
Definition: GetDensFromFock.h:388
An object respresenting the configuration of the matrix library.
Definition: scf.h:276
void update_best_fock_so_far()
Definition: SCF_unrestricted.cc:639
void do_mulliken_atomic_charges(const symmMatrix &densityMatrix, const symmMatrix &S_symm, const BasisInfoStruct &basisInfo, mat::SizesAndBlocks const &matrix_size_block_info, std::vector< int > const &permutationHML, std::vector< int > const &inversePermutationHML, const Molecule &molecule)
Definition: scf_utils.cc:2296
void write_matrix_in_matrix_market_format(Tmatrix const &A, std::vector< int > const &inversePermutation, std::string filename, std::string identifier, std::string method_and_basis)
Definition: matrix_utilities.h:149
const Dft::GridParams & gridParams
Definition: SCF_general.h:85
A structure describing the grid settings.
Definition: grid_params.h:59
symmMatrix Fprev_beta
Definition: SCF_unrestricted.h:122
int get_2e_matrices_and_energy_restricted_open(const BasisInfoStruct &basisInfo, const Molecule &molecule, const IntegralInfo &integralInfo, const JK::ExchWeights &CAM_params, symmMatrix &twoelMatrix_Fc, symmMatrix &twoelMatrix_Fo, symmMatrix &densityMatrix_sparse_alpha, symmMatrix &densityMatrix_sparse_beta, const JK::Params &J_K_params, const Dft::GridParams &gridParams, int do_xc, ergo_real *energy_2el, int noOfElectrons, mat::SizesAndBlocks const &matrix_size_block_info, std::vector< int > const &permutationHML, std::vector< int > const &inversePermutationHML)
Computes G_c and G_o.
Definition: scf_utils.cc:1929
void do_mulliken_pop_stuff()
Definition: SCF_unrestricted.cc:1226
int get_dens_from_fock(symmMatrix &Finput, symmMatrix &resultDens, symmMatrix &F_ort_prev)
Choose which method to use for computing the density matrix from Fock matrix.
Definition: GetDensFromFock.cc:76
void disturb_dens_matrix_exact(ergo_real subspaceError)
Definition: SCF_unrestricted.cc:1682
std::vector< ergo_real > eigValOCC_beta
Definition: SCF_unrestricted.h:158
JK::ExchWeights CAM_params
Definition: SCF_general.h:92
std::vector< int > inversePermutationHML
Definition: scf.h:279
void do_unrestricted_calculations()
Definition: GetDensFromFock.h:279
symmMatrix bestFockMatrixSoFar_alpha
Definition: SCF_unrestricted.h:129
Various utilities used by self-consistent field (SCF) code. For example, interface routines convertin...
intervalType lumoInterval_Fprev_beta
Definition: SCF_unrestricted.h:146
std::vector< generalVector > eigVecUNOCC_alpha
Definition: SCF_unrestricted.h:153
Contains coefficients needed for quick integral evaluation.
Definition: integral_info.h:94
int noOfShells
Definition: basisinfo.h:118
void save_final_potential()
Definition: SCF_unrestricted.cc:948
symmMatrix D_ort_prev_beta
Definition: SCF_unrestricted.h:128
void update_subspace_diff()
Definition: SCF_unrestricted.cc:1666
int use_diag_guess_from_file
Definition: scf.h:87
void compute_eigenvectors_extra(int puri_compute_eigv_in_each_iteration_, int run_shift_and_square_method_on_F_)
Definition: GetDensFromFock.h:588
const char * guessDmatFileName
Definition: SCF_general.h:83
intervalType lumoInterval_Fprev_alpha
Definition: SCF_unrestricted.h:144
int compute_FDSminusSDF_sparse(int n, symmMatrix &F_symm, symmMatrix &D_symm, symmMatrix &S_symm, normalMatrix &result, ergo_real sparse_threshold)
Definition: scf_utils.cc:2084
Utilities related to the hierarchical matrix library (HML), including functions for setting up permut...
void compute_gradient_fixeddens()
Definition: SCF_unrestricted.cc:1687
int SCF_step
Definition: SCF_general.h:95
Functionality for working with the electron density as a function of space, for a given basis set and...
symmMatrix D_ort_prev_alpha
Definition: SCF_unrestricted.h:127
bool is_empty() const
Definition: VectorGeneral.h:56
int noOfContr
Definition: basisinfo.h:77
symmMatrix Fprev_alpha
Definition: SCF_unrestricted.h:121
void do_density_images(const BasisInfoStruct &basisInfo, const Molecule &molecule, const ergo_real *densityMatrixFull_tot, const ergo_real *densityMatrixFull_spin, double output_density_images_boxwidth, const std::string &filename_id)
Definition: scf_utils.cc:2410
ergo_real compute_maxabs_sparse(const Tmatrix &M)
Definition: matrix_utilities.h:97
Definition: MatrixBase.h:55
void print(int area, const char *routine)
Definition: utilities.h:111
int force_restricted
use a restricted determinant for open shell.
Definition: scf.h:96
void combine_old_fock_matrices(ergo_real stepLength)
Definition: SCF_unrestricted.cc:668
Normal matrix.
Definition: MatrixBase.h:49
const Atom & getAtom(int i) const
Definition: molecule.h:113
symmMatrix F_ort_prev_beta
Definition: SCF_unrestricted.h:126
void get_eigs_F_ort_prev(intervalType &homoInterval_F_ort_prev_, intervalType &lumoInterval_F_ort_prev_) const
Definition: GetDensFromFock.h:539
Treal frob() const
Definition: MatrixGeneral.h:284
Xtrans< TX > transpose(TX const &A)
Transposition.
Definition: matrix_proxy.h:131
int starting_guess_spin_diff
Definition: scf.h:99
Definition: SCF_unrestricted.h:45
symmMatrix densityMatrix_beta
Definition: SCF_unrestricted.h:118
int write_diag_elements_to_file(int n, const symmMatrix &M, const char *fileName, std::vector< int > const &permutationHML)
Definition: scf_utils.cc:917
Basic OS access utilities.
void get_overlap_matrix(symmMatrix &S)
Definition: SCF_general.cc:500
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_)
Definition: GetDensFromFock.h:553
int sg_disturb_specific_elements
Definition: scf.h:90
Definition: allocate.cc:39
#define LOG_CAT_INFO
Definition: output.h:49
const SCF::Options & scfopts
Definition: SCF_general.h:86
void initialize_matrices()
Definition: SCF_unrestricted.cc:112
void get_2e_part_and_energy()
Definition: SCF_unrestricted.cc:369
int try_eigv_on_next_iteration_if_fail
Definition: scf.h:125
int noOfElectrons_beta
Definition: SCF_unrestricted.h:150
const SCF::MatOptions & matOpts
Definition: SCF_general.h:87
std::vector< int > permutationHML
Definition: scf.h:278
int noOfElectrons
Definition: SCF_general.h:121
ergo_real energy_2el
Definition: SCF_general.h:100
void set_generate_figures(std::string str="")
Plot figures from the recursive expansion.
Definition: GetDensFromFock.h:220
ergo_real get_result_entropy_term() const
Definition: GetDensFromFock.h:506
void create_eigenvalues_files() const
Definition: SCF_unrestricted.cc:1304
int use_simple_starting_guess
Definition: scf.h:86
void compute_dipole_moment()
Definition: SCF_unrestricted.cc:1214
int alpha_beta_diff
Definition: SCF_unrestricted.h:148
Class for self-consistent field (SCF) procedure; base class that can be used for both restricted and ...
int get_use_diag_on_error_guess() const
Definition: GetDensFromFock.h:376
BasisFuncStruct * basisFuncList
Definition: basisinfo.h:121
void do_spin_flip(int atomCount)
Definition: SCF_unrestricted.cc:1015
Vector3D centerCoords
Definition: basisinfo.h:90
#define LOG_AREA_SCF
Definition: output.h:58
std::string method_and_basis_set
Definition: scf.h:55
int get_use_diag_on_error() const
Definition: GetDensFromFock.h:384
int run_shift_and_square_method_on_F
Definition: scf.h:127
symmMatrix bestFockMatrixSoFar_beta
Definition: SCF_unrestricted.h:130
Constants for conversion between units for some common units like Angstrom, electron-volt (eV),...
Class for self-consistent field (SCF) procedure; spin-unrestricted case.
An interface file for writing and reading density matrices to/from a file, including basis set inform...
void write_diag_dens_to_file()
Definition: SCF_unrestricted.cc:1105
int use_6_d_funcs
Whether to use 6 d-type basis functions instead of the usual 5 functions.
Definition: basisinfo.h:113
void output_density_images()
Definition: SCF_unrestricted.cc:971
int use_dft
Definition: scf.h:85
void fullvector(std::vector< Treal > &fullVector) const
Definition: VectorGeneral.h:88
intervalType homoInterval_F_ort_prev_alpha
Definition: SCF_unrestricted.h:139
normalMatrix ErrorMatrix_alpha
Definition: SCF_unrestricted.h:133
std::string eigenvectors_method
Definition: scf.h:153
int add_disturbance_to_matrix(int n, symmMatrix &A, ergo_real disturbance, int specificElementCount, const int *elementIndexVector, std::vector< int > const &permutationHML)
Definition: scf_utils.cc:761
int get_use_purification() const
Definition: GetDensFromFock.h:368
ergo_real charge
Definition: molecule.h:52
int startIndexInMatrix
Definition: basisinfo.h:81
void initialize_homo_lumo_limits()
Definition: SCF_unrestricted.cc:314
void report_density_difference()
Definition: SCF_unrestricted.cc:1190
void save_density_as_prevdens()
Definition: SCF_unrestricted.cc:1172
Representation of a molecule as a set of nuclei and total charge.
Definition: molecule.h:87
void write_matrices_to_file()
Definition: SCF_unrestricted.cc:329
ergo_real output_density_images_boxwidth
Definition: scf.h:118
void create_eigenvectors_files() const
Definition: SCF_unrestricted.cc:1347
symmMatrix densityMatrix_alpha
Definition: SCF_unrestricted.h:117
int puri_compute_eigv_in_each_iteration
Definition: scf.h:126
std::vector< ergo_real > eigValUNOCC_beta
Definition: SCF_unrestricted.h:159
void unset_generate_figures()
Do not plot figures from the recursive expansion.
Definition: GetDensFromFock.h:232
ergo_real electronicEntropyTerm
Definition: SCF_general.h:108
int use_prev_vector_as_initial_guess
Definition: scf.h:147
void output_sparsity_symm(int n, const symmMatrix &M, const char *matrixName)
Definition: scf_utils.cc:376
mat::SizesAndBlocks size_block_info
Definition: scf.h:277
Functionality for preparing a starting guess density matrix given a previous density matrix....
void get_computed_eigenpairs(std::vector< generalVector > &eigVecUNOCCref, std::vector< generalVector > &eigVecOCCref, std::vector< ergo_real > &eigValUNOCCref, std::vector< ergo_real > &eigValOCCref)
Definition: GetDensFromFock.h:180
void create_mtx_files_F(int const scfIter)
Definition: SCF_unrestricted.cc:1256
const Molecule & molecule
Definition: SCF_general.h:79
void save_full_matrices_for_matlab()
Definition: SCF_unrestricted.cc:1121
void save_current_fock_as_fprev()
Definition: SCF_unrestricted.cc:737
std::vector< generalVector > eigVecOCC_beta
Definition: SCF_unrestricted.h:156
symmMatrix Dprev_alpha
Definition: SCF_unrestricted.h:123
void set_eigs_F_ort_prev(intervalType &homoInterval_F_ort_prev_, intervalType &lumoInterval_F_ort_prev_)
Definition: GetDensFromFock.h:532
void clean_eigs_intervals()
Set bounds for HOMO and LUMO eigenvalues to -/+ inf, thus remove any known bounds.
Definition: GetDensFromFock.h:196
symmMatrix G_alpha
Definition: SCF_unrestricted.h:135
int get_simple_starting_guess_sparse(int n, int noOfElectrons, symmMatrix &densityMatrix)
Definition: scf_utils.cc:818
const BasisInfoStruct & basisInfo
Definition: SCF_general.h:81
int get_2e_matrices_and_energy_sparse_unrestricted(const BasisInfoStruct &basisInfo, const Molecule &molecule, const IntegralInfo &integralInfo, const JK::ExchWeights &CAM_params, symmMatrix &twoelMatrix_sparse_alpha, symmMatrix &twoelMatrix_sparse_beta, symmMatrix &densityMatrix_sparse_alpha, symmMatrix &densityMatrix_sparse_beta, const JK::Params &J_K_params, const Dft::GridParams &gridParams, int do_xc, ergo_real *energy_2el, int noOfElectrons, mat::SizesAndBlocks const &matrix_size_block_info, std::vector< int > const &permutationHML, std::vector< int > const &inversePermutationHML)
Definition: scf_utils.cc:1721
ergo_real getShellFactor(const IntegralInfo &integralInfo, ergo_real exponent, int shellType, int use_6_d_funcs)
Definition: basisinfo.cc:277
const IntegralInfo & integralInfo
Definition: SCF_general.h:82
intervalType homoInterval_F_ort_prev_beta
Definition: SCF_unrestricted.h:141
void output_density_images_orbital(generalVector &eigVec, const std::string &filename_id)
Definition: SCF_unrestricted.cc:964
ergo_real coords[3]
Definition: molecule.h:53
symmMatrix FockMatrix_alpha
Definition: SCF_unrestricted.h:119
std::vector< generalVector > eigVecUNOCC_beta
Definition: SCF_unrestricted.h:157
void do_output(int logCategory, int logArea, const char *format,...)
Definition: output.cc:53
void get_starting_guess_density()
Definition: SCF_unrestricted.cc:161
void output_expected_values_pos_operator()
Definition: SCF_unrestricted.cc:956
void calculate_energy()
Definition: SCF_unrestricted.cc:539
intervalType homoInterval_Fprev_beta
Definition: SCF_unrestricted.h:145
ergo_real energy
Definition: SCF_general.h:101
Routine get_dens_from_fock_full() for getting density matrix from a given Fock matrix using diagonali...
DIISManager * DIIS
Definition: SCF_general.h:119
void output_sparsity_S_F_D(SCF_statistics &stats)
Definition: SCF_unrestricted.cc:516
DIISManagerUnrestricted class implementing direct inversion in the iterative subspace (DIIS) for unre...
int load_density_and_project_sparse(GetDensFromFock &DensFromFock, 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)
load_density_and_project_sparse loads one or two density matrices (depending on value of noOfDensityM...
Definition: density_projection.cc:123
~SCF_unrestricted()
Definition: SCF_unrestricted.cc:88
Time-measuring class.
Definition: utilities.h:80
void get_error_measure()
Definition: SCF_unrestricted.cc:599
Functionality for writing output messages to a text file.
symmMatrix G_beta
Definition: SCF_unrestricted.h:136
intervalType lumoInterval_F_ort_prev_alpha
Definition: SCF_unrestricted.h:140