Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laplace-transformed DSRG-MRPT2 #381

Draft
wants to merge 66 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
ab78a20
Add Options
shuhangli98 Apr 1, 2022
18d41e5
Cumulant_master
shuhangli98 Jul 4, 2022
6d8c1b8
Merge branch 'evangelistalab:master' into master
shuhangli98 Oct 24, 2022
ecb48e6
Merged. TODO: Reorder integrals
shuhangli98 Oct 25, 2022
2f1af49
Update LT-DSRG-MRPT2
shuhangli98 Oct 28, 2022
5b5cd3d
Update LT
shuhangli98 Oct 28, 2022
7fa661a
Use T
shuhangli98 Oct 30, 2022
e94c660
Timer
shuhangli98 Oct 31, 2022
67b8ee3
Some modification for diskdf
shuhangli98 Nov 1, 2022
e8bde35
nrow = 1
shuhangli98 Nov 2, 2022
af84081
Initialize erfc integrals
shuhangli98 Dec 14, 2022
1ff855e
Add Schwarz screening
shuhangli98 Dec 16, 2022
6e3482e
Use get_pointer Add Schwarz screening
shuhangli98 Dec 16, 2022
f3e63f4
DiskDF test for LAPLACE-DSRG.
shuhangli98 Jan 12, 2023
be4344e
Fix a mistake
shuhangli98 Jan 13, 2023
45c8d1b
Change foptions
shuhangli98 Jan 14, 2023
f7416d3
Frozen core available
shuhangli98 Jan 15, 2023
9341c30
The bug has been fixed......
shuhangli98 Jan 18, 2023
0eeb4be
Also for Core part
shuhangli98 Jan 18, 2023
8d083f2
Do ccvv once.
shuhangli98 Jan 23, 2023
57b02cc
Backup for one-active section.
shuhangli98 Jan 30, 2023
05b7866
CAVV Coulomb
shuhangli98 Feb 6, 2023
18f1bc3
Some cleanup
shuhangli98 Feb 6, 2023
4c6dec7
Fixed the erfc metric
shuhangli98 Feb 9, 2023
01610f7
ABS
shuhangli98 Feb 15, 2023
8e6e630
DEBUG
shuhangli98 Feb 16, 2023
5517462
DEBUG TEST
shuhangli98 Feb 16, 2023
a088a13
DEBUG for CAVV
shuhangli98 Feb 16, 2023
c8624db
theta_NB_IAP
shuhangli98 Feb 18, 2023
6bc8347
CCAV section. Thresholds for different section.
shuhangli98 Mar 1, 2023
820ee11
One thread
shuhangli98 Mar 2, 2023
8bc7b31
s_inf
shuhangli98 Mar 3, 2023
f441b4f
Print orbital energies
shuhangli98 Mar 10, 2023
d87260a
Some changes
shuhangli98 Mar 13, 2023
1c9739a
Separate virtual orbitals
shuhangli98 Mar 16, 2023
21d70d2
Clean
shuhangli98 Mar 16, 2023
5e4ee9e
Split_virtual_option
shuhangli98 Mar 20, 2023
4f9eb8e
Add CCVV virtual splitting. Spin-integration for Laplace.
shuhangli98 Mar 24, 2023
f1fdeab
Debug ccvv_dsrg
shuhangli98 Mar 24, 2023
123574c
Debug CCVV_dsrg
shuhangli98 Mar 24, 2023
db2f39d
Thread?
shuhangli98 Mar 29, 2023
efb6964
Keep track of prescreening step
shuhangli98 Mar 29, 2023
8a1ad6c
Why it is slower?
shuhangli98 Mar 30, 2023
7a0ae41
Fermi-level
shuhangli98 Mar 30, 2023
df998d4
laplace no scale
shuhangli98 Mar 30, 2023
56e4a23
Laplace no scale. No Fermi level
shuhangli98 Mar 31, 2023
759c313
Test. Use original scale
shuhangli98 Mar 31, 2023
daff092
Modified. Exact scale. Only delete cholesky virtuals. Check whether s…
shuhangli98 Mar 31, 2023
5a45f82
Add local timer
shuhangli98 Mar 31, 2023
55a9bf7
Back to original version.
shuhangli98 Mar 31, 2023
5c57979
ADD XAP
shuhangli98 Apr 10, 2023
dc06386
Clean
shuhangli98 Apr 12, 2023
0c6f4d1
Theta_XNB, Theta_NB_XAP
shuhangli98 Apr 12, 2023
9c031e4
Fermi-level for cavv
shuhangli98 Apr 13, 2023
1cad8b4
Some clean-up: Load_int and prepare_cholesky
shuhangli98 Sep 2, 2023
0c3728d
Clean-up: Add functions LaplaceDSRG.cc
shuhangli98 Sep 6, 2023
8535f9d
Clean.
shuhangli98 Mar 22, 2024
2f26ae0
Restore.
shuhangli98 Mar 22, 2024
dd445c7
Reset test.
shuhangli98 Mar 22, 2024
c860902
Revert "Restore."
shuhangli98 Mar 22, 2024
8855c90
Now?
shuhangli98 Mar 22, 2024
5ed05e9
Checkout tests.
shuhangli98 Mar 22, 2024
34d2888
Restore DSRG-MRPT2
shuhangli98 Mar 22, 2024
961e284
Restore sa_mrpt2.
shuhangli98 Mar 22, 2024
7e27d6b
Merge branch 'main' into LT-DSRG
shuhangli98 Mar 22, 2024
c5fa4f0
Some changes. Wait for a Psi4 PR.
shuhangli98 Mar 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions forte/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,15 @@ mrdsrg-spin-integrated/mrdsrg_pt.cc
mrdsrg-spin-integrated/mrdsrg_smart_s.cc
mrdsrg-spin-integrated/mrdsrg_srg.cc
mrdsrg-spin-integrated/three_dsrg_mrpt2.cc
mrdsrg-spin-integrated/Laplace_dsrg.cc
orbital-helpers/ao_helper.cc
orbital-helpers/aosubspace.cc
orbital-helpers/ci-no/ci-no.cc
orbital-helpers/ci-no/mrci-no.cc
orbital-helpers/fragment_projector.cc
orbital-helpers/iao_builder.cc
orbital-helpers/Laplace.cc
orbital-helpers/LaplaceDenominator.cc
orbital-helpers/localize.cc
orbital-helpers/mp2_nos.cc
orbital-helpers/mrpt2_nos.cc
Expand Down
1,032 changes: 1,032 additions & 0 deletions forte/mrdsrg-spin-integrated/Laplace_dsrg.cc

