Commit 7d27eede authored by Philipp Frank's avatar Philipp Frank
Browse files

fixup variable_cov_gaussian

parent 36871dff
......@@ -171,8 +171,9 @@ class VariableCovarianceGaussianEnergy(EnergyOperator):
res = 0.5*(r.vdot(r*i) - i.ptw("log").sum())
if not x.want_metric:
return res
met = i.val if self._cplx else 0.5*i.val
met = MultiField.from_dict({self._kr: i.val, self._ki: met**(-2)})
met = 1. if self._cplx else 0.5
met = MultiField.from_dict({self._kr: i.val, self._ki: met*i.val**(-2)},
domain=self._domain)
return res.add_metric(SamplingDtypeSetter(makeOp(met), self._dt))
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