Skip to content

Rules for det are not general and likely unstable #468

@cortner

Description

@cortner
A = [1.0 1.0; 1.0 1.0] 
det(A) * inv(A) 
# ERROR: SingularException(2)

to be fair, the LU approach is remarkably resiliant...

A = [1.0 1.0; 1.0 1.0-1e-16]
det(A) * inv(A)
# 2×2 Matrix{Float64}:
#   1.0  -1.0
#  -1.0   1.0

But I am nervous that this is too simple a special case to draw any conclusions.

Either way - it seems to me that an implementation that always works and is guaranteed numerically stable is preferrable. If the maintainers agree, then I would be happy to make a PR and implement frule and rrule via SVD instead of LU.

Questions:

  • should the det evaluation then also use SVD, or should it use whichever the standard implementation is?
  • should the SVD implementation be only for a specific class of matrices, or general? E.g. I'm unsure about sparse.
  • I noticed that there are rules for svd - I'm guessing this means one will be able to differentate the frule or rrule based on SVD?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions