obwfn.h
//
// obwfn.h
//
// Copyright (C) 1996 Limit Point Systems, Inc.
//
// Author: Curtis Janssen <cljanss@limitpt.com>
// Maintainer: LPS
//
// This file is part of the SC Toolkit.
//
// The SC Toolkit is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// The SC Toolkit is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public License
// along with the SC Toolkit; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
//
// The U.S. Government is granted a limited license as per AL 91-7.
//
#ifndef _chemistry_qc_wfn_obwfn_h
#define _chemistry_qc_wfn_obwfn_h
#ifdef __GNUC__
#pragma interface
#endif
#include <chemistry/qc/wfn/wfn.h>
namespace sc {
class OneBodyWavefunction: public Wavefunction {
protected:
ResultRefSymmSCMatrix density_;
AccResultRefSCMatrix oso_eigenvectors_;
AccResultRefDiagSCMatrix eigenvalues_;
int nirrep_;
int *nvecperirrep_;
double *occupations_;
double *alpha_occupations_;
double *beta_occupations_;
void init_sym_info();
// oldocc is converted to newocc using the correlation
// table between initial_pg_ and the current point group
// returns 1 if successful and 0 otherwise. newocc is
// delete[]'ed and new'ed.
int form_occupations(int *&newocc, const int *oldocc);
public:
OneBodyWavefunction(StateIn&);
OneBodyWavefunction(const Ref<KeyVal>&);
~OneBodyWavefunction();
void save_data_state(StateOut&);
int nelectron();
void set_desired_value_accuracy(double eps);
// Following is a proposed interface to make the meaning of
// the various transformation matrices less confusing.
// /** These members give metrics and basis transformations
// using the covariant/contravariant tensor notation. */
// //@{
// /** Returns the transformation matrix that converts
// a contravariant SO tensor index to a contravariant
// MO tensor index.
// */
// RefSCMatrix t_mo_so_I_J();
// /** Returns the transformation matrix that converts a covariant SO
// tensor index to a covariant MO tensor index.
// */
// RefSCMatrix t_mo_so_i_j();
// /** Returns the transformation matrix that converts
// a contravariant MO tensor index to a contravariant
// SO tensor index.
// */
// RefSCMatrix t_mo_so_I_J();
// /** Returns the transformation matrix that converts a covariant MO
// tensor index to a covariant SO tensor index.
// */
// RefSCMatrix t_mo_so_i_j();
// /** Returns the metric for converting a covariant SO index into
// a contravariant one. */
// RefSCMatrix g_so_I_j();
// /** Returns the metric for converting a contravariant SO index into
// a covariant one. */
// RefSCMatrix g_so_i_J();
// //@}
RefSCMatrix so_to_mo();
RefSCMatrix orthog_so_to_mo();
RefSCMatrix mo_to_so();
RefSCMatrix mo_to_orthog_so();
RefSCMatrix eigenvectors();
virtual RefSCMatrix oso_eigenvectors() = 0;
virtual RefDiagSCMatrix eigenvalues() = 0;
virtual double occupation(int irrep, int vectornum) = 0;
double occupation(int vectornum);
virtual int spin_unrestricted() = 0;
virtual double alpha_occupation(int irrep, int vectornum);
virtual double beta_occupation(int irrep, int vectornum);
double alpha_occupation(int vectornum);
double beta_occupation(int vectornum);
// Return alpha and beta electron densities
virtual RefSCMatrix oso_alpha_eigenvectors();
virtual RefSCMatrix oso_beta_eigenvectors();
virtual RefSCMatrix alpha_eigenvectors();
virtual RefSCMatrix beta_eigenvectors();
virtual RefDiagSCMatrix alpha_eigenvalues();
virtual RefDiagSCMatrix beta_eigenvalues();
virtual RefDiagSCMatrix
projected_eigenvalues(const Ref<OneBodyWavefunction>&, int alp=1);
virtual RefSCMatrix projected_eigenvectors(const Ref<OneBodyWavefunction>&,
int alp=1);
virtual RefSCMatrix hcore_guess();
virtual RefSCMatrix hcore_guess(RefDiagSCMatrix &val);
void symmetry_changed();
double orbital(const SCVector3& r, int iorb);
double orbital_density(const SCVector3& r, int iorb, double* orbval = 0);
void print(std::ostream&o=ExEnv::out0()) const;
};
// This is useful as an initial guess for other one body wavefunctions
class HCoreWfn: public OneBodyWavefunction {
private:
int nirrep_;
int *docc_;
int *socc_;
int total_charge_;
int user_occ_;
void fill_occ(const RefDiagSCMatrix &evals,
int ndocc, int *docc, int nsocc = 0, int *socc = 0);
void compute();
public:
HCoreWfn(StateIn&);
HCoreWfn(const Ref<KeyVal>&);
~HCoreWfn();
void save_data_state(StateOut&);
double occupation(int irrep, int vectornum);
RefSCMatrix oso_eigenvectors();
RefDiagSCMatrix eigenvalues();
RefSymmSCMatrix density();
int spin_polarized();
int spin_unrestricted();
int value_implemented() const;
};
}
#endif
// Local Variables:
// mode: c++
// c-file-style: "ETS"
// End: