libAtoms / QUIP

libAtoms/QUIP molecular dynamics framework: https://libatoms.github.io
347 stars 122 forks source link

Error from quippy.potential.Potential #259

Closed DGKang234 closed 3 years ago

DGKang234 commented 3 years ago

Hi all,

I was doing a tutorial examples in: https://libatoms.github.io/GAP/gap_si_surface.html?highlight=gap_3b However the below script (copied from the link) gives an error at qm_pot = Potential('TB DFTB', param_filename='dftb-params.xml') line. (Error message is attached in the bottom of the page)

I am not sure how to resolve the error.

Could you please give any advice on this error?

Many thanks.

import os
import numpy as np
import matplotlib.pylab as plt
from quippy.potential import Potential
from quippy.descriptors import Descriptor
from ase import Atoms, units
from ase.build import add_vacuum
from ase.lattice.cubic import Diamond
from ase.io import write
from ase.constraints import FixAtoms
from ase.md.velocitydistribution import MaxwellBoltzmannDistribution
from ase.md.verlet import VelocityVerlet
from ase.md.langevin import Langevin
from ase.optimize.precon import PreconLBFGS, Exp
sys.path.append('/home/uccatka/software/QUIP/src/GAP/doc_src/gap_si_surface/')
from visualise import ViewStructure

T = 1000.0 # Temperature [Kelvin]
timestep = 1.0 * units.fs

def build_slab(size=(1,2,2), vacuum=10.):
    # Build Si lattice.
    # lattice = Diamond('Si', directions=([1, 0, 0], [0, 1, 0], [0, 0, 1]), latticeconstant=5.44, size=size)
    lattice = Diamond('Si', latticeconstant=5.44, size=size)
    atoms = Atoms(lattice)

    # Fixing the bottom layer
    bottom = atoms.positions[:,2].min()
    fixed_mask = (abs(atoms.positions[:,2] - bottom) < 2.0)
    atoms.set_constraint(FixAtoms(mask=fixed_mask))

    # build surface by adding space to z direction
    add_vacuum(atoms, vacuum)
    # atoms.center(vacuum=10.0, axis=2)

    return atoms

atoms = build_slab()
print('Number of atoms:', len(atoms))

# attach tight binding calculator
qm_pot = Potential('TB DFTB', param_filename='dftb-params.xml')
atoms.set_calculator(qm_pot)

# Thermalize atoms
MaxwellBoltzmannDistribution(atoms, 2.0 * T * units.kB)
# dynamics = VelocityVerlet(atoms, timestep)
dynamics = Langevin(atoms, timestep, T * units.kB, 0.002)

#attach observer to dynamics to track quantity of interest (temperature)
def print_status():
    print('Step = {}, time = {} [fs], T = {} [K]'.format(
        dynamics.nsteps,
        dynamics.nsteps * dynamics.dt / units.fs,
        atoms.get_kinetic_energy() / (1.5 * units.kB * len(atoms))
    ))

def print_energy(a=atoms):  # store a reference to atoms in the definition.
    """Function to print the potential, kinetic and total energy."""
    epot = a.get_potential_energy() / len(a)
    ekin = a.get_kinetic_energy() / len(a)
    print('Energy per atom: Epot = %.3feV  Ekin = %.3feV (T=%3.0fK)  '
          'Etot = %.3feV' % (epot, ekin, ekin / (1.5 * units.kB), epot + ekin))

dynamics.attach(print_status, interval=10)
dynamics.attach(print_energy, interval=1)

reported Error is:

Traceback (most recent call last):
  File "input.py", line 63, in <module>
    qm_pot = Potential('TB DFTB', param_filename='dftb-params.xml')
  File "/home/uccatka/.local/lib/python3.7/site-packages/quippy-https_github.com_libAtoms_QUIP.git_357e28d_dirty-py3.7-linux-x86_64.egg/quippy/potential.py", line 82, in __init__
    param_filename=param_filename)
  File "/home/uccatka/.local/lib/python3.7/site-packages/quippy-https_github.com_libAtoms_QUIP.git_357e28d_dirty-py3.7-linux-x86_64.egg/quippy/potential_module.py", line 134, in filename_initialise
    if bulk_scale is None else bulk_scale._handle, error=error)
