Psi4
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Static Protected Attributes | Friends | List of all members
psi::BasisSet Class Reference

Basis set container class. More...

#include <basisset.h>

Public Member Functions

 BasisSet ()
 
 BasisSet (const std::string &basistype, SharedMolecule mol, std::map< std::string, std::map< std::string, std::vector< ShellInfo > > > &shell_map, std::map< std::string, std::map< std::string, std::vector< ShellInfo > > > &ecp_shell_map)
 
int nprimitive () const
 
int n_ecp_primitive () const
 
int max_nprimitive () const
 
int nshell () const
 
int n_ecp_shell () const
 
int nao () const
 
int nbf () const
 
bool has_ECP () const
 
int max_am () const
 
int max_ecp_am () const
 
bool has_puream () const
 
int max_function_per_shell () const
 
std::shared_ptr< Moleculemolecule () const
 
int shell_to_ao_function (int i) const
 
int shell_to_center (int i) const
 
int shell_to_basis_function (int i) const
 
int function_to_shell (int i) const
 
int function_to_center (int i) const
 
int ao_to_shell (int i) const
 
const GaussianShellshell (int si) const
 
const GaussianShellecp_shell (int si) const
 
const GaussianShellshell (int center, int si) const
 
int n_ecp_core (const std::string &label) const
 Return the number of core electrons associated with this (ECP) basisset, for the specified label. More...
 
int n_ecp_core () const
 Return the total number of core electrons assocated with this (ECP) basisset. More...
 
void set_n_ecp_core (const std::string &label, int n)
 Set the number of electrons associated with the given atom label, for an ECP basis set. More...
 
int n_frozen_core (const std::string &depth="", SharedMolecule mol=nullptr)
 Number of frozen core for molecule given freezing state, accounting for any ECP present. More...
 
const std::string & name () const
 Returns the name of this basis set. More...
 
void set_name (const std::string str)
 
const std::string & key () const
 Return the construction key and target information. More...
 
void set_key (const std::string str)
 
const std::string & target () const
 
void set_target (const std::string str)
 
void print_by_level (std::string out="outfile", int print_level=2) const
 
void print_summary (std::string out="outfile") const
 
void print_detail (std::string out) const
 
void print_detail () const
 
std::string print_detail_cfour () const
 
void refresh ()
 
int nshell_on_center (int i) const
 Return the number of shells on a given center. More...
 
int n_ecp_shell_on_center (int i) const
 Return the number of ECP shells on a given center. More...
 
int shell_on_center (int c, int n) const
 Return the overall shell number of the n'th shell on the c'th center. More...
 
int ecp_shell_on_center (int c, int n) const
 Return the overall ECP shell number of the n'th ECP shell on the c'th center. More...
 
int get_ao_sorted_shell (const int &i)
 Returns the value of the sorted shell list. More...
 
std::vector< int > get_ao_sorted_list ()
 Returns the vector of sorted shell list. More...
 
void move_atom (int atom, const Vector3 &trans)
 
void compute_phi (double *phi_ao, double x, double y, double z)
 
void print (std::string out) const
 
void print () const
 

Static Public Member Functions

static std::shared_ptr< BasisSetbuild (std::shared_ptr< Molecule > molecule, const std::vector< ShellInfo > &shells)
 
static void initialize_singletons ()
 
static std::shared_ptr< BasisSetzero_ao_basis_set ()
 
static std::shared_ptr
< SOBasisSet
zero_so_basis_set (const std::shared_ptr< IntegralFactory > &factory)
 
static std::pair< std::vector
< std::string >
, std::shared_ptr< BasisSet > > 
test_basis_set (int max_am)
 
static std::string make_filename (const std::string &basisname)
 

Static Public Attributes

static std::vector< Vector3exp_ao []
 Global arrays of x, y, z exponents. More...
 

Protected Attributes

std::string name_
 The name of this basis set (e.g. "BASIS", "RI BASIS") More...
 
std::string key_
 
std::string target_
 
GaussianShellshells_
 Array of gaussian shells. More...
 
