vxb_eval_info.h
//
// vxb_eval_info.h
//
// Copyright (C) 2003 Edward Valeev
//
// Author: Edward Valeev <edward.valeev@chemistry.gatech.edu>
// Maintainer: EV
//
// 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.
//
#ifdef __GNUG__
#pragma interface
#endif
#ifndef _chemistry_qc_mbptr12_vxbevalinfo_h
#define _chemistry_qc_mbptr12_vxbevalinfo_h
#include <string>
#include <util/misc/string.h>
#include <util/ref/ref.h>
#include <math/scmat/abstract.h>
#include <util/group/memory.h>
#include <chemistry/molecule/energy.h>
#include <chemistry/qc/scf/scf.h>
#include <chemistry/qc/mbptr12/linearr12.h>
#include <chemistry/qc/mbptr12/moindexspace.h>
#include <chemistry/qc/mbptr12/transform_factory.h>
namespace sc {
class MBPT2_R12;
class R12IntEvalInfo : virtual public SavableState {
public:
enum StoreMethod { mem_posix = 0, posix = 1, mem_mpi = 2, mpi = 3, mem_only = 4 };
private:
Wavefunction* wfn_; // Wavefunction that owns this
Ref<SCF> ref_;
Ref<Integral> integral_;
Ref<GaussianBasisSet> bs_;
Ref<GaussianBasisSet> bs_aux_;
Ref<GaussianBasisSet> bs_vir_;
Ref<GaussianBasisSet> bs_ri_;
Ref<SCMatrixKit> matrixkit_;
Ref<MessageGrp> msg_;
Ref<MemoryGrp> mem_;
Ref<ThreadGrp> thr_;
int nocc_;
int nfzc_;
int nfzv_;
size_t memory_;
bool dynamic_;
double print_percent_;
int debug_;
StoreMethod ints_method_;
std::string ints_file_;
LinearR12::ABSMethod abs_method_;
int nlindep_aux_;
int nlindep_vir_;
int nlindep_ri_;
Ref<MOIndexSpace> mo_space_; // symblocked MO space
Ref<MOIndexSpace> obs_space_; // energy-sorted MO space
Ref<MOIndexSpace> abs_space_;
Ref<MOIndexSpace> ribs_space_;
Ref<MOIndexSpace> act_occ_space_;
Ref<MOIndexSpace> occ_space_;
Ref<MOIndexSpace> occ_space_symblk_;
Ref<MOIndexSpace> act_vir_space_;
Ref<MOIndexSpace> vir_space_;
Ref<MOIndexSpace> vir_space_symblk_;
Ref<MOIntsTransformFactory> tfactory_;
// construct the RI basis based on abs_method
void construct_ri_basis_(bool safe);
void construct_ri_basis_ks_(bool safe);
void construct_ri_basis_ksplus_(bool safe);
void construct_ri_basis_ev_(bool safe);
void construct_ri_basis_evplus_(bool safe);
// Uses ri_basis to construct a basis that spans the orthogonal complement to the OBS
void construct_ortho_comp_svd_();
// Returns true if ABS spans OBS
bool abs_spans_obs_();
// Construct eigenvector and eigenvalues sorted by energy
void eigen2_();
// Construct orthog_aux_
void construct_orthog_aux_();
// Construct orthog_vir_
void construct_orthog_vir_();
// Construct orthog_ri_
void construct_orthog_ri_();
public:
R12IntEvalInfo(StateIn&);
R12IntEvalInfo(MBPT2_R12*);
~R12IntEvalInfo();
void save_data_state(StateOut&);
void set_dynamic(bool dynamic) { dynamic_ = dynamic; };
void set_print_percent(double print_percent) { print_percent_ = print_percent; };
void set_debug_level(int debug) { debug_ = debug; };
void set_ints_method(const StoreMethod method) { ints_method_ = method; };
void set_ints_file(const std::string& filename) { ints_file_ = filename; };
void set_memory(const size_t nbytes);
void set_absmethod(LinearR12::ABSMethod abs_method);
Wavefunction* wfn() const { return wfn_; };
Ref<SCF> ref() const { return ref_; };
Ref<Integral> integral() const { return integral_; };
Ref<GaussianBasisSet> basis() const { return bs_; };
Ref<GaussianBasisSet> basis_vir() const { return bs_vir_; };
Ref<GaussianBasisSet> basis_ri() const { return bs_ri_; };
Ref<SCMatrixKit> matrixkit() const { return matrixkit_; };
Ref<MemoryGrp> mem() const { return mem_;};
Ref<MessageGrp> msg() const { return msg_;};
Ref<ThreadGrp> thr() const { return thr_;};
bool dynamic() const { return dynamic_; };
double print_percent() const { return print_percent_; };
int debug_level() const { return debug_; };
const StoreMethod ints_method() const { return ints_method_; };
const std::string& ints_file() const;
const size_t memory() const { return memory_; };
const int nocc() const { return nocc_;};
const int nocc_act() const { return nocc_ - nfzc_;};
const int nfzc() const { return nfzc_;};
const int nvir() const { return vir_space_->rank();};
const int nvir_act() const { return act_vir_space_->rank();};
const int nfzv() const { return nfzv_;};
LinearR12::ABSMethod abs_method() const { return abs_method_; };
Ref<MOIndexSpace> mo_space() const { return mo_space_; };
Ref<MOIndexSpace> obs_space() const { return obs_space_; };
Ref<MOIndexSpace> act_occ_space() const { return act_occ_space_; };
Ref<MOIndexSpace> act_vir_space() const { return act_vir_space_; };
Ref<MOIndexSpace> occ_space() const { return occ_space_; };
Ref<MOIndexSpace> occ_space_symblk() const { return occ_space_symblk_; };
Ref<MOIndexSpace> vir_space() const { return vir_space_; };
Ref<MOIndexSpace> vir_space_symblk() const { return vir_space_symblk_; };
Ref<MOIndexSpace> abs_space() const { return abs_space_; };
Ref<MOIndexSpace> ribs_space() const { return ribs_space_; };
Ref<MOIntsTransformFactory> tfactory() const { return tfactory_; };
static Ref<MOIndexSpace> orthog_comp(const Ref<MOIndexSpace>& space1, const Ref<MOIndexSpace>& space2,
const std::string& name, double lindep_tol);
static Ref<MOIndexSpace> orthogonalize(const std::string& name, const Ref<GaussianBasisSet>& bs, const Ref<Integral>& integral,
OverlapOrthog::OrthogMethod orthog_method, double lindep_tol,
int& nlindep);
static Ref<MOIndexSpace> gen_project(const Ref<MOIndexSpace>& space1, const Ref<MOIndexSpace>& space2,
const std::string& name, double lindep_tol);
static void compute_overlap_ints(const Ref<MOIndexSpace>& space1,
const Ref<MOIndexSpace>& space2,
RefSCMatrix& S);
static void compute_multipole_ints(const Ref<MOIndexSpace>& space1,
const Ref<MOIndexSpace>& space2,
RefSCMatrix& MX,
RefSCMatrix& MY,
RefSCMatrix& MZ,
RefSCMatrix& MXX,
RefSCMatrix& MYY,
RefSCMatrix& MZZ);
};
}
#endif
// Local Variables:
// mode: c++
// c-file-style: "CLJ"
// End: