evaleev / libint

Libint: high-performance library for computing Gaussian integrals in quantum mechanics
Other
225 stars 95 forks source link

problems about BasisSet object #163

Closed lqhenwunai closed 4 years ago

lqhenwunai commented 4 years ago

Dear all,

I am trying to use libint to interface with our own codes. For test purpose, in the hartree-fock.cc example file, I wrote:

libint2::BasisSet obs("cc-pVDZ",atoms);

after the vector atoms reading geometries. Namely: {

/*** =========================== ***/
/*** initialize molecule         ***/
/*** =========================== ***/

// read geometry from a file; by default read from h2o.xyz, else take filename (.xyz) from the command line
const auto filename = (argc > 1) ? argv[1] : "h2o.xyz";
std::vector<Atom> atoms = read_geometry(filename);

 //here I try to create BasisSet object, but failed.
libint2::BasisSet obs("cc-pVDZ",atoms);

} ---------------------------------------

However, the compilation says: hartree-fock.cc:86:42: error: no matching function for call to ‘libint2::BasisSet::BasisSet(const char [8], std::vector&)’ libint2::BasisSet obs("cc-pVDZ",atoms);

I am using libint-2.6.

Is there something changed in libint-2.6 but not updated in libint-WIKI? And what is the basis set format for built-in basis sets? If I need to read in a non-standard basis set, how do I create corresponding BasisSet object?

Many thanks for your help.

best

evaleev commented 4 years ago

@lqhenwunai please post your entire code, compile command + full output, and other details (at least the compiler version)

lqhenwunai commented 4 years ago

@evaleev The input file "hartree-fock.cc" is uploaded as the .txt file. I simply add libint2::BasisSet obs("cc-pVDZ",atoms); at line 86.

hartree-fock.txt

The compile command is simply "make". The related compiler versions are GNU Make 4.1 gcc version 7.4.0

The output is as follows: output.txt

evaleev commented 4 years ago

on line 46 you defined struct Atom which is then used to define the type of variable atoms. Constructor for BasisSet expects a vector of libint2::Atoms, not a vector of your Atoms.

You are clearly trying to adjust hartree-fock.cc example to use BasisSet ... replace the definition of Atom with using Atom = libint2::Atom and it should compile. Replace shells with obs and it should at least get to the guess step. You will need to borrow more code from hartree-fock++.cc to make it do what you want.