Skip to content

Conversation

praneethratna
Copy link
Contributor

References to other Issues or PRs

Brief description of what is fixed or changed

Fixes #20752 and now is_positive_semidefinite returns None for Matrix([[0, 0, 0], [0, b, 0], [0, 0, b]]) where b is nonzero instead of True.

Other comments

Release Notes

  • matrices
    • fixed bug in is_positive_semidefinite() in eigen.py.

@sympy-bot
Copy link

sympy-bot commented Aug 19, 2021

Hi, I am the SymPy bot (v161). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.9.

Click here to see the pull request description that was parsed.
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->


#### Brief description of what is fixed or changed
Fixes #20752 and now is_positive_semidefinite returns `None` for `Matrix([[0, 0, 0], [0, b, 0], [0, 0, b]])` where b is nonzero instead of `True`.

#### Other comments


#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers.

or if no release note(s) should be included use:

NO ENTRY

See https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more
information on how to write release notes. The bot will check your release
notes automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
* matrices
   * fixed bug in is_positive_semidefinite() in eigen.py. 
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@github-actions
Copy link

github-actions bot commented Aug 19, 2021

Benchmark results from GitHub Actions

Lower numbers are good, higher numbers are bad. A ratio less than 1
means a speed up and greater than 1 means a slowdown. Green lines
beginning with + are slowdowns (the PR is slower then master or
master is slower than the previous release). Red lines beginning
with - are speedups.

Significantly changed benchmark results (PR vs master)

Significantly changed benchmark results (master vs previous release)

       before           after         ratio
     [ed9a550f]       [c880b2ca]
     <sympy-1.8^0>                 
-         950±3ms        128±0.3ms     0.13  dsolve.TimeDsolve01.time_dsolve
-      8.80±0.02s          4.26±0s     0.48  integrate.TimeIntegrationRisch02.time_doit(100)
-         8.81±0s          4.24±0s     0.48  integrate.TimeIntegrationRisch02.time_doit_risch(100)
-      76.7±0.2μs       29.3±0.1μs     0.38  matrices.TimeDiagonalEigenvals.time_eigenvals
-      91.9±0.3μs       60.4±0.4μs     0.66  matrices.TimeMatrixGetItem.time_ImmutableSparseMatrix_getitem
-      90.4±0.7μs       60.1±0.6μs     0.66  matrices.TimeMatrixGetItem.time_MutableSparseMatrix_getitem
-      84.2±0.2μs      52.0±0.08μs     0.62  solve.TimeMatrixArithmetic.time_dense_add(10, 0)
+     11.6±0.03μs       19.0±0.1μs     1.64  solve.TimeMatrixArithmetic.time_dense_add(3, 0)
+     13.8±0.03μs       31.0±0.1μs     2.24  solve.TimeMatrixArithmetic.time_dense_add(3, 5)
+     20.4±0.09μs      39.4±0.06μs     1.93  solve.TimeMatrixArithmetic.time_dense_add(4, 5)
+     37.2±0.08μs       63.4±0.2μs     1.71  solve.TimeMatrixArithmetic.time_dense_add(6, 5)
-     1.28±0.01ms        219±0.2μs     0.17  solve.TimeMatrixArithmetic.time_dense_multiply(10, 0)
-      47.9±0.4μs      24.8±0.05μs     0.52  solve.TimeMatrixArithmetic.time_dense_multiply(3, 0)
+     75.0±0.06μs        133±0.2μs     1.77  solve.TimeMatrixArithmetic.time_dense_multiply(3, 5)
-       102±0.3μs      31.3±0.07μs     0.31  solve.TimeMatrixArithmetic.time_dense_multiply(4, 0)
-         304±1μs      63.6±0.07μs     0.21  solve.TimeMatrixArithmetic.time_dense_multiply(6, 0)
-      92.8±0.3μs      43.7±0.07μs     0.47  solve.TimeMatrixOperations.time_det(3, 0)
-       168±0.2μs       99.7±0.2μs     0.59  solve.TimeMatrixOperations.time_det(3, 2)
-       159±0.1μs       91.5±0.1μs     0.57  solve.TimeMatrixOperations.time_det(3, 5)
-      93.3±0.3μs       43.4±0.2μs     0.46  solve.TimeMatrixOperations.time_det_bareiss(3, 0)
-       168±0.1μs       99.7±0.2μs     0.59  solve.TimeMatrixOperations.time_det_bareiss(3, 2)
-       159±0.3μs       91.3±0.2μs     0.57  solve.TimeMatrixOperations.time_det_bareiss(3, 5)
-      92.9±0.3μs       43.5±0.1μs     0.47  solve.TimeMatrixOperations.time_det_berkowitz(3, 0)
-       168±0.5μs      99.6±0.09μs     0.59  solve.TimeMatrixOperations.time_det_berkowitz(3, 2)
-       159±0.4μs      91.3±0.06μs     0.57  solve.TimeMatrixOperations.time_det_berkowitz(3, 5)
+       723±0.5μs         1.10±0ms     1.53  solve.TimeMatrixOperations.time_det_berkowitz(4, 0)
+         862±2μs         1.61±0ms     1.86  solve.TimeMatrixOperations.time_det_berkowitz(4, 2)
+         902±1μs         1.71±0ms     1.89  solve.TimeMatrixOperations.time_det_berkowitz(4, 5)
+       266±0.5μs          431±1μs     1.62  solve.TimeMatrixOperations.time_rank(3, 0)
+       419±0.7μs          655±3μs     1.56  solve.TimeMatrixOperations.time_rank(4, 0)
+       122±0.1μs        185±0.3μs     1.52  solve.TimeMatrixOperations.time_rref(3, 0)
-     5.11±0.01ms      2.81±0.01ms     0.55  solve.TimeRationalSystem.time_linsolve(10)
-        1.03±0ms          650±1μs     0.63  solve.TimeRationalSystem.time_linsolve(5)
+        3.06±0ms      4.59±0.01ms     1.50  solve.TimeSparseSystem.time_linear_eq_to_matrix(20)
+     6.18±0.01ms      9.47±0.02ms     1.53  solve.TimeSparseSystem.time_linear_eq_to_matrix(30)
-        1.21±0ms          796±1μs     0.66  solve.TimeSparseSystem.time_linsolve_eqs(10)
-        2.27±0ms         1.44±0ms     0.63  solve.TimeSparseSystem.time_linsolve_eqs(20)
-        3.33±0ms         2.10±0ms     0.63  solve.TimeSparseSystem.time_linsolve_eqs(30)

Full benchmark results can be found as artifacts in GitHub Actions
(click on checks at the top of the PR).

@oscarbenjamin
Copy link
Collaborator

Looks good, thanks!

@oscarbenjamin oscarbenjamin merged commit 3ec7b74 into sympy:master Aug 23, 2021
@praneethratna praneethratna deleted the 20752_matrices branch August 24, 2021 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

is_positive_semidefinite() gives wrong result on sympy==1.7.1
3 participants