[0b990d] | 1 |
|
---|
| 2 | #ifdef __GNUC__
|
---|
| 3 | #pragma interface
|
---|
| 4 | #endif
|
---|
| 5 |
|
---|
| 6 | #ifndef _chemistry_qc_psi_psiwfn_h
|
---|
| 7 | #define _chemistry_qc_psi_psiwfn_h
|
---|
| 8 |
|
---|
| 9 | #include <chemistry/qc/wfn/wfn.h>
|
---|
| 10 | #include <chemistry/qc/psi/psiexenv.h>
|
---|
| 11 |
|
---|
| 12 | namespace sc {
|
---|
| 13 |
|
---|
| 14 | ///////////////////////////////////////////////////////////////////
|
---|
| 15 | /** PsiWavefunction is an abstract base for all Psi wave functions.
|
---|
| 16 | Its KeyVal constructor is invoked by all KeyVal constructors of
|
---|
| 17 | concrete implementations of PsiWavefunction.
|
---|
| 18 | */
|
---|
| 19 |
|
---|
| 20 | class PsiWavefunction: public Wavefunction {
|
---|
| 21 |
|
---|
| 22 | Ref<PsiExEnv> exenv_;
|
---|
| 23 |
|
---|
| 24 | int* read_occ(const Ref<KeyVal> &keyval, const char *name, int nirrep);
|
---|
| 25 |
|
---|
| 26 | protected:
|
---|
| 27 | int nirrep_;
|
---|
| 28 | int *docc_;
|
---|
| 29 | int *socc_;
|
---|
| 30 | int *frozen_docc_;
|
---|
| 31 | int *frozen_uocc_;
|
---|
| 32 | int multp_;
|
---|
| 33 | int charge_;
|
---|
| 34 | char *memory_;
|
---|
| 35 | /// Prepares a complete Psi input file. The input file is assumed to have been opened.
|
---|
| 36 | virtual void write_input(int conv) =0;
|
---|
| 37 |
|
---|
| 38 | public:
|
---|
| 39 | /** The KeyVal constructor.
|
---|
| 40 |
|
---|
| 41 | <dl>
|
---|
| 42 |
|
---|
| 43 | <dt><tt>psienv</tt><dd> Specifies a PsiExEnv object. There
|
---|
| 44 | is no default.
|
---|
| 45 |
|
---|
| 46 | <dt><tt>memory</tt><dd> This integer specifies the amount of memory
|
---|
| 47 | (in bytes) for Psi to use. The default is 2000000.
|
---|
| 48 |
|
---|
| 49 | <dt><tt>debug</tt><dd> This integer can be used to produce output
|
---|
| 50 | for debugging. The default is 0.
|
---|
| 51 |
|
---|
| 52 | </dl> */
|
---|
| 53 | PsiWavefunction(const Ref<KeyVal>&);
|
---|
| 54 | PsiWavefunction(StateIn&);
|
---|
| 55 | ~PsiWavefunction();
|
---|
| 56 |
|
---|
| 57 | void save_data_state(StateOut&);
|
---|
| 58 |
|
---|
| 59 | /** Writes out Psi input file entries specific to this PsiWavefunction.
|
---|
| 60 | The input file is assumed to have been opened. */
|
---|
| 61 | virtual void write_basic_input(int conv);
|
---|
| 62 | void compute();
|
---|
| 63 | void print(std::ostream&o=ExEnv::out0()) const;
|
---|
| 64 | RefSymmSCMatrix density();
|
---|
| 65 | int nelectron();
|
---|
| 66 |
|
---|
| 67 | /// Return an associated PsiExEnv object
|
---|
| 68 | Ref<PsiExEnv> get_psi_exenv() const { return exenv_; };
|
---|
| 69 | /// Return an associated PsiInput object
|
---|
| 70 | Ref<PsiInput> get_psi_input() const { return exenv_->get_psi_input(); };
|
---|
| 71 | };
|
---|
| 72 |
|
---|
| 73 | ///////////////////////////////////////////////////////////////////
|
---|
| 74 | /// PsiSCF is an abstract base for all Psi SCF wave functions
|
---|
| 75 |
|
---|
| 76 | class PsiSCF: public PsiWavefunction {
|
---|
| 77 | public:
|
---|
| 78 | PsiSCF(const Ref<KeyVal>&);
|
---|
| 79 | PsiSCF(StateIn&);
|
---|
| 80 | ~PsiSCF();
|
---|
| 81 | void save_data_state(StateOut&);
|
---|
| 82 |
|
---|
| 83 | enum RefType {rhf, hsoshf, uhf};
|
---|
| 84 | /// Returns the PsiSCF::RefType of this particular Psi SCF wave function
|
---|
| 85 | virtual PsiSCF::RefType reftype() const =0;
|
---|
| 86 | };
|
---|
| 87 |
|
---|
| 88 | ///////////////////////////////////////////////////////////////////
|
---|
| 89 | /// PsiCLHF is a concrete implementation of Psi RHF wave function
|
---|
| 90 |
|
---|
| 91 | class PsiCLHF: public PsiSCF {
|
---|
| 92 | protected:
|
---|
| 93 | void write_input(int conv);
|
---|
| 94 | public:
|
---|
| 95 | PsiCLHF(const Ref<KeyVal>&);
|
---|
| 96 | PsiCLHF(StateIn&);
|
---|
| 97 | ~PsiCLHF();
|
---|
| 98 |
|
---|
| 99 | void write_basic_input(int conv);
|
---|
| 100 | int spin_polarized() { return 0;};
|
---|
| 101 | int gradient_implemented() const { return 1;};
|
---|
| 102 | PsiSCF::RefType reftype() const { return rhf;};
|
---|
| 103 | };
|
---|
| 104 |
|
---|
| 105 | ///////////////////////////////////////////////////////////////////
|
---|
| 106 | /// PsiHSOSHF is a concrete implementation of Psi ROHF wave function
|
---|
| 107 |
|
---|
| 108 | class PsiHSOSHF: public PsiSCF {
|
---|
| 109 | protected:
|
---|
| 110 | void write_input(int conv);
|
---|
| 111 | public:
|
---|
| 112 | PsiHSOSHF(const Ref<KeyVal>&);
|
---|
| 113 | PsiHSOSHF(StateIn&);
|
---|
| 114 | ~PsiHSOSHF();
|
---|
| 115 |
|
---|
| 116 | void write_basic_input(int conv);
|
---|
| 117 | int spin_polarized() { return 0;};
|
---|
| 118 | int gradient_implemented() const { return 1;};
|
---|
| 119 | PsiSCF::RefType reftype() const { return hsoshf;};
|
---|
| 120 | };
|
---|
| 121 |
|
---|
| 122 | ///////////////////////////////////////////////////////////////////
|
---|
| 123 | /// PsiUHF is a concrete implementation of Psi UHF wave function
|
---|
| 124 |
|
---|
| 125 | class PsiUHF: public PsiSCF {
|
---|
| 126 | protected:
|
---|
| 127 | void write_input(int conv);
|
---|
| 128 | public:
|
---|
| 129 | PsiUHF(const Ref<KeyVal>&);
|
---|
| 130 | PsiUHF(StateIn&);
|
---|
| 131 | ~PsiUHF();
|
---|
| 132 |
|
---|
| 133 | void write_basic_input(int conv);
|
---|
| 134 | int spin_polarized() { return 1;};
|
---|
| 135 | int gradient_implemented() const { return 1;};
|
---|
| 136 | PsiSCF::RefType reftype() const { return uhf;};
|
---|
| 137 | };
|
---|
| 138 |
|
---|
| 139 | ///////////////////////////////////////////////////////////////////
|
---|
| 140 | /// PsiCCSD is a concrete implementation of Psi CCSD wave function
|
---|
| 141 |
|
---|
| 142 | class PsiCCSD: public PsiWavefunction {
|
---|
| 143 | Ref<PsiSCF> reference_;
|
---|
| 144 | protected:
|
---|
| 145 | void write_input(int conv);
|
---|
| 146 | public:
|
---|
| 147 | PsiCCSD(const Ref<KeyVal>&);
|
---|
| 148 | PsiCCSD(StateIn&);
|
---|
| 149 | ~PsiCCSD();
|
---|
| 150 | void save_data_state(StateOut&);
|
---|
| 151 | int spin_polarized() { return reference_->spin_polarized();};
|
---|
| 152 | int gradient_implemented() const;
|
---|
| 153 | };
|
---|
| 154 |
|
---|
| 155 | ///////////////////////////////////////////////////////////////////
|
---|
| 156 | /// PsiCCSD_T is a concrete implementation of Psi CCSD(T) wave function
|
---|
| 157 |
|
---|
| 158 | class PsiCCSD_T: public PsiWavefunction {
|
---|
| 159 | Ref<PsiSCF> reference_;
|
---|
| 160 | protected:
|
---|
| 161 | void write_input(int conv);
|
---|
| 162 | public:
|
---|
| 163 | PsiCCSD_T(const Ref<KeyVal>&);
|
---|
| 164 | PsiCCSD_T(StateIn&);
|
---|
| 165 | ~PsiCCSD_T();
|
---|
| 166 |
|
---|
| 167 | void save_data_state(StateOut&);
|
---|
| 168 | int spin_polarized() { return reference_->spin_polarized();};
|
---|
| 169 | int gradient_implemented() const;
|
---|
| 170 | };
|
---|
| 171 |
|
---|
| 172 | }
|
---|
| 173 |
|
---|
| 174 | #endif
|
---|