Commit 7caca9b2 authored by Martin Reinecke's avatar Martin Reinecke

don't simplify ScalingOperators with complex factors

parent b84c1829
Pipeline #31535 failed with stages
in 4 minutes and 6 seconds
......@@ -16,6 +16,7 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
import numpy as np
from .linear_operator import LinearOperator
......@@ -52,7 +53,8 @@ class ChainOperator(LinearOperator):
opsnew = []
lastdom = ops[-1].domain
for op in ops:
if isinstance(op, ScalingOperator):
if (isinstance(op, ScalingOperator) and
not np.issubdtype(type(op._factor), np.complexfloating)):
fct *= op._factor
else:
opsnew.append(op)
......
  • Since I have fixed my problems with complex fields, this problem related to Chain simplifications is gone. Do we need this change?

  • I don't know. Is it safe now to move ScalingOperators around freely? Reimar said that some of our operators were linear with respect to R but not with respect to C. If that is true, we have to be very careful.

  • @reimar, what's your opinion?

  • I think its safer not to take along complex factors in chains of operators. I think many people use operations that inherit from linear operator but that are only R-linear, whereas there are not that many complex factors that might be combined with later complex factors.

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