from ase import * from pylab import * from hotbit import * from box import mix from hotbit.analysis import LinearResponse # equilibrium length Na2 = Atoms('Na2', [(0, 0, 0), (3.0, 0, 0)], cell=(6, 4, 4), pbc=False) Na2.center() calc = Hotbit(parameters=testpar, SCC=True, txt='optical.cal') Na2.set_calculator(calc) calc.solve_ground_state(Na2) lr = LinearResponse(calc, energy_cut=10, txt='lr.out') lr.run() lr.info() #get excitation energies and oscillator strengths omega, F = lr.get_linear_response() e, f = mix.broaden(omega, F, width=0.1, function='lorentzian') plot(e, f) savefig('lr.pdf')
from ase import * from pylab import * from hotbit import * from box import mix from hotbit.analysis import LinearResponse # equilibrium length Na2=Atoms('Na2',[(0,0,0),(3.0,0,0)],cell=(6,4,4),pbc=False) Na2.center() calc=Hotbit(parameters=testpar,SCC=True,txt='optical.cal') Na2.set_calculator(calc) calc.solve_ground_state(Na2) lr=LinearResponse(calc,energy_cut=10,txt='lr.out') lr.run() lr.info() #get excitation energies and oscillator strengths omega, F=lr.get_linear_response() e,f=mix.broaden(omega,F,width=0.1,function='lorentzian') plot(e,f) savefig('lr.pdf')
from ase import * from hotbit import Hotbit from hotbit.analysis import LinearResponse from ase.data.molecules import molecule from hotbit.test.misc import default_param atoms = Atoms('Na3', [(1.6964999745231999, 0, 0), (-1.6964999745231999, 0, 0), (0, 2.9384240999630005, 0)]) atoms.center(vacuum=5) default_param['width'] = 0.0136 calc = Hotbit(SCC=True, charge=1, txt='linear_response.cal', **default_param) atoms.set_calculator() calc.solve_ground_state(atoms) lr = LinearResponse(calc, energy_cut=2000, txt='linear_response.txt') lr.run() lr.plot_spectrum('Na3+_lr.png', width=0.08) el = [1.81951, 1.81951, 7.43599, 7.43599] fl = [0.43036, 0.43036, 4.27744, 4.27744] for i in range(4): e, f = lr.get_excitation(i) assert abs(e - el[i]) < 1E-4 and abs(f - fl[i]) < 1E-4
from ase import * from hotbit import Hotbit from hotbit.analysis import LinearResponse from ase.data.molecules import molecule from hotbit.test.misc import default_param atoms=Atoms('Na3',[(1.6964999745231999,0,0),(-1.6964999745231999,0,0),(0,2.9384240999630005,0)]) atoms.center(vacuum=5) default_param['width'] = 0.0136 calc=Hotbit(SCC=True,charge=1,txt='linear_response.cal',**default_param) atoms.set_calculator() calc.solve_ground_state(atoms) lr=LinearResponse(calc,energy_cut=2000,txt='linear_response.txt') lr.run() lr.plot_spectrum('Na3+_lr.png',width=0.08) el = [1.81951,1.81951,7.43599,7.43599] fl = [0.43036,0.43036,4.27744,4.27744] for i in range(4): e,f = lr.get_excitation(i) assert abs(e-el[i])<1E-4 and abs(f-fl[i])<1E-4