Psi4
rohf.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 __rohf_psi_h__
30 #define __rohf_psi_h__
31 
32 #include <vector>
33 #include "psi4/libpsio/psio.hpp"
34 #include "hf.h"
35 
36 namespace psi {
37 namespace scf {
38 
39 class ROHF : public HF {
40  protected:
54 
55  void form_initial_F() override;
56  void form_initial_C() override;
57  double compute_initial_E() override;
59  void semicanonicalize() override;
60 
61  // Second-order convergence code
62  void Hx(SharedMatrix x, SharedMatrix ret);
63 
64  void format_guess() override;
65 
66  void common_init();
67 
68  public:
69  ROHF(SharedWavefunction ref_wfn, std::shared_ptr<SuperFunctional> functional);
70  ROHF(SharedWavefunction ref_wfn, std::shared_ptr<SuperFunctional> functional, Options& options,
71  std::shared_ptr<PSIO> psio);
72  ~ROHF() override;
73 
74  SharedMatrix moFeff() const { return moFeff_; }
75  SharedMatrix moFa() const { return moFa_; }
76  SharedMatrix moFb() const { return moFb_; }
77 
78  bool diis() override;
79  void save_density_and_energy() override;
80  double compute_orbital_gradient(bool save_diis, int max_diis_vectors) override;
81 
82  void form_C() override;
83  void form_D() override;
84  void form_F() override;
85  void form_G() override;
86  double compute_E() override;
87  void finalize() override;
88 
89  void compute_SAD_guess() override;
90 
91  void damping_update(double) override;
92  int soscf_update(double soscf_conv, int soscf_min_iter, int soscf_max_iter, int soscf_print) override;
93  bool stability_analysis() override;
94 
95  std::shared_ptr<ROHF> c1_deep_copy(std::shared_ptr<BasisSet> basis);
96 };
97 } // namespace scf
98 } // namespace psi
99 
100 #endif
std::shared_ptr< ROHF > c1_deep_copy(std::shared_ptr< BasisSet > basis)
Definition: rohf.cc:1311
void form_initial_C() override
Definition: rohf.cc:458
Options & options() const
Definition: wavefunction.cc:648
SharedMatrix Dt_old_
Definition: rohf.h:46
SharedMatrix moFa() const
Definition: rohf.h:75
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:646
std::shared_ptr< BasisSet > basis
Definition: dx_write.cc:59
double compute_orbital_gradient(bool save_diis, int max_diis_vectors) override
Definition: rohf.cc:304
SharedMatrix Ka_
Definition: rohf.h:50
SharedMatrix Gb_
Definition: rohf.h:49
double ** scf
Definition: dx_write.cc:57
SharedMatrix moFa_
Definition: rohf.h:52
std::shared_ptr< SuperFunctional > functional() const
The DFT Functional object (or null if it has been deleted)
Definition: hf.h:293
SharedMatrix soFeff_
Definition: rohf.h:42
void Hx(SharedMatrix x, SharedMatrix ret)
Definition: rohf.cc:530
SharedMatrix moFeff_
Definition: rohf.h:41
SharedMatrix Da_old_
Definition: rohf.h:44
void format_guess() override
Definition: rohf.cc:108
double compute_initial_E() override
Definition: rohf.cc:512
void save_density_and_energy() override
Save the current density and energy.
Definition: rohf.cc:298
SharedMatrix Kb_
Definition: rohf.h:51
void finalize() override
Definition: rohf.cc:252
void form_G() override
Definition: rohf.cc:960
SharedMatrix Db_old_
Definition: rohf.h:45
bool diis() override
Definition: rohf.cc:350
void prepare_canonical_orthogonalization() override
Edit matrices if we are doing canonical orthogonalization.
Definition: rohf.cc:450
SharedMatrix moFb() const
Definition: rohf.h:76
SharedMatrix moFeff() const
Definition: rohf.h:74
void compute_SAD_guess() override
SAD Guess and propagation.
Definition: rohf.cc:1337
void form_C() override
Compute the MO coefficients (C_)
Definition: rohf.cc:437
SharedMatrix Ga_
Definition: rohf.h:48
void damping_update(double) override
Definition: rohf.cc:795
Definition: liboptions.h:353
double compute_E() override
Compute energy for the iteration.
Definition: rohf.cc:514
~ROHF() override
Definition: rohf.cc:72
void form_F() override
Definition: rohf.cc:369
void form_D() override
Computes the density matrix (D_)
Definition: rohf.cc:482
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
void common_init()
Definition: rohf.cc:74
Definition: rohf.h:39
void semicanonicalize() override
Definition: rohf.cc:121
Definition: hf.h:48
int soscf_update(double soscf_conv, int soscf_min_iter, int soscf_max_iter, int soscf_print) override
Definition: rohf.cc:804
SharedMatrix Dt_
Definition: rohf.h:43
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:54
bool stability_analysis() override
Check the stability of the wavefunction, and correct (if requested)
Definition: rohf.cc:993
ROHF(SharedWavefunction ref_wfn, std::shared_ptr< SuperFunctional > functional)
Definition: rohf.cc:61
SharedMatrix moFb_
Definition: rohf.h:53
void form_initial_F() override
Definition: rohf.cc:352
SharedMatrix Ct_
Definition: rohf.h:47