Attachment 'setupham.py'
Download 1 #!/usr/bin/env python
2
3 import Numeric
4 from ASE import Atom, ListOfAtoms
5 from Dacapo import Dacapo
6 from ASE.Utilities.Wannier import Wannier,CompositeWannierCells
7
8 # Read the atoms for the DFT calculation of the scattering region
9 #(1 principal layer on each side of S must be included)
10 atoms1 = Dacapo.ReadAtoms("out_scatter_kpt-0.375x-0.375.nc",save_memory=True)
11 # Read the atoms for the DFT calculation of the lead
12 atoms2 = Dacapo.ReadAtoms("out_lead.nc",save_memory=True)
13
14 calc1 = atoms1.GetCalculator()
15 calc2 = atoms2.GetCalculator()
16
17 # Initialize a Wannier object for the Wannier functions in S
18 wannier1 = Wannier(numberofwannier=432,calculator=calc1,occupationenergy=3.0)
19 wannier1.ReadZIBlochMatrix('zibloch_scatter.pickle')
20 wannier1.ReadRotation('Wannier_scatter')
21
22 # Initialize a Wannier object for the Wannier functions in the lead
23 wannier2 = Wannier(numberofwannier=18,calculator=calc2,occupationenergy=3.0)
24 wannier2.ReadZIBlochMatrix('zibloch_lead.pickle')
25 wannier2.ReadRotation('Wannier_lead')
26
27 # Setup cells describing 1 principal layer and the scattering region
28 cell1=CompositeWannierCells.WannierCell(wannier2,atoms2,repeat=[1,3,3])
29 cell2=CompositeWannierCells.WannierCell(wannier1,atoms1,repeat=[1,1,1])
30 cell3=CompositeWannierCells.WannierCell(wannier2,atoms2,repeat=[1,3,3])
31
32 # Glue the three regions together and specify the k-point
33 container=CompositeWannierCells.CompositeWannierCell([cell1,cell2,cell3],kpoint=[-0.375,-0.375],executable='/home/niflheim/lhansen/thul/dacapo/dacapo.run')
34 # Construct the Hamiltonian
35 container.WriteHSMatrixToNetCDFFile('HS.nc')
36
37
38
39
40
41
42
43
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.