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

fixup variable_cov_gaussian

parent 36871dff
Pipeline #81317 passed with stages
in 13 minutes and 24 seconds
...@@ -171,8 +171,9 @@ class VariableCovarianceGaussianEnergy(EnergyOperator): ...@@ -171,8 +171,9 @@ class VariableCovarianceGaussianEnergy(EnergyOperator):
res = 0.5*(r.vdot(r*i) - i.ptw("log").sum()) res = 0.5*(r.vdot(r*i) - i.ptw("log").sum())
if not x.want_metric: if not x.want_metric:
return res return res
met = i.val if self._cplx else 0.5*i.val met = 1. if self._cplx else 0.5
met = MultiField.from_dict({self._kr: i.val, self._ki: met**(-2)}) met = MultiField.from_dict({self._kr: i.val, self._ki: met*i.val**(-2)},
return res.add_metric(SamplingDtypeSetter(makeOp(met), self._dt)) return res.add_metric(SamplingDtypeSetter(makeOp(met), self._dt))
def _simplify_for_constant_input_nontrivial(self, c_inp): 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