Skip to content

Optimize ComposedLinearOperator materialisation and as_matrix#2

Open
jpbrodrick89 wants to merge 1 commit intomainfrom
claude/explore-operator-colouring-57ptE
Open

Optimize ComposedLinearOperator materialisation and as_matrix#2
jpbrodrick89 wants to merge 1 commit intomainfrom
claude/explore-operator-colouring-57ptE

Conversation

@jpbrodrick89
Copy link
Owner

  • Add compose rules in materialise() for Diagonal/Tridiagonal combinations:

    • Diagonal @ Diagonal -> DiagonalLinearOperator
    • Diagonal @ Tridiagonal -> TridiagonalLinearOperator
    • Tridiagonal @ Diagonal -> TridiagonalLinearOperator
  • Update as_matrix() to delegate to materialise() first, falling back to
    vmap over operator1.mv for O(N²) instead of O(N³) when operator1 has
    efficient mv.

https://claude.ai/code/session_0143xm3Fot5bh7Zy3GfkP6bD

- Add identity shortcuts: Identity @ X returns X, X @ Identity returns X
- Use vmap over operator1.mv instead of matmul for as_matrix, enabling
  efficient composition when operator1 has O(N) mv (e.g., Diagonal)

https://claude.ai/code/session_0143xm3Fot5bh7Zy3GfkP6bD
@jpbrodrick89 jpbrodrick89 force-pushed the claude/explore-operator-colouring-57ptE branch from c904e26 to 06a0469 Compare January 31, 2026 17:35
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.

1 participant