Commit 06e7f0a9 authored by Philipp Arras's avatar Philipp Arras
Browse files

Add simplify Sandwich

parent 8b60e308
Pipeline #70782 passed with stages
in 17 minutes and 57 seconds
......@@ -52,6 +52,10 @@ class SandwichOperator(EndomorphicOperator):
cheese: EndomorphicOperator
the cheese part
if isinstance(cheese, SandwichOperator):
old_cheese = cheese
cheese = old_cheese._cheese
bun = old_cheese._bun @ bun
if not isinstance(bun, LinearOperator):
raise TypeError("bun must be a linear operator")
if cheese is not None and not isinstance(cheese, LinearOperator):
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