Energy band plotting
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
Is there some way in which I could plot energy bands using Mathematica in a manner that is given in the image below? I have $E$ as a function of $k_x$ and $k_y$. How can the plot given below be made with these specific points on the $(k_x,k_y)$ axis?
My function for the energy $E$ is:
energy[kx_,ky_]:=Sqrt[1-(Cos[kx/2]Cos[ky/2])^2]
and I can plot parts of the graph with something like:
Plot[energy[kx,0],kx,0,Pi]
Plot[energy[kx,0],kx,Pi,2 Pi]
How do I stitch these together?
plotting
New contributor
 |Â
show 1 more comment
up vote
3
down vote
favorite
Is there some way in which I could plot energy bands using Mathematica in a manner that is given in the image below? I have $E$ as a function of $k_x$ and $k_y$. How can the plot given below be made with these specific points on the $(k_x,k_y)$ axis?
My function for the energy $E$ is:
energy[kx_,ky_]:=Sqrt[1-(Cos[kx/2]Cos[ky/2])^2]
and I can plot parts of the graph with something like:
Plot[energy[kx,0],kx,0,Pi]
Plot[energy[kx,0],kx,Pi,2 Pi]
How do I stitch these together?
plotting
New contributor
3
Please add some functions you have defined and code you have tried.
â Edmund
4 hours ago
Don't forget to take the tour now and learning about asking and what's on-topic. There you will learn why you should edit your question to show due diligence, give brief context that is meaningful for non-physicist, include minimal working example of code and data in formatted form. By doing all this you help us to help you and likely you will inspire great answers. Not doing that risks getting you question closed as off-topic.
â rhermans
3 hours ago
I have tried setting ky=0, and then Plot[E[kx,0],kx,0,Pi], and I get one branch of that whole graph. Is there a way to concatenate all these parts with one plotting?
â Theorist
3 hours ago
Please follow the advise in the comments, it's not fair to ask us to guess your functions and write code you already have. Sharing what you have makes it more likely for somebody to decide to commit effort to solve your problem. You should definitely share your code in formatted form so people can Copy&Paste it. Help us to help you.
â rhermans
3 hours ago
Give me an hour or two, I have existing code for this, but it needs a little polishing to post.
â rcollyer
3 hours ago
 |Â
show 1 more comment
up vote
3
down vote
favorite
up vote
3
down vote
favorite
Is there some way in which I could plot energy bands using Mathematica in a manner that is given in the image below? I have $E$ as a function of $k_x$ and $k_y$. How can the plot given below be made with these specific points on the $(k_x,k_y)$ axis?
My function for the energy $E$ is:
energy[kx_,ky_]:=Sqrt[1-(Cos[kx/2]Cos[ky/2])^2]
and I can plot parts of the graph with something like:
Plot[energy[kx,0],kx,0,Pi]
Plot[energy[kx,0],kx,Pi,2 Pi]
How do I stitch these together?
plotting
New contributor
Is there some way in which I could plot energy bands using Mathematica in a manner that is given in the image below? I have $E$ as a function of $k_x$ and $k_y$. How can the plot given below be made with these specific points on the $(k_x,k_y)$ axis?
My function for the energy $E$ is:
energy[kx_,ky_]:=Sqrt[1-(Cos[kx/2]Cos[ky/2])^2]
and I can plot parts of the graph with something like:
Plot[energy[kx,0],kx,0,Pi]
Plot[energy[kx,0],kx,Pi,2 Pi]
How do I stitch these together?
plotting
plotting
New contributor
New contributor
edited 3 hours ago
Carl Woll
58.9k276150
58.9k276150
New contributor
asked 4 hours ago
Theorist
304
304
New contributor
New contributor
3
Please add some functions you have defined and code you have tried.
â Edmund
4 hours ago
Don't forget to take the tour now and learning about asking and what's on-topic. There you will learn why you should edit your question to show due diligence, give brief context that is meaningful for non-physicist, include minimal working example of code and data in formatted form. By doing all this you help us to help you and likely you will inspire great answers. Not doing that risks getting you question closed as off-topic.
â rhermans
3 hours ago
I have tried setting ky=0, and then Plot[E[kx,0],kx,0,Pi], and I get one branch of that whole graph. Is there a way to concatenate all these parts with one plotting?
â Theorist
3 hours ago
Please follow the advise in the comments, it's not fair to ask us to guess your functions and write code you already have. Sharing what you have makes it more likely for somebody to decide to commit effort to solve your problem. You should definitely share your code in formatted form so people can Copy&Paste it. Help us to help you.
â rhermans
3 hours ago
Give me an hour or two, I have existing code for this, but it needs a little polishing to post.
â rcollyer
3 hours ago
 |Â
show 1 more comment
3
Please add some functions you have defined and code you have tried.
â Edmund
4 hours ago
Don't forget to take the tour now and learning about asking and what's on-topic. There you will learn why you should edit your question to show due diligence, give brief context that is meaningful for non-physicist, include minimal working example of code and data in formatted form. By doing all this you help us to help you and likely you will inspire great answers. Not doing that risks getting you question closed as off-topic.
â rhermans
3 hours ago
I have tried setting ky=0, and then Plot[E[kx,0],kx,0,Pi], and I get one branch of that whole graph. Is there a way to concatenate all these parts with one plotting?
â Theorist
3 hours ago
Please follow the advise in the comments, it's not fair to ask us to guess your functions and write code you already have. Sharing what you have makes it more likely for somebody to decide to commit effort to solve your problem. You should definitely share your code in formatted form so people can Copy&Paste it. Help us to help you.
â rhermans
3 hours ago
Give me an hour or two, I have existing code for this, but it needs a little polishing to post.
â rcollyer
3 hours ago
3
3
Please add some functions you have defined and code you have tried.
â Edmund
4 hours ago
Please add some functions you have defined and code you have tried.
â Edmund
4 hours ago
Don't forget to take the tour now and learning about asking and what's on-topic. There you will learn why you should edit your question to show due diligence, give brief context that is meaningful for non-physicist, include minimal working example of code and data in formatted form. By doing all this you help us to help you and likely you will inspire great answers. Not doing that risks getting you question closed as off-topic.
â rhermans
3 hours ago
Don't forget to take the tour now and learning about asking and what's on-topic. There you will learn why you should edit your question to show due diligence, give brief context that is meaningful for non-physicist, include minimal working example of code and data in formatted form. By doing all this you help us to help you and likely you will inspire great answers. Not doing that risks getting you question closed as off-topic.
â rhermans
3 hours ago
I have tried setting ky=0, and then Plot[E[kx,0],kx,0,Pi], and I get one branch of that whole graph. Is there a way to concatenate all these parts with one plotting?
â Theorist
3 hours ago
I have tried setting ky=0, and then Plot[E[kx,0],kx,0,Pi], and I get one branch of that whole graph. Is there a way to concatenate all these parts with one plotting?
â Theorist
3 hours ago
Please follow the advise in the comments, it's not fair to ask us to guess your functions and write code you already have. Sharing what you have makes it more likely for somebody to decide to commit effort to solve your problem. You should definitely share your code in formatted form so people can Copy&Paste it. Help us to help you.
â rhermans
3 hours ago
Please follow the advise in the comments, it's not fair to ask us to guess your functions and write code you already have. Sharing what you have makes it more likely for somebody to decide to commit effort to solve your problem. You should definitely share your code in formatted form so people can Copy&Paste it. Help us to help you.
â rhermans
3 hours ago
Give me an hour or two, I have existing code for this, but it needs a little polishing to post.
â rcollyer
3 hours ago
Give me an hour or two, I have existing code for this, but it needs a little polishing to post.
â rcollyer
3 hours ago
 |Â
show 1 more comment
2 Answers
2
active
oldest
votes
up vote
4
down vote
accepted
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
]
Thank you very much! This is really useful.
â Theorist
3 hours ago
add a comment |Â
up vote
2
down vote
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
]
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
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
]
Thank you very much! This is really useful.
â Theorist
3 hours ago
add a comment |Â
up vote
4
down vote
accepted
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
]
Thank you very much! This is really useful.
â Theorist
3 hours ago
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
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
]
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
]
answered 3 hours ago
Carl Woll
58.9k276150
58.9k276150
Thank you very much! This is really useful.
â Theorist
3 hours ago
add a comment |Â
Thank you very much! This is really useful.
â Theorist
3 hours ago
Thank you very much! This is really useful.
â Theorist
3 hours ago
Thank you very much! This is really useful.
â Theorist
3 hours ago
add a comment |Â
up vote
2
down vote
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
]
add a comment |Â
up vote
2
down vote
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
]
add a comment |Â
up vote
2
down vote
up vote
2
down vote
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
]
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
]
answered 35 mins ago
rcollyer
28.2k673164
28.2k673164
add a comment |Â
add a comment |Â
Theorist is a new contributor. Be nice, and check out our Code of Conduct.
Theorist is a new contributor. Be nice, and check out our Code of Conduct.
Theorist is a new contributor. Be nice, and check out our Code of Conduct.
Theorist is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182723%2fenergy-band-plotting%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3
Please add some functions you have defined and code you have tried.
â Edmund
4 hours ago
Don't forget to take the tour now and learning about asking and what's on-topic. There you will learn why you should edit your question to show due diligence, give brief context that is meaningful for non-physicist, include minimal working example of code and data in formatted form. By doing all this you help us to help you and likely you will inspire great answers. Not doing that risks getting you question closed as off-topic.
â rhermans
3 hours ago
I have tried setting ky=0, and then Plot[E[kx,0],kx,0,Pi], and I get one branch of that whole graph. Is there a way to concatenate all these parts with one plotting?
â Theorist
3 hours ago
Please follow the advise in the comments, it's not fair to ask us to guess your functions and write code you already have. Sharing what you have makes it more likely for somebody to decide to commit effort to solve your problem. You should definitely share your code in formatted form so people can Copy&Paste it. Help us to help you.
â rhermans
3 hours ago
Give me an hour or two, I have existing code for this, but it needs a little polishing to post.
â rcollyer
3 hours ago