Here’s my situation.
As you can see, in In1 and In[2], I’m trying to put the WaveFunction and its ConjugateTranspose into a variable (psi) with the assumption of Real value of (theta) and (phi).
I do it on this way because I wanna make (theta) and (phi) as a Real value “globally”
In In[3], it works.
After that, I do an extra line, In[7], to test it if it works for any situations. However, it does not.
Can anyone help me to improve the Codes so that (theta) and (phi) will be Real “globally”??
Thank you!!
My point is, I already put the assumptions, (theta) and (phi) are Real, into the Variable (psi)i.
So, logically, in In[7], I should not need to use the Refine Function again since (theta) and (phi) in the (psi)i is assumed to be Real already in the previous input line.
The use of assumptions in step 1 inside the Refine does not make those assumptions available outside that Refine.
In step 3 those assumptions were no longer in effect and it was only because the arguments were already simple enough that some automatic cancellation happened in the product.
If you make assignments to $Assumptions then the Mathematica functions which check that will make use of those.
Thus
In[1]:= $Assumptions = {?, ?} \[Element] Reals;
In[2]:= Refine[{{Cos[?/2]}, {E^(I ?) Sin[?/2]}}.ConjugateTranspose[{{Cos[?/2]}, {E^(I ?) Sin[?/2]}}]]
Out[2]= {{Cos[?/2]^2, E^(-I ?) Cos[?/2] Sin[?/2]},{E^(I ?) Cos[?/2] Sin[?/2], Sin[?/2]^2}}