Attachment 'Wannier2.py'
Download 1 from ASE import Atom, ListOfAtoms
2 from Dacapo import Dacapo
3 from ASE.Utilities.Wannier.Wannier import Wannier
4 atoms = Dacapo.ReadAtoms('Benzene.nc')
5
6 calc = atoms.GetCalculator()
7 # Initialize the Wannier class
8 wannier = Wannier(numberofwannier=18,calculator=calc)
9
10 # Perform the localization with specified convergence criterion
11 wannier.Localize(tolerance=1.0e-8)
12
13
14 for n in range(0,wannier.GetNumberOfWannierFunctions()):
15 wannier.WriteCube(n,'WF_'+str(n)+'.cube',real=True)
16
17
18 # Read the centers, (quicker than plotting the cube files)
19 for center in wannier.GetCenters():
20 print center
21
22 centers = wannier.GetCentersAsAtoms()
23
24 # plot centers together with atoms
25 from ASE.Visualization.VMD import VMD
26 VMD(atoms,centers)
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.