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
bb6c6849
Commit
bb6c6849
authored
Nov 12, 2019
by
Philipp Arras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics
parent
e29710db
Pipeline
#63530
passed with stages
in 8 minutes and 35 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
19 deletions
+22
-19
nifty5/library/correlated_fields.py
nifty5/library/correlated_fields.py
+22
-19
No files found.
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