Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galumph
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
grp-svergun
galumph
Commits
64b04d59
Verified
Commit
64b04d59
authored
May 24, 2020
by
Chris Kerr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return a Fraction from _modified_gaunt_squared
parent
22bf4a51
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
src/python/gaunt.py
src/python/gaunt.py
+2
-2
test/test_gaunt.py
test/test_gaunt.py
+4
-2
No files found.
src/python/gaunt.py
View file @
64b04d59
...
...
@@ -130,11 +130,11 @@ def _modified_gaunt_squared(l_1, l_2, l_3, m, *, factorials=None):
_gaunt_ksum
(
l_1
,
l_2
,
l_3
,
m
,
factorials
=
factorials
),
_gaunt_big_L_part
(
l_1
,
l_2
,
l_3
,
factorials
=
factorials
),
))
return
float
(
prod
((
return
prod
((
_gaunt_sqrt_arg
(
l_1
,
l_2
,
l_3
,
m
,
factorials
=
factorials
),
non_sqrt_part
*
non_sqrt_part
,
(
2
*
l_3
+
1
),
# For standard Gaunt, omit this
))
)
# For standard Gaunt, divide by (4 * math.pi)
))
# For standard Gaunt, divide by (4 * math.pi)
def
modified_gaunt
(
l_1
,
l_2
,
l_3
,
m
,
*
,
factorials
=
None
):
...
...
test/test_gaunt.py
View file @
64b04d59
...
...
@@ -56,9 +56,11 @@ def test_sympy_gaunt_vs_wigner(lmkp):
def
test_python_vs_sympy_gaunt2
(
lmkp
):
L
,
M
,
K
,
P
=
lmkp
sympy_result
=
sympy_matrix_element_G
(
L
,
M
,
K
,
P
)
**
2
sympy_float
=
float
(
sympy_result
.
n
(
10
))
python_result
=
gaunt
.
_modified_gaunt_squared
(
L
,
K
,
P
,
M
)
assert
python_result
==
pytest
.
approx
(
sympy_float
)
assert_sympy_equal
(
python_result
,
sympy_result
,
)
@
given
(
lmkp
=
LMKP
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment