There is no energy spectrum in the analysis for a bulk, because what you do for bulk is compute the band structure. But I think you figured that out already? :)
So, why do you need the index? I assume it is because you want to compute the Bloch function for a particular eigenstate, for which you need the quantum numbers "band index" and k-point. The k-point is obvious, but how to get the band index?
If you look at the band structure plot in VNL (in the Result Browser), there is a band index shown in the "Tool Tip" which appears if you let the mouse rest over a particular point on the curves. Sadly, this index is wrong!
Therefore, unfortunately it's not extremely easy to find the index (as it should be)...
Here's what you could do.
- Assume we have converged a calculation for a bulk material, computed the band structure, and looked at it, and determined that at a particular k-point (let's say [0,0,0] for simplicity), it would be interesting to see the Bloch function for the band with an energy which is about -0.93 eV.
- We have stored the calculation in a checkpoint file, "c:/vnl/bulk.nc" (assuming Windows, modify for Linux or if your file is elsewhere; note forward-slashes "/", backslash "\" means something else in Python strings!).
- Now, we write a small script that shows us the band indices at this k-point:
from ATK.KohnSham import *
# Restore the self-consistent calculation
# --- Change filename to match your case! ---
scf = restoreSelfConsistentCalculation("c:/vnl/bulk.nc")
# Calculate the band structure in just one single point
# --- Change the k-point value to the one relevant for you! ---
k = (0,0,0)
bands = calculateEnergyBands(scf,[k])
print "Index\tEnergy (eV)"
print "---------------------------"
for i in range(bands.numberOfBands()):
print i,'\t',bands.band(i)[0].inUnitsOf(eV)
- Either run this in ATK, from the command line, or drop it on the "Job Manager" in VNL. In the latter case you need to take care to use the full path to the NetCDF file; if you run from the command line you can just write the file name, if the file is in the same directory as you execute ATK in.
The output will look like
Index Energy (eV)
---------------------------
0 -7.88580879754
1 -2.46911803845
2 -2.46911803746
3 -2.46911803684
4 -0.93553745241
5 -0.935537451013
6 24.7557039501
7 24.7557039577
8 24.7557039583
9 26.3855165124
10 41.5600392667
11 41.560039267
12 41.5600392725
13 53.5208120456
14 53.5208120462
Notes:
- If you have a spin-polarized calculation, some modifications are needed!
- The bands are usually degenerate! Take care to get the right index, if there are two with the same energy (most likely you will want both, simply).
Hope you figure it out!
I will also take the opportunity to make some advertising for the new tutorial on band structure calculations (http://quantumwise.com/publications/tutorials) (and DOS); actually this little script might make for a useful appendix to that tutorial...
Here's how you would do it for a spin-polarized system:
from ATK.KohnSham import *
# Restore the self-consistent calculation
# --- Change filename to match your case! ---
scf = restoreSelfConsistentCalculation("c:/vnl/fe.nc")
# Calculate the band structure in just one single point
# --- Change the k-point value to the one relevant for you! ---
k = (0,0,0)
bands_up = calculateEnergyBands(scf,[k],Spin.Up)
bands_dn = calculateEnergyBands(scf,[k],Spin.Down)
print "Index\t\tEnergy (eV)"
print "\tSpin.Up\t\tSpin.Down"
print "------------------------------------"
for i in range(bands_up.numberOfBands()):
print i,'\t',bands_up.band(i)[0].inUnitsOf(eV),
print '\t',bands_dn.band(i)[0].inUnitsOf(eV)
Output looks like:
Index Energy (eV)
Spin.Up Spin.Down
------------------------------------
0 -8.57804275842 -8.00798815437
1 -2.31747667937 -0.580211098406
2 -2.31747667888 -0.580211097992
3 -2.31747638121 -0.580210882288
4 -1.0434911475 1.33719151525
5 -1.04349114563 1.33719151738
6 29.3066311312 30.3959460736
7 29.3066311709 30.3959461524
8 29.3066311719 30.3959461533
2,when I see the export log files ,in the energy band ,It have one line "Energy Band: number" , what's meaning of this number between that band index?
and i also see four column under that line (the first three is k points ,and the last is energy), are they belong to one list? or from (i)[0] that you write
I guess they belong to two different list(one is the kpoint list and the energy is another)? any way I want to know how to use member of a list and
how can we know the constitutes of a list?
The index shown in the log appears to be shifted by 1. So, what is called "Energy Band: 1" would be index=0.
The columns are indeed kA, kB, kC, and the energy, in eV, and would belong to the list energy_bands.band(0). To extract elements (not members :) ) from this list, use square brackets. Thus, to print the energy of the 22nd k-point of the 13th band, I would add this line at the end of the VNL-generated script for the band structure calculation:
print energy_bands.band(12)[21]
Note the shift by 1! If I wanted the 1st k-point of the 1st band, I would use
print energy_bands.band(0)[0]
Ok, easy enough. I assume your converged calculation is in "file.nc", which contains only one BulkConfiguration.
configuration = nlread("file.nc", BulkConfiguration)[0]
energies_at_G = Bandstructure(configuration, kpoints=[[0,0,0],[0,0,0]])
print "Index\tEnergy / eV"
print "-"*30
for ix,energy in enumerate(energies_at_G.evaluate().inUnitsOf(eV)[0]):
print ix, "\t", energy
Wrong version of ATK. You need 12.8, I didn't realize that. But you can fix it like this:
configuration = nlread("file.nc", BulkConfiguration)[0]
energies_at_G = Bandstructure(configuration, route=['G','G'], points_per_segment=2)
print "Index\tEnergy / eV"
print "-"*30
for ix,energy in enumerate(energies_at_G.evaluate().inUnitsOf(eV)[0]):
print ix, "\t", energy