Пример #1
0
from ase import *
from numpy import random, pi
from box import Atoms
from box import mix
from hotbit import Hotbit
#from hotbit import Calculator0
from ase.units import Bohr, Hartree
from hotbit.test.misc import default_param

# C-non-SCC
calc = Hotbit(SCC=False, txt='test.cal', **default_param)
C = Atoms('C', positions=[(0, 0, 0)], cell=(10, 10, 10), pbc=False)
C.center(vacuum=100)
C.set_calculator(calc)
e = C.get_potential_energy()
if abs(e) > 1E-6:
    raise RuntimeError('energy %f, should be %f' % (e, 0.0))

# C, SCC
calc = Hotbit(SCC=True, txt='test.cal', **default_param)
C = Atoms('C', positions=[(0, 0, 0)], cell=(10, 10, 10), pbc=False)
C.center(vacuum=100)
C.set_calculator(calc)
e = C.get_potential_energy()
if abs(e) > 1E-6:
    raise RuntimeError('energy %f, should be %f' % (e, 0.0))

# rotate Au-dimer
#calc0=Calculator0(SCC=True,txt='test.cal',**default_param)
calc = Hotbit(SCC=True, txt='test.cal', **default_param)
Au2 = Atoms('Au2',
Пример #2
0
from ase import *
from numpy import random, pi
from box import Atoms
from box import mix
from hotbit import Hotbit

# from hotbit import Calculator0
from ase.units import Bohr, Hartree
from hotbit.test.misc import default_param

# C-non-SCC
calc = Hotbit(SCC=False, txt="test.cal", **default_param)
C = Atoms("C", positions=[(0, 0, 0)], cell=(10, 10, 10), pbc=False)
C.center(vacuum=100)
C.set_calculator(calc)
e = C.get_potential_energy()
if abs(e) > 1e-6:
    raise RuntimeError("energy %f, should be %f" % (e, 0.0))

# C, SCC
calc = Hotbit(SCC=True, txt="test.cal", **default_param)
C = Atoms("C", positions=[(0, 0, 0)], cell=(10, 10, 10), pbc=False)
C.center(vacuum=100)
C.set_calculator(calc)
e = C.get_potential_energy()
if abs(e) > 1e-6:
    raise RuntimeError("energy %f, should be %f" % (e, 0.0))


# rotate Au-dimer
# calc0=Calculator0(SCC=True,txt='test.cal',**default_param)