MADNESS  0.10.1
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
slymer::NWChem_Interface Class Reference

Class for interfacing with NWChem (tested on version 6.6). More...

#include <NWChem.h>

Inheritance diagram for slymer::NWChem_Interface:
Inheritance graph
[legend]
Collaboration diagram for slymer::NWChem_Interface:
Collaboration graph
[legend]

Public Member Functions

 NWChem_Interface ()=delete
 
 NWChem_Interface (const std::string &fname_, std::ostream &err_)
 Wrap the output of a NWChem computation. More...
 
virtual void read (Properties::Properties props) override
 Read the specified properties and store them in the member variables. More...
 
void reset (const std::string &fname_)
 Changes the base file name. More...
 
- Public Member Functions inherited from slymer::ES_Interface
 ES_Interface ()=delete
 No default constructor. More...
 
 ES_Interface (const ES_Interface &es)
 Copy constructor. More...
 
 ES_Interface (ES_Interface &&es)
 Move constructor. More...
 
 ES_Interface (std::ostream &err_)
 Constructor that sets the error/warning stream and the references. More...
 
virtual ~ES_Interface ()=default
 

Public Attributes

const std::string & fname
 Publically-accessible version of the file name. More...
 
- Public Attributes inherited from slymer::ES_Interface
const Atomsatoms
 Publically accessible list of atoms. More...
 
const BasisSetbasis_set
 Publicly accessible basis set. More...
 
const madness::Tensor< double > & beta_energies
 Publically accessible list of beta MO energies (in eV). More...
 
const madness::Tensor< double > & beta_MOs
 Publically accessible beta MO expansions coefficients. Column is the MO, row is the basis function. More...
 
const madness::Tensor< double > & beta_occupancies
 Publically accessible list of beta MO occupancies (in eV). More...
 
const madness::Tensor< double > & energies
 Publically accessible list of alpha MO energies. More...
 
std::reference_wrapper< std::ostream > err
 Output stream for messages. More...
 
const unsigned int & lineardeps
 Publically accessible number of linear dependencies. More...
 
const madness::Tensor< double > & MOs
 Publically accessible alpha MO expansions coefficients. Column is the MO, row is the basis function. More...
 
const madness::Tensor< double > & occupancies
 Publically accessible list of alpha MO occupancies (in eV). More...
 
const Properties::Propertiesproperties
 Publically accessible list of read properties. More...
 

Protected Member Functions

void read_atoms (std::istream &in)
 Extract and store the atom types and positions. More...
 
void read_basis_set (std::istream &in)
 Extract and store the basis set. More...
 
void read_movecs (const Properties::Properties props, std::istream &in)
 Read the NWChem movecs file containing occupation numbers, MO energies, and MO coefficients. More...
 
- Protected Member Functions inherited from slymer::ES_Interface
void reset ()
 Reset the interface. More...
 

Protected Attributes

std::vector< std::unique_ptr< GaussianFunction > > gaussians
 Storage for the actual basis functions. More...
 
std::string my_fname
 The base file name of the NWChem output. More...
 
- Protected Attributes inherited from slymer::ES_Interface
Atoms my_atoms
 The atoms (symbols and positions, in angstroms). More...
 
BasisSet my_basis_set
 The basis set. More...
 
madness::Tensor< double > my_beta_energies
 Beta molecular orbital energies. More...
 
madness::Tensor< double > my_beta_MOs
 Beta molecular orbital expansions coefficients. Column is the MO, row is the basis function. More...
 
madness::Tensor< double > my_beta_occupancies
 Beta molecular orbital occupancies. More...
 
madness::Tensor< double > my_energies
 Alpha molecular orbital energies. More...
 
unsigned int my_lineardeps
 Number of linear dependencies in the basis. More...
 
madness::Tensor< double > my_MOs
 Alpha molecular orbital expansions coefficients. Column is the MO, row is the basis function. More...
 
madness::Tensor< double > my_occupancies
 Alpha molecular orbital occupancies. More...
 
Properties::Properties my_properties
 The properties that have been read. More...
 

Detailed Description

Class for interfacing with NWChem (tested on version 6.6).

Constructor & Destructor Documentation

◆ NWChem_Interface() [1/2]

slymer::NWChem_Interface::NWChem_Interface ( )
delete

◆ NWChem_Interface() [2/2]

slymer::NWChem_Interface::NWChem_Interface ( const std::string &  fname_,
std::ostream &  err_ 
)
inline

Wrap the output of a NWChem computation.

The parameter is the base file name (potentially including path) for the NWChem output files. For example, the NWChem log file will be fname.out, the molecular orbitals file will be fname.movecs, etc.

Parameters
[in]fname_Base file name for the NWChem computation.
[in,out]err_Output stream for error or warning messages.

Member Function Documentation

◆ read()

void slymer::NWChem_Interface::read ( Properties::Properties  props)
overridevirtual

Read the specified properties and store them in the member variables.

Exceptions
std::invalid_argumentif the NWChem logfile (fname.out) cannot be opened.
std::runtime_errorif there is an error reading the NWChem output file.
Parameters
[in]propsThe properties to be read, using a bit flag combination.

Implements slymer::ES_Interface.

References slymer::Properties::Atoms, slymer::Properties::Basis, slymer::Properties::Energies, fname, slymer::Properties::MOs, slymer::ES_Interface::my_properties, slymer::Properties::Occupancies, read_atoms(), read_basis_set(), and read_movecs().

Referenced by madness::SCF::initial_guess(), madness::AtomicBasisSet::read_nw_file(), and madness::InitParameters::readnw().

◆ read_atoms()

void slymer::NWChem_Interface::read_atoms ( std::istream &  in)
protected

Extract and store the atom types and positions.

Parameters
[in,out]inThe stream containing the NWChem output file.

References slymer::Properties::Atoms, slymer::ES_Interface::err, slymer::ES_Interface::my_atoms, slymer::ES_Interface::my_properties, slymer::Atom::position, and slymer::Atom::symbol.

Referenced by read().

◆ read_basis_set()

void slymer::NWChem_Interface::read_basis_set ( std::istream &  in)
protected

Extract and store the basis set.

Todo:
Reading Cartesian-type d and f shells has not been tested.
Note
Only shells of type s, p, d, f, g and h are implemented.
Parameters
[in,out]inThe stream containing the NWChem output file.

References slymer::ES_Interface::atoms, slymer::Properties::Basis, slymer::BasisShell::coeffs, slymer::dxx, slymer::dxxmyy, slymer::dxy, slymer::dxz, slymer::dyy, slymer::dyz, slymer::dzz, slymer::dzzmrr, slymer::ES_Interface::err, slymer::BasisShell::exps, func(), slymer::fxxx, slymer::fxxy, slymer::fxxymyyy, slymer::fxxz, slymer::fxxzmyyz, slymer::fxyy, slymer::fxyymxxx, slymer::fxyz, slymer::fxzz, slymer::fxzzmrrx, slymer::fyyy, slymer::fyyz, slymer::fyzz, slymer::fyzzmrry, slymer::fzzz, slymer::fzzzmrrz, gaussians, slymer::gx2my2dz2mr2, slymer::gx4mx2y2py4, slymer::gxxxx, slymer::gxxxy, slymer::gxxxz, slymer::gxxyy, slymer::gxxyz, slymer::gxxzz, slymer::gxydx2my2, slymer::gxydz2mr2, slymer::gxyyy, slymer::gxyyz, slymer::gxyzz, slymer::gxzdx2my2, slymer::gxzdz2mr2, slymer::gxzzz, slymer::gyyyy, slymer::gyyyz, slymer::gyyzz, slymer::gyzdx2my2, slymer::gyzdz2mr2, slymer::gyzzz, slymer::gzero, slymer::gzzzz, slymer::hm1, slymer::hm2, slymer::hm3, slymer::hm4, slymer::hm5, slymer::hp1, slymer::hp2, slymer::hp3, slymer::hp4, slymer::hp5, slymer::hxxxxx, slymer::hxxxxy, slymer::hxxxxz, slymer::hxxxyy, slymer::hxxxyz, slymer::hxxxzz, slymer::hxxyyy, slymer::hxxyyz, slymer::hxxyzz, slymer::hxxzzz, slymer::hxyyyy, slymer::hxyyyz, slymer::hxyyzz, slymer::hxyzzz, slymer::hxzzzz, slymer::hyyyyy, slymer::hyyyyz, slymer::hyyyzz, slymer::hyyzzz, slymer::hyzzzz, slymer::hzero, slymer::hzzzzz, slymer::ES_Interface::my_basis_set, slymer::ES_Interface::my_lineardeps, slymer::ES_Interface::my_properties, madness::detail::norm(), slymer::px, slymer::py, slymer::pz, slymer::s, slymer::BasisShell::type, and madness::type().

Referenced by read().

◆ read_movecs()

void slymer::NWChem_Interface::read_movecs ( const Properties::Properties  props,
std::istream &  in 
)
protected

◆ reset()

void slymer::NWChem_Interface::reset ( const std::string &  fname_)
inline

Changes the base file name.

Parameters
[in]fname_The new base file name for the NWChem computation.

References gaussians, my_fname, and slymer::ES_Interface::reset().

Member Data Documentation

◆ fname

const std::string& slymer::NWChem_Interface::fname

Publically-accessible version of the file name.

Referenced by read().

◆ gaussians

std::vector<std::unique_ptr<GaussianFunction> > slymer::NWChem_Interface::gaussians
protected

Storage for the actual basis functions.

Referenced by read_basis_set(), and reset().

◆ my_fname

std::string slymer::NWChem_Interface::my_fname
protected

The base file name of the NWChem output.

Referenced by reset().


The documentation for this class was generated from the following files: