Skip to content

Update slogdet guidance for when the determinant is zero #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion spec/extensions/linear_algebra_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,14 @@ The purpose of this function is to calculate the determinant more accurately whe
- first element must have the field name `sign` and must be an array containing a number representing the sign of the determinant for each square matrix.
- second element must have the field name `logabsdet` and must be an array containing the determinant for each square matrix.

For a real matrix, the sign of the determinant must be either `1`, `0`, or `-1`. If a determinant is zero, then the corresponding `sign` must be `0` and `logabsdet` must be `-infinity`. In all cases, the determinant must be equal to `sign * exp(logsabsdet)`.
For a real matrix, the sign of the determinant must be either `1`, `0`, or `-1`.

Each returned array must have shape `shape(x)[:-2]` and a floating-point data type determined by {ref}`type-promotion`.

```{note}
If a determinant is zero, then the corresponding `sign` should be `0` and `logabsdet` should be `-infinity`; however, depending on the underlying algorithm, the returned result may differ. In all cases, the determinant should be equal to `sign * exp(logsabsdet)` (although, again, the result may be subject to numerical precision errors).
```

(function-linalg-solve)=
### linalg.solve(x1, x2, /)

Expand Down