Coder Social home page Coder Social logo

hotbit's Introduction

logo

Hotbit

Hotbit is an ASE density-functional tight-binding calculator that aims to provide

  • an open-source DFTB code
  • a handy companion for DFT (for easy & fast electronic structure analysis, for quick access to dynamical properties for testing, and for playing around)
  • a compact and accessible code for everyone to inspect and modify (avoiding parallelization implies that the code is less suitable for large systems)
  • an intuitive user interface (ideal for learning and teaching realistic electronic structure simulations)
  • DFTB parametrization suite including interface to libxc (see further instructions below)

Take a closer look:

  1. About hotbit
  2. Download and installation
  3. Manual:
  1. Code development (for code developers)

If you find hotbit useful in your work, please cite (pdf):

    @article{koskinen_CMS_09,
      Author = {P. Koskinen, V. Mäkinen},
      Journal = {Computational Material Science},
      Title = {Density-functional tight-binding for beginners},
      Volume = {47},
      Pages = {237},
      Year = {2009}
    }

environment variables

When installing with

python setup.py install --home=.

you can set the necessary environment variables by calling

bash env_exports

libxc interface:

libxc can be found at www.tddft.org/programs/libxc

  • For using the Hotbit Slater-Koster parametrization suite together with exchange-correlation functionals from libxc, you should install libxc and its python module. For details on the installation, please refer to the instructions given with the libxc package. Currently, Hotbit supports LDA and GGA functionals (meta-GGAs and hybrids pending) Specification of functionals is supported via their generic names. For a list of available functionals, please refer to
hotbit.parametrization.pylibxc_functionals.py

Support of direct specification via libxc identifiers will be added soon.

hotbit's People

Contributors

ajjackson avatar martin-stoehr avatar pekkosk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hotbit's Issues

linear_response.py FAILED! -> 'pylab' has no attribute 'poly_between'

FYI: pylab.poly_between has been removed in matplotlib 3.1.1

Throws the following error when I run the tests:

C6H6_wedge.py             OK. (3.0 seconds)
[0.00447103 0.00447103 0.00968666 0.01300298 0.01344216 0.01344216
 0.0215762  0.0215762  0.03671848 0.07467506 0.07467507]
Traceback (most recent call last):
  File "/Users/robertwexler/hb/hotbit/lib/python/hotbit/test/linear_response.py", line 18, in <module>
    lr.plot_spectrum('Na3+_lr.png',width=0.08)
  File "/Users/robertwexler/hb/hotbit/lib/python/hotbit/analysis/lr.py", line 251, in plot_spectrum
    xs, ys = pl.poly_between(e, 0, f)
AttributeError: module 'pylab' has no attribute 'poly_between'
linear_response.py returned 256 and FAILED!

Looking for a work-around, I'll let you know if I find one.

Best,
Rob

Homonuclear parametrization

Hello,

I am trying to learn how to parametrize DFTB with hotbit. I am able to construct the CH and HC Slater Koster tables but I am having trouble doing the homonuclear cases (e.g., HH and CC). I noticed in the AuAu example that dimer, "bulk", and homogeneous clusters are used. I constructed a dimer and bulk trajectory for hydrogen by just copying the gold examples (and adjusting the bond lengths in the dimer). However, I am wondering if this is sufficient for the homogeneous cluster (i.e., replacing Au with H in the Au12-.xyz file and decreasing the bond lengths between the atoms). Any help is appreciated.

-Sarah

Trajectory file for Parameterization

Dear users,

I am exploring Hotbit and would like to know how the trajectory files are created.
Which type of calculations are used in ASE to generate the trajectory file.
I would be grateful if can share the script used to create the trajectory files in the CH_parameterization
example available in the HOTBIT code.

Regards,
Anshuman

Cannot Install HotBit

Hello:

I run into an error when trying to set up hotbit. I followed the instructions where it said to git clone followed by running setup.py, but the terminal says there is an issue recognizing the OS. I am using Windows 10 btw, I do not know if that makes a difference.

Traceback (most recent call last):
File "setup.py", line 39, in
get_system_config(inc_dirs, libs, lib_dirs,
File "C:\Users<User>\Desktop\hotbit\config.py", line 31, in get_system_config
machine = os.uname()[4]
AttributeError: module 'os' has no attribute 'uname'

If there is a binary precompiled that I can use from my desktop, that would be great. Also, is there a high-res image of the map referenced in the code development subsection of the documentation? It would be helpful if that was available.

Thank you!

Free atom on-site energies for Au

Hi ,

While using the scalar relativistic KSAllelectron calculation with gold (Au) gives the on-site valence energies as :

6s: -0.222837407
6p: -0.032527285
5d: -0.261806241

which is significantly different from the valence energies available in AuAu_Parameterization examples.

6s: -0.2149
6p: -0.0096
5d: -0.2537

What parameter should I use to get the energies match the above values?
I tried changing the amount of electrons being added/removed from the 6s/6p orbitals but it does not work.

Best Regards,
Anshuman

ImportError: cannot import name PropertyNotImplementedError

Hey,

I've just started to have a look into ASE and Hotbit, I managed to install Hotbit, but whenever I call
hotbit
or e.g. within a python script
from hotbit import Hotbit
I get
ImportError: cannot import name PropertyNotImplementedError.

I made sure that ASE is up to date (3.13.0) using
pip install --upgrade --user ase

Any ideas where I failed or what's the reason for this?

ImportError: cannot import name Trajectory

Dear Pekkosk,

I downloaded and installed your code hotbit. When I run the test.py, there is an error as "ImportError: cannot import name Trajectory". Could you tell me how to deal with it? Thanks.

Best regards,
Yunsong Li

Error when using functionals from libxc

Dear Developers and Users,

I would like to compare the electronic parameters generated from various functionals. But I have ran into some errors in using both LDA and GGA functionals.

About codes, I use openblas to compile hotbit and install the pylibxc based on libxc-5.0.0.

Using LDA PW92 from libxc,

>>> calc = KSAllElectron('Pt', scalarrel = True, xc = 'pw92')
>>> calc.run()
*******************************************
Kohn-Sham all-electron calculation for Pt
*******************************************
Using scalar relativistic corrections.
max 5 nodes, 3000 grid points
Pt xc=pw92 charge=0.0 conf:none

Start iteration...
iter   0, dn=1.5e+02>1.0e-07, max 14 sp-iter
iter  10, dn=2.3e+00>1.0e-07, max 10 sp-iter
Traceback (most recent call last):
  File "/home/hotbit/parametrization/atom.py", line 330, in run
    d_enl_max, itmax=self.solve_eigenstates(it)
  File "/home/hotbit/parametrization/atom.py", line 419, in solve_eigenstates
    assert c0[-2]<0 and c0[-1]<0
AssertionError

Using GGA PBE from libxc,

>>> calc = KSAllElectron('Pt', scalarrel = True, xc = 'pbe')
>>> calc.run()
*******************************************
Kohn-Sham all-electron calculation for Pt
*******************************************
Using scalar relativistic corrections.
max 5 nodes, 3000 grid points
Pt xc=pbe charge=0.0 conf:none

Start iteration...
Traceback (most recent call last):
  File "/home/hotbit/parametrization/atom.py", line 326, in run
    self.veff=self.mix*self.calculate_veff()+(1-self.mix)*self.veff
  File "/home/hotbit/parametrization/atom.py", line 263, in calculate_veff
    self.vxc=self.xcf.vxc(self.dens)
  File "/home/hotbit/parametrization/pylibxc_interface.py", line 90, in vxc
    if self._xGGA: v_x -= self.v_gga(res['vsigma'][0], drho_dr)
ValueError: non-broadcastable output operand with shape (1,) doesn't match the broadcast shape (3000,)

Could you give me some advice on these errors? Is there a docker for hotbit+libxc to run some calculations successfully?

Many thanks,
Jiayan

Unable to run the CH_parameterization example

Dear pekkosk,

I am getting the below error while using the latest example from HOTBIT:

DeprecationWarning: Please stop using old trajectory files!
Convert to the new future-proof format like this:

$ python -m ase.io.trajectory CH-.traj

After downloading the code using :- git clone https://github.com/pekkosk/hotbit.git
and modifying the environment variables, I was able to run the tests without any error.
I have ase-15.0 code installed.
I was not able run 'Quench benzene molecule (benzene.py) ' from the example.
This gave me the following error
from ase.data.molecules import molecule
ImportError: cannot import name molecule.
I changed from ase.data.molecules import molecule to from ase.structure import molecule
and this works fine.
I am wondering if we need to modify the example CH.py code along with the source code to run this?
Please let me which version of ase should I use to run HOTBIT.
Currently, I am using ase-15.0
Update:: I had to modify fitting.py code to use Trajectory instead of PickleTrajectory and the program runs without any error.

Best Regards,
Anshuman

ATLAS no recognised with port instalation

the config.py file looks only in the /usr/lib directory for atlas, but osx ports are installed under /opt/local/lib/

Hacking the configure file to

  for dir in ['/opt/lib', '/opt/local/lib']:

fixes this.

An alternative is to make configure look for the $ATLAS environment variables

SCC can not be converged.

Recently, I have made an interface of HOTBIT parameterization module to DFTBplus.
In order to obtain Rep, a skf file without Rep would be prepared for DFTBplus after Hamilton and overlap calculations. However, I found that, the SCC calculations using the skf files were always not converged.
Now, I am focusing on the parameters about Boron. The problems have occurred in B-H and B-B.
When I set electron temperature to 0.005 K, the problem would be disappeared.
I do not know which parameter can be used to solve the problem during the parameterization.
Could you give me some advice ? Thank you very much.

How to reproduce Hubbard parameters

Dear administrator

When I tested Au parametrization example, I found that the Hubbard or orbital energies of Au I calculated is different from the values in default Au.elm (in /hotbit/param/fixed_parameters).
In this calculation, I used KSAllElectron with Scalar Relativistic correction.

I cannot reproduce exactly orbital energies and Hubbard parameters of not only Au but also other elements.

For example, in default C.elm file, the energies of 2p and 2s are
epsilon_2s=-0.4988
epsilon_2p=-0.1974

However, the values I calculated (using KSAllElectron or IP_EA without confinement or Scalar Relativistic Correction) are
epsilon_2s= -0.500675
epsilon_2p= -0.199259

How can I reproduce these values exactly?

Segmentation fault at line 194 in tests/mulliken.py

Encountered a seg fault at line 194 in mulliken.py:

python -m pdb mulliken.py 
> /Users/robertwexler/hb/hotbit/lib/python/hotbit/test/mulliken.py(1)<module>()
-> from ase import *
(Pdb) until 194
/Users/robertwexler/hb/hotbit/lib/python/box/misc.py:50: LinAlgWarning: Ill-conditioned matrix (rcond=1.73652e-17): result may not be accurate.
  c=solve(A,b)
/Users/robertwexler/hb/hotbit/lib/python/box/misc.py:50: LinAlgWarning: Ill-conditioned matrix (rcond=3.55489e-25): result may not be accurate.
  c=solve(A,b)
/Users/robertwexler/hb/hotbit/lib/python/box/misc.py:50: LinAlgWarning: Ill-conditioned matrix (rcond=1.03818e-17): result may not be accurate.
  c=solve(A,b)
/Users/robertwexler/hb/hotbit/lib/python/box/misc.py:50: LinAlgWarning: Ill-conditioned matrix (rcond=7.80523e-18): result may not be accurate.
  c=solve(A,b)
/Users/robertwexler/hb/hotbit/lib/python/box/misc.py:50: LinAlgWarning: Ill-conditioned matrix (rcond=2.24815e-26): result may not be accurate.
  c=solve(A,b)
/Users/robertwexler/hb/hotbit/lib/python/box/misc.py:50: LinAlgWarning: Ill-conditioned matrix (rcond=9.19242e-25): result may not be accurate.
  c=solve(A,b)
> /Users/robertwexler/hb/hotbit/lib/python/hotbit/test/mulliken.py(194)<module>()
-> atoms.get_potential_energy()
(Pdb) n
Segmentation fault: 11

Here's the line in the source code:

183 #
184 #   BONDING ANALYSIS
185 #
186 
187 #
188 #   Mayer bond order
189 #
190 if True:
191     atoms = graphene(4,4,1.42)
192     calc = Hotbit(SCC=False,kpts=(8,8,1),txt='-',**default_param)
193     atoms.set_calculator(calc)
194     atoms.get_potential_energy()
195     assert abs(calc.get_mayer_bond_order(1,2)-1.24155188722)<eps
196     assert abs(calc.get_atom_energy(0)-6.95260830265)<eps
197     assert abs(calc.get_atom_and_bond_energy(0)--9.62628777865)<eps
198     assert abs(calc.get_promotion_energy(0)-6.95260830265)<eps
199     assert abs(calc.get_bond_energy(1,2)--12.0027553172)<eps
200 
201     #print 'graphene'
202     #print 'A_C:',calc.get_atom_energy(0)
203     #print 'AB_C:',calc.get_atom_and_bond_energy(0)
204     #print 'prom_C',calc.get_promotion_energy(0)
205     #print 'B_CC:',calc.get_bond_energy(1,2)

Didn't have an issue with the preceding calls to atoms.get_potential_energy() though.

My specs:
Python 3.7.6 | packaged by conda-forge | (default, Mar 23 2020, 22:45:16)
ASE 3.19.1
macOS Catalina, Version 10.15.3

Please let me know if you need any other information. Thanks in advance for your help!

Best,
Rob

IndexError: list index out of range

Dear Mr. @pastewka,

Sorry I'm Newbie In Python script. In file " hotbit/hotbit/io/hb2skf.py " , there is a python script which can transform par to skf format, I have an error when trying to open **.par and **.elm
" parf = open(argv[1] + '_' + argv[2] + '.par')
IndexError: list index out of range
GPAW CLEANUP for serial binary: <type 'exceptions.IndexError'> occured. Calling sys.exit() "

Can you help me to solved it. Thanks

Best Regards,
Maftukhin

where to download the helper module ?

Dear Mr Koskinen
In misc folder, there is a python script which can transform par to skf format. I am wondering the module helper, how to download it and how to install this module on my machine? Thanks.

                                                           Best regards
                                                           Peter

User guide not in good detail

I hope to study the energy band structure of some annular molecule, e.g. the C_{18}(Science 365, 1299-1301). However I'm biginner about the hotbit package and the user guide seems not in great detail. Can any offer some useful suggestions?

ASE interface having trouble reading in `.par` files

Hi there, I just installed Hotbit and I was running into an error. When I was using the ASE interface of Hotbit, it had trouble reading in .par files for organic bond interactions. However, I noticed all of those files were in the param/fixed_parameters directory. The calculator began working when I moved the .par files from param/fixed_parameters to param. I'm not sure if I was using the calculator incorrectly or if this is an issue.

Thank you!

vdw.py

Dear Koskinen:
in file vdw.py line 67:
h1 = np.exp(-h2r**self.N)
#print r,self.N,h2,-h2
r**self.N,h1
f = (1.0-h1)**self.M

   i have print out the value of h1, and it is infinite. i think there is some problems when using the default vdw parameters.

   the form of vdw is 12-6 form of L-J ? 

Installation problem

Hi,
I just installed hotbit on my computer. But the error below occurred when I imported.
File "", line 1, in
File "hotbit/init.py", line 5, in
from .aseinterface import Hotbit, database_from_path
File "hotbit/aseinterface.py", line 17, in
from ase.calculators.calculator import PropertyNotImplementedError
ImportError: cannot import name PropertyNotImplementedError

CC repulsion fitting with diamond

diamond.txt
Hello again,

I have succeeded in creating a trajectory file for graphene and was able to use the "append_energy_curve" function for this file without any errors. However, when I try to do the same for my diamond trajectory, I get the following error :

AssertionError: Distance between atoms 0 and 1 is only 0.0000 Bohr

However, in my files none of the atoms are abnormally close together. Do you have any idea why I am getting this error?

a possible bug in hb2skf.py

Hi
I am using the hb2skf.py code to convert the hotbit parameter to the skf file.
Here is the procedure:
1. I went to the example folder AuAu_parametrization
2. I renamed the Au_Au_repulsion.par file to Au_Au.par
3. then I copied the hb2skf.py from the source code to the current example folder AuAu_parametrization
4. run the python code by 'python hb2skf.py Au Au'

Then I encountered an error like this:

Fitting a spline basis function in the range between 0.494382851691 and 0.594382851691
DEBUG  t=[0.49438285 0.51438285 0.53438285 0.55438285 0.57438285 0.59438285]

DEBUG  start=0.494382851691
Traceback (most recent call last):
  File "hb2skf.py", line 276, in <module>
    generate_DFTBplus_repulsion(tmp,
  File "hb2skf.py", line 129, in generate_DFTBplus_repulsion
    splParams, fitCovariances = curve_fit(splinefit, [t, start], data)
  File "/u/home/g/gengsun/anaconda3/lib/python3.8/site-packages/scipy/optimize/minpack.py", line 742, in curve_fit
    xdata = np.asarray_chkfinite(xdata, float)
  File "/u/home/g/gengsun/anaconda3/lib/python3.8/site-packages/numpy/lib/function_base.py", line 486, in asarray_chkfinite
    a = asarray(a, dtype=dtype, order=order)
  File "/u/home/g/gengsun/anaconda3/lib/python3.8/site-packages/numpy/core/_asarray.py", line 102, in asarray
    return array(a, dtype, copy=False, order=order)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

In which, I modified the hb2skf.py to print the two lines starting with DEBUG.
It seems that the curve_fit function complains about the input [t, start]. 't' is a numpy array, but 'start' is a float. This is a little bit strange to me.
Is there anything wrong in my usage of the code? or is this a bug?

Thanks.
Best,

Geng

Repulsion Fitting in hotbit

Hi there,
I am using hotbit for parametrization of Cu-M (where M is another transition metal).
I am able to get the .elm and Slako tables with no repulsion.
However, when I try the fourth step of repulsion fitting, I end up with the following error.

"
Fitting repulsion curve between Cu and Cu

Adding a scalable system ['Cu', 'Cu'] with 1 bonds at R=2.4900.

Appending energy curve data from dimer_curve.traj...
Traceback (most recent call last):
File "CuCu-repfit.py", line 37, in
rep.append_energy_curve(weight=1.0,calc=calc0,traj='dimer_curve.traj',comment='dimer curve')
File "/home/sha/hotbit/hotbit/parametrization/fitting.py", line 554, in append_energy_curve
traj = Trajectory(traj)
File "/home/sha/ase/ase/io/trajectory.py", line 48, in Trajectory
return TrajectoryReader(filename)
File "/home/sha/ase/ase/io/trajectory.py", line 217, in init
self._open(filename)
File "/home/sha/ase/ase/io/trajectory.py", line 222, in _open
self.backend = ulm.open(filename, 'r')
File "/home/sha/ase/ase/io/ulm.py", line 78, in open
return Reader(filename, index or 0)
File "/home/sha/ase/ase/io/ulm.py", line 346, in init
fd = builtins.open(fd, 'rb')
IOError: [Errno 2] No such file or directory: 'dimer_curve.traj'

"
I am not sure what is going wrong. Could someone help me solve this error?

Thanks
Sha

Issue of doing test

issue.docx

Hello administrator,
I am a fresh man who firstly use hotbit in order to get parameters for DFTB. I have installed hotbit in my laptop but I have something wrong when doing test shown in Download and installation. That is in $HOTBIT_DIR/hotbit/test. But I met some errors which seems strange, I have attached it in the attachment, can you please help me to solve that?

Thank you very much!

Best regards,
Yunhao

Adding polarization to certain elements

Hi pekkosk
I have been trying to add extra valence shell for say Silicon in the data.py file and then calculate the on-site energies. So I included 3s, 3p, 3d as valence shell for Si.

However, I get this error:
Epsilon history for 3d
nl=3d, eps=0.000180
Max epsilon 0.00018036
And atom not stable?

I tried changing the percentage of electron removed or added. But didn't help.

Do u have any suggestions on this?

Thanks

Slater-Koster Table for CH

Dear pekkosk,
The Slater-Koster file for CH_parameterization in the example is not symmetry ( C-H table is not the same as H-C table ). If we compare this with mio sk CH file C-H table is same as the H-C table.
I am wondering why is this the case for Hotbit. We also modified the def select_orbitals in slako.py as this was not permuting the orbitals correctly for Hamiltonian integral(this is what we think). We modified the select_orbitals function to fetch all the orbitals for C-H and H-C and then obtain the C-H_no_repulsion.par file.

def select_orbitals(val1,val2,integral):
"""
Select orbitals from given valences to calculate given integral.
e.g. ['2s','2p'],['4s','3d'],'sds' --> '2s' & '3d'
"""
nl1=None
#for nl in val1:
# if nl[1]==integral[0]: nl1=nl
nl2=None
#for nl in val2:
# if nl[1]==integral[1]: nl2=nl
for pair in ((a,b) for a in val1 for b in val2):
x = pair[0]
y = pair[1]
if x[1]==integral[0] and y[1]==integral[1]:
nl1 = x
nl2 = y
if x[1]==integral[1] and y[1]==integral[0]:
nl1 = x
nl2 = y
print (nl1,nl2)
return nl1,nl2

Best Regards,
Anshuman
C_H_norepulsion_par.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.