RuntimeError
Exception ignored in: <function Potential.__del__ at 0x2ab14599c9d8>
Traceback (most recent call last):
  File "/home/uccatka/.local/lib/python3.7/site-packages/quippy-https_github.com_libAtoms_QUIP.git_357e28d_dirty-py3.7-linux-x86_64.egg/quippy/potential_module.py", line 258, in __del__
    _quippy.f90wrap_potential_finalise(this=self._handle, error=error)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
gabor1 commented 3 years ago

When you compiled QUIP, did you turn on "TB support" ?

-- Gábor

Gábor Csányi Professor of Molecular Modelling Engineering Laboratory, University of Cambridge Pembroke College Cambridge

Pembroke College supports CARA. A Lifeline to Academics at Risk. http://www.cara.ngo/

On 8 Dec 2020, at 16:24, Computational-Chem-Nanocluster notifications@github.com wrote:

Hi all,

I was doing a tutorial examples in: https://libatoms.github.io/GAP/gap_si_surface.html?highlight=gap_3b However the below script (copied from the link) gives an error at qm_pot = Potential('TB DFTB', param_filename='dftb-params.xml') line. (Error message is attached in the bottom of the page)

I am not sure how to resolve the error.

Could you please give any advice on this error?

Many thanks.

import os import numpy as np import matplotlib.pylab as plt from quippy.potential import Potential from quippy.descriptors import Descriptor from ase import Atoms, units from ase.build import add_vacuum from ase.lattice.cubic import Diamond from ase.io import write from ase.constraints import FixAtoms from ase.md.velocitydistribution import MaxwellBoltzmannDistribution from ase.md.verlet import VelocityVerlet from ase.md.langevin import Langevin from ase.optimize.precon import PreconLBFGS, Exp sys.path.append('/home/uccatka/software/QUIP/src/GAP/doc_src/gap_si_surface/') from visualise import ViewStructure

T = 1000.0 # Temperature [Kelvin] timestep = 1.0 * units.fs

def build_slab(size=(1,2,2), vacuum=10.):

Build Si lattice.

# lattice = Diamond('Si', directions=([1, 0, 0], [0, 1, 0], [0, 0, 1]), latticeconstant=5.44, size=size)
lattice = Diamond('Si', latticeconstant=5.44, size=size)
atoms = Atoms(lattice)

# Fixing the bottom layer
bottom = atoms.positions[:,2].min()
fixed_mask = (abs(atoms.positions[:,2] - bottom) < 2.0)
atoms.set_constraint(FixAtoms(mask=fixed_mask))

# build surface by adding space to z direction
add_vacuum(atoms, vacuum)
# atoms.center(vacuum=10.0, axis=2)

return atoms

atoms = build_slab() print('Number of atoms:', len(atoms))

attach tight binding calculator

qm_pot = Potential('TB DFTB', param_filename='dftb-params.xml') atoms.set_calculator(qm_pot)

Thermalize atoms

MaxwellBoltzmannDistribution(atoms, 2.0 T units.kB)

dynamics = VelocityVerlet(atoms, timestep)

dynamics = Langevin(atoms, timestep, T * units.kB, 0.002)

attach observer to dynamics to track quantity of interest (temperature)

def print_status(): print('Step = {}, time = {} [fs], T = {} [K]'.format( dynamics.nsteps, dynamics.nsteps dynamics.dt / units.fs, atoms.get_kinetic_energy() / (1.5 units.kB * len(atoms)) ))

def print_energy(a=atoms): # store a reference to atoms in the definition. """Function to print the potential, kinetic and total energy.""" epot = a.get_potential_energy() / len(a) ekin = a.get_kinetic_energy() / len(a) print('Energy per atom: Epot = %.3feV Ekin = %.3feV (T=%3.0fK) ' 'Etot = %.3feV' % (epot, ekin, ekin / (1.5 * units.kB), epot + ekin))

dynamics.attach(print_status, interval=10) dynamics.attach(print_energy, interval=1)

reported Error is:

Traceback (most recent call last): File "input.py", line 63, in qm_pot = Potential('TB DFTB', param_filename='dftb-params.xml') File "/home/uccatka/.local/lib/python3.7/site-packages/quippy-https_github.com_libAtoms_QUIP.git_357e28d_dirty-py3.7-linux-x86_64.egg/quippy/potential.py", line 82, in init param_filename=param_filename) File "/home/uccatka/.local/lib/python3.7/site-packages/quippy-https_github.com_libAtoms_QUIP.git_357e28d_dirty-py3.7-linux-x86_64.egg/quippy/potential_module.py", line 134, in filename_initialise if bulk_scale is None else bulk_scale._handle, error=error) RuntimeError Exception ignored in: <function Potential.del at 0x2ab14599c9d8> Traceback (most recent call last): File "/home/uccatka/.local/lib/python3.7/site-packages/quippy-https_github.com_libAtoms_QUIP.git_357e28d_dirty-py3.7-linux-x86_64.egg/quippy/potential_module.py", line 258, in del _quippy.f90wrap_potential_finalise(this=self._handle, error=error) TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

DGKang234 commented 3 years ago

@gabor1 I have recompiled QUIP/GAP with TB support (=1) and I can see TB files in ~/src/Potentials. However, it still gives an error:

Traceback (most recent call last):
  File "input.py", line 63, in <module>
    qm_pot = Potential('TB DFTB', param_filename='dftb-params.xml')
  File "/home/uccatka/.local/lib/python3.7/site-packages/quippy-https_github.com_libAtoms_QUIP.git_357e28d_dirty-py3.7-linux-x86_64.egg/quippy/potential.py", line 82, in __init__
    param_filename=param_filename)
  File "/home/uccatka/.local/lib/python3.7/site-packages/quippy-https_github.com_libAtoms_QUIP.git_357e28d_dirty-py3.7-linux-x86_64.egg/quippy/potential_module.py", line 134, in filename_initialise
    if bulk_scale is None else bulk_scale._handle, error=error)
RuntimeError: Traceback (most recent call last)
  File "/home/uccatka/software/QUIP/src/libAtoms/System.f95", line 520 kind unspecified
    IO error opening "dftb-params.xml" on unit 7, error number: 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             0^[\
Exception ignored in: <function Potential.__del__ at 0x2ba7aa8a0f28>
Traceback (most recent call last):
  File "/home/uccatka/.local/lib/python3.7/site-packages/quippy-https_github.com_libAtoms_QUIP.git_357e28d_dirty-py3.7-linux-x86_64.egg/quippy/potential_module.py", line 258, in __del__
    _quippy.f90wrap_potential_finalise(this=self._handle, error=error)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

I cannot find the dftb-params.xml file in ~/share/Parameters:

uccatka@faraday:~/software/QUIP/share/Parameters$ ls
concat_quip_params             ip.parms.DispTS.CH-example.xml  ip.parms.Glue.xml                       ip.parms.SW_Si_H_DFTB_elastic.xml  self_consistency.data.xml              tightbind.parms.NRL_TB.Fe_spinpol.xml
ip.parms.BKS.xml               ip.parms.EAM_ErcolAd.xml        ip.parms.LJ.xml                         ip.parms.SW_VP.xml                 tightbind.parms.Bowler.xml             tightbind.parms.NRL_TB.Mo.xml
ip.parms.BOP.xml               ip.parms.Einstein.xml           ip.parms.Morse.CoSb3_CompMatSci_44.xml  ip.parms.SW.xml                    tightbind.parms.GSP.BOP0.xml           tightbind.parms.NRL_TB.Pb.xml
ip.parms.Brenner_2002.xml      ip.parms.FB.xml                 ip.parms.Si_MEAM.xml                    ip.parms.Template.xml              tightbind.parms.NRL_TB.Al_PRB_61.xml   tightbind.parms.NRL_TB.Si.xml
ip.parms.Brenner_Screened.xml  ip.parms.FC.filled_FSM_cf.xml   ip.parms.Sutton_Chen.xml                ip.parms.Tersoff.xml               tightbind.parms.NRL_TB.CuAu.xml        tightbind.parms.NRL_TB.Ti_PRB_73.xml
ip.parms.Brenner.xml           ip.parms.FS.xml                 ip.parms.SW_SiC_CASTEP_elastic.xml      ip.parms.TS.xml                    tightbind.parms.NRL_TB.Cu_unpub99.xml  tightbind.parms.NRL_TB.W_new.xml
ip.parms.Coulomb.xml           ip.parms.Glue_CaCd.xml          ip.parms.SW_SiC_DFTB_elastic.xml        k_pt_mesh.data.xml                 tightbind.parms.NRL_TB.Fe_paramag.xml  tightbind.parms.NRL_TB.W.xml

or, Is the TB a separate file that I have to download like GAP?

gabor1 commented 3 years ago

you presumably have the dftb-params.xml file?

The thing to do is to test the "quip" command line program, to see if the problem is in the python part or the fortran part. find "quip" in the "QUIP/build/…/" directory where … is your architecture, and try

quip param_filename=dftb-params.xml atoms_filename= E

where is an atomic structure in XYZ format.

-- Gábor

Gábor Csányi Professor of Molecular Modelling Engineering Laboratory, University of Cambridge Pembroke College Cambridge

Pembroke College supports CARA. A Lifeline to Academics at Risk. http://www.cara.ngo/

On 9 Dec 2020, at 10:31, Computational-Chem-Nanocluster notifications@github.com wrote:

@gabor1 I have recompiled QUIP/GAP with TB support (=1). However, it still gives an error:

Traceback (most recent call last): File "input.py", line 63, in qm_pot = Potential('TB DFTB', param_filename='dftb-params.xml') File "/home/uccatka/.local/lib/python3.7/site-packages/quippy-https_github.com_libAtoms_QUIP.git_357e28d_dirty-py3.7-linux-x86_64.egg/quippy/potential.py", line 82, in init param_filename=param_filename) File "/home/uccatka/.local/lib/python3.7/site-packages/quippy-https_github.com_libAtoms_QUIP.git_357e28d_dirty-py3.7-linux-x86_64.egg/quippy/potential_module.py", line 134, in filename_initialise if bulk_scale is None else bulk_scale._handle, error=error) RuntimeError: Traceback (most recent call last) File "/home/uccatka/software/QUIP/src/libAtoms/System.f95", line 520 kind unspecified IO error opening "dftb-params.xml" on unit 7, error number: 2 0^[\ Exception ignored in: <function Potential.del at 0x2ba7aa8a0f28> Traceback (most recent call last): File "/home/uccatka/.local/lib/python3.7/site-packages/quippy-https_github.com_libAtoms_QUIP.git_357e28d_dirty-py3.7-linux-x86_64.egg/quippy/potential_module.py", line 258, in del _quippy.f90wrap_potential_finalise(this=self._handle, error=error) TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

or, Is the TB a separate file that I have to download like GAP?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

DGKang234 commented 3 years ago

@gabor1 There is not dftb-params.xml file. Is the tutorial question requires to download dftb-params.xml separately? Many thanks. P.S. list of the package that installed:

# F77=gfortran
# F90=gfortran
# F95=gfortran
# CC=gcc
# CPLUSPLUS=g++
# FPP=gfortran -E -x f95-cpp-input
# LINKER=gfortran
# LIBTOOL=
# OPTIM=
# COPTIM=
QUIPPY_INSTALL_OPTS=--user
# DEBUG=-O0 -g -DDUMP_CORE_ON_ABORT -DDEBUG -fbounds-check
# DEBUG=
# CDEBUG=
MATH_LINKOPTS=-L/opt/openblas/gnu-4.9/serial/i4/0.2.20/lib -lopenblas
PYTHON=/opt/miniconda3/bin/python
PIP=/opt/miniconda3/bin/pip
EXTRA_LINKOPTS=
HAVE_CP2K=0
HAVE_VASP=0
HAVE_TB=1
HAVE_PRECON=1
HAVE_LOTF=0
HAVE_ONIOM=0
HAVE_LOCAL_E_MIX=0
HAVE_QC=0
HAVE_GAP=1
HAVE_DESCRIPTORS_EXTERNAL=1
HAVE_TURBOGAP=0
HAVE_QR=1
HAVE_THIRDPARTY=0
HAVE_FX=0
HAVE_SCME=0
HAVE_MTP=0
HAVE_MBD=0
HAVE_TTM_NF=0
HAVE_CH4=0
HAVE_NETCDF4=0
HAVE_MDCORE=0
HAVE_ASAP=0
HAVE_CGAL=0
HAVE_METIS=0
HAVE_LMTO_TBE=0
SIZEOF_FORTRAN_T=2
gabor1 commented 3 years ago

ok, so when you give a param file, you have to have the file!

we are not allowed to publicly redistribute dftb parameters. I’m happy to send you a file privately.

-- Gábor

Gábor Csányi Professor of Molecular Modelling Engineering Laboratory, University of Cambridge Pembroke College Cambridge

Pembroke College supports CARA. A Lifeline to Academics at Risk. http://www.cara.ngo/

On 9 Dec 2020, at 10:45, Computational-Chem-Nanocluster notifications@github.com wrote:

@gabor1 There is not dftb-params.xml file. Is the tutorial question requires to download dftb-params.xml separately? Many thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

DGKang234 commented 3 years ago

@gabor1 I see. I thought I compiled with the wrong setting. Could you please send the file? I will not distribute the file. I appreciate your help.

DGKang234 commented 3 years ago

*Downlaod the potential and add in ~/QUIP/shared/Parameters/ Then, instead of _qm_pot = Potential('TB DFTB', param_filename='dftb-params.xml') past the path of the parameter like: qm_pot = Potential('TB DFTB', param_filename=''/home/{user}/software/QUIP/share/Parameters/{full name of param}')

Many thanks.

leoil commented 3 years ago

I’m having the same issue when going through this tutorial. May I having a copy of the file? I sincerely appreciate it.

gabor1 commented 3 years ago

send me your private email, I can’t post it here.

-- Gábor

Gábor Csányi Professor of Molecular Modelling Engineering Laboratory, University of Cambridge Pembroke College Cambridge

Pembroke College supports CARA. A Lifeline to Academics at Risk. http://www.cara.ngo/

On 8 Apr 2021, at 15:45, leoil @.***> wrote:

I’m having the same issue when going through this tutorial. May I having a copy of the file? I sincerely appreciate it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

leoil commented 3 years ago

This is my personal @.*** Again, I appreciate your time and help.

------------------ 原始邮件 ------------------ 发件人: "libAtoms/QUIP" @.>; 发送时间: 2021年4月8日(星期四) 晚上11:58 @.>; @.**@.>; 主题: Re: [libAtoms/QUIP] Error from quippy.potential.Potential (#259)

send me your private email, I can’t post it here.

-- Gábor

Gábor Csányi Professor of Molecular Modelling Engineering Laboratory, University of Cambridge Pembroke College Cambridge

Pembroke College supports CARA. A Lifeline to Academics at Risk. http://www.cara.ngo/

> On 8 Apr 2021, at 15:45, leoil @.***> wrote: > > > I’m having the same issue when going through this tutorial. > May I having a copy of the file? > I sincerely appreciate it. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub, or unsubscribe. >

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

gabor1 commented 3 years ago

um…. that’s a bunch of stars.

-- Gábor

Gábor Csányi Professor of Molecular Modelling Engineering Laboratory, University of Cambridge Pembroke College Cambridge

Pembroke College supports CARA. A Lifeline to Academics at Risk. http://www.cara.ngo/

On 8 Apr 2021, at 17:16, leoil @.***> wrote:

This is my personal @.*** Again, I appreciate your time and help.

------------------ 原始邮件 ------------------ 发件人: "libAtoms/QUIP" @.>; 发送时间: 2021年4月8日(星期四) 晚上11:58 @.>; @.**@.>; 主题: Re: [libAtoms/QUIP] Error from quippy.potential.Potential (#259)

send me your private email, I can’t post it here.

-- Gábor

Gábor Csányi Professor of Molecular Modelling Engineering Laboratory, University of Cambridge Pembroke College Cambridge

Pembroke College supports CARA. A Lifeline to Academics at Risk. http://www.cara.ngo/

> On 8 Apr 2021, at 15:45, leoil @.***> wrote: > > > I’m having the same issue when going through this tutorial. > May I having a copy of the file? > I sincerely appreciate it. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub, or unsubscribe. >

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

leoil commented 3 years ago

sorry, the address got blocked for some reason.

jiapeng-liu commented 2 years ago

send me your private email, I can’t post it here. -- Gábor Gábor Csányi Professor of Molecular Modelling Engineering Laboratory, University of Cambridge Pembroke College Cambridge Pembroke College supports CARA. A Lifeline to Academics at Risk. http://www.cara.ngo/ On 8 Apr 2021, at 15:45, leoil @.***> wrote: I’m having the same issue when going through this tutorial. May I having a copy of the file? I sincerely appreciate it. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Dear Gábor,

Can you kindly send me also a copy of the 'dftb-params.xml'? My email address is 'jliubt@connect.ust.hk'. Thanks

Amitcuhp commented 1 year ago

Can you send me the file please , email = amitkumar15020@gmail.com

gabor1 commented 1 year ago

Amit, which elements do you have in your system?

Amitcuhp commented 1 year ago

Si

Amitcuhp commented 1 year ago

Can yoy please explain these steps ? How to resolve

RuntimeError Traceback (most recent call last) /tmp/ipykernel_11858/2531361136.py in 1 # attach tight binding calculator ----> 2 qm_pot = Potential('TB DFTB', param_filename='dftb-params.xml') 3 atoms.set_calculator(qm_pot) 4 5 # Thermalize atoms

~/anaconda3/lib/python3.9/site-packages/quippy/potential.py in init(self, args_str, pot1, pot2, param_str, param_filename, atoms, calculation_always_required, calc_args, add_arrays, add_info, **kwargs) 79 if param_filename is not None and isinstance(param_filename, str): 80 # from a param filename ---> 81 self._quip_potential = quippy.potential_module.Potential.filename_initialise(args_str=args_str, 82 param_filename=param_filename) 83 elif pot1 is not None and pot2 is not None:

~/anaconda3/lib/python3.9/site-packages/quippy/potential_module.py in filename_initialise(cls, args_str, param_filename, bulk_scale, error) 132 bare_class = cls.new(cls) 133 f90wrap.runtime.FortranDerivedType.init(bare_class) --> 134 result = quippy._quippy.f90wrap_potential_filename_initialise(args_str=args_str, param_filename=param_filename, 135 bulk_scale=None if bulk_scale is None else bulk_scale._handle, error=error) 136 bare_class._handle = result[0] if isinstance(result, tuple) else result

RuntimeError: Traceback (most recent call last) File "/project/src/libAtoms/System.f95", line 537 kind unspecified IO error opening "dftb-params.xml" on unit 7, error number: 2

bernstei commented 1 year ago

On Nov 28, 2022, at 11:31 AM, Amitcuhp @.**@.>> wrote:

RuntimeError: Traceback (most recent call last) File "/project/src/libAtoms/System.f95", line 537 kind unspecified IO error opening "dftb-params.xml" on unit 7, error number: 2

It's pretty clearly saying that it can't find the "dftb-params.xml" file. Is that file in the current working directory?

Amitcuhp commented 1 year ago

It's not there. I am following tutorial of :The SOAP descriptor, Gaussian Approximation Potentials (GAP) and machine-learning of force fields"

Where I can find the file

Amitcuhp commented 1 year ago

Can you provide me sample file. I would be great help

gabor1 commented 1 year ago

I sent it to you earlier today to the email address you provided above. you need to rename the file.

Amitcuhp commented 1 year ago

Thank you very much sir

Amitcuhp commented 1 year ago

KeyError Traceback (most recent call last) /tmp/ipykernel_3595/1247473112.py in ----> 1 qm_energies = [at.info['energy'] for at in db] 2 gap2b_energies = [] 3 for dba in db: 4 a = dba.copy() 5 a.set_calculator(gap2b)

/tmp/ipykernel_3595/1247473112.py in (.0) ----> 1 qm_energies = [at.info['energy'] for at in db] 2 gap2b_energies = [] 3 for dba in db: 4 a = dba.copy() 5 a.set_calculator(gap2b)

KeyError: 'energy'

WHat is key error?

bernstei commented 1 year ago

On Nov 28, 2022, at 9:32 PM, Amitcuhp @.***> wrote:

KeyError Traceback (most recent call last) /tmp/ipykernel_3595/1247473112.py in ----> 1 qm_energies = [at.info['energy'] for at in db] 2 gap2b_energies = [] 3 for dba in db: 4 a = dba.copy() 5 a.set_calculator(gap2b)

/tmp/ipykernel_3595/1247473112.py in (.0) ----> 1 qm_energies = [at.info['energy'] for at in db] 2 gap2b_energies = [] 3 for dba in db: 4 a = dba.copy() 5 a.set_calculator(gap2b)

KeyError: 'energy'

WHat is key error?

It means that the python dict does not have that key. I'm not sure what code this is or where it came from, but it looks like at.info <http://at.info/> (which is an object in db) does not have an energy entry.

bernstei commented 1 year ago

Note that Atoms.info<http://Atoms.info> contains the information that's on the 2nd line of each xyz configuration. Whatever fitting (or testing) database you're loading either doesn't have energy entries, or something's changed in the way it's parsed and the script is out of date.

wanggrun commented 9 months ago

Can you send me the file "dftb-params.xml" please, email address is: wanggrun (at) gmail (dot) com

Your kind help will be highly appreciated.

bernstei commented 9 months ago

@wanggrun please don't post random requests in a closed issue. Anyway, the licensing on the DFTB parameter files (at least as of when we built QUIP) does not allow us to redistribute them. We do have a program that converts from the DFTB format (or at least the format they used when we created it, probably 5-10 years ago) to the xml format (DFTB_to_xml, I think). It should be built if you build from source and do make all, but I'm not sure the python quippy installation includes it.