Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
forum:data:2024:definition_of_density_matrix [2024/08/06 03:21] – Created from the form at forum:start David Tamforum:data:2024:definition_of_density_matrix [2024/08/07 07:41] (current) Maurits W. Haverkort
Line 7: Line 7:
 The Mathematica documentation states that the density matrix is constructed from The Mathematica documentation states that the density matrix is constructed from
  
 +<code>
 Subscript[B, \[Rho]]=Flatten[Table[{SphericalHarmonicY[l,m,\[Theta],\[Phi]],SphericalHarmonicY[l,m,\[Theta],\[Phi]]},{m,-l,l}]] Subscript[B, \[Rho]]=Flatten[Table[{SphericalHarmonicY[l,m,\[Theta],\[Phi]],SphericalHarmonicY[l,m,\[Theta],\[Phi]]},{m,-l,l}]]
 +
 r[\[Theta],\[Phi]]== Subscript[B, \[Rho]]\[Conjugate] \[CenterDot] M \[CenterDot] Subscript[B, \[Rho]] r[\[Theta],\[Phi]]== Subscript[B, \[Rho]]\[Conjugate] \[CenterDot] M \[CenterDot] Subscript[B, \[Rho]]
 +</code>
 +
 +I tried to define this basis using:
 +
 +<\code>
 +basis3 =With[{l = 3}, Flatten[Table[{SphericalHarmonicY[l, m, \[Theta], \[Phi]], SphericalHarmonicY[l, m, \[Theta], \[Phi]]}, {m, -l, l}]]]
 +<\code>
  
-I defined this basis using: 
-basis3 =  
- With[{l = 3},  
-  Flatten[Table[{SphericalHarmonicY[l, m, \[Theta], \[Phi]],  
-     SphericalHarmonicY[l, m, \[Theta], \[Phi]]}, {m, -l, l}]]] 
 which is exactly as written on the help page for Hydrogen wavefunctions, and then I calculated B* as which is exactly as written on the help page for Hydrogen wavefunctions, and then I calculated B* as
-basis3conj =  + 
- Simplify[ +<code> 
-    Conjugate[#], \[Theta] \[Element] Reals && \[Phi] \[Element]  +basis3conj = Simplify[Conjugate[#], \[Theta] \[Element] Reals && \[Phi] \[Element] Reals] & /@ basis3 
-      Reals] & /@ basis3+</code>
  
 I then looked at the real part of the density matrix given for CeRu2Al10 in the help files, using at the real and imaginary parts of the charge density (with some tricks to simplify the expressions): I then looked at the real part of the density matrix given for CeRu2Al10 in the help files, using at the real and imaginary parts of the charge density (with some tricks to simplify the expressions):
 +
 +<code>
 Chop@Simplify@Chop@ComplexExpand@Re[basis3conj . dm1 . basis3] Chop@Simplify@Chop@ComplexExpand@Re[basis3conj . dm1 . basis3]
 +
 Chop@Simplify@Chop@ComplexExpand@Im[basis3conj . dm1 . basis3] Chop@Simplify@Chop@ComplexExpand@Im[basis3conj . dm1 . basis3]
-which gives 0 for the imaginary part as I expected.+</code> 
 + 
 + 
 +which gives 0 for the imaginary part as I expected. I then tried to plot the real part of the charge density using 
 + 
 +<code> 
 +SphericalPlot3D[Chop@Simplify@Chop@ComplexExpand@Re[basis3conj . dm1 . basis3], {\[Theta], 0, \[Pi]}, {\[Phi], 0, 2 \[Pi]}, PlotRange -> All, Axes -> False, Boxed -> False, PlotStyle -> Lighter@Gray] 
 +</code>
  
-I then tried to plot the real part of the charge density using 
-SphericalPlot3D[ 
- Chop@Simplify@ 
-   Chop@ComplexExpand@Re[basis3conj . dm1 . basis3], {\[Theta],  
-  0, \[Pi]}, {\[Phi], 0, 2 \[Pi]}, PlotRange -> All, Axes -> False,  
- Boxed -> False, PlotStyle -> Lighter@Gray] 
  
 The result looks similar to the shape given in the help, but not exactly. Moreover, repeating the exercise for the simple p-shell wavefunction in the "Quanty/tutorial/wavefunctions_and_density" page also reflects the orientation around the xy plane compared to the result you show. Some kind of phase problem is appearing in both these cases. The result looks similar to the shape given in the help, but not exactly. Moreover, repeating the exercise for the simple p-shell wavefunction in the "Quanty/tutorial/wavefunctions_and_density" page also reflects the orientation around the xy plane compared to the result you show. Some kind of phase problem is appearing in both these cases.
Print/export