Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
forum:data:2024:definition_of_density_matrix [2024/08/06 03:25] – edited formulas David Tam | forum: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 | ||
+ | < | ||
Subscript[B, | Subscript[B, | ||
r[\[Theta], | r[\[Theta], | ||
+ | </ | ||
I tried to define this basis using: | I tried to define this basis using: | ||
+ | < | ||
basis3 =With[{l = 3}, Flatten[Table[{SphericalHarmonicY[l, | basis3 =With[{l = 3}, Flatten[Table[{SphericalHarmonicY[l, | ||
+ | < | ||
which is exactly as written on the help page for Hydrogen wavefunctions, | which is exactly as written on the help page for Hydrogen wavefunctions, | ||
+ | < | ||
basis3conj = Simplify[Conjugate[# | basis3conj = Simplify[Conjugate[# | ||
+ | </ | ||
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): | ||
+ | < | ||
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. I then tried to plot the real part of the charge density using | which gives 0 for the imaginary part as I expected. 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] | 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 " | 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 " |