Commit eac959bd authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'fixes2' into 'NIFTy_5'

fixing metric of sum operator

See merge request !308
parents 19335917 644bb4f0
Pipeline #46497 passed with stages
in 18 minutes and 24 seconds
......@@ -392,7 +392,10 @@ class _OpSum(Operator):
op = lin1._jac._myadd(lin2._jac, False)
res =, op(x.jac))
if lin1._metric is not None and lin2._metric is not None:
res = res.add_metric(self._op1(x)._metric + self._op2(x)._metric)
from .sandwich_operator import SandwichOperator
met = lin1._metric._myadd(lin2._metric, False)
met = SandwichOperator.make(x.jac, met)
res = res.add_metric(met)
return res
def _simplify_for_constant_input_nontrivial(self, c_inp):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment