MPQC  3.0.0-alpha
obwfn.h
1 //
2 // obwfn.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_obwfn_h
29 #define _chemistry_qc_wfn_obwfn_h
30 
31 #include <vector>
32 #include <chemistry/qc/wfn/wfn.h>
33 #ifdef MPQC_NEW_FEATURES
34 # include <util/misc/xml.h>
35 #endif
36 
37 namespace sc {
38 
41 
45  protected:
46  ResultRefSymmSCMatrix density_;
47  AccResultRefSCMatrix oso_eigenvectors_;
48  AccResultRefDiagSCMatrix eigenvalues_;
49  int nirrep_;
50  int *nvecperirrep_;
51  double *occupations_;
52  double *alpha_occupations_;
53  double *beta_occupations_;
54 
55 
56  void init_sym_info();
57 
58  // oldocc is converted to newocc using the correlation
59  // table between initial_pg_ and the current point group
60  // returns 1 if successful and 0 otherwise. newocc is
61  // delete[]'ed and new'ed.
62  int form_occupations(int *&newocc, const int *oldocc);
63 
64  public:
78 
80 
81  int nelectron();
82 
85  void set_desired_value_accuracy(double eps);
86 
87  // Following is a proposed interface to make the meaning of
88  // the various transformation matrices less confusing.
89 // /** These members give metrics and basis transformations
90 // using the covariant/contravariant tensor notation. */
91 // //@{
92 // /** Returns the transformation matrix that converts
93 // a contravariant SO tensor index to a contravariant
94 // MO tensor index.
95 // */
96 // RefSCMatrix t_mo_so_I_J();
97 // /** Returns the transformation matrix that converts a covariant SO
98 // tensor index to a covariant MO tensor index.
99 // */
100 // RefSCMatrix t_mo_so_i_j();
101 // /** Returns the transformation matrix that converts
102 // a contravariant MO tensor index to a contravariant
103 // SO tensor index.
104 // */
105 // RefSCMatrix t_mo_so_I_J();
106 // /** Returns the transformation matrix that converts a covariant MO
107 // tensor index to a covariant SO tensor index.
108 // */
109 // RefSCMatrix t_mo_so_i_j();
110 // /** Returns the metric for converting a covariant SO index into
111 // a contravariant one. */
112 // RefSCMatrix g_so_I_j();
113 // /** Returns the metric for converting a contravariant SO index into
114 // a covariant one. */
115 // RefSCMatrix g_so_i_J();
116 // //@}
117 
119  RefSCMatrix so_to_mo();
121  RefSCMatrix orthog_so_to_mo();
123  RefSCMatrix mo_to_so();
127 
132  virtual RefSCMatrix oso_eigenvectors() = 0;
134  virtual RefDiagSCMatrix eigenvalues() = 0;
137  virtual double occupation(int irrep, int vectornum) = 0;
140  double occupation(int vectornum);
141 
143  virtual int spin_unrestricted() = 0;
144 
147  virtual double alpha_occupation(int irrep, int vectornum);
150  virtual double beta_occupation(int irrep, int vectornum);
153  double alpha_occupation(int vectornum);
156  double beta_occupation(int vectornum);
157 
158  // Return alpha and beta electron densities
159  virtual RefSCMatrix oso_alpha_eigenvectors();
160  virtual RefSCMatrix oso_beta_eigenvectors();
161  virtual RefSCMatrix alpha_eigenvectors();
162  virtual RefSCMatrix beta_eigenvectors();
163  virtual RefDiagSCMatrix alpha_eigenvalues();
164  virtual RefDiagSCMatrix beta_eigenvalues();
165 
172  virtual RefDiagSCMatrix
173  projected_eigenvalues(const Ref<OneBodyWavefunction>& guess_wfn, int alp=1);
177  int alp=1);
180  virtual RefSCMatrix hcore_guess();
185 
186  void symmetry_changed();
187 
189  double orbital(const SCVector3& r, int iorb);
190 
193  void orbitals(const std::vector<SCVector3> & r, std::vector<double>& values,
194  unsigned int first, unsigned int last,
195  bool energy_ordered = false);
196 
197  double orbital_density(const SCVector3& r, int iorb, double* orbval = 0);
198 
199  void print(std::ostream&o=ExEnv::out0()) const;
200 
201 };
202 
203 
206  private:
207  int nirrep_;
208  int *docc_;
209  int *socc_;
210  int total_charge_;
211  int user_occ_;
212 
214  void fill_occ(const RefDiagSCMatrix &evals,
215  int nelectron, int *docc, int *socc);
216 
217  void compute();
218 
219  public:
220  HCoreWfn(StateIn&);
241  HCoreWfn(const Ref<KeyVal>&);
242  ~HCoreWfn();
243 
244  void save_data_state(StateOut&);
245 
246  double occupation(int irrep, int vectornum);
247 
251  double magnetic_moment() const;
252  int spin_unrestricted();
253 
254  int value_implemented() const;
255 };
256 
258 // end of addtogroup ChemistryElectronicStructureOneBody
259 
260 }
261 
262 #endif
263 
264 // Local Variables:
265 // mode: c++
266 // c-file-style: "ETS"
267 // End:
sc::OneBodyWavefunction::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::OneBodyWavefunction::orbital
double orbital(const SCVector3 &r, int iorb)
returns the value of MO iorb at point r. To compute several MOs at several points use orbitals() inst...
sc::OneBodyWavefunction::nelectron
int nelectron()
Returns the number of electrons.
sc::HCoreWfn::oso_eigenvectors
RefSCMatrix oso_eigenvectors()
Returns the orthogonal MO (columns) to orthogonal-SO (rows) transformation matrix.
sc::OneBodyWavefunction::oso_eigenvectors
virtual RefSCMatrix oso_eigenvectors()=0
Returns the orthogonal MO (columns) to orthogonal-SO (rows) transformation matrix.
sc::RefSymmSCMatrix
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:265
sc::OneBodyWavefunction
A OneBodyWavefunction is a MolecularEnergy that solves an effective one-body problem.
Definition: obwfn.h:44
sc::RefSCMatrix
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
sc::OneBodyWavefunction::set_desired_value_accuracy
void set_desired_value_accuracy(double eps)
Overload of Function::set_desired_value_accuracy().
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::OneBodyWavefunction::symmetry_changed
void symmetry_changed()
Call this if you have changed the molecular symmetry of the molecule contained by this MolecularEnerg...
sc::OneBodyWavefunction::alpha_occupation
virtual double alpha_occupation(int irrep, int vectornum)
Returns the alpha occupation.
sc::Wavefunction
A Wavefunction is a MolecularEnergy that utilizies a GaussianBasisSet.
Definition: wfn.h:52
sc::RefDiagSCMatrix
The RefDiagSCMatrix class is a smart pointer to an DiagSCMatrix specialization.
Definition: matrix.h:389
sc::AccResult< RefSymmSCMatrix >
sc::OneBodyWavefunction::mo_to_orthog_so
RefSCMatrix mo_to_orthog_so()
/ Returns the SO to MO transformation matrix.
sc::OneBodyWavefunction::eigenvectors
RefSCMatrix eigenvectors()
Deprecated.
sc::StateIn
Definition: statein.h:79
sc::HCoreWfn::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::HCoreWfn
This is useful as an initial guess for other one body wavefunctions. Produces high-spin electron conf...
Definition: obwfn.h:205
sc::OneBodyWavefunction::projected_eigenvalues
virtual RefDiagSCMatrix projected_eigenvalues(const Ref< OneBodyWavefunction > &guess_wfn, int alp=1)
Imports the eigenvalues of guess_wfn.
sc::OneBodyWavefunction::occupation
virtual double occupation(int irrep, int vectornum)=0
Returns the occupation.
sc::OneBodyWavefunction::hcore_guess
virtual RefSCMatrix hcore_guess()
Return a guess vector.
sc::HCoreWfn::magnetic_moment
double magnetic_moment() const
Computes the S (or J) magnetic moment of the target state(s), in units of .
sc::HCoreWfn::spin_unrestricted
int spin_unrestricted()
Return 1 if the alpha orbitals are not equal to the beta orbitals.
sc::HCoreWfn::density
RefSymmSCMatrix density()
Returns the SO density.
sc::HCoreWfn::eigenvalues
RefDiagSCMatrix eigenvalues()
Returns the MO basis eigenvalues.
sc::OneBodyWavefunction::spin_unrestricted
virtual int spin_unrestricted()=0
Return 1 if the alpha orbitals are not equal to the beta orbitals.
sc::OneBodyWavefunction::projected_eigenvectors
virtual RefSCMatrix projected_eigenvectors(const Ref< OneBodyWavefunction > &guess_wfn, int alp=1)
Projects the density (not eigenvalues) of guess_wfn into the current basis set.
sc::StateOut
Definition: stateout.h:71
sc::HCoreWfn::value_implemented
int value_implemented() const
sc::SCVector3
a 3-element version of SCVector
Definition: vector3.h:43
sc::ExEnv::out0
static std::ostream & out0()
Return an ostream that writes from node 0.
sc::OneBodyWavefunction::print
void print(std::ostream &o=ExEnv::out0()) const
Print information about the object.
sc::OneBodyWavefunction::beta_occupation
virtual double beta_occupation(int irrep, int vectornum)
Returns the beta occupation.
sc::OneBodyWavefunction::orbitals
void orbitals(const std::vector< SCVector3 > &r, std::vector< double > &values, unsigned int first, unsigned int last, bool energy_ordered=false)
computes values of MOs in range [first,last] at points r and store them in an array values
sc::HCoreWfn::occupation
double occupation(int irrep, int vectornum)
Returns the occupation.
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::OneBodyWavefunction::eigenvalues
virtual RefDiagSCMatrix eigenvalues()=0
Returns the MO basis eigenvalues.

Generated at Sun Jan 26 2020 23:24:00 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.