def afunc(var,data=None): rcs, rcp = var[0], var[1] f=open("base.fdf","w") f.write("%block PAO.Basis\n Ga 2\n") f.write(" 0 1\n") f.write("%10.5f\n1.0\n" % (rcs,) ) f.write("1 1\n") f.write("%10.5f\n1.0\n" % (rcp,) ) f.write("%endblock PAO.Basis\n") f.close() atoms = ListOfAtoms([Atom('Ga', (0.0,0.0,0.0),magmom=0), Atom('Ga', (2.0,0.0,0.0),magmom=0)]) a = Siesta(executable="/Users/ag/bin/siesta-xlf") a.SetOption("%include","base.fdf") energy = a.run(atoms) print rcs, rcp, energy return -energy
def afunc(var, data=None): rcs, rcp = var[0], var[1] f = open("base.fdf", "w") f.write("%block PAO.Basis\n Ga 2\n") f.write(" 0 1\n") f.write("%10.5f\n1.0\n" % (rcs, )) f.write("1 1\n") f.write("%10.5f\n1.0\n" % (rcp, )) f.write("%endblock PAO.Basis\n") f.close() atoms = ListOfAtoms([ Atom('Ga', (0.0, 0.0, 0.0), magmom=0), Atom('Ga', (2.0, 0.0, 0.0), magmom=0) ]) a = Siesta(executable="/Users/ag/bin/siesta-xlf") a.SetOption("%include", "base.fdf") energy = a.run(atoms) print rcs, rcp, energy return -energy
from Siesta.siesta import Siesta import urllib import os, shutil URLbase = "http://fisica.ehu.es/ag/siesta-psffiles/" atoms = Crystal([Atom('H', (0.757,0.586,0.),label="H_test"), Atom('H', (-0.757,0.586,0.),magmom=1), Atom('O', (0, 0, 0),magmom=1)]) # cell=(4, 4, 4), periodic=1) # create a work subdirectory orig_dir = os.getcwd() dir = "h2o_work" if os.path.isdir(dir): # does dir exist? shutil.rmtree(dir) # yes, remove old directory os.mkdir(dir) # make dir directory os.chdir(dir) # move to dir urllib.urlretrieve(URLbase + "H.psf", "H.psf") urllib.urlretrieve(URLbase + "H.psf", "H_test.psf") urllib.urlretrieve(URLbase + "O.psf", "O.psf") a = Siesta(executable="$HOME/bin/siesta-2.4-optim") energy = a.run(atoms,out="OUT") print "The energy is: ", energy os.chdir(orig_dir)
import Numeric as num p=biggles.FramedPlot(title="Energy/bond") # # Standard bond length (units: Angstrom) # d0 = math.sqrt(0.757**2 + 0.586**2) # Range of bond lengths areoun the presumed minimum bonds = num.arange(0.8*d0,1.3*d0,0.1) energy = 0.0*bonds theta=0.5*(180.-105.0)*math.pi/180. # Angle with the x axis, in radians print bonds a = Siesta(executable="$HOME/bin/siesta-2.4-optim") # Initialize object # create a work subdirectory orig_dir = os.getcwd() dir = "bond_work" if os.path.isdir(dir): # does dir exist? shutil.rmtree(dir) # yes, remove old directory os.mkdir(dir) # make dir directory os.chdir(dir) # move to dir URLbase = "http://fisica.ehu.es/ag/siesta-psffiles/" urllib.urlretrieve(URLbase + "H.psf", "H.psf") urllib.urlretrieve(URLbase + "O.psf", "O.psf") for i in range(len(bonds)): d = bonds[i]
p = biggles.FramedPlot(title="Energy/bond") # # Standard bond length (units: Angstrom) # d0 = math.sqrt(0.757**2 + 0.586**2) # Range of bond lengths areoun the presumed minimum bonds = num.arange(0.8 * d0, 1.3 * d0, 0.1) energy = 0.0 * bonds theta = 0.5 * (180. - 105.0) * math.pi / 180. # Angle with the x axis, in radians print bonds a = Siesta(executable="$HOME/bin/siesta-2.4-optim") # Initialize object # create a work subdirectory orig_dir = os.getcwd() dir = "bond_work" if os.path.isdir(dir): # does dir exist? shutil.rmtree(dir) # yes, remove old directory os.mkdir(dir) # make dir directory os.chdir(dir) # move to dir URLbase = "http://fisica.ehu.es/ag/siesta-psffiles/" urllib.urlretrieve(URLbase + "H.psf", "H.psf") urllib.urlretrieve(URLbase + "O.psf", "O.psf") for i in range(len(bonds)): d = bonds[i]