from gpaw.elf import ELF # Graphene nanoribbon ribbon = graphene_nanoribbon(5, 6, type='armchair', saturated=True, vacuum=3.5) # Gold adsorbate pos = (ribbon[35].position + ribbon[60].position) / 2.0 pos[1] += 2.2 adsorbate = Atoms('Au', (pos, )) ribbon += adsorbate ribbon.center(axis=1, vacuum=3.5) txt = 'output_p_{}.txt'.format(size) ribbon.calc = GPAW( h=0.22, xc='PBE', txt=txt, occupations=FermiDirac(0.2), eigensolver=RMMDIIS(), ) ribbon.get_potential_energy() # Calculate electron localization function elf = ELF(ribbon.calc) elf.update() elf_g = elf.get_electronic_localization_function(gridrefinement=2) if rank == 0: write('elf_ribbon.cube', ribbon, data=elf_g)
atoms.center(2.0) txt = sys.stdout txt = None try: atoms, calc = restart("CO.gpw", txt=txt) energy = atoms.get_potential_energy() except: calc = GPAW(h=0.24, txt=txt) atoms.set_calculator(calc) energy = atoms.get_potential_energy() calc.write("CO.gpw", "all") elf = ELF(calc) elf.update() elf_G = elf.get_electronic_localization_function(gridrefinement=1) elf_g = elf.get_electronic_localization_function(gridrefinement=2) nt_G = calc.density.nt_sG[0] taut_G = elf.taut_sG[0] nt_grad2_G = elf.nt_grad2_sG[0] nt_grad2_g = elf.nt_grad2_sg[0] # integrate the CO bond if rank == 0: # bond area x0 = (atoms.positions[0][0] - 1.0) / atoms.get_cell()[0, 0] x1 = 1 - x0 y0 = (atoms.positions[0][1] - 1.0) / atoms.get_cell()[1, 1] y1 = 1 - y0
atoms.center(2.0) txt = sys.stdout txt = None try: atoms, calc = restart('CO.gpw', txt=txt) energy = atoms.get_potential_energy() except: calc = GPAW(h=0.24, txt=txt) atoms.set_calculator(calc) energy = atoms.get_potential_energy() calc.write('CO.gpw', 'all') elf = ELF(calc) elf.update() elf_G = elf.get_electronic_localization_function(gridrefinement=1) elf_g = elf.get_electronic_localization_function(gridrefinement=2) nt_G = calc.density.nt_sG[0] taut_G = elf.taut_sG[0] nt_grad2_G = elf.nt_grad2_sG[0] nt_grad2_g = elf.nt_grad2_sg[0] # integrate the CO bond if rank == 0: # bond area x0 = (atoms.positions[0][0] - 1.0) / atoms.get_cell()[0, 0] x1 = 1 - x0 y0 = (atoms.positions[0][1] - 1.0) / atoms.get_cell()[1, 1] y1 = 1 - y0
from ase.data.molecules import molecule from gpaw import GPAW from gpaw.elf import ELF from gpaw.test import equal from gpaw.mpi import rank atoms = molecule('CO') atoms.center(2.0) calc = GPAW(h=0.24) atoms.set_calculator(calc) atoms.get_potential_energy() elf = ELF(calc) elf.initialize(calc) elf.update(calc.wfs) elf_G = elf.get_electronic_localization_function(spin=0, gridrefinement=1) elf_g = elf.get_electronic_localization_function(spin=0, gridrefinement=2) # integrate the CO bond if rank == 0: # bond area x0 = (atoms.positions[0][0] - 1.0) / atoms.get_cell()[0, 0] x1 = 1 - x0 y0 = (atoms.positions[0][1] - 1.0) / atoms.get_cell()[1, 1] y1 = 1 - y0 z0 = atoms.positions[1][2] / atoms.get_cell()[2, 2] z1 = atoms.positions[0][2] / atoms.get_cell()[2, 2] gd = calc.wfs.gd Gx0, Gx1 = gd.N_c[0] * x0, gd.N_c[0] * x1 Gy0, Gy1 = gd.N_c[1] * y0, gd.N_c[1] * y1 Gz0, Gz1 = gd.N_c[2] * z0, gd.N_c[2] * z1 finegd = calc.density.finegd
from ase.data.molecules import molecule from gpaw import GPAW from gpaw.elf import ELF from gpaw.test import equal from gpaw.mpi import rank atoms = molecule('CO') atoms.center(2.0) calc = GPAW(h=0.24) atoms.set_calculator(calc) atoms.get_potential_energy() elf = ELF(calc) elf.initialize(calc) elf.update(calc.wfs) elf_G = elf.get_electronic_localization_function(spin=0,gridrefinement=1) elf_g = elf.get_electronic_localization_function(spin=0,gridrefinement=2) # integrate the CO bond if rank == 0: # bond area x0 = (atoms.positions[0][0] - 1.0)/atoms.get_cell()[0,0] x1 = 1 - x0 y0 = (atoms.positions[0][1] -1.0)/atoms.get_cell()[1,1] y1 = 1 - y0 z0 = atoms.positions[1][2]/atoms.get_cell()[2,2] z1 = atoms.positions[0][2]/atoms.get_cell()[2,2] gd = calc.wfs.gd Gx0, Gx1 = gd.N_c[0]*x0, gd.N_c[0] * x1 Gy0, Gy1 = gd.N_c[1]*y0, gd.N_c[1] * y1 Gz0, Gz1 = gd.N_c[2]*z0, gd.N_c[2] * z1 finegd = calc.density.finegd