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-2018 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 namespace psi {
53 
54 class Options;
55 class IntegralTransform;
56 
57 namespace dcft {
58 
59 class DCFTSolver : public Wavefunction {
60  public:
62  ~DCFTSolver();
63 
64  double compute_energy();
65 
66  protected:
68 
69  void mp2_guess();
70  void scf_guess();
71  void finalize();
72  void transform_integrals();
74  void sort_OOOO_integrals();
75  void sort_OOVV_integrals();
76  void sort_VVVV_integrals();
77  void sort_OVOV_integrals();
78  void sort_OVVV_integrals();
79  void sort_OOOV_integrals();
80  void init();
81  void compute_dcft_energy();
82  void compute_cepa0_energy();
84  void compute_scf_energy();
86  void build_tau();
87  void transform_tau();
88  void build_gtau();
89  void print_opdm();
93  void process_so_ints();
94  void build_G();
95  void build_AO_tensors();
96  void build_denominators();
97  void update_fock();
98  void dump_density();
99  void dpd_buf4_add(dpdbuf4 *A, dpdbuf4 *B, double alpha);
100  void half_transform(dpdbuf4 *A, dpdbuf4 *B, SharedMatrix &C1, SharedMatrix &C2, int *mospi_left, int *mospi_right,
101  int **so_row, int **mo_row, bool backwards, double alpha, double beta);
102  void file2_transform(dpdfile2 *A, dpdfile2 *B, SharedMatrix C, bool backwards);
103  void AO_contribute(dpdbuf4 *tau1_AO, dpdbuf4 *tau2_AO, int p, int q, int r, int s, double value,
104  dpdfile2 * = nullptr, dpdfile2 * = nullptr, dpdfile2 * = nullptr);
105  // void AO_contribute(dpdfile2 *tau1_AO, dpdfile2 *tau2_AO, int p, int q,
106  // int r, int s, double value);
107  bool correct_mo_phases(bool dieOnError = true);
108  double compute_cumulant_residual();
109  double compute_scf_error_vector();
110  double update_scf_density(bool damp = false);
111  void run_twostep_dcft();
114  void run_simult_dcft();
115  void run_simult_dcft_oo();
116  // DCFT analytic gradient subroutines
117  virtual SharedMatrix compute_gradient();
118  void compute_gradient_dc();
119  void compute_gradient_odc();
120  void response_guess();
121  void gradient_init();
122  void compute_lagrangian_OV();
123  void compute_lagrangian_VO();
125  void orbital_response_guess();
127  double update_orbital_response();
128  double compute_response_coupling();
131  void build_perturbed_tau();
135  void compute_lagrangian_OO();
136  void compute_lagrangian_VV();
137  void compute_ewdm_dc();
138  void compute_ewdm_odc();
143  void compute_TPDM_trace();
144  // Quadratically-convergent DCFT
145  void run_qc_dcft();
147  void form_idps();
148  void compute_sigma_vector();
154  int iterate_nr_jacobi();
155  void check_qc_convergence();
157  void update_cumulant_nr();
158  void run_davidson();
159  void davidson_guess();
160  // Exact Tau
161  void refine_tau();
163  // Cumulant residual intermediates
164  void compute_G_intermediate();
165  void compute_F_intermediate();
166  void compute_V_intermediate();
167  void compute_W_intermediate();
168  void compute_H_intermediate();
169  void compute_I_intermediate();
170  void compute_J_intermediate();
171  void compute_K_intermediate();
172  void compute_L_intermediate();
173  void compute_O_intermediate();
174  void compute_M_intermediate();
175  void compute_N_intermediate();
176 
177  // Orbital-optimized DCFT
178  void run_simult_dc_guess();
179  double compute_orbital_residual();
187  void rotate_orbitals();
188  void compute_oe_properties();
189  void write_molden_file();
190  // Three-particle cumulant contributions
192  void dcft_semicanonicalize();
194  void dump_semicanonical();
197  void semicanonicalize_dc();
198  double compute_triples_aaa();
199  double compute_triples_aab();
200  double compute_triples_abb();
201  double compute_triples_bbb();
202 
203  // RHF-reference DCFT
204  double compute_energy_RHF();
205  void scf_guess_RHF();
206  double update_scf_density_RHF(bool damp = false);
208  void build_denominators_RHF();
209  void mp2_guess_RHF();
218  void run_simult_dcft_oo_RHF();
219  void run_simult_dcft_RHF();
220  void build_tau_RHF();
221  void refine_tau_RHF();
222  void transform_tau_RHF();
223  void process_so_ints_RHF();
229  void compute_scf_energy_RHF();
233  void rotate_orbitals_RHF();
240  void compute_gradient_RHF();
241  void gradient_init_RHF();
245  void compute_ewdm_odc_RHF();
246  void print_opdm_RHF();
247  void compute_R_AA_and_BB();
248  void presort_mo_tpdm_AB();
249  void presort_mo_tpdm_AA();
250 
251  // UHF-reference DCFT
252  void compute_gradient_UHF();
253  double compute_energy_UHF();
254 
255  bool augment_b(double *vec, double tol);
270  int print_;
272  int ntriso_;
274  int nalpha_;
276  int nbeta_;
278  int navir_;
280  int nbvir_;
282  int maxdiis_;
286  int maxiter_;
288  int iter_;
289  // Quadratically-convergent DCFT
291  int nidp_;
307  int dim_;
317  int nguess_;
319  int b_dim_;
323  int n_add_;
325  int nevals_;
337  int *aocc_off_;
339  int *avir_off_;
341  int *bocc_off_;
343  int *bvir_off_;
345  double enuc_;
367  double scf_energy_;
375  double regularizer_;
380  double vec_add_tol_;
383 
458  // Quadratically-convergent DCFT
490 
492  std::string indent;
493 
494  // Density-Fitting DCFT
496  void df_build_b_ao();
498  void df_memory();
500  void build_DF_tensors_RHF();
501  void build_DF_tensors_UHF();
503  void formJm12(std::shared_ptr<BasisSet> auxiliary, std::shared_ptr<BasisSet> zero);
504  void formJm12_scf(std::shared_ptr<BasisSet> auxiliary, std::shared_ptr<BasisSet> zero);
506  void formb_ao(std::shared_ptr<BasisSet> primary, std::shared_ptr<BasisSet> auxiliary,
507  std::shared_ptr<BasisSet> zero);
508  void formb_ao_scf(std::shared_ptr<BasisSet> primary, std::shared_ptr<BasisSet> auxiliary,
509  std::shared_ptr<BasisSet> zero);
511  void transform_b();
513  void transform_b_ao2so();
514  void transform_b_ao2so_scf();
516  void formb_oo();
517  void formb_oo_scf();
519  void formb_ov();
521  void formb_vv();
523  void formb_pq();
524  void formb_pq_scf();
525 
527  void form_df_g_ovov();
529  void form_df_g_oooo();
531  void form_df_g_vvoo();
533  void form_df_g_vooo();
535  void form_df_g_ovvv();
537  void form_df_g_vvvv();
539  void build_gbarGamma_RHF();
540  void build_gbarGamma_UHF();
542  void build_gbarKappa_RHF();
543  void build_gbarKappa_UHF();
547 
548  // Density-Fitting DCFT
550  std::shared_ptr<BasisSet> auxiliary_;
552  std::shared_ptr<BasisSet> auxiliary_scf_;
554  std::shared_ptr<BasisSet> primary_;
556  int nn_;
558  int nQ_;
559  int nQ_scf_;
561  int naocc_;
563  double **Jm12_;
564  double **Jm12_scf_;
575 
590 
602 };
603 
604 } // namespace dcft
605 } // namespace psi
606 
607 #endif // Header guard
bool orbitalsDone_
Controls convergence of the orbital updates.
Definition: dcft.h:257
void transform_tau_RHF()
Definition: dcft_tau_RHF.cc:256
double compute_energy()
Definition: dcft_compute.cc:47
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:58
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:371
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:375
void process_so_ints()
Definition: dcft_scf_UHF.cc:451
void form_density_weighted_fock()
Definition: dcft_intermediates_UHF.cc:516
SharedMatrix Fa_
The alpha Fock matrix in the SO basis.
Definition: dcft.h:425
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:259
Options & options() const
Definition: wavefunction.cc:572
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:399
void dcft_semicanonicalize()
Definition: dcft_triples.cc:64
int nn_
Number of total primary basis functions.
Definition: dcft.h:556
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:319
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:479
SharedMatrix scf_error_a_
The alpha SCF error vector.
Definition: dcft.h:455
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:443
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:587
SharedMatrix kappa_mo_a_
The Kappa in the MO basis (alpha occupied)
Definition: dcft.h:413
SharedMatrix aocc_tau_
The Tau matrix in the MO basis (alpha occupied)
Definition: dcft.h:397
~DCFTSolver()
Definition: dcft.cc:109
SharedVector D_
The conjugate direction vector in the IDP basis for conjugate gradient procedure. ...
Definition: dcft.h:473
double compute_orbital_residual_RHF()
Definition: dcft_oo_RHF.cc:208
void run_twostep_dcft_orbital_updates()
Definition: dcft_compute_UHF.cc:340
int n_add_
The number of vectors that can be added during the iteration in the Davidson diagonalization.
Definition: dcft.h:323
SharedMatrix mo_gammaB_
Definition: dcft.h:601
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:263
double diis_start_thresh_
The convergence that must be achieved before DIIS extrapolation starts.
Definition: dcft.h:365
double new_total_energy_
The updated total energy.
Definition: dcft.h:373
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:462
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:568
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:584
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:357
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:339
double ** Jm12_
J^-1/2 Matrix.
Definition: dcft.h:563
void compute_H_intermediate()
Definition: dcft_intermediates_UHF.cc:1699
SharedMatrix bQmn_so_
Definition: dcft.h:567
SharedMatrix mo_gbarGamma_A_
MO-based (Gbar Tau + Gbar Kappa)
Definition: dcft.h:595
int nevals_
The number of eigenvalues requested in the stability check.
Definition: dcft.h:325
SharedMatrix bvir_ptau_
The perturbed Tau matrix in the MO basis (beta virtual)
Definition: dcft.h:411
void formb_oo_scf()
Definition: dcft_df_tensor.cc:2819
void print_orbital_energies()
Definition: dcft_scf_UHF.cc:227
void update_cumulant_response()
Definition: dcft_gradient_UHF.cc:3039
void compute_sigma_vector_orb_cum()
Definition: dcft_qc.cc:866
virtual SharedMatrix compute_gradient()
Compute gradient. Subclasses override this function to compute the gradient.
Definition: dcft_gradient.cc:43
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:447
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:483
void build_gbarGamma_UHF()
Definition: dcft_df_tensor.cc:2240
bool exact_tau_
Definition: dcft.h:268
SharedMatrix bQiaA_mo_
b(Q|i, a)
Definition: dcft.h:577
int dim_orbitals_
The maximum number of IDPs possible for orbital updates.
Definition: dcft.h:309
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:362
SharedMatrix bvir_tau_
The Tau matrix in the MO basis (beta virtual)
Definition: dcft.h:403
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:449
SharedMatrix bQaiB_mo_
Definition: dcft.h:581
bool orbital_optimized_
Whether the user requested the DCFT functional that is variationally orbitally-optimized.
Definition: dcft.h:265
Definition: dcft.h:59
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:439
int orbital_idp_
The total number of orbital independent pairs for the current NR step.
Definition: dcft.h:297
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:600
int nQ_
Number of total auxilliary basis functions.
Definition: dcft.h:558
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:431
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:291
void semicanonicalize_gbar_ooov()
Definition: dcft_triples.cc:390
double vec_add_tol_
Definition: dcft.h:380
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:345
int maxdiis_
The maximum size of the DIIS subspace.
Definition: dcft.h:282
SharedMatrix aocc_c_
The alpha occupied eigenvectors, per irrep.
Definition: dcft.h:385
int cumulant_idp_bb_
The number of cumulant independent pairs for the current NR step (Beta-Beta spin) ...
Definition: dcft.h:303
int max_space_
The maximum size of the subspace in stability check.
Definition: dcft.h:327
void compute_dcft_energy()
Definition: dcft_energy_UHF.cc:43
int * bocc_off_
Beta occupied MO offset.
Definition: dcft.h:341
void iterate_cumulant_response()
Definition: dcft_gradient_UHF.cc:1890
SharedMatrix mo_gbarKappa_B_
Definition: dcft.h:598
void update_cumulant_nr()
Definition: dcft_qc.cc:1950
int print_
The amount of information to print.
Definition: dcft.h:270
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:429
SharedMatrix avir_ptau_
The perturbed Tau matrix in the MO basis (alpha virtual)
Definition: dcft.h:409
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:280
double energy_level_shift_
Level shift applied to the diagonal of the density-weighted Fock operator.
Definition: dcft.h:382
double cumulant_convergence_
The RMS value of the change in lambda after the lambda iterations.
Definition: dcft.h:351
std::shared_ptr< BasisSet > auxiliary_
Auxiliary basis.
Definition: dcft.h:550
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:569
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:437
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:54
void semicanonicalize_dc()
Definition: dcft_triples.cc:595
SharedMatrix bQijA_mo_scf_
Definition: dcft.h:573
Dimension naoccpi_
The number of occupied alpha orbitals per irrep.
Definition: dcft.h:329
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:419
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:487
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:407
SharedVector S_
The search direction vector in the IDP basis for conjugate gradient procedure.
Definition: dcft.h:477
SharedMatrix bQijB_mo_
Definition: dcft.h:572
double r_convergence_
Convergence of the residual in the Davidson diagonalization.
Definition: dcft.h:321
Dimension navirpi_
The number of virtual alpha orbitals per irrep.
Definition: dcft.h:333
SharedMatrix bocc_ptau_
The perturbed Tau matrix in the MO basis (beta occupied)
Definition: dcft.h:407
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:464
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:272
SharedMatrix tau_so_b_
The Tau matrix in the AO basis, stored by irrep, to perturb the beta Fock matrix. ...
Definition: dcft.h:395
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:481
SharedMatrix bQmn_ao_
b(Q|mu,nu)
Definition: dcft.h:566
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:293
SharedMatrix tau_so_a_
The Tau matrix in the AO basis, stored by irrep, to perturb the alpha Fock matrix.
Definition: dcft.h:393
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:471
void update_fock()
Definition: dcft_scf_UHF.cc:1012
int nQ_scf_
Definition: dcft.h:559
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:460
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:177
SharedMatrix ao_s_
The overlap matrix in the AO basis.
Definition: dcft.h:417
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:349
SharedMatrix mo_tauA_
The Tau in the MO basis (All)
Definition: dcft.h:592
int dim_cumulant_
The maximum number of IDPs possible for cumulant updates.
Definition: dcft.h:311
void finalize()
Definition: dcft_memory.cc:204
SharedMatrix Fb_
The beta Fock matrix in the SO basis.
Definition: dcft.h:427
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:561
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:355
int run_twostep_dcft_cumulant_updates()
Definition: dcft_compute_UHF.cc:230
Definition: dimension.h:40
int nguess_
The number of the guess subspace vectors for the Davidson diagonalization.
Definition: dcft.h:317
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:335
SharedMatrix moF0b_
The beta Fock matrix (without Tau contribution) in the MO basis.
Definition: dcft.h:423
SharedMatrix bQpqA_mo_scf_
Definition: dcft.h:588
SharedMatrix mo_gbarKappa_A_
Definition: dcft.h:597
Definition: liboptions.h:353
void run_davidson()
Definition: dcft_qc.cc:2021
int dim_
The maximum number of IDPs ever possible.
Definition: dcft.h:307
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:1095
SharedMatrix bQijA_mo_
b(Q|i, j)
Definition: dcft.h:571
void dpd_buf4_add(dpdbuf4 *A, dpdbuf4 *B, double alpha)
Definition: dcft.cc:90
Definition: libdpd/dpd.h:140
SharedMatrix bQpqB_mo_scf_
Definition: dcft.h:589
double lambda_energy_
The Lambda component of the energy.
Definition: dcft.h:369
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:353
double energy_threshold_
The convergence criterion for energy.
Definition: dcft.h:363
void build_G()
Definition: dcft_scf_UHF.cc:1410
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:67
int cumulant_idp_aa_
The number of cumulant independent pairs for the current NR step (Alpha-Alpha spin) ...
Definition: dcft.h:299
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:286
SharedMatrix Ftilde_a_
The alpha density-weighted Fock matrix in the MO basis.
Definition: dcft.h:433
double compute_triples_aab()
Definition: dcft_triples.cc:1279
SharedMatrix mo_gbarGamma_B_
Definition: dcft.h:596
std::shared_ptr< BasisSet > auxiliary_scf_
Auxiliary basis for SCF terms in DCT.
Definition: dcft.h:552
SharedMatrix Xtotal_b_
Generator of the orbital rotations (Beta) with respect to the reference orbitals. ...
Definition: dcft.h:489
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
int * bvir_off_
Beta virtual MO offset.
Definition: dcft.h:343
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:387
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:475
Dimension nboccpi_
The number of occupied beta orbitals per irrep.
Definition: dcft.h:331
double update_orbital_response()
Definition: dcft_gradient_UHF.cc:1344
double cumulant_threshold_
The convergence criterion for the lambda iterations.
Definition: dcft.h:359
void scf_guess()
Definition: dcft_scf_UHF.cc:299
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:313
int mindiisvecs_
The number of DIIS vectors needed for extrapolation.
Definition: dcft.h:284
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:377
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:469
Definition: libdpd/dpd.h:105
SharedMatrix bQabA_mo_
b(Q|a, b)
Definition: dcft.h:583
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:441
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:421
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:261
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:405
SharedMatrix kappa_mo_b_
The Kappa in the MO basis (beta occupied)
Definition: dcft.h:415
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:276
void run_simult_dcft()
Definition: dcft_compute_UHF.cc:421
void rotate_orbitals_RHF()
Definition: dcft_oo_RHF.cc:605
SharedMatrix mo_tauB_
Definition: dcft.h:593
std::string indent
Used to align things in the output.
Definition: dcft.h:492
SharedMatrix kappa_so_b_
The beta kappa matrix in the SO basis.
Definition: dcft.h:445
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:46
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:554
SharedMatrix bQaiA_mo_
b(Q|a, i)
Definition: dcft.h:580
SharedMatrix bQiaB_mo_
Definition: dcft.h:578
void compute_scf_energy()
Definition: dcft_scf_UHF.cc:331
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:453
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:564
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:391
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:451
void check_n_representability()
Definition: dcft_n_representability.cc:767
SharedMatrix scf_error_b_
The beta SCF error vector.
Definition: dcft.h:457
SharedMatrix X_b_
Generator of the orbital rotations (Beta) with respect to the orbitals from the previous update...
Definition: dcft.h:485
SharedMatrix avir_tau_
The Tau matrix in the MO basis (alpha virtual)
Definition: dcft.h:401
SharedMatrix avir_c_
The alpha virtual eigenvectors, per irrep.
Definition: dcft.h:389
int navir_
The number of virtual alpha orbitals.
Definition: dcft.h:278
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:347
SharedVector Hd_
Definition: dcft.h:467
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:574
int cumulant_idp_
The total number of cumulant independent pairs for the current NR step.
Definition: dcft.h:305
int orbital_idp_b_
The number of orbital independent pairs for the current NR step (Beta spin)
Definition: dcft.h:295
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:315
int * aocc_off_
Alpha occupied MO offset.
Definition: dcft.h:337
void build_denominators()
Definition: dcft_integrals_UHF.cc:582
int iter_
The current number of macroiteration for energy or gradient computation.
Definition: dcft.h:288
SharedMatrix Ftilde_b_
The beta density-weighted Fock matrix in the MO basis.
Definition: dcft.h:435
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:367
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:138
int nalpha_
The number of active alpha electrons.
Definition: dcft.h:274
double orbitals_threshold_
The convergence criterion for the scf iterations.
Definition: dcft.h:361
int cumulant_idp_ab_
The number of cumulant independent pairs for the current NR step (Alpha-Beta spin) ...
Definition: dcft.h:301
SharedMatrix bQpqA_mo_
b(Q|p, q)
Definition: dcft.h:586
void build_DF_tensors_UHF()
Definition: dcft_df_tensor.cc:1798
void rotate_orbitals()
Definition: dcft_oo_UHF.cc:906