Skip to content

Add ArrayInterface.issingular for IdentityOperator and ScalarOperator - #400

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
singhharsh1708:feat/issingular-identity-scalar
Jul 9, 2026
Merged

ChrisRackauckas merged 2 commits into
SciML:masterfrom
singhharsh1708:feat/issingular-identity-scalar

Conversation

@singhharsh1708

Copy link
Copy Markdown
Member

IdentityOperator and ScalarOperator cannot be used as f.mass_matrix in OrdinaryDiffEq today because ArrayInterface.issingular is not defined on them, so the DAE check at the top of solve throws before the solver even starts. Repro on master: SciML/OrdinaryDiffEq.jl#3814.

Adds:

ArrayInterface.issingular(::IdentityOperator) = false
ArrayInterface.issingular(op::ScalarOperator) = iszero(op.val)

Alongside the existing ArrayInterface.issingular(::MatrixOperator) in matrix.jl:278.

Tests exercise both methods in test/basic.jl and test/scalar.jl.

Note: this fixes only the issingular blocker. A separate follow-up in OrdinaryDiffEqCore is needed for get_differential_vars (lib/OrdinaryDiffEqCore/src/misc_utils.jl:143), which calls all(!iszero, mass_matrix) and needs an IdentityOperator/ScalarOperator-aware branch.

Lets these operators be used as mass matrices in DiffEq solvers.
@ChrisRackauckas
ChrisRackauckas merged commit bb49b93 into SciML:master Jul 9, 2026
15 of 17 checks passed
@singhharsh1708
singhharsh1708 deleted the feat/issingular-identity-scalar branch July 9, 2026 18:47
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