MPQC  2.3.1
wfn.h
1 //
2 // wfn.h
3 //
4 // Copyright (C) 1996 Limit Point Systems, Inc.
5 //
6 // Author: Curtis Janssen <cljanss@limitpt.com>
7 // Maintainer: LPS
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _chemistry_qc_wfn_wfn_h
29 #define _chemistry_qc_wfn_wfn_h
30 
31 #ifdef __GNUC__
32 #pragma interface
33 #endif
34 
35 #include <iostream>
36 
37 #include <util/misc/compute.h>
38 #include <math/scmat/matrix.h>
39 #include <math/scmat/vector3.h>
40 #include <chemistry/molecule/energy.h>
41 #include <chemistry/qc/basis/basis.h>
42 #include <chemistry/qc/basis/integral.h>
43 #include <chemistry/qc/basis/orthog.h>
44 
45 namespace sc {
46 
49 
50  RefSCDimension aodim_;
51  RefSCDimension sodim_;
52  Ref<SCMatrixKit> basiskit_;
53 
54  ResultRefSymmSCMatrix overlap_;
55  ResultRefSymmSCMatrix hcore_;
56  ResultRefSCMatrix natural_orbitals_;
57  ResultRefDiagSCMatrix natural_density_;
58 
59  double * bs_values;
60  double * bsg_values;
61 
63  Ref<Integral> integral_;
64 
65  Ref<GaussianBasisSet> atom_basis_;
66  double * atom_basis_coef_;
67 
68  double lindep_tol_;
69  OverlapOrthog::OrthogMethod orthog_method_;
70  Ref<OverlapOrthog> orthog_;
71 
72  int print_nao_;
73  int print_npa_;
74 
75  void init_orthog();
76 
77  void set_up_charge_types(std::vector<int> &q_pc,
78  std::vector<int> &q_cd,
79  std::vector<int> &n_pc,
80  std::vector<int> &n_cd);
81 
82  double nuc_rep_pc_pc(const std::vector<int>&,const std::vector<int>&,bool);
83  double nuc_rep_pc_cd(const std::vector<int>&,const std::vector<int>&);
84  double nuc_rep_cd_cd(const std::vector<int>&,const std::vector<int>&,bool);
85  void scale_atom_basis_coef();
86 
87  void nuc_rep_grad_pc_pc(double **grad,
88  const std::vector<int>&c1,
89  const std::vector<int>&c2,
90  bool uniq);
91  void nuc_rep_grad_pc_cd(double **grad,
92  const std::vector<int>&c1,
93  const std::vector<int>&c2);
94  void nuc_rep_grad_cd_cd(double **grad,
95  const std::vector<int>&c1,
96  const std::vector<int>&c2,
97  bool uniq);
98 
99  protected:
100 
101  int debug_;
102 
103  double min_orthog_res();
104  double max_orthog_res();
105 
106  void copy_orthog_info(const Ref<Wavefunction> &);
107 
108  public:
142  Wavefunction(const Ref<KeyVal>&);
143  virtual ~Wavefunction();
144 
145  void save_data_state(StateOut&);
146 
147  double density(const SCVector3&);
148  double density_gradient(const SCVector3&,double*);
149  double natural_orbital(const SCVector3& r, int iorb);
150  double natural_orbital_density(const SCVector3& r,
151  int orb, double* orbval = 0);
152  double orbital(const SCVector3& r, int iorb, const RefSCMatrix& orbs);
153 
154  double orbital_density(const SCVector3& r,
155  int iorb,
156  const RefSCMatrix& orbs,
157  double* orbval = 0);
158 
160  double charge();
162  virtual int nelectron() = 0;
163 
165  virtual RefSymmSCMatrix density() = 0;
167  virtual RefSymmSCMatrix ao_density();
169  virtual RefSCMatrix natural_orbitals();
172 
174  virtual int spin_polarized() = 0;
175 
177  virtual RefSymmSCMatrix alpha_density();
179  virtual RefSymmSCMatrix beta_density();
184 
186  virtual RefSCMatrix nao(double *atom_charges=0);
187 
189  virtual RefSymmSCMatrix overlap();
192 
196  virtual double nuclear_repulsion_energy();
201  void nuclear_repulsion_energy_gradient(double *g);
206  virtual void nuclear_repulsion_energy_gradient(double **g);
207 
217  Ref<Molecule> molecule() const;
224  const double *atom_basis_coef() const;
227 
228  // override symmetry_changed from MolecularEnergy
229  void symmetry_changed();
230 
238 
242 
247 
249  double lindep_tol() const;
251  void set_lindep_tol(double);
252 
253  void obsolete();
254 
255  void print(std::ostream& = ExEnv::out0()) const;
256 };
257 
258 }
259 
260 #endif
261 
262 // Local Variables:
263 // mode: c++
264 // c-file-style: "ETS"
265 // End:
sc::Wavefunction::atom_basis_coef
const double * atom_basis_coef() const
Returns the coefficients of the nuclear charge distribution basis functions.
sc::Wavefunction::natural_orbitals
virtual RefSCMatrix natural_orbitals()
Returns the natural orbitals.
sc::Wavefunction::nao
virtual RefSCMatrix nao(double *atom_charges=0)
returns the ao to nao transformation matrix
sc::Wavefunction::atom_basis
Ref< GaussianBasisSet > atom_basis() const
Returns the basis set describing the nuclear charge distributions.
sc::RefSymmSCMatrix
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:261
sc::Wavefunction::lindep_tol
double lindep_tol() const
Returns the tolerance for linear dependencies.
sc::OverlapOrthog::OrthogMethod
OrthogMethod
An enum for the types of orthogonalization.
Definition: orthog.h:42
sc::Wavefunction::spin_polarized
virtual int spin_polarized()=0
Return 1 if the alpha density is not equal to the beta density.
sc::RefSCMatrix
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
sc::Ref
A template class that maintains references counts.
Definition: ref.h:332
sc::Wavefunction::integral
Ref< Integral > integral()
Returns the integral evaluator.
sc::Wavefunction::beta_ao_density
virtual RefSymmSCMatrix beta_ao_density()
Return beta electron densities in the AO basis.
sc::Wavefunction::beta_density
virtual RefSymmSCMatrix beta_density()
Return beta electron densities in the SO basis.
sc::Wavefunction
A Wavefunction is a MolecularEnergy that utilizies a GaussianBasisSet.
Definition: wfn.h:48
sc::Wavefunction::so_to_orthog_so
RefSCMatrix so_to_orthog_so()
Returns a matrix which does the default transform from SO's to orthogonal SO's.
sc::Wavefunction::core_hamiltonian
virtual RefSymmSCMatrix core_hamiltonian()
Returns the SO core Hamiltonian.
sc::RefDiagSCMatrix
The RefDiagSCMatrix class is a smart pointer to an DiagSCMatrix specialization.
Definition: matrix.h:380
sc::Wavefunction::nuclear_repulsion_energy
virtual double nuclear_repulsion_energy()
Returns the nuclear repulsion energy.
sc::Wavefunction::so_dimension
RefSCDimension so_dimension()
Symmetry adapted orbital dimension.
sc::AccResult< RefSymmSCMatrix >
sc::Wavefunction::basis_matrixkit
Ref< SCMatrixKit > basis_matrixkit()
Matrix kit for AO, SO, orthogonalized SO, and MO dimensioned matrices.
sc::Wavefunction::symmetry_changed
void symmetry_changed()
Call this if you have changed the molecular symmetry of the molecule contained by this MolecularEnerg...
sc::Wavefunction::ao_density
virtual RefSymmSCMatrix ao_density()
Returns the AO density.
sc::Wavefunction::natural_density
virtual RefDiagSCMatrix natural_density()
Returns the natural density (a diagonal matrix).
sc::Wavefunction::alpha_ao_density
virtual RefSymmSCMatrix alpha_ao_density()
Return alpha electron densities in the AO basis.
sc::StateIn
Restores objects that derive from SavableState.
Definition: statein.h:70
sc::RefSCDimension
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition: dim.h:156
sc::Wavefunction::charge
double charge()
Returns the charge.
sc::Wavefunction::obsolete
void obsolete()
Marks all results as being out of date.
sc::MolecularEnergy
The MolecularEnergy abstract class inherits from the Function class.
Definition: energy.h:48
sc::Wavefunction::nuclear_repulsion_energy_gradient
void nuclear_repulsion_energy_gradient(double *g)
Computes the nuclear repulsion gradient.
sc::Wavefunction::basis
Ref< GaussianBasisSet > basis() const
Returns the basis set.
sc::Wavefunction::alpha_density
virtual RefSymmSCMatrix alpha_density()
Return alpha electron densities in the SO basis.
sc::Wavefunction::set_lindep_tol
void set_lindep_tol(double)
Re(Sets) the tolerance for linear dependencies.
sc::Wavefunction::ao_dimension
RefSCDimension ao_dimension()
Atomic orbital dimension.
sc::Wavefunction::orthog_method
OverlapOrthog::OrthogMethod orthog_method() const
Returns the orthogonalization method.
sc::Wavefunction::molecule
Ref< Molecule > molecule() const
Returns the Molecule.
sc::StateOut
Serializes objects that derive from SavableState.
Definition: stateout.h:61
sc::Wavefunction::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::Wavefunction::overlap
virtual RefSymmSCMatrix overlap()
Returns the SO overlap matrix.
sc::SCVector3
Definition: vector3.h:45
sc::ExEnv::out0
static std::ostream & out0()
Return an ostream that writes from node 0.
sc::Wavefunction::nelectron
virtual int nelectron()=0
Returns the number of electrons.
sc::Wavefunction::oso_dimension
RefSCDimension oso_dimension()
Orthogonalized symmetry adapted orbital dimension.
sc::Wavefunction::set_orthog_method
void set_orthog_method(const OverlapOrthog::OrthogMethod &)
(Re)Sets the orthogonalization method and makes this obsolete
sc::Wavefunction::so_to_orthog_so_inverse
RefSCMatrix so_to_orthog_so_inverse()
Returns the inverse of the transformation returned by so_to_orthog_so.
sc::Wavefunction::density
virtual RefSymmSCMatrix density()=0
Returns the SO density.
sc::Wavefunction::print
void print(std::ostream &=ExEnv::out0()) const
Print information about the object.

Generated at Sun Jan 26 2020 23:33:05 for MPQC 2.3.1 using the documentation package Doxygen 1.8.16.