Commit 64f07ff6 authored by Stephan Rave's avatar Stephan Rave
Browse files

[project] better handling of Concatenations with ConstantOperators

parent 64bb8c5c
......@@ -162,7 +162,14 @@ class ProjectRules(RuleTable):
# at least we can try to partially project the outer operators
projected_first = project(first, None, source_basis)
projected_last = project(last, range_basis, None)
return ConcatenationOperator((projected_last,) + op.operators[1:-1] + (projected_first,), name=op.name)
projected_op = ConcatenationOperator((projected_last,) + op.operators[1:-1] + (projected_first,), name=op.name)
# special handling for concatenations with ConstantOperators
# probably should be moved elsewhere
if not projected_op.parametric and any(isinstance(o, ConstantOperator) for o in projected_op.operators):
projected_op = ConstantOperator(projected_op.apply(projected_op.source.zeros()), projected_op.source)
return projected_op
@match_class(AdjointOperator)
def action_AdjointOperator(self, op):
......
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