Skip to main content
11 events
when toggle format what by license comment
May 7, 2015 at 8:38 comment added user14634 Would you please help me on this new question: mathematica.stackexchange.com/questions/82778/…, Thanks a lot!
Feb 12, 2015 at 10:22 history edited Mr.Wizard CC BY-SA 3.0
deleted 237 characters in body
Sep 3, 2014 at 7:45 comment added user14634 Thank you so much! This function is really useful.
Sep 2, 2014 at 12:24 comment added Stephen Luttrell You use Coefficient to extract coefficients from expressions. So, using the state[spin, index] notation in my original answer, the probability of position -1 is #.Conjugate[#]&[Coefficient[yourstate, {state["\[DownArrow]", -1], state["\[UpArrow]", -1]}]], where the pure function #.Conjugate[#]& computes this probability from the individual basis state amplitudes.
Sep 2, 2014 at 9:58 comment added user14634 Thanks a lot for your good suggestion. I have succeesfully gotten the order I need. Furthermore, I need to extract the coefficient of each term, so as to plot a figure of positions VS probabilities (probability= square of the coefficient). In the above example, the probability for position -1 is (-2/(2 Sqrt[2]))^2+(1/(2 Sqrt[2]))^2. Do you have some suggestions for picking up the coefficients? I have tried several commands in Mathematica, but not succeed. Thank you very much!
Aug 30, 2014 at 20:57 comment added Stephen Luttrell You can display the results in the form that you want by simply using the Notation package (that I mentioned in my answer above) to map each internal state[index, spin] expression to your required state[spin, index] displayed output. You then get the best of both worlds - convenient internal computations AND convenient displayed output - with the Notation package connecting the two of these together.
Aug 30, 2014 at 14:14 comment added user14634 Thanks a lot! But I need to keep the form of state[spin,index], so as to show the original physical meaning. Would you please make a high-level program to rearrange the element? Thank you very much!
Aug 30, 2014 at 10:48 comment added Stephen Luttrell The easiest way to get the ordering you want is to define the basis state as state[index, spin] rather than state[spin, index], and to correspondingly adjust the definitions of how the H and S operators act on these basis states. Don't forget to remove the old definitions first, or start with a fresh kernel. Mathematica will then automatically display the result ordered as you want it to be.
Aug 30, 2014 at 9:06 comment added user14634 I have a further question: How to rearrange the element in an increasing order of the “index”? e.g., (-state["[DownArrow]", -3] - 2 state["[DownArrow]", -1] + state["[DownArrow]", 1] + state["[UpArrow]", -1] + state["[UpArrow]", 3])/(2 Sqrt[2]) is rearranged as (-state["[DownArrow]", -3] - 2 state["[DownArrow]", -1] + state["[UpArrow]", -1] + state["[DownArrow]", 1] + state["[UpArrow]", 3])/(2 Sqrt[2])
Aug 30, 2014 at 8:21 vote accept user14634
Aug 29, 2014 at 13:25 history answered Stephen Luttrell CC BY-SA 3.0