28 #ifndef _chemistry_qc_nbody_ref_h
29 #define _chemistry_qc_nbody_ref_h
31 #include <chemistry/qc/wfn/wfn.h>
32 #include <chemistry/qc/scf/scf.h>
33 #include <chemistry/qc/lcao/wfnworld.h>
34 #include <chemistry/qc/wfn/orbitalspace.h>
35 #include <chemistry/qc/wfn/spin.h>
68 const std::vector<double>& occs,
69 const std::vector<ParticleHoleOrbitalAttributes>& active,
71 bool eorder_increasing =
true,
209 bool use_world_df =
false);
220 virtual void purge();
223 const Ref<GaussianBasisSet>& basis()
const {
return basis_; }
224 const Ref<Integral>& integral()
const {
return integral_; }
232 virtual double energy() =0;
250 virtual int dk()
const =0;
267 virtual bool sdref()
const =0;
310 virtual void reset();
318 bool use_world_dfinfo_;
323 virtual void _set_desired_value_accuracy(
double eps) =0;
385 bool spin_restricted =
true,
386 unsigned int nfzc = 0,
387 unsigned int nfzv = 0,
389 std::string occ_orbs = std::string(
"canonical"));
400 const Ref<OrbitalSpace>& vir_space()
const {
return vir_space_; }
402 if (vir_space_)
return vir_space_->basis();
403 else return this->basis();
406 double energy() {
return obwfn()->energy(); }
412 bool spin_restricted()
const {
return spin_restricted_; }
413 int dk()
const {
return obwfn()->dk(); }
417 unsigned int nfzc()
const {
return nfzc_; }
418 unsigned int nfzv()
const {
return nfzv_; }
419 RefSymmSCMatrix
ordm(SpinCase1 spin)
const;
420 Ref<DensityFittingInfo>
dfinfo()
const;
421 const std::string& occ_orbitals()
const {
return occ_orbitals_; }
423 Ref<OneBodyWavefunction> obwfn_;
424 Ref<OrbitalSpace> vir_space_;
425 bool spin_restricted_;
426 std::string occ_orbitals_;
430 void init_spaces_restricted();
431 void init_spaces_unrestricted();
432 void _set_desired_value_accuracy(
double eps) { obwfn_->set_desired_value_accuracy(eps); }
457 const std::vector<unsigned int>& orbsymm,
461 unsigned int nfzc = 0,
462 unsigned int nfzv = 0,
463 bool omit_uocc =
false);
486 const std::vector<unsigned int>& orbsymm,
489 std::vector<unsigned int> occpi,
490 std::vector<unsigned int> fzcpi,
491 std::vector<unsigned int> fzvpi,
492 std::vector<unsigned int> holepi = std::vector<unsigned int>(),
493 std::vector<unsigned int> partpi = std::vector<unsigned int>(),
494 bool omit_uocc =
false);
509 bool spin_polarized()
const {
return rdm_[Alpha] != rdm_[Beta]; }
511 bool spin_restricted()
const {
return true; }
513 int dk()
const {
return 0; }
517 unsigned int nfzc()
const {
return nfzc_; }
518 unsigned int nfzv()
const {
return nfzv_; }
519 bool omit_uocc()
const {
return omit_uocc_; }
520 bool ordm_idempotent()
const {
return ordm_idempotent_; }
522 RefSymmSCMatrix rdm_[NSpinCases1];
525 unsigned int nelectron_;
526 unsigned int magmom_;
528 mutable bool ordm_idempotent_;
531 const std::vector<unsigned int>& orbsym,
532 std::vector<unsigned int> occpi,
533 std::vector<unsigned int> fzcpi,
534 std::vector<unsigned int> fzvpi,
535 std::vector<unsigned int> holepi,
536 std::vector<unsigned int> partpi);
538 void init_spaces() {
throw sc::ProgrammingError(
"For Extern_RefWavefunction, spaces must be init-ed in constructor");}
541 void init_spaces(
const RefSCMatrix&
orbs,
542 const std::vector<unsigned int>& orbsym,
543 std::vector<unsigned int> occpi,
544 std::vector<unsigned int> fzcpi,
545 std::vector<unsigned int> fzvpi,
546 std::vector<unsigned int> holepi,
547 std::vector<unsigned int> partpi);
548 void _set_desired_value_accuracy(
double eps) {
552 Ref<DensityFittingInfo> dfinfo()
const;
560 bool spin_restricted =
true,
561 unsigned int nfzc = 0,
562 unsigned int nfzv = 0,
int nelectron() const
Definition: ref.h:410
const Ref< OrbitalSpace > & orbs_sb() const
Definition: ref.h:96
Extern_RefWavefunction(const Ref< WavefunctionWorld > &world, const Ref< GaussianBasisSet > &basis, const Ref< Integral > &integral, const RefSCMatrix &orbs, const std::vector< unsigned int > &orbsymm, const RefSymmSCMatrix &alpha_1rdm, const RefSymmSCMatrix &beta_1rdm, unsigned int nocc, unsigned int nfzc=0, unsigned int nfzv=0, bool omit_uocc=false)
Constructs Extern_RefWavefunction using the MO-basis 1-RDMs + MO coefficients (same for alpha and bet...
void print(std::ostream &os=ExEnv::out0()) const
Print the object.
virtual bool sdref() const =0
is this a single-determinantal reference?
double energy()
Definition: ref.h:406
const Ref< OrbitalSpace > & uocc_act() const
Definition: ref.h:118
Ref< GaussianBasisSet > momentum_basis() const
Definition: ref.h:514
double actual_value_accuracy() const
Return the accuracy with which the value has been computed.
Definition: ref.h:407
const Ref< OrbitalSpace > & occ() const
Definition: ref.h:102
double actual_value_accuracy() const
Return the accuracy with which the value has been computed.
Definition: ref.h:506
const Ref< OrbitalSpace > & uocc_sb(SpinCase1 spin=AnySpinCase1) const
Return the space of symmetry-blocked unoccupied (virtual) MOs of the given spin.
const Ref< OrbitalSpace > & occ_sb(SpinCase1 spin=AnySpinCase1) const
Return the space of symmery-blocked occupied MOs of the given spin.
virtual const Ref< GaussianBasisSet > & uocc_basis() const
returns the basis supporting unoccupied orbitals. The defauls is same as returned by basis().
Definition: ref.h:226
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:265
void set_desired_value_accuracy(double)
Set the accuracy to which the value is to be computed.
void obsolete()
obsoletes this object
RefSymmSCMatrix ordm(SpinCase1 spin) const
return the AO basis density
virtual void obsolete()
obsoletes this object
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
A template class that maintains references counts.
Definition: ref.h:361
RefWavefunction specialization that is not an adaptor to a Wavefunction object.
Definition: ref.h:437
virtual double magnetic_moment() const =0
virtual double actual_value_accuracy() const =0
Return the accuracy with which the value has been computed.
Ref< OrbitalSpace > compute_canonvir_space(const Ref< FockBuildRuntime > &fb_rtime, const Ref< OrbitalSpace > &A, SpinCase1 spin)
canonicalize A
virtual void reset()
calling this will cause the object to be re-initialized next time it is used
double energy()
Definition: ref.h:505
virtual double desired_value_accuracy() const =0
const Ref< OrbitalSpace > & uocc_act_sb() const
Definition: ref.h:116
Ref< GaussianBasisSet > momentum_basis() const
Definition: ref.h:414
const Ref< OrbitalSpace > & orbs_sb(SpinCase1 spin=AnySpinCase1) const
Return the space of symmetry-blocked MOs of the given spin.
void save_data_state(StateOut &so)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
const Ref< OrbitalSpaceRegistry > & orbital_registry() const
Definition: ref.h:87
double desired_value_accuracy() const
Definition: ref.h:408
int dk() const
Definition: ref.h:413
void print(std::ostream &os=ExEnv::out0()) const
Print the object.
static double zero_occupancy()
an orbital is occupied if its occupancy is greater than this
Definition: ref.h:80
virtual Ref< DensityFittingInfo > dfinfo() const =0
which DensityFittingRuntime used to compute this reference wave function
double magnetic_moment() const
The RefDiagSCMatrix class is a smart pointer to an DiagSCMatrix specialization.
Definition: matrix.h:389
int dk() const
reimplements RefWavefunction::dk(). Currently only nonrelativistic references are supported.
Definition: ref.h:513
virtual int dk() const =0
SD_RefWavefunction(const Ref< KeyVal > &kv)
A KeyVal constructor is used to generate a SD_RefWavefunction object from a KeyVal object.
virtual RefSymmSCMatrix ordm(SpinCase1 spin) const =0
return the AO basis density
const Ref< OrbitalSpace > & occ(SpinCase1 spin=AnySpinCase1) const
Return the space of occupied MOs of the given spin.
const Ref< OrbitalSpace > & occ_act() const
Definition: ref.h:106
const Ref< OrbitalSpace > & valence_orbs() const
This OrbitalSpace defines valence orbitals.
const Ref< OrbitalSpace > & occ_sb() const
Definition: ref.h:100
const Ref< OrbitalSpace > & occ_frz(SpinCase1 spin=AnySpinCase1) const
Return the space of frozen occupied MOs of the given spin.
bool force_average_AB_rdm1_
For spin-free algorithms, if this is true, we would set both alpha/beta 1-rdm to the average of them;...
Definition: ref.h:305
void purge()
purges the data from this object
RefSymmSCMatrix ordm(SpinCase1 spin) const
return the AO basis density
Definition: ref.h:498
Ref< DensityFittingInfo > dfinfo() const
which DensityFittingRuntime used to compute this reference wave function
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void add_ao_space(const Ref< GaussianBasisSet > &bs, const Ref< Integral > &ints, const Ref< AOSpaceRegistry > &aoreg, const Ref< OrbitalSpaceRegistry > oreg)
construct and add an AO space to aoreg and oreg
virtual void init_spaces()=0
initialize OrbitalSpace objects
int nelectron() const
Definition: ref.h:508
const Ref< OrbitalSpace > & uocc() const
Definition: ref.h:114
RefSymmSCMatrix core_hamiltonian_for_basis(const Ref< GaussianBasisSet > &basis, const Ref< GaussianBasisSet > &p_basis)
Returns the SO core Hamiltonian in the given basis and momentum basis.
const Ref< GaussianBasisSet > & uocc_basis() const
returns the basis supporting unoccupied orbitals. The defauls is same as returned by basis().
Definition: ref.h:401
virtual double energy()=0
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
virtual RefSymmSCMatrix ordm_orbs_sb(SpinCase1 spin) const
return the density in the orbs_sb() space
const Ref< OrbitalSpace > & occ_frz() const
Definition: ref.h:110
const Ref< OrbitalSpace > & uocc_act(SpinCase1 spin=AnySpinCase1) const
Return the space of active unoccupied (virtual) MOs of the given spin.
const Ref< OrbitalSpace > & occ_act(SpinCase1 spin=AnySpinCase1) const
Return the space of active occupied MOs of the given spin.
virtual void print(std::ostream &os=ExEnv::out0()) const =0
Print the object.
RefWavefunction(const Ref< KeyVal > &kv)
A KeyVal constructor is used to generate a RefWavefunction object from a KeyVal object.
PopulatedOrbitalSpace(const Ref< OrbitalSpaceRegistry > &oreg, SpinCase1 spin, const Ref< GaussianBasisSet > &bs, const Ref< Integral > &integral, const RefSCMatrix &coefs, const std::vector< double > &occs, const std::vector< ParticleHoleOrbitalAttributes > &active, const RefDiagSCMatrix &energies, bool eorder_increasing=true, Ref< OrbitalSpace > vbs=0, Ref< FockBuildRuntime > fbrun=0)
virtual Ref< GaussianBasisSet > momentum_basis() const =0
RefSymmSCMatrix core_hamiltonian_for_basis(const Ref< GaussianBasisSet > &basis, const Ref< GaussianBasisSet > &p_basis)
Returns the SO core Hamiltonian in the given basis and momentum basis.
const Ref< OrbitalSpace > & occ_act_sb(SpinCase1 spin=AnySpinCase1) const
Return the space of symmery-blocked active occupied MOs of the given spin.
Definition: stateout.h:71
RefWavefunction specialization for a single-determinant wave function.
Definition: ref.h:328
double desired_value_accuracy() const
Definition: ref.h:507
const Ref< OrbitalSpace > & oso_space() const
Returns the space of symmetry-blocked orthogonal SOs (spans the entire space of the basis)
virtual bool desired_value_accuracy_set_to_default() const
const Ref< OrbitalSpace > & orbs() const
Definition: ref.h:98
This factory produces the RefWavefunction that corresponds to the type of ref object.
Definition: ref.h:556
bool sdref() const
is this a single-determinantal reference?
This is thrown when a situations arises that should be impossible.
Definition: scexception.h:92
virtual RefSymmSCMatrix ordm_occ_sb(SpinCase1 spin) const
return the density in the occ_sb() space
const Ref< OrbitalSpace > & uocc_act_sb(SpinCase1 spin=AnySpinCase1) const
Return the space of symmetry-blocked active unoccupied (virtual) MOs of the given spin.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
RefWavefunction represents the reference wave function (or, more generally, a state) used as a starti...
Definition: ref.h:159
static std::ostream & out0()
Return an ostream that writes from node 0.
bool sdref() const
is this a single-determinantal reference?
Definition: ref.h:398
virtual RefSymmSCMatrix core_hamiltonian_for_basis(const Ref< GaussianBasisSet > &basis, const Ref< GaussianBasisSet > &p_basis)=0
Returns the SO core Hamiltonian in the given basis and momentum basis.
bool use_world_dfinfo() const
if true, override density fitting settings of RefWavefunction objects with those of WavefunctionWorld...
Definition: ref.h:165
Base class for objects that can save/restore state.
Definition: state.h:45
const Ref< OrbitalSpace > & occ_frz_sb() const
Definition: ref.h:108
void init() const
initializes the object
const Ref< OrbitalSpace > & orbs(SpinCase1 spin=AnySpinCase1) const
Return the space of energy-sorted MOs of the given spin.
PopulatedOrbitalSpace is an OrbitalSpace populated with a density.
Definition: ref.h:48
virtual int nelectron() const =0
bool spin_polarized() const
Definition: ref.h:246
void remove_ao_space(const Ref< GaussianBasisSet > &bs, const Ref< AOSpaceRegistry > &aoreg, const Ref< OrbitalSpaceRegistry > oreg)
undo the effect of add_ao_space()
const Ref< OrbitalSpace > & uocc_sb() const
Definition: ref.h:112
double magnetic_moment() const
Definition: ref.h:411
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
virtual void purge()
purges the data from this object
const Ref< OrbitalSpace > & uocc(SpinCase1 spin=AnySpinCase1) const
Return the space of unoccupied (virtual) MOs of the given spin.
const Ref< OrbitalSpace > & occ_act_sb() const
Definition: ref.h:104
const Ref< OrbitalSpace > & occ_frz_sb(SpinCase1 spin=AnySpinCase1) const
Return the space of symmery-blocked frozen occupied MOs of the given spin.
bool desired_value_accuracy_set_to_default() const
Definition: ref.h:409
Generated at Sun Jan 26 2020 23:23:59 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.