Skip to content
Snippets Groups Projects
Commit b1a9f4fa authored by Philipp Arras's avatar Philipp Arras
Browse files

Make quadratic energy real

parent 5e993f95
No related branches found
No related tags found
1 merge request!453Fix mpi kl
Pipeline #73466 passed
......@@ -34,9 +34,9 @@ class QuadraticEnergy(Energy):
else:
Ax = self._A(self._position)
self._grad = Ax if b is None else Ax - b
self._value = 0.5*self._position.s_vdot(Ax)
self._value = 0.5*self._position.s_vdot(Ax).real
if b is not None:
self._value -= b.s_vdot(self._position)
self._value -= b.s_vdot(self._position).real
def at(self, position):
return QuadraticEnergy(position, self._A, self._b)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment