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
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
13
Merge Requests
13
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
0dd173a4
Commit
0dd173a4
authored
Nov 18, 2019
by
Philipp Haim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for tests
parent
aa2512f9
Pipeline
#63843
failed with stages
in 7 minutes and 10 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
nifty5/library/correlated_fields.py
nifty5/library/correlated_fields.py
+7
-7
No files found.
nifty5/library/correlated_fields.py
View file @
0dd173a4
...
...
@@ -94,11 +94,11 @@ def _log_vol(power_space):
return
logk_lengths
[
1
:]
-
logk_lengths
[:
-
1
]
def
_total_fluctuation_realized
(
samples
,
space
=
0
):
def
_total_fluctuation_realized
(
samples
):
res
=
0.
for
s
in
samples
:
res
=
res
+
(
s
-
s
.
mean
())
**
2
return
np
.
sqrt
((
res
/
len
(
samples
)).
mean
(
space
))
return
np
.
sqrt
((
res
/
len
(
samples
)).
mean
())
def
_stats
(
op
,
samples
):
...
...
@@ -490,7 +490,7 @@ class CorrelatedFieldMaker:
from
..sugar
import
from_random
scm
=
1.
for
a
in
self
.
_a
:
op
=
a
.
fluctuation_amplitude
op
=
a
.
fluctuation_amplitude
*
self
.
_azm
.
one_over
()
res
=
np
.
array
([
op
(
from_random
(
'normal'
,
op
.
domain
)).
to_global_data
()
for
_
in
range
(
nsamples
)])
scm
*=
res
**
2
+
1.
...
...
@@ -513,7 +513,7 @@ class CorrelatedFieldMaker:
return
self
.
average_fluctuation
(
0
)
q
=
1.
for
a
in
self
.
_a
:
fl
=
a
.
fluctuation_amplitude
fl
=
a
.
fluctuation_amplitude
*
self
.
_azm
.
one_over
()
q
=
q
*
(
Adder
(
full
(
fl
.
target
,
1.
))
@
fl
**
2
)
return
(
Adder
(
full
(
q
.
target
,
-
1.
))
@
q
).
sqrt
()
*
self
.
_azm
...
...
@@ -526,7 +526,7 @@ class CorrelatedFieldMaker:
return
self
.
average_fluctuation
(
0
)
q
=
1.
for
j
in
range
(
len
(
self
.
_a
)):
fl
=
self
.
_a
[
j
].
fluctuation_amplitude
fl
=
self
.
_a
[
j
].
fluctuation_amplitude
*
self
.
_azm
.
one_over
()
if
j
==
space
:
q
=
q
*
fl
**
2
else
:
...
...
@@ -539,8 +539,8 @@ class CorrelatedFieldMaker:
raise
NotImplementedError
assert
space
<
len
(
self
.
_a
)
if
len
(
self
.
_a
)
==
1
:
return
self
.
_a
[
0
].
fluctuation_amplitude
*
self
.
_azm
return
self
.
_a
[
space
].
fluctuation_amplitude
*
self
.
_azm
return
self
.
_a
[
0
].
fluctuation_amplitude
return
self
.
_a
[
space
].
fluctuation_amplitude
@
staticmethod
def
offset_amplitude_realized
(
samples
):
...
...
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