Psi4
dcft.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2019 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef _PSI4_SRC_BIN_DCFT_DCFT_H_
30 #define _PSI4_SRC_BIN_DCFT_DCFT_H_
31 
32 #include "psi4/libmints/matrix.h"
33 #include "psi4/libmints/vector.h"
35 #include "psi4/libdpd/dpd.h"
36 #include "psi4/libciomr/libciomr.h"
38 
39 #define DCFT_TIMER
40 
41 // Handy mints timer macros, requires libqt to be included
42 #ifdef DCFT_TIMER
43 #include "psi4/libqt/qt.h"
44 
45 #define dcft_timer_on(a) timer_on((a));
46 #define dcft_timer_off(a) timer_off((a));
47 #else
48 #define dcft_timer_on(a)
49 #define dcft_timer_off(a)
50 #endif
51 
52 #define ID(x) _ints->DPD_ID(x)
53 
54 #ifndef INDEX
55 #define INDEX(i, j) (((i) > (j)) ? (((i) * ((i) + 1) / 2) + (j)) : (((j) * ((j) + 1) / 2) + (i)))
56 #endif
57 
58 #define PRINT_ENERGY_COMPONENTS 0
59 
60 namespace psi {
61 
62 class Options;
63 class IntegralTransform;
64 
65 namespace dcft {
66 
67 class DCFTSolver : public Wavefunction {
68  public:
70  ~DCFTSolver() override;
71 
72  double compute_energy() override;
73 
74  protected:
76 
77  void mp2_guess();
78  void scf_guess();
79  void finalize();
80  void transform_integrals();
82  void sort_OOOO_integrals();
83  void sort_OOVV_integrals();
84  void sort_VVVV_integrals();
85  void sort_OVOV_integrals();
86  void sort_OVVV_integrals();
87  void sort_OOOV_integrals();
88  void init();
89  void compute_dcft_energy();
90  void compute_cepa0_energy();
92  void compute_scf_energy();
94  void build_tau();
95  void transform_tau();
96  void build_gtau();
97  void print_opdm();
101  void process_so_ints();
102  void build_G();
103  void build_AO_tensors();
104  void build_denominators();
105  void update_fock();
106  void dump_density();
107  void dpd_buf4_add(dpdbuf4 *A, dpdbuf4 *B, double alpha);
108  void half_transform(dpdbuf4 *A, dpdbuf4 *B, SharedMatrix &C1, SharedMatrix &C2, int *mospi_left, int *mospi_right,
109  int **so_row, int **mo_row, bool backwards, double alpha, double beta);
110  void file2_transform(dpdfile2 *A, dpdfile2 *B, SharedMatrix C, bool backwards);
111  void AO_contribute(dpdbuf4 *tau1_AO, dpdbuf4 *tau2_AO, int p, int q, int r, int s, double value,
112  dpdfile2 * = nullptr, dpdfile2 * = nullptr, dpdfile2 * = nullptr);
113  // void AO_contribute(dpdfile2 *tau1_AO, dpdfile2 *tau2_AO, int p, int q,
114  // int r, int s, double value);
115  bool correct_mo_phases(bool dieOnError = true);
116  double compute_cumulant_residual();
117  double compute_scf_error_vector();
118  double update_scf_density(bool damp = false);
119  void run_twostep_dcft();
122  void run_simult_dcft();
123  void run_simult_dcft_oo();
124  // DCFT analytic gradient subroutines
125  SharedMatrix compute_gradient() override;
126  void compute_gradient_dc();
127  void compute_gradient_odc();
128  void response_guess();
129  void gradient_init();
130  void compute_lagrangian_OV();
131  void compute_lagrangian_VO();
133  void orbital_response_guess();
135  double update_orbital_response();
136  double compute_response_coupling();
139  void build_perturbed_tau();
143  void compute_lagrangian_OO();
144  void compute_lagrangian_VV();
145  void compute_ewdm_dc();
146  void compute_ewdm_odc();
151  void compute_TPDM_trace();
152  // Quadratically-convergent DCFT
153  void run_qc_dcft();
155  void form_idps();
156  void compute_sigma_vector();
162  int iterate_nr_jacobi();
163  void check_qc_convergence();
165  void update_cumulant_nr();
166  void run_davidson();
167  void davidson_guess();
168  // Exact Tau
169  void refine_tau();
171  // Cumulant residual intermediates
172  void compute_G_intermediate();
173  void compute_F_intermediate();
174  void compute_V_intermediate();
175  void compute_W_intermediate();
176  void compute_H_intermediate();
177  void compute_I_intermediate();
178  void compute_J_intermediate();
179  void compute_K_intermediate();
180  void compute_L_intermediate();
181  void compute_O_intermediate();
182  void compute_M_intermediate();
183  void compute_N_intermediate();
184 
185  // Orbital-optimized DCFT
186  void run_simult_dc_guess();
187  double compute_orbital_residual();
195  void rotate_orbitals();
196  void compute_oe_properties();
197  void write_molden_file();
198  // Three-particle cumulant contributions
200  void dcft_semicanonicalize();
202  void dump_semicanonical();
205  void semicanonicalize_dc();
206  double compute_triples_aaa();
207  double compute_triples_aab();
208  double compute_triples_abb();
209  double compute_triples_bbb();
210 
211  // RHF-reference DCFT
212  double compute_energy_RHF();
213  void scf_guess_RHF();
214  double update_scf_density_RHF(bool damp = false);
216  void build_denominators_RHF();
217  void mp2_guess_RHF();
226  void run_simult_dcft_oo_RHF();
227  void run_simult_dcft_RHF();
228  void build_tau_RHF();
229  void refine_tau_RHF();
230  void transform_tau_RHF();
231  void process_so_ints_RHF();
237  void compute_scf_energy_RHF();
241  void rotate_orbitals_RHF();
248  void compute_gradient_RHF();
249  void gradient_init_RHF();
253  void compute_ewdm_odc_RHF();
254  void print_opdm_RHF();
255  void compute_R_AA_and_BB();
256  void presort_mo_tpdm_AB();
257  void presort_mo_tpdm_AA();
258 
259  // UHF-reference DCFT
260  void compute_gradient_UHF();
261  double compute_energy_UHF();
262 
263  bool augment_b(double *vec, double tol);
278  int print_;
280  int ntriso_;
282  int nalpha_;
284  int nbeta_;
286  int navir_;
288  int nbvir_;
290  int maxdiis_;
294  int maxiter_;
296  int iter_;
297  // Quadratically-convergent DCFT
299  int nidp_;
315  int dim_;
325  int nguess_;
327  int b_dim_;
331  int n_add_;
333  int nevals_;
345  int *aocc_off_;
347  int *avir_off_;
349  int *bocc_off_;
351  int *bvir_off_;
353  double enuc_;
375  double scf_energy_;
383  double regularizer_;
388  double vec_add_tol_;
391 
466  // Quadratically-convergent DCFT
498 
500  std::string indent;
501 
502  // Density-Fitting DCFT
504  void df_build_b_ao();
506  void df_memory();
508  void build_DF_tensors_RHF();
509  void build_DF_tensors_UHF();
511  void formJm12(std::shared_ptr<BasisSet> auxiliary, std::shared_ptr<BasisSet> zero);
512  void formJm12_scf(std::shared_ptr<BasisSet> auxiliary, std::shared_ptr<BasisSet> zero);
514  void formb_ao(std::shared_ptr<BasisSet> primary, std::shared_ptr<BasisSet> auxiliary,
515  std::shared_ptr<BasisSet> zero);
516  void formb_ao_scf(std::shared_ptr<BasisSet> primary, std::shared_ptr<BasisSet> auxiliary,
517  std::shared_ptr<BasisSet> zero);
519  void transform_b();
521  void transform_b_ao2so();
522  void transform_b_ao2so_scf();
524  void formb_oo();
525  void formb_oo_scf();
527  void formb_ov();
529  void formb_vv();
531  void formb_pq();
532  void formb_pq_scf();
533 
535  void form_df_g_ovov();
537  void form_df_g_oooo();
539  void form_df_g_vvoo();
541  void form_df_g_vooo();
543  void form_df_g_ovvv();
545  void form_df_g_vvvv();
547  void build_gbarGamma_RHF();
548  void build_gbarGamma_UHF();
550  void build_gbarKappa_RHF();
551  void build_gbarKappa_UHF();
555 
556  // Density-Fitting DCFT
558  std::shared_ptr<BasisSet> auxiliary_;
560  std::shared_ptr<BasisSet> auxiliary_scf_;
562  std::shared_ptr<BasisSet> primary_;
564  int nn_;
566  int nQ_;
567  int nQ_scf_;
569  int naocc_;
571  double **Jm12_;
572  double **Jm12_scf_;
583 
598 
610 };
611 
612 } // namespace dcft
613 } // namespace psi
614 
615 #endif // Header guard
bool orbitalsDone_
Controls convergence of the orbital updates.
Definition: dcft.h:265
void transform_tau_RHF()
Definition: dcft_tau_RHF.cc:256
void half_transform(dpdbuf4 *A, dpdbuf4 *B, SharedMatrix &C1, SharedMatrix &C2, int *mospi_left, int *mospi_right, int **so_row, int **mo_row, bool backwards, double alpha, double beta)
Definition: half_transform.cc:57
void build_gbarlambda_UHF_v3mem()
Definition: dcft_df_tensor.cc:1853
void sort_OVVV_integrals()
Definition: dcft_integrals_UHF.cc:436
void run_qc_dcft()
Definition: dcft_qc.cc:45
double old_total_energy_
The previous total energy.
Definition: dcft.h:379
void compute_sigma_vector()
Definition: dcft_qc.cc:540
double regularizer_
The Tikhonow regularizer used to remove singularities (c.f. Taube and Bartlett, JCP, 2009)
Definition: dcft.h:383
void process_so_ints()
Definition: dcft_scf_UHF.cc:453
void form_density_weighted_fock()
Definition: dcft_intermediates_UHF.cc:516
SharedMatrix Fa_
The alpha Fock matrix in the SO basis.
Definition: dcft.h:433
double compute_cumulant_residual()
Definition: dcft_lambda_UHF.cc:48
void response_guess()
Definition: dcft_gradient_UHF.cc:325
bool cumulantDone_
Controls convergence of the decnsity cumulant updates.
Definition: dcft.h:267
Options & options() const
Definition: wavefunction.cc:645
void build_DF_tensors_RHF()
Build density-fitted &lt;VV||VV&gt;, &lt;vv||vv&gt;, and &lt;Vv|Vv&gt; tensors in G intermediate.
Definition: dcft_df_tensor.cc:1408
void form_idps()
Definition: dcft_qc.cc:317
void transform_core_integrals_RHF()
Definition: dcft_integrals_RHF.cc:239
void build_gbarKappa_UHF()
Definition: dcft_df_tensor.cc:2412
SharedMatrix bocc_tau_
The Tau matrix in the MO basis (beta occupied)
Definition: dcft.h:407
void dcft_semicanonicalize()
Definition: dcft_triples.cc:64
int nn_
Number of total primary basis functions.
Definition: dcft.h:564
void form_df_g_vooo()
Form density-fitted MO-basis TEI g(VO|OO) in chemists&#39; notation.
Definition: dcft_df_tensor.cc:1057
int b_dim_
The dimension of the subspace in the Davidson diagonalization.
Definition: dcft.h:327
void process_so_ints_RHF()
Definition: dcft_scf_RHF.cc:121
void sort_OVOV_integrals()
Definition: dcft_integrals_UHF.cc:133
double compute_triples_aaa()
Definition: dcft_triples.cc:744
void sort_VVVV_integrals()
Definition: dcft_integrals_UHF.cc:326
SharedVector Q_
The new element of Krylov subspace vector in the IDP basis for conjugate gradient procedure...
Definition: dcft.h:487
SharedMatrix scf_error_a_
The alpha SCF error vector.
Definition: dcft.h:463
void form_df_g_vvvv()
Form density-fitted MO-basis TEI g&lt;VV|VV&gt; in physists&#39; notation.
Definition: dcft_df_tensor.cc:1338
SharedMatrix kappa_so_a_
The alpha kappa matrix in the SO basis.
Definition: dcft.h:451
void presort_mo_tpdm_AA()
Definition: dcft_sort_mo_tpdm.cc:196
void compute_F_intermediate_RHF()
Definition: dcft_intermediates_RHF.cc:216
SharedMatrix bQpqB_mo_
Definition: dcft.h:595
SharedMatrix kappa_mo_a_
The Kappa in the MO basis (alpha occupied)
Definition: dcft.h:421
SharedMatrix aocc_tau_
The Tau matrix in the MO basis (alpha occupied)
Definition: dcft.h:405
SharedVector D_
The conjugate direction vector in the IDP basis for conjugate gradient procedure. ...
Definition: dcft.h:481
double compute_orbital_residual_RHF()
Definition: dcft_oo_RHF.cc:208
void run_twostep_dcft_orbital_updates()
Definition: dcft_compute_UHF.cc:347
int n_add_
The number of vectors that can be added during the iteration in the Davidson diagonalization.
Definition: dcft.h:331
SharedMatrix mo_gammaB_
Definition: dcft.h:609
void formb_pq()
Form MO-basis b(Q, pq)
Definition: dcft_df_tensor.cc:728
bool energyConverged_
Controls convergence of the DCFT energy.
Definition: dcft.h:271
double diis_start_thresh_
The convergence that must be achieved before DIIS extrapolation starts.
Definition: dcft.h:373
double new_total_energy_
The updated total energy.
Definition: dcft.h:381
void sort_OVOV_integrals_RHF()
Definition: dcft_integrals_RHF.cc:148
double compute_cumulant_response_residual()
Definition: dcft_gradient_UHF.cc:2938
SharedMatrix orbital_gradient_b_
The orbital gradient in the MO basis (Beta spin)
Definition: dcft.h:470
void mp2_guess_RHF()
Definition: dcft_mp2_RHF.cc:50
void compute_I_intermediate()
Definition: dcft_intermediates_UHF.cc:1795
SharedMatrix bQmn_ao_scf_
Definition: dcft.h:576
void transform_b_ao2so()
Transform b(Q|mu,nu) from AO basis to SO basis.
Definition: dcft_df_tensor.cc:374
void compute_W_intermediate()
Definition: dcft_intermediates_UHF.cc:2295
void gradient_init_RHF()
Definition: dcft_gradient_RHF.cc:54
SharedMatrix bQabB_mo_
Definition: dcft.h:592
void presort_mo_tpdm_AB()
Definition: dcft_sort_mo_tpdm.cc:52
double response_coupling_rms_
The RMS value of the change in the coupling of orbital and cumulant response.
Definition: dcft.h:365
void dump_semicanonical()
Definition: dcft_triples.cc:124
void print_opdm_RHF()
Definition: dcft_tau_RHF.cc:315
void compute_dcft_energy_RHF()
Definition: dcft_energy_RHF.cc:41
int * avir_off_
Alpha virtual MO offset.
Definition: dcft.h:347
double ** Jm12_
J^-1/2 Matrix.
Definition: dcft.h:571
void compute_H_intermediate()
Definition: dcft_intermediates_UHF.cc:1699
SharedMatrix bQmn_so_
Definition: dcft.h:575
~DCFTSolver() override
Definition: dcft.cc:117
SharedMatrix mo_gbarGamma_A_
MO-based (Gbar Tau + Gbar Kappa)
Definition: dcft.h:603
int nevals_
The number of eigenvalues requested in the stability check.
Definition: dcft.h:333
SharedMatrix bvir_ptau_
The perturbed Tau matrix in the MO basis (beta virtual)
Definition: dcft.h:419
void formb_oo_scf()
Definition: dcft_df_tensor.cc:2819
void print_orbital_energies()
Definition: dcft_scf_UHF.cc:229
void update_cumulant_response()
Definition: dcft_gradient_UHF.cc:3039
void compute_sigma_vector_orb_cum()
Definition: dcft_qc.cc:866
void sort_OOOO_integrals_RHF()
Definition: dcft_integrals_RHF.cc:158
void transform_b()
Transform AO-basis b(Q, mn) to MO-basis b(Q, pq)
Definition: dcft_df_tensor.cc:360
SharedMatrix g_tau_a_
The alpha external potential in the SO basis.
Definition: dcft.h:455
void compute_orbital_rotation_nr()
Definition: dcft_qc.cc:1912
void compute_relaxed_density_OOVV()
Definition: dcft_density_UHF.cc:1321
SharedMatrix X_a_
Generator of the orbital rotations (Alpha) with respect to the orbitals from the previous update...
Definition: dcft.h:491
void build_gbarGamma_UHF()
Definition: dcft_df_tensor.cc:2240
bool exact_tau_
Definition: dcft.h:276
SharedMatrix bQiaA_mo_
b(Q|i, a)
Definition: dcft.h:585
int dim_orbitals_
The maximum number of IDPs possible for orbital updates.
Definition: dcft.h:317
void init()
Definition: dcft_memory.cc:49
void compute_cumulant_response_intermediates()
Definition: dcft_gradient_UHF.cc:2233
double compute_scf_error_vector()
Definition: dcft_scf_UHF.cc:364
SharedMatrix bvir_tau_
The Tau matrix in the MO basis (beta virtual)
Definition: dcft.h:411
void form_df_g_oooo()
Form density-fitted MO-basis TEI g(OO|OO) in chemists&#39; notation.
Definition: dcft_df_tensor.cc:884
void sort_OOVV_integrals_RHF()
Definition: dcft_integrals_RHF.cc:167
void transform_core_integrals()
Definition: dcft_integrals_UHF.cc:497
SharedMatrix g_tau_b_
The beta external potential in the SO basis.
Definition: dcft.h:457
SharedMatrix bQaiB_mo_
Definition: dcft.h:589
bool orbital_optimized_
Whether the user requested the DCFT functional that is variationally orbitally-optimized.
Definition: dcft.h:273
Definition: dcft.h:67
void transform_integrals_triples()
Definition: dcft_triples.cc:93
void scf_guess_RHF()
Definition: dcft_scf_RHF.cc:52
void build_gbarGamma_RHF()
Form MO-based Gbar*Gamma.
Definition: dcft_df_tensor.cc:1580
SharedMatrix old_ca_
The old full alpha MO coefficients.
Definition: dcft.h:447
int orbital_idp_
The total number of orbital independent pairs for the current NR step.
Definition: dcft.h:305
void compute_R_AA_and_BB()
Definition: dcft_lambda_RHF.cc:128
void sort_OOOO_integrals()
Definition: dcft_integrals_UHF.cc:209
void compute_L_intermediate()
Definition: dcft_intermediates_UHF.cc:2065
SharedMatrix mo_gammaA_
MO-based Gamma &lt;r|s&gt;
Definition: dcft.h:608
int nQ_
Number of total auxilliary basis functions.
Definition: dcft.h:566
double compute_three_particle_energy()
Definition: dcft_triples.cc:42
void form_df_g_vvoo()
Form density-fitted MO-basis TEI g(VV|OO) in chemists&#39; notation.
Definition: dcft_df_tensor.cc:949
Enter brief description of file here.
void compute_ewdm_dc()
Definition: dcft_gradient_UHF.cc:3622
void build_gtau()
Definition: dcft_integrals_UHF.cc:806
void update_cumulant_jacobi_RHF()
Definition: dcft_lambda_RHF.cc:86
void mp2_guess()
Definition: dcft_mp2_UHF.cc:51
SharedMatrix moFb_
The beta Fock matrix in the MO basis.
Definition: dcft.h:439
void build_cumulant_intermediates()
Definition: dcft_intermediates_UHF.cc:43
int nidp_
The total number of independent pairs for the current NR step.
Definition: dcft.h:299
void semicanonicalize_gbar_ooov()
Definition: dcft_triples.cc:390
double vec_add_tol_
Definition: dcft.h:388
double compute_triples_bbb()
Definition: dcft_triples.cc:2433
void davidson_guess()
Definition: dcft_qc.cc:2206
void compute_cepa0_energy()
Definition: dcft_energy_UHF.cc:159
double enuc_
The nuclear repulsion energy in Hartree.
Definition: dcft.h:353
int maxdiis_
The maximum size of the DIIS subspace.
Definition: dcft.h:290
SharedMatrix aocc_c_
The alpha occupied eigenvectors, per irrep.
Definition: dcft.h:393
int cumulant_idp_bb_
The number of cumulant independent pairs for the current NR step (Beta-Beta spin) ...
Definition: dcft.h:311
int max_space_
The maximum size of the subspace in stability check.
Definition: dcft.h:335
void compute_dcft_energy()
Definition: dcft_energy_UHF.cc:43
int * bocc_off_
Beta occupied MO offset.
Definition: dcft.h:349
void iterate_cumulant_response()
Definition: dcft_gradient_UHF.cc:1890
SharedMatrix mo_gbarKappa_B_
Definition: dcft.h:606
void update_cumulant_nr()
Definition: dcft_qc.cc:1950
int print_
The amount of information to print.
Definition: dcft.h:278
void formb_ao_scf(std::shared_ptr< BasisSet > primary, std::shared_ptr< BasisSet > auxiliary, std::shared_ptr< BasisSet > zero)
Definition: dcft_df_tensor.cc:2664
void compute_K_intermediate()
Definition: dcft_intermediates_UHF.cc:1907
double compute_cumulant_residual_RHF()
Definition: dcft_lambda_RHF.cc:46
SharedMatrix moFa_
The alpha Fock matrix in the MO basis.
Definition: dcft.h:437
SharedMatrix avir_ptau_
The perturbed Tau matrix in the MO basis (alpha virtual)
Definition: dcft.h:417
void compute_unrelaxed_density_VVVV_RHF()
Definition: dcft_density_RHF.cc:292
double compute_energy_UHF()
Definition: dcft_compute_UHF.cc:48
int nbvir_
The number of virtual beta orbitals.
Definition: dcft.h:288
double energy_level_shift_
Level shift applied to the diagonal of the density-weighted Fock operator.
Definition: dcft.h:390
double cumulant_convergence_
The RMS value of the change in lambda after the lambda iterations.
Definition: dcft.h:359
std::shared_ptr< BasisSet > auxiliary_
Auxiliary basis.
Definition: dcft.h:558
void transform_integrals_RHF()
Definition: dcft_integrals_RHF.cc:45
void compute_N_intermediate()
Definition: dcft_intermediates_UHF.cc:3463
void compute_gradient_dc()
Definition: dcft_gradient_UHF.cc:56
void compute_sigma_vector_orb_orb()
Definition: dcft_qc.cc:777
void formb_ov()
Form MO-basis b(Q, ia)
Definition: dcft_df_tensor.cc:531
void df_memory()
Calculate memory required for density-fitting.
Definition: dcft_df_tensor.cc:307
void sort_OOOV_integrals()
Definition: dcft_integrals_UHF.cc:350
double update_scf_density_RHF(bool damp=false)
Definition: dcft_scf_RHF.cc:86
SharedMatrix bQmn_so_scf_
Definition: dcft.h:577
void compute_gradient_odc_RHF()
Definition: dcft_gradient_RHF.cc:86
void gradient_init()
Definition: dcft_gradient_UHF.cc:253
SharedMatrix s_half_inv_
The inverse square root overlap matrix in the SO basis.
Definition: dcft.h:445
void refine_tau_RHF()
Definition: dcft_tau_RHF.cc:128
void compute_relaxed_density_VVVV()
Definition: dcft_density_UHF.cc:1672
void sort_OVVV_integrals_RHF()
Definition: dcft_integrals_RHF.cc:228
bool correct_mo_phases(bool dieOnError=true)
Definition: dcft_scf_UHF.cc:56
void semicanonicalize_dc()
Definition: dcft_triples.cc:595
SharedMatrix bQijA_mo_scf_
Definition: dcft.h:581
Dimension naoccpi_
The number of occupied alpha orbitals per irrep.
Definition: dcft.h:337
void run_simult_dcft_oo_RHF()
Definition: dcft_oo_RHF.cc:51
void compute_ewdm_odc()
Definition: dcft_gradient_UHF.cc:4583
SharedMatrix so_h_
The one-electron integrals in the SO basis.
Definition: dcft.h:427
void compute_oe_properties()
Definition: dcft_density_UHF.cc:2008
void iterate_orbital_response()
Definition: dcft_gradient_UHF.cc:1094
SharedMatrix Xtotal_a_
Generator of the orbital rotations (Alpha) with respect to the reference orbitals.
Definition: dcft.h:495
void compute_unrelaxed_density_OOOO_RHF()
Definition: dcft_density_RHF.cc:40
void build_gbarKappa_RHF()
Form MO-based Gbar*Kappa.
Definition: dcft_df_tensor.cc:1688
void compute_F_intermediate()
Definition: dcft_intermediates_UHF.cc:397
double update_scf_density(bool damp=false)
Definition: dcft_scf_UHF.cc:409
SharedVector S_
The search direction vector in the IDP basis for conjugate gradient procedure.
Definition: dcft.h:485
SharedMatrix bQijB_mo_
Definition: dcft.h:580
double r_convergence_
Convergence of the residual in the Davidson diagonalization.
Definition: dcft.h:329
Dimension navirpi_
The number of virtual alpha orbitals per irrep.
Definition: dcft.h:341
SharedMatrix bocc_ptau_
The perturbed Tau matrix in the MO basis (beta occupied)
Definition: dcft.h:415
void update_cumulant_jacobi()
Definition: dcft_lambda_UHF.cc:200
void build_gbarlambda_RHF_v3mem()
Form gbar&lt;ab|cd&gt; * lambda &lt;ij|cd&gt;
Definition: dcft_df_tensor.cc:1444
void formb_ao(std::shared_ptr< BasisSet > primary, std::shared_ptr< BasisSet > auxiliary, std::shared_ptr< BasisSet > zero)
Form AO basis b(Q|mu,nu)
Definition: dcft_df_tensor.cc:210
double compute_orbital_residual()
Definition: dcft_oo_UHF.cc:229
void build_tau_fourth_order()
Definition: dcft_tau_UHF.cc:171
SharedVector gradient_
Orbital and cumulant gradient in the basis of IDP.
Definition: dcft.h:472
void compute_orbital_response_intermediates()
Definition: dcft_gradient_UHF.cc:1211
void semicanonicalize_gbar_ovvv()
Definition: dcft_triples.cc:209
void run_simult_dc_guess()
Definition: dcft_oo_UHF.cc:197
int ntriso_
The number of unique pairs of symmetrized atomic orbitals.
Definition: dcft.h:280
SharedMatrix tau_so_b_
The Tau matrix in the AO basis, stored by irrep, to perturb the beta Fock matrix. ...
Definition: dcft.h:403
void build_perturbed_tau()
Definition: dcft_gradient_UHF.cc:2024
void compute_orbital_rotation_jacobi_RHF()
Definition: dcft_oo_RHF.cc:580
void compute_unrelaxed_density_OOVV()
Definition: dcft_density_UHF.cc:220
void run_simult_dcft_oo()
Definition: dcft_oo_UHF.cc:45
SharedMatrix b_
The subspace vector in the Davidson diagonalization procedure.
Definition: dcft.h:489
SharedMatrix bQmn_ao_
b(Q|mu,nu)
Definition: dcft.h:574
void form_density_weighted_fock_RHF()
Definition: dcft_intermediates_RHF.cc:252
int orbital_idp_a_
The number of orbital independent pairs for the current NR step (Alpha spin)
Definition: dcft.h:301
SharedMatrix tau_so_a_
The Tau matrix in the AO basis, stored by irrep, to perturb the alpha Fock matrix.
Definition: dcft.h:401
SharedVector sigma_
Sigma vector in the basis of IDP (the product of the off-diagonal part of the Hessian with the step v...
Definition: dcft.h:479
void update_fock()
Definition: dcft_scf_UHF.cc:1014
int nQ_scf_
Definition: dcft.h:567
void formb_oo()
Form MO-basis b(Q, ij)
Definition: dcft_df_tensor.cc:431
void transform_b_ao2so_scf()
Definition: dcft_df_tensor.cc:2762
SharedMatrix orbital_gradient_a_
The orbital gradient in the MO basis (Alpha spin)
Definition: dcft.h:468
bool augment_b(double *vec, double tol)
Definition: dcft_qc.cc:2220
void compute_scf_energy_RHF()
Definition: dcft_scf_RHF.cc:482
void compute_J_intermediate()
Definition: dcft_intermediates_UHF.cc:1851
void orbital_response_guess()
Definition: dcft_gradient_UHF.cc:1159
void run_twostep_dcft()
Definition: dcft_compute_UHF.cc:184
SharedMatrix ao_s_
The overlap matrix in the AO basis.
Definition: dcft.h:425
void formJm12(std::shared_ptr< BasisSet > auxiliary, std::shared_ptr< BasisSet > zero)
Form J(P|Q)^-1/2.
Definition: dcft_df_tensor.cc:125
double orbitals_convergence_
The RMS value of the error vector after the SCF iterations.
Definition: dcft.h:357
SharedMatrix mo_tauA_
The Tau in the MO basis (All)
Definition: dcft.h:600
int dim_cumulant_
The maximum number of IDPs possible for cumulant updates.
Definition: dcft.h:319
void finalize()
Definition: dcft_memory.cc:204
SharedMatrix Fb_
The beta Fock matrix in the SO basis.
Definition: dcft.h:435
void compute_unrelaxed_density_VVVV()
Definition: dcft_density_UHF.cc:994
void transform_tau()
Definition: dcft_tau_UHF.cc:592
int naocc_
Number of alpha occupied orbitals.
Definition: dcft.h:569
void compute_lagrangian_VV()
Definition: dcft_gradient_UHF.cc:3385
double cumulant_response_rms_
The RMS value of the change in the cumulant response.
Definition: dcft.h:363
int run_twostep_dcft_cumulant_updates()
Definition: dcft_compute_UHF.cc:237
Definition: dimension.h:40
int nguess_
The number of the guess subspace vectors for the Davidson diagonalization.
Definition: dcft.h:325
void compute_orbital_rotation_jacobi()
Definition: dcft_oo_UHF.cc:871
double compute_energy_RHF()
Definition: dcft_compute_RHF.cc:51
void write_molden_file()
Definition: dcft_density_UHF.cc:2067
Dimension nbvirpi_
The number of virtual beta orbitals per irrep.
Definition: dcft.h:343
SharedMatrix moF0b_
The beta Fock matrix (without Tau contribution) in the MO basis.
Definition: dcft.h:431
SharedMatrix bQpqA_mo_scf_
Definition: dcft.h:596
SharedMatrix mo_gbarKappa_A_
Definition: dcft.h:605
Definition: liboptions.h:352
void run_davidson()
Definition: dcft_qc.cc:2021
int dim_
The maximum number of IDPs ever possible.
Definition: dcft.h:315
void compute_orbital_gradient_VO_RHF()
Definition: dcft_oo_RHF.cc:435
double compute_scf_error_vector_RHF()
Definition: dcft_scf_RHF.cc:502
Header file for the Quantum Trio LibraryDavid Sherrill 1994.
void build_AO_tensors()
Definition: dcft_scf_UHF.cc:1097
SharedMatrix bQijA_mo_
b(Q|i, j)
Definition: dcft.h:579
void dpd_buf4_add(dpdbuf4 *A, dpdbuf4 *B, double alpha)
Definition: dcft.cc:98
Definition: libdpd/dpd.h:140
SharedMatrix bQpqB_mo_scf_
Definition: dcft.h:597
double lambda_energy_
The Lambda component of the energy.
Definition: dcft.h:377
double compute_triples_abb()
Definition: dcft_triples.cc:1858
double orbital_response_rms_
The RMS value of the change in the orbital response.
Definition: dcft.h:361
double energy_threshold_
The convergence criterion for energy.
Definition: dcft.h:371
void build_G()
Definition: dcft_scf_UHF.cc:1412
void compute_V_intermediate()
Definition: dcft_intermediates_UHF.cc:710
void compute_orbital_gradient()
Definition: dcft_qc.cc:204
void form_df_g_ovov()
Form density-fitted MO-basis TEI g(OV|OV) in chemists&#39; notation.
Definition: dcft_df_tensor.cc:819
IntegralTransform * _ints
Definition: dcft.h:75
int cumulant_idp_aa_
The number of cumulant independent pairs for the current NR step (Alpha-Alpha spin) ...
Definition: dcft.h:307
void print_opdm()
Definition: dcft_tau_UHF.cc:673
void sort_OOVV_integrals()
Definition: dcft_integrals_UHF.cc:233
int maxiter_
The maximum number of iterations.
Definition: dcft.h:294
SharedMatrix Ftilde_a_
The alpha density-weighted Fock matrix in the MO basis.
Definition: dcft.h:441
double compute_triples_aab()
Definition: dcft_triples.cc:1279
SharedMatrix mo_gbarGamma_B_
Definition: dcft.h:604
std::shared_ptr< BasisSet > auxiliary_scf_
Auxiliary basis for SCF terms in DCT.
Definition: dcft.h:560
SharedMatrix Xtotal_b_
Generator of the orbital rotations (Beta) with respect to the reference orbitals. ...
Definition: dcft.h:497
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
int * bvir_off_
Beta virtual MO offset.
Definition: dcft.h:351
void dump_density()
Definition: dcft_n_representability.cc:43
void sort_OOOV_integrals_RHF()
Definition: dcft_integrals_RHF.cc:217
SharedMatrix bocc_c_
The beta occupied eigenvectors, per irrep.
Definition: dcft.h:395
DCFTSolver(SharedWavefunction ref_wfn, Options &options)
Definition: dcft.cc:44
SharedVector R_
The residual vector in the IDP basis for conjugate gradient procedure.
Definition: dcft.h:483
Dimension nboccpi_
The number of occupied beta orbitals per irrep.
Definition: dcft.h:339
double update_orbital_response()
Definition: dcft_gradient_UHF.cc:1344
double cumulant_threshold_
The convergence criterion for the lambda iterations.
Definition: dcft.h:367
void scf_guess()
Definition: dcft_scf_UHF.cc:301
Simple wavefunction base class.
Definition: wavefunction.h:85
int * lookup_orbitals_
The lookup array that determines which compound indices belong to orbital IDPs and which don&#39;t...
Definition: dcft.h:321
int mindiisvecs_
The number of DIIS vectors needed for extrapolation.
Definition: dcft.h:292
void compute_sigma_vector_cum_orb()
Definition: dcft_qc.cc:1409
void compute_O_intermediate()
Definition: dcft_intermediates_UHF.cc:2253
double orbital_level_shift_
Level shift for denominators in orbital updates.
Definition: dcft.h:385
void form_df_g_ovvv()
Form density-fitted MO-basis TEI g(OV|VV) in chemists&#39; notation.
Definition: dcft_df_tensor.cc:1247
SharedVector X_
The step vector in the IDP basis.
Definition: dcft.h:477
Definition: libdpd/dpd.h:105
SharedMatrix bQabA_mo_
b(Q|a, b)
Definition: dcft.h:591
int iterate_nr_jacobi()
Definition: dcft_qc.cc:1845
void compute_lagrangian_OV()
Definition: dcft_gradient_UHF.cc:368
void df_build_b_ao()
Density-fitted MP2 (DF-MP2) guess.
Definition: dcft_df_tensor.cc:76
void compute_orbital_gradient_OV()
Definition: dcft_oo_UHF.cc:297
void transform_integrals()
Definition: dcft_integrals_UHF.cc:45
SharedMatrix old_cb_
The old full beta MO coefficients.
Definition: dcft.h:449
void compute_M_intermediate()
Definition: dcft_intermediates_UHF.cc:3414
void compute_gradient_RHF()
Definition: dcft_gradient_RHF.cc:43
void compute_G_intermediate()
Definition: dcft_intermediates_UHF.cc:65
SharedMatrix moF0a_
The alpha Fock matrix (without Tau contribution) in the MO basis.
Definition: dcft.h:429
void build_tau()
Definition: dcft_tau_UHF.cc:52
void formb_pq_scf()
Definition: dcft_df_tensor.cc:2920
void compute_gradient_odc()
Definition: dcft_gradient_UHF.cc:241
double compute_response_coupling()
Definition: dcft_gradient_UHF.cc:1456
void run_simult_dcft_RHF()
Definition: dcft_compute_RHF.cc:142
void compute_unrelaxed_density_OOOO()
Definition: dcft_density_UHF.cc:48
Definition: pointgrp.h:109
void compute_orbital_gradient_VO()
Definition: dcft_oo_UHF.cc:620
void compute_unrelaxed_density_OVOV_RHF()
Definition: dcft_density_RHF.cc:148
void compute_sigma_vector_cum_cum()
Definition: dcft_qc.cc:1100
bool densityConverged_
Controls convergence of the idempotent one-particle density.
Definition: dcft.h:269
void compute_relaxed_density_OVOV()
Definition: dcft_density_UHF.cc:1383
SharedMatrix aocc_ptau_
The perturbed Tau matrix in the MO basis (alpha occupied)
Definition: dcft.h:413
SharedMatrix kappa_mo_b_
The Kappa in the MO basis (beta occupied)
Definition: dcft.h:423
void compute_unrelaxed_density_OVOV()
Definition: dcft_density_UHF.cc:779
void compute_lagrangian_VV_RHF()
Definition: dcft_gradient_RHF.cc:289
int nbeta_
The number of active beta electrons.
Definition: dcft.h:284
void run_simult_dcft()
Definition: dcft_compute_UHF.cc:428
void rotate_orbitals_RHF()
Definition: dcft_oo_RHF.cc:605
SharedMatrix mo_tauB_
Definition: dcft.h:601
std::string indent
Used to align things in the output.
Definition: dcft.h:500
SharedMatrix kappa_so_b_
The beta kappa matrix in the SO basis.
Definition: dcft.h:453
void build_cumulant_intermediates_RHF()
Definition: dcft_intermediates_RHF.cc:43
void check_qc_convergence()
Definition: dcft_qc.cc:1894
void sort_VVVV_integrals_RHF()
Definition: dcft_integrals_RHF.cc:209
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:54
SharedWavefunction dcft(SharedWavefunction, Options &)
Definition: dcft/main.cc:44
Definition: integraltransform.h:59
void AO_contribute(dpdbuf4 *tau1_AO, dpdbuf4 *tau2_AO, int p, int q, int r, int s, double value, dpdfile2 *=nullptr, dpdfile2 *=nullptr, dpdfile2 *=nullptr)
Definition: dcft/AO_contribute.cc:40
std::shared_ptr< BasisSet > primary_
Primary basis.
Definition: dcft.h:562
SharedMatrix bQaiA_mo_
b(Q|a, i)
Definition: dcft.h:588
SharedMatrix bQiaB_mo_
Definition: dcft.h:586
void compute_scf_energy()
Definition: dcft_scf_UHF.cc:333
void compute_orbital_gradient_OV_RHF()
Definition: dcft_oo_RHF.cc:253
SharedMatrix moG_tau_b_
The beta external potential in the MO basis (only needed in two-step algorithm)
Definition: dcft.h:461
void compute_lagrangian_VO()
Definition: dcft_gradient_UHF.cc:843
void formb_vv()
Form MO-basis b(Q, ab)
Definition: dcft_df_tensor.cc:629
double ** Jm12_scf_
Definition: dcft.h:572
void compute_lagrangian_OO_RHF()
Definition: dcft_gradient_RHF.cc:98
void build_tau_RHF()
Definition: dcft_tau_RHF.cc:50
void cumulant_response_guess()
Definition: dcft_gradient_UHF.cc:1976
void compute_unrelaxed_density_OOVV_RHF()
Definition: dcft_density_RHF.cc:110
SharedMatrix bvir_c_
The beta virtual eigenvectors, per irrep.
Definition: dcft.h:399
void compute_TPDM_trace()
Definition: dcft_density_UHF.cc:1832
SharedMatrix moG_tau_a_
The alpha external potential in the MO basis (only needed in two-step algorithm)
Definition: dcft.h:459
void check_n_representability()
Definition: dcft_n_representability.cc:767
SharedMatrix scf_error_b_
The beta SCF error vector.
Definition: dcft.h:465
SharedMatrix X_b_
Generator of the orbital rotations (Beta) with respect to the orbitals from the previous update...
Definition: dcft.h:493
SharedMatrix avir_tau_
The Tau matrix in the MO basis (alpha virtual)
Definition: dcft.h:409
SharedMatrix compute_gradient() override
Compute gradient. Subclasses override this function to compute the gradient.
Definition: dcft_gradient.cc:43
SharedMatrix avir_c_
The alpha virtual eigenvectors, per irrep.
Definition: dcft.h:397
int navir_
The number of virtual alpha orbitals.
Definition: dcft.h:286
void refine_tau()
Definition: dcft_tau_UHF.cc:770
void build_denominators_RHF()
Definition: dcft_integrals_RHF.cc:289
double int_tolerance_
The cutoff below which and integral is assumed to be zero.
Definition: dcft.h:355
SharedVector Hd_
Definition: dcft.h:475
void compute_ewdm_odc_RHF()
Definition: dcft_gradient_RHF.cc:434
void compute_gradient_UHF()
Definition: dcft_gradient_UHF.cc:45
SharedMatrix bQijB_mo_scf_
Definition: dcft.h:582
int cumulant_idp_
The total number of cumulant independent pairs for the current NR step.
Definition: dcft.h:313
int orbital_idp_b_
The number of orbital independent pairs for the current NR step (Beta spin)
Definition: dcft.h:303
void compute_lagrangian_OO()
Definition: dcft_gradient_UHF.cc:3084
int * lookup_cumulant_
The lookup array that determines which compound indices belong to cumulant IDPs and which don&#39;t...
Definition: dcft.h:323
int * aocc_off_
Alpha occupied MO offset.
Definition: dcft.h:345
void build_denominators()
Definition: dcft_integrals_UHF.cc:582
int iter_
The current number of macroiteration for energy or gradient computation.
Definition: dcft.h:296
SharedMatrix Ftilde_b_
The beta density-weighted Fock matrix in the MO basis.
Definition: dcft.h:443
double compute_energy() override
Definition: dcft_compute.cc:47
void formJm12_scf(std::shared_ptr< BasisSet > auxiliary, std::shared_ptr< BasisSet > zero)
Definition: dcft_df_tensor.cc:2579
std::shared_ptr< Vector > SharedVector
Definition: adc.h:51
int iterate_nr_conjugate_gradients()
Definition: dcft_qc.cc:1757
double scf_energy_
The SCF component of the energy.
Definition: dcft.h:375
void compute_relaxed_density_OOOO()
Definition: dcft_density_UHF.cc:1139
void file2_transform(dpdfile2 *A, dpdfile2 *B, SharedMatrix C, bool backwards)
Definition: half_transform.cc:137
int nalpha_
The number of active alpha electrons.
Definition: dcft.h:282
double orbitals_threshold_
The convergence criterion for the scf iterations.
Definition: dcft.h:369
int cumulant_idp_ab_
The number of cumulant independent pairs for the current NR step (Alpha-Beta spin) ...
Definition: dcft.h:309
SharedMatrix bQpqA_mo_
b(Q|p, q)
Definition: dcft.h:594
void build_DF_tensors_UHF()
Definition: dcft_df_tensor.cc:1798
void rotate_orbitals()
Definition: dcft_oo_UHF.cc:906