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
128309f6
Commit
128309f6
authored
Mar 08, 2020
by
Martin Reinecke
Browse files
Merge branch 'mightier_operators' into 'NIFTy_6'
Mightier operators See merge request
!414
parents
76568d69
698bc932
Pipeline
#70416
passed with stages
in 26 minutes and 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/operators/energy_operators.py
View file @
128309f6
...
...
@@ -134,10 +134,8 @@ class VariableCovarianceGaussianEnergy(EnergyOperator):
lin
=
isinstance
(
x
,
Linearization
)
r
=
FieldAdapter
(
self
.
_domain
[
self
.
_r
],
self
.
_r
)
icov
=
FieldAdapter
(
self
.
_domain
[
self
.
_icov
],
self
.
_icov
)
res0
=
r
.
conjugate
()
*
r
*
icov
sum_it
=
ContractionOperator
(
res0
.
target
,
None
)
res0
=
sum_it
(
res0
).
real
res1
=
sum_it
(
icov
.
log
())
res0
=
r
.
vdot
(
r
*
icov
).
real
res1
=
icov
.
log
().
sum
()
res
=
0.5
*
(
res0
-
res1
)
res
=
res
(
x
)
if
not
lin
:
...
...
nifty6/operators/operator.py
View file @
128309f6
...
...
@@ -66,6 +66,13 @@ class Operator(metaclass=NiftyMeta):
from
.simple_linear_operators
import
ConjugationOperator
return
ConjugationOperator
(
self
.
target
)(
self
)
def
sum
(
self
,
spaces
=
None
):
from
.contraction_operator
import
ContractionOperator
return
ContractionOperator
(
self
.
target
,
spaces
)(
self
)
def
vdot
(
self
,
other
):
return
(
self
.
conjugate
()
*
other
).
sum
()
@
property
def
real
(
self
):
from
.simple_linear_operators
import
Realizer
...
...
Write
Preview
Supports
Markdown
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