Skip to content

Add mul! tests for TensorProductOperator#362

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
albertomercurio:master
May 3, 2026
Merged

Add mul! tests for TensorProductOperator#362
ChrisRackauckas merged 2 commits into
SciML:masterfrom
albertomercurio:master

Conversation

@albertomercurio
Copy link
Copy Markdown
Contributor

Continuation of #358

Comment thread src/tensor.jl
Comment on lines +101 to +103
if op.ops[2] isa IdentityOperator
# We call the main method to avoid recursion with the method below
return TensorProductOperator((left, op.ops[2]), nothing)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's an IdentityOperator can't you just drop it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically saying

$$ I \otimes (O \otimes I) = (I \otimes O) \otimes I $$

But we need to call the main method, otherwise we call the method TensorProductOperator(op::TensorProductOperator, ii::IdentityOperator) below and we get StackOverflow.

@ChrisRackauckas ChrisRackauckas merged commit d775d0f into SciML:master May 3, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants