reading basis set from BSE file: bas_tag_lib: failed to locate basis

436 views
Skip to first unread message

Drew Parsons

unread,
Feb 19, 2021, 10:09:05 AM2/19/21
to NWChem Forum

I'm trying to read a basis set downloaded from BSE (def2-TZVP is not available for Nd in the default library).  It works if copied into my input file.  But for cleaner maintenance of input files I would prefer to keep the downloaded basis set in a separate file, and reference that file in the nwchem input file.

I'm attaching basis set file (for Nd) as downloaded from BSE, and my input file.

That input file is:
====================
start Nd
 title "Nd3+"
 memory stack 1600 mb heap 300 mb global 2000 mb
 charge 3
 geometry
   Nd  0  0  0
 end

 basis
   Nd library def2-TZVP file def2-tzvp.Nd.nw
 end
 ecp
   Nd library def2-ECP file def2-tzvp.Nd.nw
 end

 dft
   MULT 2
   direct
   GRID NODISK
   iterations 100
   noprint "final vectors analysis"
 end

task dft
================================

The error message attempting to read the basis set is:

  bas_tag_lib: failed to locate basis nd_def2-tzvp in file def2-tzvp.Nd.nw
 ------------------------------------------------------------------------
 bas_tag_lib: no such basis available                   0
 ------------------------------------------------------------------------
 ------------------------------------------------------------------------
  current input line :
    10:    Nd library def2-TZVP file def2-tzvp.Nd.nw
 ------------------------------------------------------------------------

I gather it's related to the tag used in the basis set file. It downloads as "ao basis", i.e.
BASIS "ao basis" PRINT

But even if I change that tag in the file def2-tzvp.Nd.nw to "Nd_Def2-TZVP" (similar to how the tags appear in the default libraries), it still gives the same error, "failed to locate basis nd_def2-tzvp in file def2-tzvp.Nd.nw"

What needs to be done to read the basis sets from a separate file?


Drew Parsons

unread,
Feb 19, 2021, 10:18:28 AM2/19/21
to NWChem Forum
p.s. I cannot attach the files. It seems Google no longer support Google Groups and has deactivated file attach functionality.
The basis set here is def2-TZVP for Nd, 
https://www.basissetexchange.org/basis/def2-tzvp/format/nwchem/?version=1&elements=60&optimize_general=true&uncontract_general=true
saved as def2-tzvp.Nd.nw

Edoardo Aprà

unread,
Feb 19, 2021, 12:56:39 PM2/19/21
to NWChem Forum
I think the easiest way to use the new BSE data is to use the approach described in https://nwchemgit.github.io/Basis.html#how-to-use-basis-files-from-httpswwwbasissetexchangeorg-new-in-2019
This requires access to the source of NWChem 7.0.0 (and later versions) and define the following environment variable
NWCHEM_BASIS_LIBRARY=$NWCHEM_TOP/src/basis/libraries.bse/

If you still want to manually create your own library files, I am attaching an edited file (same change of keywords from upper to lower case) from the bse link you posted. This is the input file that goes with it
 geometry
   Nd  0  0  0
 end
 basis
   Nd library "def2-tzvp" file ./def2-tzvp.txt
 end
 ecp
   Nd library def2-ECP file ./def2-tzvp.txt
 end

def2-tzvp.txt

Drew Parsons

unread,
Feb 20, 2021, 2:41:27 PM2/20/21
to NWChem Forum
Thanks Edoardo.  The essential step then, was simply to convert the uppercase keywords to lowercase.  With that (and making sure the tags match), it's working now for me.  I was confused by the input script syntax which is insensitive to keyword case.

Setting the NWCHEM_BASIS_LIBRARY environment variable also works. Good to know it's an option, though I think It's important to know how to use a separate local file for finer control of the basis sets (or perhaps for mixing BSE data for one atom with standard data for other atoms).

Adding the Spherical keyword is an interesting and important point. The in-source files in src/basis/libraries.bse aren't marked Spherical either.  The calculation proceeds perfectly happily without the flag. Does it mean without the Spherical keyword the data is treated as cartesian (the default setting), and therefore the results will be completely wrong?  That would be disastrous of course.

Edoardo Aprà

unread,
Feb 22, 2021, 8:36:17 PM2/22/21
to NWChem Forum
The spherical keyword from the basis set library is currently ignored in NWChem.
The only option for the user is to set is to use the keyword spherical in the first basis line https://nwchemgit.github.io/Basis.html#-spherical-or-cartesian
basis spherical
   Nd library "def2-tzvp" file ./def2-tzvp.txt
 end

Drew Parsons

unread,
Feb 23, 2021, 9:50:03 AM2/23/21
to NWChem Forum
Thanks for clarifying.  I gather that means library files must necessarily provide the spherical format (i.e. cartesian format is not possible in library files).

Edoardo Aprà

unread,
Feb 23, 2021, 1:58:37 PM2/23/21
to NWChem Forum
Since I am not quite sure I was able to correctly describe what NWChem does when reading  basis set library file, I think an example might be a better way to understand what is going on. The library file I am using is just the simplest library file I can think of that has d orbitals (please don't use it for real calculations).
The attached test file use the mylib.txt library file. The library file mylib.txt contains the spherical keyword. To be more precise, the first line of mylib.txt is
basis "Ti_mylib" spherical

If you use the input file testlib.nw, you end up with 19 functions. testlib.nw has the simplest basis library input section using all default options. Therefore, NWChem has adopted cartesian functions. In other words, as I was trying to convey in my earlier message, the spherical keyword from the library file is not used.
basis
 Ti library "mylib" file ./mylib.txt
end

Same behavior if the file testlib_cartesian.nw is used, where the basis line explicitly sets the basis as cartesian.
basis cartesian
 Ti library "mylib" file ./mylib.txt
end

Instead, if the spherical keyword is used in the basis line as in the testlib_spherical.nw input file, then spherical functions are used and the total number of basis functions is 18 instead of 19.
basis spherical
 Ti library "mylib" file ./mylib.txt
end
 
testlib_cartesian.nw.txt
testlib.nw.txt
testlib_spherical.nw.txt
mylib.txt

Drew Parsons

unread,
Mar 4, 2021, 5:52:22 PM3/4/21
to NWChem Forum
I think I get it now.  The spherical keyword is used in the input file, not the library file, and refers to how the basis set is used in the specific calculation at hand. Thanks again Edoardo.
Reply all
Reply to author
Forward
0 new messages