Large diffs are not rendered by default.

158 changes: 158 additions & 0 deletions forte/mrdsrg-spin-integrated/Laplace_dsrg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
#ifndef _laplace_dsrg_h_
#define _laplace_dsrg_h_

#include "master_mrdsrg.h"

using namespace ambit;

namespace forte {

class LaplaceDSRG {
public:
LaplaceDSRG(std::shared_ptr<ForteOptions> options, std::shared_ptr<ForteIntegrals> ints,
std::shared_ptr<MOSpaceInfo> mo_space_info, psi::SharedVector epsilon_rdocc,
psi::SharedVector epsilon_virtual, psi::SharedVector epsilon_active,
psi::SharedMatrix Gamma1, psi::SharedMatrix Eta1);

~LaplaceDSRG();

void prepare_cholesky_coeff(std::shared_ptr<AtomicOrbitalHelper> ao_helper_ptr,
const std::string& algorithm);
void Load_int(double& theta_NB, const std::string& algorithm);
void clear_maps(const std::string& algorithm);
void fill_maps(const std::string& algorithm, const int& nweight, const int& nocc,
const int& nact, const int& nvir);
void compute_coulomb(const std::string& algorithm, const int& nocc, const int& nact,
const int& nvir);
void compute_exchange(const std::string& algorithm, const int& nocc, const int& nact,
const int& nvir);
double compute_ccvv();
double compute_cavv();
double compute_ccav();
void print_header();
size_t vir_start() { return vir_start_; }

protected:
std::shared_ptr<ForteOptions> foptions_;
std::shared_ptr<ForteIntegrals> ints_;
std::shared_ptr<MOSpaceInfo> mo_space_info_;
psi::SharedVector eps_rdocc_;
psi::SharedVector eps_virtual_;
psi::SharedVector eps_active_;
psi::SharedMatrix Cwfn_;
psi::SharedMatrix C_pq_;
psi::SharedMatrix S_;
SparseMap i_p_;

std::shared_ptr<psi::BasisSet> primary_;
std::shared_ptr<psi::BasisSet> auxiliary_;

size_t nmo_;
size_t nthree_;
size_t nfrozen_;
size_t ncore_;
size_t nactive_;
size_t nvirtual_;

/// Thresholds
double Omega_;
double laplace_threshold_;
double vir_tol_;
size_t vir_start_;
size_t weights_;

/// CCVV
double theta_NB_;
double theta_NB_IAP_;
double theta_ij_;
double theta_schwarz_;
double theta_ij_sqrt_;

/// CAVV
double theta_NB_cavv_;
double theta_XNB_cavv_;
double theta_NB_IAP_cavv_;
double theta_NB_XAP_cavv_;
double theta_ij_cavv_;
double theta_schwarz_cavv_;
double theta_ij_sqrt_cavv_;

/// CCAV
double theta_NB_ccav_;
double theta_NB_IAP_ccav_;
double theta_ij_ccav_;
double theta_schwarz_ccav_;
double theta_ij_sqrt_ccav_;

/// Energy
double E_J_;
double E_K_;

/// SparseMaps related
SparseMap ao_list_per_q_;
SparseMap i_bar_p_up_; /// Construct [ibar]_p
SparseMap a_bar_p_up_; /// Construct [abar]_p
SparseMap ibar_p_; /// Construct {ibar}_p
SparseMap xbar_p_; /// Construct {xbar}_p
SparseMap ibar_x_p_; /// Construct {ibar_x}_p
SparseMap P_ibar_; /// Construct {P}_ibar. Obtain this by "inversion" of {ibar}_p
SparseMap P_xbar_; /// Construct {P}_xbar
SparseMap P_ibar_x_; /// Construct {p}_ibar_x
SparseMap abar_ibar_; /// Construct {a_bar}_ibar
SparseMap abar_xbar_; /// Construct {a_bar}_xbar
SparseMap xbar_ibar_; /// Construct {x_bar}_ibar

psi::SharedMatrix N_pu_;
std::vector<psi::SharedMatrix> P_iu_;
std::vector<psi::SharedMatrix> T_ibar_i_list_;
std::vector<SparseMap> xbar_u_p_;
std::vector<std::vector<psi::SharedMatrix>> P_xbar_u_cavv_;
std::vector<std::vector<psi::SharedMatrix>> P_xbar_u_ccav_;
std::vector<psi::SharedMatrix> P_ibar_u_; /// Construct (P|ibar u)
std::vector<psi::SharedMatrix> P_ibar_abar_; /// Construct (P|ibar abar)
std::vector<psi::SharedMatrix> P_xbar_abar_; /// Construct (P|xbar abar)
std::vector<psi::SharedMatrix> P_ibar_xbar_; /// Construct (P|ibar xbar)
std::vector<psi::SharedMatrix> i_bar_a_bar_P_; /// Construct (ibar abar|P)
std::vector<psi::SharedMatrix> x_bar_a_bar_P_; /// Construct (xbar abar|P)
std::vector<psi::SharedMatrix> i_bar_x_bar_P_; /// Construct (ibar xbar|P)
std::vector<psi::SharedMatrix> i_bar_a_bar_P_sliced_; /// Constrcut Sliced (ibar abar|P);
std::vector<psi::SharedMatrix> x_bar_a_bar_P_sliced_; /// Construct Sliced (xbar abar|P)
std::vector<psi::SharedMatrix> i_bar_x_bar_P_sliced_; /// Construct Sliced (ibar xbar|P)
psi::SharedMatrix Z_pq_; /// Construct Z_pq
psi::SharedMatrix ZA_pq_; /// Construct ZA_pq
std::vector<psi::SharedMatrix> B_ia_Q_; /// Construct B_ia_Q
std::vector<psi::SharedMatrix> B_xa_Q_; /// Construct B_xa_Q
std::vector<psi::SharedMatrix> B_ix_Q_; /// Construct B_ix_Q
psi::SharedMatrix Q_ia_; /// Construc Q_ia square;
psi::SharedMatrix Q_xa_;
psi::SharedMatrix Q_ix_;
std::vector<int> vir_intersection_per_ij_;
std::vector<int> aux_intersection_per_ij_;
std::vector<int> aux_in_B_i_;
std::vector<int> aux_in_B_j_;
std::vector<int> aux_in_B_ix_;
std::vector<int> vir_intersection_per_ix_;
std::vector<int> aux_intersection_per_ix_;
std::vector<int> aux_intersection_per_ijx_;
std::vector<int> aux_intersection_per_ixj_;

/// CCVV Cholesky
std::vector<psi::SharedMatrix> Occupied_cholesky_;
std::vector<psi::SharedMatrix> Virtual_cholesky_;
psi::SharedMatrix Cholesky_Occ_;

std::vector<psi::SharedMatrix> Occupied_cholesky_abs_;
std::vector<psi::SharedMatrix> Virtual_cholesky_abs_;
psi::SharedMatrix Cholesky_Occ_abs_;

/// CAVV Cholesky
std::vector<psi::SharedMatrix> Active_cholesky_;
std::vector<psi::SharedMatrix> Active_cholesky_abs_;
psi::SharedMatrix Gamma1_mat_;

/// CCAV Cholesky
psi::SharedMatrix Eta1_mat_;
};
} // namespace forte

#endif
Loading