Skip to content

Adding linalg.det function for determinant calculation #3415

Open
Lucas-Fernandes-Martins wants to merge 1 commit intoml-explore:mainfrom
Lucas-Fernandes-Martins:main
Open

Adding linalg.det function for determinant calculation #3415
Lucas-Fernandes-Martins wants to merge 1 commit intoml-explore:mainfrom
Lucas-Fernandes-Martins:main

Conversation

@Lucas-Fernandes-Martins
Copy link
Copy Markdown

@Lucas-Fernandes-Martins Lucas-Fernandes-Martins commented Apr 15, 2026

Proposed changes

Hi, tentative implemention of linalg.det for determinant calculation, using LU decomposition through lu_helper. Also added a test file on python/tests/test_det.py. Idea was proposed in #3335.

Super happy to iterate on feedback! If maintainers think this is relevant, I'd also be happy to work on implementing mx.linalg.slogdet.

To be able to use lu_helper, I decided to add a allow_singular parameter to the function so it can also be used for determinant calculation for singular matrices (by default, lu_helper throws an error if the matrix is singular). Happy to hear your thoughts on this!

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

@Lucas-Fernandes-Martins Lucas-Fernandes-Martins changed the title Adding linalg.det function for Determinant calculation Adding linalg.det function for determinant calculation Apr 15, 2026
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