Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
4941d0da
Commit
4941d0da
authored
Jan 21, 2019
by
Philipp Arras
Browse files
Cosmetics
parent
300da90d
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/library/correlated_fields.py
View file @
4941d0da
...
...
@@ -16,6 +16,7 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
from
functools
import
reduce
from
operator
import
mul
from
..domain_tuple
import
DomainTuple
from
..operators.contraction_operator
import
ContractionOperator
...
...
@@ -105,8 +106,8 @@ def MfCorrelatedField(target, amplitudes, name='xi'):
d
=
[
dd0
,
dd1
]
a
=
[
dd
@
amplitudes
[
ii
]
for
ii
,
dd
in
enumerate
(
d
)]
a
=
reduce
(
lambda
x
,
y
:
x
*
y
,
a
)
a
=
reduce
(
mul
,
a
)
A
=
pd
@
a
# For `vol` see comment in `CorrelatedField`
vol
=
reduce
(
lambda
x
,
y
:
x
*
y
,
[
sp
.
scalar_dvol
**-
0.5
for
sp
in
hsp
])
vol
=
reduce
(
mul
,
[
sp
.
scalar_dvol
**-
0.5
for
sp
in
hsp
])
return
ht
(
vol
*
A
*
ducktape
(
hsp
,
None
,
name
))
Write
Preview
Supports
Markdown
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