Energy band plotting

Construct an Interpolation function that translates from the $x$-value to the $\{k_x,k_y\}$ coordinates:

xkData = {{0,{Pi,0}},{1,{0,0}},{2,{Pi,-Pi}},{3,{Pi,0}},{4,{2Pi,0}}};
if = Interpolation[xkData, InterpolationOrder->1];

Then, use the above interpolating function to construct the plot, and use xkData again to create the ticks:

Plot[
    energy @@ if[x],
    {x, 0, 4},
    Frame -> True,
    FrameTicks->{
        {Automatic,None},
        {xkData, None}
    },
    GridLines->{Range[0,4], None}
]

enter image description here


Compared to my old solution, Carl's is much better. But, there is a subtle flaw in it, and in the original image that the OP posted: the distances between the intervals are not identical. The correct parameterization is to use arc-length. Essentially, we need to Accumulate the arc-length between the points in k-space, as follows:

pts = {{π, 0}, {0, 0}, {π, -π}, {π, 0}, {2 π, 0}};
arcs = Map[ArcLength[Line[#]] &]@
   FoldList[Join[#1, {#2}] &, {First@#}, Rest@#]&@pts
(* {0, π, π + Sqrt[2] π, 2 π + Sqrt[2] π, 3 π + Sqrt[2] π} *)

Then, with some modifications, we can adapt the answer:

xkData = Transpose[{arcs, pts}];
if = Interpolation[xkData, InterpolationOrder -> 1];
Plot[energy @@ if[x], {x, arcs[[1]], arcs[[-1]]}, 
  Frame -> True, 
  FrameTicks -> {{Automatic, None}, {xkData, None}}, 
  GridLines -> {arcs, None}
]

enter image description here


There have been some great answers, but I decided to add an alternative, which uses Piecewise and Rescale instead.

kList = {{\[Pi], 0}, {0, 0}, {\[Pi], -\[Pi]}, {\[Pi], 0}, {2 \[Pi], 
    0}};
xList = Range[0, 4, 1];

mapXToK[x_] := 
  Piecewise@
   MapThread[{Rescale[x, {#1, #2}, {#3, #4}], x < #2} &, {Most[xList],
      Rest[xList], Most[kList], Rest[kList]}];

energy[kx_, ky_] := Sqrt[1 - (Cos[kx/2] Cos[ky/2])^2];

Plot[energy @@ mapXToK[x], {x, 0, 4}, GridLines -> {xList, None}, 
 FrameTicks -> {Automatic, {Transpose[{xList, kList}], None}}, 
 Frame -> True]

enter image description here

Taking the arc-length length comment into account:

xList = Prepend[
   Accumulate@
    MapThread[ArcLength[Line[{##}]] &, {Most[kList], Rest[kList]}], 
   0];
Plot[energy @@ mapXToK[x], {x, 0, Last[xList]}, 
 GridLines -> {xList, None}, 
 FrameTicks -> {Automatic, {Transpose[{xList, kList}], None}}, 
 Frame -> True]

enter image description here

Tags:

Plotting