from QuantumATK import *
import pylab

x_list = numpy.linspace(0,1,11)
Egap_list_scf_c = []

for x in x_list:
    filename = 'ingaas-x%i.hdf5' %(x*100)
    bandstructure = nlread(filename,Bandstructure)[0]
    # Calculate the direct band gap.
    Egap_list_scf_c.append(bandstructure._directBandGap().inUnitsOf(eV))

# Plot results
pylab.figure()
pylab.plot(x_list,Egap_list_scf_c,'ro',label='VCA, PBEsol-SG15M-MGGA, scf c')
pylab.plot(x_list,0.36 + 0.63*(1-x_list)+0.43*(1-x_list)**2,'k',label='Ioffe, 300 K.')
pylab.xlabel('x',fontsize=14)
pylab.ylabel('Band gap  (eV)',fontsize=14)
pylab.grid('on')
pylab.legend(loc=0)
pylab.show()
