Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
NIFTy
Commits
300da90d
Commit
300da90d
authored
6 years ago
by
Philipp Arras
Browse files
Options
Downloads
Patches
Plain Diff
Comment
parent
0327ffdc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nifty5/library/correlated_fields.py
+5
-0
5 additions, 0 deletions
nifty5/library/correlated_fields.py
with
5 additions
and
0 deletions
nifty5/library/correlated_fields.py
+
5
−
0
View file @
300da90d
...
@@ -56,6 +56,10 @@ def CorrelatedField(target, amplitude_operator, name='xi'):
...
@@ -56,6 +56,10 @@ def CorrelatedField(target, amplitude_operator, name='xi'):
power_distributor
=
PowerDistributor
(
h_space
,
p_space
)
power_distributor
=
PowerDistributor
(
h_space
,
p_space
)
A
=
power_distributor
(
amplitude_operator
)
A
=
power_distributor
(
amplitude_operator
)
vol
=
h_space
.
scalar_dvol
**-
0.5
vol
=
h_space
.
scalar_dvol
**-
0.5
# When doubling the resolution of `tgt` the value of the highest k-mode
# will scale with a square root. `vol` cancels this effect such that the
# same power spectrum can be used for the spaces with the same volume,
# different resolutions and the same object in them.
return
ht
(
vol
*
A
*
ducktape
(
h_space
,
None
,
name
))
return
ht
(
vol
*
A
*
ducktape
(
h_space
,
None
,
name
))
...
@@ -103,5 +107,6 @@ def MfCorrelatedField(target, amplitudes, name='xi'):
...
@@ -103,5 +107,6 @@ def MfCorrelatedField(target, amplitudes, name='xi'):
a
=
[
dd
@
amplitudes
[
ii
]
for
ii
,
dd
in
enumerate
(
d
)]
a
=
[
dd
@
amplitudes
[
ii
]
for
ii
,
dd
in
enumerate
(
d
)]
a
=
reduce
(
lambda
x
,
y
:
x
*
y
,
a
)
a
=
reduce
(
lambda
x
,
y
:
x
*
y
,
a
)
A
=
pd
@
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
(
lambda
x
,
y
:
x
*
y
,
[
sp
.
scalar_dvol
**-
0.5
for
sp
in
hsp
])
return
ht
(
vol
*
A
*
ducktape
(
hsp
,
None
,
name
))
return
ht
(
vol
*
A
*
ducktape
(
hsp
,
None
,
name
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment