niter1 = calc.get_number_of_iterations() calc.write('lead.gpw') dump_lead_hs(calc, 'lead') # Tip calculation tip = atoms.copy() tip.positions[:] += (atoms.cell / 2.0)[0, :] + (atoms.cell / 2.0)[1, :] del tip[:4] tip.translate([0, 0, 10]) tip.cell[2, 2] += 10 calc.set(kpts=(1, 1, 1)) tip.set_calculator(calc) e2 = tip.get_potential_energy() niter2 = calc.get_number_of_iterations() calc.write('tip.gpw') dump_hs(calc, 'tip', region='tip', cvl=2) # Surface calculation srf = atoms.copy() del srf[8:] srf.cell[2, 2] += 10 srf.set_calculator(calc) e3 = srf.get_potential_energy() niter3 = calc.get_number_of_iterations() calc.write('srf.gpw', region='surface', cvl=2) dump_hs(calc, 'srf', region='surface', cvl=2) #STM simulation tip = GPAW('tip') srf = GPAW('srf')
# surface calculation a = 4.0 srf = fcc100('Al', size=(2, 2, 10), vacuum=8.0) srf.translate([0, 0, -4]) srf.pbc = (1, 1, 0) srf += Atom('H', (a / 2**.5, a / 2**.5, srf.positions[-1][2] + 1.55)) srf.set_calculator(calc) srf.get_potential_energy() calc.write('srf') # Dump the overlap matrix and the Hamiltonian matrix to the local directory. # Here the keyword 'cvl' refers to the number of basis functions in the # in the convergence layer, i.e. for the present system four atomic layers are used. dump_hs(calc, 'srf', region='surface', cvl=4 * 4 * 9) # tip calculation a = 0.75 # lattice constant tip = Atoms('H12', pbc=(1, 1, 0), cell=[5, 5, 12 * a + 7]) tip.positions[:, 2] = [i * a for i in range(12)] tip.positions[:] += (tip.cell / 2.0)[0, :] + (tip.cell / 2.0)[1, :] tip.translate([0, 0, 6]) tip.set_calculator(calc) tip.get_potential_energy() calc.write('tip') dump_hs(calc, 'tip', region='tip', cvl=4) # dump overlap and hamiltonian matrix calc.set(
niter1 = calc.get_number_of_iterations() calc.write("lead.gpw") dump_lead_hs(calc, "lead") # Tip calculation tip = atoms.copy() tip.positions[:] += (atoms.cell / 2.0)[0, :] + (atoms.cell / 2.0)[1, :] del tip[:4] tip.translate([0, 0, 10]) tip.cell[2, 2] += 10 calc.set(kpts=(1, 1, 1)) tip.set_calculator(calc) e2 = tip.get_potential_energy() niter2 = calc.get_number_of_iterations() calc.write("tip.gpw") dump_hs(calc, "tip", region="tip", cvl=2) # Surface calculation srf = atoms.copy() del srf[8:] srf.cell[2, 2] += 10 srf.set_calculator(calc) e3 = srf.get_potential_energy() niter3 = calc.get_number_of_iterations() calc.write("srf.gpw", region="surface", cvl=2) dump_hs(calc, "srf", region="surface", cvl=2) # STM simulation tip = GPAW("tip") srf = GPAW("srf")
# surface calculation a = 4.0 srf = fcc100('Al', size=(2, 2, 10), vacuum=8.0) srf.translate([0, 0, -4]) srf.pbc= (1, 1, 0) srf += Atom('H', (a / 2**.5, a / 2**.5, srf.positions[-1][2] + 1.55)) srf.set_calculator(calc) srf.get_potential_energy() calc.write('srf') # Dump the overlap matrix and the Hamiltonian matrix to the local directory. # Here the keyword 'cvl' refers to the number of basis functions in the # in the convergence layer, i.e. for the present system four atomic layers are used. dump_hs(calc, 'srf', region='surface', cvl=4*4*9) # tip calculation a = 0.75 # lattice constant tip = Atoms('H12', pbc=(1, 1, 0), cell=[5, 5, 12 * a + 7]) tip.positions[:,2] = [i * a for i in range(12)] tip.positions[:] += (tip.cell / 2.0)[0, :] + (tip.cell / 2.0)[1, :] tip.translate([0, 0, 6]) tip.set_calculator(calc) tip.get_potential_energy() calc.write('tip') dump_hs(calc, 'tip', region='tip', cvl=4) # dump overlap and hamiltonian matrix calc.set(kpts=(1, 1, 7)) # for the lead calculations we use kpoints in the z-direction