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
370ccf92
Commit
370ccf92
authored
Dec 12, 2019
by
Philipp Haim
Browse files
Cosmetics
parent
919e2439
Pipeline
#65440
passed with stages
in 16 minutes and 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/library/correlated_fields.py
View file @
370ccf92
...
...
@@ -114,9 +114,7 @@ def _total_fluctuation_realized(samples):
for
s
in
samples
:
res
=
res
+
(
s
-
co
.
adjoint
(
co
(
s
)
/
size
))
**
2
res
=
res
.
mean
(
spaces
)
/
len
(
samples
)
if
np
.
isscalar
(
res
):
return
np
.
sqrt
(
res
)
return
np
.
sqrt
(
res
.
val
)
return
np
.
sqrt
(
res
if
np
.
isscalar
(
res
)
else
res
.
val
)
class
_LognormalMomentMatching
(
Operator
):
...
...
@@ -592,9 +590,8 @@ class CorrelatedFieldMaker:
res
=
0.
for
s
in
samples
:
res
=
res
+
s
.
mean
(
spaces
)
**
2
if
np
.
isscalar
(
res
):
return
np
.
sqrt
(
res
/
len
(
samples
))
return
np
.
sqrt
(
res
.
val
/
len
(
samples
))
res
=
res
/
len
(
samples
)
return
np
.
sqrt
(
res
if
np
.
isscalar
(
res
)
else
res
.
val
)
@
staticmethod
def
total_fluctuation_realized
(
samples
):
...
...
@@ -617,9 +614,7 @@ class CorrelatedFieldMaker:
res1
=
res1
/
len
(
samples
)
res2
=
res2
/
len
(
samples
)
res
=
res1
.
mean
(
spaces
)
-
res2
.
mean
(
spaces
[:
-
1
])
if
np
.
isscalar
(
res
):
return
np
.
sqrt
(
res
)
return
np
.
sqrt
(
res
.
val
)
return
np
.
sqrt
(
res
if
np
.
isscalar
(
res
)
else
res
.
val
)
@
staticmethod
def
average_fluctuation_realized
(
samples
,
space
):
...
...
@@ -643,6 +638,4 @@ class CorrelatedFieldMaker:
r
=
s
.
mean
(
sub_spaces
)
res
=
res
+
(
r
-
co
.
adjoint
(
co
(
r
)
/
size
))
**
2
res
=
res
.
mean
(
spaces
[
0
])
/
len
(
samples
)
if
np
.
isscalar
(
res
):
return
np
.
sqrt
(
res
)
return
np
.
sqrt
(
res
.
val
)
return
np
.
sqrt
(
res
if
np
.
isscalar
(
res
)
else
res
.
val
)
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