Commit 705c8bc7 authored by Lukas Platz's avatar Lukas Platz
Browse files

cleanup Linearization.prepend_jac

parent 17c15fd4
Pipeline #75690 passed with stages
in 13 minutes and 10 seconds
...@@ -19,6 +19,7 @@ import numpy as np ...@@ -19,6 +19,7 @@ import numpy as np
from .sugar import makeOp from .sugar import makeOp
from .operators.operator import Operator from .operators.operator import Operator
from .operators.sandwich_operator import SandwichOperator
class Linearization(Operator): class Linearization(Operator):
...@@ -65,10 +66,7 @@ class Linearization(Operator): ...@@ -65,10 +66,7 @@ class Linearization(Operator):
return self.make_var(self._val, self._want_metric) return self.make_var(self._val, self._want_metric)
def prepend_jac(self, jac): def prepend_jac(self, jac):
metric = None metric = None if self._metric is None else SandwichOperator.make(jac, self._metric)
if self._metric is not None:
from .operators.sandwich_operator import SandwichOperator
metric = None if self._metric is None else SandwichOperator.make(jac, self._metric)
return self.new(self._val, self._jac @ jac, metric) return self.new(self._val, self._jac @ jac, metric)
@property @property
......
Markdown is supported
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