GaussianShellecp_shells_
 Array of ECP shells. More...
 
std::vector< int > sorted_ao_shell_list_
 vector of shells numbers sorted in ascending AM order. More...
 
std::map< std::string, int > ncore_
 The number of core electrons for each atom type. More...
 
std::shared_ptr< Moleculemolecule_
 Molecule object. More...
 
int nao_
 Number of atomic orbitals (Cartesian) More...
 
int nbf_
 Number of basis functions (either cartesian or spherical) More...
 
int n_uprimitive_
 The number of unique primitives. More...
 
int n_ecp_uprimitive_
 The number of unique ECP primitives. More...
 
int n_shells_
 The number of shells. More...
 
int n_ecp_shells_
 The number of ECP shells. More...
 
int nprimitive_
 The number of primitives. More...
 
int n_ecp_primitive_
 The number of ECP primitives. More...
 
int max_am_
 The maximum angular momentum. More...
 
int max_ecp_am_
 The maximum ECP angular momentum. More...
 
int max_nprimitive_
 The maximum number of primitives in a shell. More...
 
bool puream_
 Whether the basis set is uses spherical basis functions or not. More...
 
int * n_prim_per_shell_
 The number of primitives (and exponents) in each shell. More...
 
int * shell_first_ao_
 The first (Cartesian) atomic orbital in each shell. More...
 
int * shell_first_basis_function_
 The first (Cartesian / spherical) basis function in each shell. More...
 
int * shell_center_
 Shell number to atomic center. More...
 
int * ecp_shell_center_
 ECP Shell number to atomic center. More...
 
int * function_to_shell_
 Which shell does a given (Cartesian / spherical) function belong to? More...
 
int * ao_to_shell_
 Which shell does a given Cartesian function belong to? More...
 
int * function_center_
 Which center is a given function on? More...
 
int * center_to_nshell_
 How many shells are there on each center? More...
 
int * center_to_shell_
 What's the first shell on each center? More...
 
int * center_to_ecp_nshell_
 How many ECP shells are there on each center? More...
 
int * center_to_ecp_shell_
 What's the first ECP shell on each center? More...
 
double * uexponents_
 The flattened lists of unique exponents. More...
 
double * ucoefficients_
 The flattened lists of unique contraction coefficients (normalized) More...
 
double * uoriginal_coefficients_
 The flattened lists of unique contraction coefficients (as provided by the user) More...
 
double * uecpexponents_
 The flattened lists of unique ECP exponents. More...
 
double * uecpcoefficients_
 The flattened lists of unique ECP contraction coefficients (normalized) More...
 
int * uecpns_
 The flattened list of r exponenets for ECP calculations. More...
 
double * uerd_coefficients_
 The flattened lists of ERD normalized contraction coefficients. More...
 
double * xyz_
 The flattened list of Cartesian coordinates for each atom. More...
 

Static Protected Attributes

static bool initialized_shared_ = false
 

Friends

class BasisSetParser
 

Detailed Description

Basis set container class.

Reads the basis set from a checkpoint file object. Also reads the molecule from the checkpoint file storing the information in an internal Molecule class which can be accessed using molecule().

Constructor & Destructor Documentation

BasisSet::BasisSet ( )
psi::BasisSet::BasisSet ( const std::string &  basistype,
SharedMolecule  mol,
std::map< std::string, std::map< std::string, std::vector< ShellInfo > > > &  shell_map,
std::map< std::string, std::map< std::string, std::vector< ShellInfo > > > &  ecp_shell_map 
)

Member Function Documentation

int psi::BasisSet::ao_to_shell ( int  i) const
inline

Given a Cartesian function (AO) number what shell does it correspond to.

std::shared_ptr< BasisSet > BasisSet::build ( std::shared_ptr< Molecule molecule,
const std::vector< ShellInfo > &  shells 
)
static

Builder factory method

Parameters
moleculethe molecule to build the BasisSet around
shellsarray of atom-numbered GaussianShells to build the BasisSet from
Returns
BasisSet corresponding to this molecule and set of shells
void BasisSet::compute_phi ( double *  phi_ao,
double  x,
double  y,
double  z 
)
const GaussianShell & BasisSet::ecp_shell ( int  si) const

Return the si'th ECP shell

Parameters
siShell number
Returns
A shared pointer to the GaussianShell object for the i'th shell.
int psi::BasisSet::ecp_shell_on_center ( int  c,
int  n 
) const
inline

Return the overall ECP shell number of the n'th ECP shell on the c'th center.

int psi::BasisSet::function_to_center ( int  i) const
inline

Given a function what is its atomic center

Parameters
iFunction number
Returns
The atomic center for the i'th function.
int psi::BasisSet::function_to_shell ( int  i) const
inline

Given a function number what shell does it correspond to.

std::vector<int> psi::BasisSet::get_ao_sorted_list ( )
inline

Returns the vector of sorted shell list.

int psi::BasisSet::get_ao_sorted_shell ( const int &  i)
inline

Returns the value of the sorted shell list.

bool psi::BasisSet::has_ECP ( ) const
inline

Has ECP

Returns
Whether this basis set object has an ECP associated with it
bool psi::BasisSet::has_puream ( ) const
inline

Spherical harmonics?

Returns
true if using spherical harmonics
void BasisSet::initialize_singletons ( )
static

Initialize singleton values that are shared by all basis set objects.

const std::string& psi::BasisSet::key ( ) const
inline

Return the construction key and target information.

std::string BasisSet::make_filename ( const std::string &  basisname)
static

Converts basis set name to a compatible filename.

Parameters
basisnameBasis name
Returns
Compatible file name.
int psi::BasisSet::max_am ( ) const
inline

Maximum angular momentum used in the basis set.

Returns
Maximum angular momentum.
int psi::BasisSet::max_ecp_am ( ) const
inline

Maximum angular momentum used in the ECPs in this.

Returns
Maximum ECP angular momentum.
int psi::BasisSet::max_function_per_shell ( ) const
inline

Compute the maximum number of basis functions contained in a shell.

Returns
The max number of basis functions in a shell.
int psi::BasisSet::max_nprimitive ( ) const
inline

Maximum number of primitives in a shell. Examines each shell and find the shell with the maximum number of primitives returns that number of primitives.

Returns
Maximum number of primitives.
std::shared_ptr< Molecule > BasisSet::molecule ( ) const

Molecule this basis is for.

Returns
Shared pointer to the molecule for this basis set.
void BasisSet::move_atom ( int  atom,
const Vector3 trans 
)
int psi::BasisSet::n_ecp_core ( const std::string &  label) const
inline

Return the number of core electrons associated with this (ECP) basisset, for the specified label.

int BasisSet::n_ecp_core ( ) const

Return the total number of core electrons assocated with this (ECP) basisset.

int psi::BasisSet::n_ecp_primitive ( ) const
inline

Number of ECP primitives.

Returns
The total number of ECP primitives in all shells.
int psi::BasisSet::n_ecp_shell ( ) const
inline

Number of ECP shells.

Returns
Number of ECP shells.
int psi::BasisSet::n_ecp_shell_on_center ( int  i) const
inline

Return the number of ECP shells on a given center.

int BasisSet::n_frozen_core ( const std::string &  depth = "",
SharedMolecule  mol = nullptr 
)

Number of frozen core for molecule given freezing state, accounting for any ECP present.

const std::string& psi::BasisSet::name ( ) const
inline

Returns the name of this basis set.

int psi::BasisSet::nao ( ) const
inline

Number of atomic orbitals (Cartesian).

Returns
The number of atomic orbitals (Cartesian orbitals, always).
int psi::BasisSet::nbf ( ) const
inline

Number of basis functions (Spherical).

Returns
The number of basis functions (Spherical, if has_puream() == true).
int psi::BasisSet::nprimitive ( ) const
inline

Number of primitives.

Returns
The total number of primitives in all contractions.
int psi::BasisSet::nshell ( ) const
inline

Number of shells.

Returns
Number of shells.
int psi::BasisSet::nshell_on_center ( int  i) const
inline

Return the number of shells on a given center.

void BasisSet::print ( std::string  out) const

Print the basis set.

Parameters
outThe file stream to use for printing. Defaults to outfile.
void psi::BasisSet::print ( void  ) const
inline
void BasisSet::print_by_level ( std::string  out = "outfile",
int  print_level = 2 
) const

Print basis set information according to the level of detail in print_level

Parameters
outThe file stream to use for printing. Defaults to outfile.
print_level< 1: Nothing 1: Brief summary 2: Summary and contraction details > 2: Full details Defaults to 2
void BasisSet::print_detail ( std::string  out) const

Prints a detailed PSI3-style summary of the basis (per-atom)

Parameters
outThe file stream to use for printing. Defaults to outfile.
void psi::BasisSet::print_detail ( ) const
inline
std::string BasisSet::print_detail_cfour ( ) const

Returns a string in CFOUR-style of the basis (per-atom) Format from http://slater.chemie.uni-mainz.de/cfour/index.php?n=Main.OldFormatOfAnEntryInTheGENBASFile

void BasisSet::print_summary ( std::string  out = "outfile") const

Prints a short string summarizing the basis set

Parameters
outThe file stream to use for printing. Defaults to outfile.
void BasisSet::refresh ( )

Refresh internal basis set data. Useful if someone has pushed to shells_. Pushing to shells_ happens in the BasisSetParsers, so the parsers will call refresh().

void psi::BasisSet::set_key ( const std::string  str)
inline
void psi::BasisSet::set_n_ecp_core ( const std::string &  label,
int  n 
)
inline

Set the number of electrons associated with the given atom label, for an ECP basis set.

void psi::BasisSet::set_name ( const std::string  str)
inline
void psi::BasisSet::set_target ( const std::string  str)
inline
const GaussianShell & BasisSet::shell ( int  si) const

Return the si'th Gaussian shell

Parameters
siShell number
Returns
A shared pointer to the GaussianShell object for the i'th shell.
const GaussianShell & BasisSet::shell ( int  center,
int  si 
) const

Return the i'th Gaussian shell on center

Parameters
centeratomic center
siShell number
Returns
A shared pointer to the GaussianShell object for the i'th shell.
int psi::BasisSet::shell_on_center ( int  c,
int  n 
) const
inline

Return the overall shell number of the n'th shell on the c'th center.

int psi::BasisSet::shell_to_ao_function ( int  i) const
inline

Given a shell what is its first AO function

Parameters
iShell number
Returns
The function number for the first function for the i'th shell.
int psi::BasisSet::shell_to_basis_function ( int  i) const
inline

Given a shell what is its first basis function (spherical) function

Parameters
iShell number
Returns
The function number for the first function for the i'th shell.
int psi::BasisSet::shell_to_center ( int  i) const
inline

Given a shell what is its atomic center

Parameters
iShell number
Returns
The atomic center for the i'th shell.
const std::string& psi::BasisSet::target ( ) const
inline
std::pair< std::vector< std::string >, std::shared_ptr< BasisSet > > BasisSet::test_basis_set ( int  max_am)
static

Returns a shell-labeled test basis set object

Parameters
max_ammaximum angular momentum to build
Returns
pair containing shell labels and four-center test basis for use in benchmarking See libmints/benchmark.cc for details
std::shared_ptr< BasisSet > BasisSet::zero_ao_basis_set ( )
static

Returns an empty basis set object.

Returns a BasisSet object that actually has a single s-function at the origin with an exponent of 0.0 and contraction of 1.0.

Returns
A new empty BasisSet object.
static std::shared_ptr<SOBasisSet> psi::BasisSet::zero_so_basis_set ( const std::shared_ptr< IntegralFactory > &  factory)
static

Returns an empty SO basis set object.

Returns an SOBasis object that actually has a single s-function at the origin with an exponent of 0.0 and contraction of 1.0.

Returns
A new empty SOBasis object.

Friends And Related Function Documentation

friend class BasisSetParser
friend

Member Data Documentation

int* psi::BasisSet::ao_to_shell_
protected

Which shell does a given Cartesian function belong to?

int* psi::BasisSet::center_to_ecp_nshell_
protected

How many ECP shells are there on each center?

int* psi::BasisSet::center_to_ecp_shell_
protected

What's the first ECP shell on each center?

int* psi::BasisSet::center_to_nshell_
protected

How many shells are there on each center?

int* psi::BasisSet::center_to_shell_
protected

What's the first shell on each center?

int* psi::BasisSet::ecp_shell_center_
protected

ECP Shell number to atomic center.

GaussianShell* psi::BasisSet::ecp_shells_
protected

Array of ECP shells.

std::vector< Vector3 > BasisSet::exp_ao
static

Global arrays of x, y, z exponents.

int* psi::BasisSet::function_center_
protected

Which center is a given function on?

int* psi::BasisSet::function_to_shell_
protected

Which shell does a given (Cartesian / spherical) function belong to?

bool BasisSet::initialized_shared_ = false
staticprotected
std::string psi::BasisSet::key_
protected
int psi::BasisSet::max_am_
protected

The maximum angular momentum.

int psi::BasisSet::max_ecp_am_
protected

The maximum ECP angular momentum.

int psi::BasisSet::max_nprimitive_
protected

The maximum number of primitives in a shell.

std::shared_ptr<Molecule> psi::BasisSet::molecule_
protected

Molecule object.

int psi::BasisSet::n_ecp_primitive_
protected

The number of ECP primitives.

int psi::BasisSet::n_ecp_shells_
protected

The number of ECP shells.

int psi::BasisSet::n_ecp_uprimitive_
protected

The number of unique ECP primitives.

int* psi::BasisSet::n_prim_per_shell_
protected

The number of primitives (and exponents) in each shell.

int psi::BasisSet::n_shells_
protected

The number of shells.

int psi::BasisSet::n_uprimitive_
protected

The number of unique primitives.

std::string psi::BasisSet::name_
protected

The name of this basis set (e.g. "BASIS", "RI BASIS")

int psi::BasisSet::nao_
protected

Number of atomic orbitals (Cartesian)

int psi::BasisSet::nbf_
protected

Number of basis functions (either cartesian or spherical)

std::map<std::string, int> psi::BasisSet::ncore_
protected

The number of core electrons for each atom type.

int psi::BasisSet::nprimitive_
protected

The number of primitives.

bool psi::BasisSet::puream_
protected

Whether the basis set is uses spherical basis functions or not.

int* psi::BasisSet::shell_center_
protected

Shell number to atomic center.

int* psi::BasisSet::shell_first_ao_
protected

The first (Cartesian) atomic orbital in each shell.

int* psi::BasisSet::shell_first_basis_function_
protected

The first (Cartesian / spherical) basis function in each shell.

GaussianShell* psi::BasisSet::shells_
protected

Array of gaussian shells.

std::vector<int> psi::BasisSet::sorted_ao_shell_list_
protected

vector of shells numbers sorted in ascending AM order.

std::string psi::BasisSet::target_
protected
double* psi::BasisSet::ucoefficients_
protected

The flattened lists of unique contraction coefficients (normalized)

double* psi::BasisSet::uecpcoefficients_
protected

The flattened lists of unique ECP contraction coefficients (normalized)

double* psi::BasisSet::uecpexponents_
protected

The flattened lists of unique ECP exponents.

int* psi::BasisSet::uecpns_
protected

The flattened list of r exponenets for ECP calculations.

double* psi::BasisSet::uerd_coefficients_
protected

The flattened lists of ERD normalized contraction coefficients.

double* psi::BasisSet::uexponents_
protected

The flattened lists of unique exponents.

double* psi::BasisSet::uoriginal_coefficients_
protected

The flattened lists of unique contraction coefficients (as provided by the user)

double* psi::BasisSet::xyz_
protected

The flattened list of Cartesian coordinates for each atom.


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