Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work on understanding conventions #49

Open
wants to merge 96 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
bf4bb96
Add explicit Condon-Shortley computation
moble Dec 5, 2024
0162c8d
Test Condon-Shortley's explicit formulas
moble Dec 5, 2024
5bb3ca7
Use more consistent notation
moble Dec 6, 2024
100c7b1
Add broken Edmonds tests
moble Dec 6, 2024
8a3d765
Add unfinished notes about conventions
moble Dec 6, 2024
9a92295
Get Edmonds tests working
moble Dec 7, 2024
f71f63b
Add some references about functional / harmonic analysis
moble Dec 10, 2024
396c574
Sketch an outline
moble Dec 10, 2024
f05ddbb
Rearrange conventions docs
moble Dec 11, 2024
ca8b6ae
Make Documenter happy
moble Dec 11, 2024
2b78fcd
Compare to Kip's review
moble Dec 11, 2024
8a08398
List comparisons I intend to make
moble Dec 12, 2024
0987cdd
Introduce quaternions
moble Dec 12, 2024
ead68ed
Fix missing `end`
moble Dec 12, 2024
21939c3
Start on Mathematica conventions
moble Dec 12, 2024
478544a
Remove errant character and make string valid
moble Dec 12, 2024
5e577bd
Mention quaternion multiplication convention
moble Dec 12, 2024
9f0bffa
Add some more notes on conventions
moble Dec 20, 2024
a0a413d
Rearrange the notebooks
moble Dec 24, 2024
78d6db9
Figure out the rotation structure
moble Dec 24, 2024
b44370c
Ignore marimo stuff
moble Dec 24, 2024
1e5ec3e
Add lifting diagram
moble Dec 27, 2024
11fb119
Add composition diagram
moble Dec 28, 2024
f0830c1
Remove lifting diagrams
moble Dec 28, 2024
aed6119
Start the section on functions
moble Dec 28, 2024
a618bc3
Move diagram into markdown
moble Dec 29, 2024
3c9b0ac
Simplify, having moved two-color versions into inline markdown
moble Dec 29, 2024
9e49c70
A little more about finite rotations
moble Dec 31, 2024
f2d6df0
Accept Rational with denominator 1
moble Jan 12, 2025
624884d
Test composition formula and basis commutators
moble Jan 12, 2025
af60ff3
Expand on differential rotations
moble Jan 12, 2025
23d6198
Find and cite Strakhov
moble Jan 12, 2025
e88e06f
Include Varshalovich conventions
moble Jan 12, 2025
1046f5f
Translate formulas from my 2016 paper (via python spherical_functions…
moble Jan 12, 2025
c4e9d70
Add and test explicit 1/2-integer functions
moble Jan 13, 2025
3af0ae3
Add discussion and a few functions for NIST (no tests yet)
moble Jan 13, 2025
af6a461
Add original Gumerov-Duraiswami references
moble Jan 15, 2025
a4bf075
Include Bander and Lee
moble Jan 16, 2025
e8d941a
Show how to use Euler angles to derive ang.-mom. ops
moble Jan 17, 2025
ef3a926
Rename "notebooks" to "literate_input"
moble Jan 17, 2025
a79c2fa
Remove Hwloc
moble Jan 17, 2025
f944812
Incorporate Literate.jl
moble Jan 17, 2025
12aa826
A few minor consistency changes
moble Jan 18, 2025
6228790
Show build start and elapsed times
moble Jan 18, 2025
417e1f6
Add explanation, streamline operator definitions, and make pretty output
moble Jan 18, 2025
547e018
Clear out older code
moble Jan 18, 2025
974964c
Make Conventions/Calculations subgroup
moble Jan 18, 2025
98204e9
Use Quaternionic; streamline display of results; explain R_j on 2-sphere
moble Jan 19, 2025
dc160a4
Write up comparison of J/L/R with Varshalovich
moble Jan 20, 2025
3f973cc
Wording tweaks
moble Jan 20, 2025
f6ef906
Calculate commutators
moble Feb 2, 2025
d613e34
Minor touch-ups
moble Feb 2, 2025
d77d930
Check Varshalovich conventions
moble Feb 2, 2025
cbee017
Add the basics about Newman-Penrose and NINJA
moble Feb 3, 2025
c1ced69
Add a crucial bit on Goldberg et al.; tidy up some Varshalovich et al…
moble Feb 3, 2025
bdc263c
Sort out the conventions for L and R, including spin weight and raisi…
moble Feb 3, 2025
cb71aeb
Update Varshalovich disagreement
moble Feb 3, 2025
7d96c50
Summarize new interpretation of spin-weight operators
moble Feb 4, 2025
1e7ed68
Carefully examine the definition of spin in Newman-Penrose
moble Feb 6, 2025
804ed80
Finalize angular-momentum conventions
moble Feb 6, 2025
9a1eb85
Define spin weight and explain relationship with R_u operators
moble Feb 6, 2025
82ae32c
Split conventions out into summary and details
moble Feb 6, 2025
840227e
Fix problem due to excessive indentation
moble Feb 6, 2025
9a3620c
Pause tests on nightly
moble Feb 6, 2025
799a673
Tiny tweaks
moble Feb 6, 2025
788da5d
Change from enumerated list to subsections
moble Feb 6, 2025
e32d8b2
Shorten page titles
moble Feb 6, 2025
a84103e
Sort out Mathematica's Euler angles
moble Feb 6, 2025
6a2cdcf
Compare to Wikipedia's rigid rotor angular-momentum operators
moble Feb 6, 2025
b8b2d99
More serious work on D conventions
moble Feb 9, 2025
1bd69da
Find non-d behavior of D
moble Feb 9, 2025
b25ced6
Specify the edition of Edmonds
moble Feb 10, 2025
910afcb
Figure out some Edmonds conventions
moble Feb 10, 2025
e02dbb4
Throw together some junk on computing d
moble Feb 10, 2025
b33e83e
Clarify second-hand citation
moble Feb 12, 2025
02984ca
Figure out some SymPy details, and more info for Varshalovich
moble Feb 12, 2025
2ffa7de
Add option to quiet iterator warnings
moble Feb 14, 2025
e0fe8b6
Update @showprogress syntax
moble Feb 14, 2025
d715a36
Add some explicit formulas for Y
moble Feb 17, 2025
4c5a769
Remove silly sign change
moble Feb 17, 2025
3bd3a39
Add some details from Shankar
moble Feb 17, 2025
5254f9c
Add details from Mathematica
moble Feb 17, 2025
88ef4f6
Tweak some wording
moble Feb 17, 2025
2ef6dcb
Add Zettili and auto-sort
moble Feb 17, 2025
c232154
Include Zettili's conventions
moble Feb 17, 2025
31f7418
Add Le Bellac and Cohen-Tannoudji
moble Feb 17, 2025
b19e52a
Account for change in ExplicitWignerMatrices.D_formula
moble Feb 17, 2025
3e0e325
Replace missing operator
moble Feb 18, 2025
6f1326e
Add Shankar
moble Feb 18, 2025
fa26c10
Add LALSuite
moble Feb 18, 2025
ae87316
Review LAL, NINJA, and Torres del Castillo
moble Feb 18, 2025
4f7a392
Update changed name of LAL function
moble Feb 18, 2025
4b65071
Emphasize that we're using v3 of the NINJA paper
moble Feb 18, 2025
5effeaa
Note that LALSuite appears to correctly use the newer (corrected) ver…
moble Feb 18, 2025
36feb36
Correct citation syntax
moble Feb 18, 2025
9448055
Include Griffiths; more on Goldberg and on Cohen-Tannoudji
moble Feb 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
matrix:
version:
- '1'
- 'nightly'
# - 'nightly'
os:
- ubuntu-latest
include:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ benchmark/results.md
# Ignore my notes and settings
/notes
.vscode

conventions.slides.json

rotate.jl

docs/.CondaPkg
docs/src/literate_output
9 changes: 6 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
DoubleFloats = "497a8b3b-efae-58df-a0af-a86822472b78"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
FastTransforms = "057dd010-8810-581a-b7be-e3fc3b93f78c"
Hwloc = "0e44f5e4-bd66-52a0-8798-143a42290a1d"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Expand All @@ -24,11 +23,13 @@ AbstractFFTs = "1"
Aqua = "0.8"
Coverage = "1.6"
DoubleFloats = "1"
ForwardDiff = "0.10"
FFTW = "1"
FastDifferentiation = "0.3.17"
FastTransforms = "0.12, 0.13, 0.14, 0.15, 0.16"
ForwardDiff = "0.10"
Hwloc = "2, 3"
LinearAlgebra = "1"
Literate = "2.20"
Logging = "1.11"
LoopVectorization = "0.12"
OffsetArrays = "1.10"
Expand All @@ -47,10 +48,12 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Coverage = "a2441757-f6aa-5fb2-8edb-039e3f45d037"
DoubleFloats = "497a8b3b-efae-58df-a0af-a86822472b78"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
FastDifferentiation = "eb9bf01b-bf85-4b60-bf87-ee5de06c00be"
FastTransforms = "057dd010-8810-581a-b7be-e3fc3b93f78c"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Hwloc = "0e44f5e4-bd66-52a0-8798-143a42290a1d"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Expand All @@ -61,4 +64,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"

[targets]
test = ["Aqua", "Coverage", "DoubleFloats", "FFTW", "FastTransforms", "ForwardDiff", "Hwloc", "LinearAlgebra", "Logging", "OffsetArrays", "ProgressMeter", "Quaternionic", "Random", "StaticArrays", "Test", "TestItemRunner"]
test = ["Aqua", "Coverage", "DoubleFloats", "FFTW", "FastDifferentiation", "FastTransforms", "ForwardDiff", "LinearAlgebra", "Literate", "Logging", "OffsetArrays", "ProgressMeter", "Quaternionic", "Random", "StaticArrays", "Test", "TestItemRunner"]
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
Quaternionic = "0756cd96-85bf-4b6f-a009-b5012ea7a443"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SphericalFunctions = "af6d55de-b1f7-4743-b797-0829a72cf84e"
SymPyPythonCall = "bc8888f7-b21e-4b7c-a06a-5d9c9496438c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"
108 changes: 108 additions & 0 deletions docs/literate_input/condon_shortley_expression.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import marimo

__generated_with = "0.9.20"
app = marimo.App(width="medium")


@app.cell(hide_code=True)
def __(mo):
mo.md(
r"""
Eq. (15) of Sec. 4³ (page 52) of Condon and Shortley (1935) defines the polar portion of the spherical harmonic function as

\begin{equation}
\Theta(\ell, m) = (-1)^\ell \sqrt{\frac{2\ell+1}{2} \frac{(\ell+m)!}{(\ell-m)!}}
\frac{1}{2^\ell \ell!} \frac{1}{\sin^m\theta}
\frac{d^{\ell-m}}{d(\cos\theta)^{\ell-m}} \sin^{2\ell}\theta.
\end{equation}

A footnote gives the first few values through $\ell=3$. I explicitly test these explicit forms in [`SphericalFunctions.jl`](https://github.com/moble/SphericalFunctions.jl)`/test/conventions/condon_shortley.jl`. Here, I want to verify that they are correct.

Visually comparing, and accounting for some minor differences in simplification, I find that the expressions in the book are correct. I also use the explicit expressions — as implemented in the test code and translated by AI — to check that sympy can simplify the difference to 0.
"""
)
return


@app.cell
def __():
from IPython.display import display
import marimo as mo
import sympy
from sympy import S

θ = sympy.symbols("θ", real=True)

def ϴ(ℓ, m):
cosθ = sympy.symbols("cosθ", real=True)
return (
(-1)**ℓ
* sympy.sqrt(
((2*ℓ+1) / 2)
* (sympy.factorial(ℓ+m) / sympy.factorial(ℓ-m))
)
* (1 / (2**ℓ * sympy.factorial(ℓ)))
* (1 / sympy.sin(θ)**m)
#* sympy.diff(sympy.sin(θ)**(2*ℓ), sympy.cos(θ), ℓ-m) # Can't differentiate wrt cos(θ), so we use a dummy and substitute
* sympy.diff((1 - cosθ**2)**ℓ, cosθ, ℓ-m).subs(cosθ, sympy.cos(θ))
).simplify()
return S, display, mo, sympy, Θ, θ


@app.cell
def __(S, display, Θ):
for ℓ in range(4):
for m in range(-ℓ, ℓ+1):
display(ℓ, m, ϴ(S(ℓ), S(m)))
return l, m


@app.cell
def __(S, sympy, Θ, θ):
def compare_explicit_expression(ℓ, m):
if (ℓ, m) == (0, 0):
expression = sympy.sqrt(1/S(2))
elif (ℓ, m) == (1, 0):
expression = sympy.sqrt(3/S(2)) * sympy.cos(θ)
elif (ℓ, m) == (2, 0):
expression = sympy.sqrt(5/S(8)) * (2*sympy.cos(θ)**2 - sympy.sin(θ)**2)
elif (ℓ, m) == (3, 0):
expression = sympy.sqrt(7/S(8)) * (2*sympy.cos(θ)**3 - 3*sympy.cos(θ)*sympy.sin(θ)**2)
elif (ℓ, m) == (1, 1):
expression = -sympy.sqrt(3/S(4)) * sympy.sin(θ)
elif (ℓ, m) == (1, -1):
expression = sympy.sqrt(3/S(4)) * sympy.sin(θ)
elif (ℓ, m) == (2, 1):
expression = -sympy.sqrt(15/S(4)) * sympy.cos(θ) * sympy.sin(θ)
elif (ℓ, m) == (2, -1):
expression = sympy.sqrt(15/S(4)) * sympy.cos(θ) * sympy.sin(θ)
elif (ℓ, m) == (3, 1):
expression = -sympy.sqrt(21/S(32)) * (4*sympy.cos(θ)**2*sympy.sin(θ) - sympy.sin(θ)**3)
elif (ℓ, m) == (3, -1):
expression = sympy.sqrt(21/S(32)) * (4*sympy.cos(θ)**2*sympy.sin(θ) - sympy.sin(θ)**3)
elif (ℓ, m) == (2, 2):
expression = sympy.sqrt(15/S(16)) * sympy.sin(θ)**2
elif (ℓ, m) == (2, -2):
expression = sympy.sqrt(15/S(16)) * sympy.sin(θ)**2
elif (ℓ, m) == (3, 2):
expression = sympy.sqrt(105/S(16)) * sympy.cos(θ) * sympy.sin(θ)**2
elif (ℓ, m) == (3, -2):
expression = sympy.sqrt(105/S(16)) * sympy.cos(θ) * sympy.sin(θ)**2
elif (ℓ, m) == (3, 3):
expression = -sympy.sqrt(35/S(32)) * sympy.sin(θ)**3
elif (ℓ, m) == (3, -3):
expression = sympy.sqrt(35/S(32)) * sympy.sin(θ)**3
else:
raise ValueError(f"Unknown {ℓ=}, {m=}")
return sympy.simplify(ϴ(S(ℓ), S(m)) - expression) == 0


for _ℓ in range(4):
for _m in range(-_ℓ, _ℓ+1):
print((_ℓ, _m), " \t", compare_explicit_expression(_ℓ, _m))

return (compare_explicit_expression,)


if __name__ == "__main__":
app.run()
Loading
Loading