# gnuscript of the simiplied models for the AFM spin splitting project.
# conduction-band.dat
# fit the energy data for up spin, the 5th column

set size square
set key left
set pointsize 1.5

set style line 1\
	linecolor rgb 'black' \
	linetype 1 linewidth 2 \
	pointtype 8 pointsize 0

FIT_LIMIT = 1e-50

f(kx, ky, kz) = a000 + a100*cos(2*pi*kx) + a010*cos(2*pi*ky) \
+ a020*cos(4*pi*ky) + a011*cos(2*pi*ky)*cos(2*pi*kz)

fit [kx = -0.5:0.5] [ky = -0.5:0.5] [kz = -0.5:0.5] f(kx, ky, kz) 'conduction-band.dat' using 1:2:3:5 \
via a000, a100, a010, a020, a011

plot 'conduction-band.dat' using ($1 == 0 && $3==$2 && $2>=0 ? $2:1/0):($5),\
'' using ($2 == 0 && $1==-$3 && $3<=0 ? $3:1/0):($5),\
'' using ($1 == 0 && $3==$2 && $2>=0 ? $2:1/0):(f($1, $2, $3)),\
'' using ($2 == 0 && $1==-$3 && $3<=0 ? $3:1/0):(f($1, $2, $3))

set print "conduction_band_selected_data_up_simplified.txt"
do for [x=0:50:5] {print 0, 0.01*x, 0.01*x, f(0, 0.01*x, 0.01*x)}
do for [x=0:50:5] {print 0.01*x, 0, -0.01*x, f(0.01*x, 0, -0.01*x)}

set xlabel 'L-GAMMA-Z'
set ylabel 'Energy'
