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
bb6c6849
Commit
bb6c6849
authored
Nov 12, 2019
by
Philipp Arras
Browse files
Cosmetics
parent
e29710db
Pipeline
#63530
passed with stages
in 8 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/library/correlated_fields.py
View file @
bb6c6849
...
...
@@ -377,19 +377,6 @@ class CorrelatedFieldMaker:
return
self
.
_a
[
0
].
fluctuation_amplitude
return
self
.
_a
[
space
].
fluctuation_amplitude
def
offset_amplitude_realized
(
self
,
samples
):
res
=
0.
for
s
in
samples
:
res
+=
s
.
mean
()
**
2
return
np
.
sqrt
(
res
/
len
(
samples
))
def
total_fluctuation_realized
(
self
,
samples
):
res
=
0.
for
s
in
samples
:
res
=
res
+
(
s
-
s
.
mean
())
**
2
res
=
res
/
len
(
samples
)
return
np
.
sqrt
(
res
.
mean
())
def
average_fluctuation_realized
(
self
,
samples
,
space
):
ldom
=
len
(
samples
[
0
].
domain
)
assert
space
<
ldom
...
...
@@ -421,12 +408,6 @@ class CorrelatedFieldMaker:
res
=
res1
.
mean
()
-
res2
.
mean
()
return
np
.
sqrt
(
res
)
def
stats
(
self
,
op
,
samples
):
sc
=
StatCalculator
()
for
s
in
samples
:
sc
.
add
(
op
(
s
.
extract
(
op
.
domain
)))
return
sc
.
mean
.
to_global_data
(),
sc
.
var
.
sqrt
().
to_global_data
()
def
moment_slice_to_average
(
self
,
fluctuations_slice_mean
,
nsamples
=
1000
):
fluctuations_slice_mean
=
float
(
fluctuations_slice_mean
)
assert
fluctuations_slice_mean
>
0
...
...
@@ -438,3 +419,25 @@ class CorrelatedFieldMaker:
scm
*=
flm
**
2
+
1.
scm
=
np
.
mean
(
np
.
sqrt
(
scm
))
return
fluctuations_slice_mean
/
scm
@
staticmethod
def
offset_amplitude_realized
(
samples
):
res
=
0.
for
s
in
samples
:
res
+=
s
.
mean
()
**
2
return
np
.
sqrt
(
res
/
len
(
samples
))
@
staticmethod
def
total_fluctuation_realized
(
samples
):
res
=
0.
for
s
in
samples
:
res
=
res
+
(
s
-
s
.
mean
())
**
2
res
=
res
/
len
(
samples
)
return
np
.
sqrt
(
res
.
mean
())
@
staticmethod
def
stats
(
op
,
samples
):
sc
=
StatCalculator
()
for
s
in
samples
:
sc
.
add
(
op
(
s
.
extract
(
op
.
domain
)))
return
sc
.
mean
.
to_global_data
(),
sc
.
var
.
sqrt
().
to_global_data
()
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