Skip to content

Conversation

oscargus
Copy link
Contributor

References to other Issues or PRs

Fixes #19661

Brief description of what is fixed or changed

Added {} around expressions already containing a ^.

Other comments

Added the tests in test_secondquant.py as all the other printing tests of the classes are there.

Release Notes

  • printing
    • Corrected LaTeX-printing of Bd etc from physics.secondquant

@sympy-bot
Copy link

sympy-bot commented Aug 22, 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:

  • printing
    • Corrected LaTeX-printing of Bd etc from physics.secondquant (#21930 by @oscargus)

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. -->

Fixes #19661

#### Brief description of what is fixed or changed
Added `{}` around expressions already containing a `^`.

#### Other comments
Added the tests in test_secondquant.py as all the other printing tests of the classes are there.

#### 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 -->
* printing
   * Corrected LaTeX-printing of `Bd` etc from `physics.secondquant`
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@github-actions
Copy link

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]       [de446c6d]
     <sympy-1.8^0>                 
-      1.19±0.02s          163±2ms     0.14  dsolve.TimeDsolve01.time_dsolve
-        95.9±5μs         36.0±1μs     0.38  matrices.TimeDiagonalEigenvals.time_eigenvals
-         107±3μs         71.0±3μs     0.66  matrices.TimeMatrixGetItem.time_ImmutableSparseMatrix_getitem
-         101±7μs         64.9±4μs     0.64  solve.TimeMatrixArithmetic.time_dense_add(10, 0)
+      13.1±0.4μs       21.6±0.9μs     1.65  solve.TimeMatrixArithmetic.time_dense_add(3, 0)
+      17.2±0.7μs         34.5±2μs     2.01  solve.TimeMatrixArithmetic.time_dense_add(3, 5)
+      24.6±0.6μs         43.2±2μs     1.76  solve.TimeMatrixArithmetic.time_dense_add(4, 5)
+        44.7±1μs         77.3±4μs     1.73  solve.TimeMatrixArithmetic.time_dense_add(6, 5)
-     1.43±0.06ms         242±20μs     0.17  solve.TimeMatrixArithmetic.time_dense_multiply(10, 0)
-        58.0±3μs         28.9±2μs     0.50  solve.TimeMatrixArithmetic.time_dense_multiply(3, 0)
+        85.7±4μs          159±4μs     1.86  solve.TimeMatrixArithmetic.time_dense_multiply(3, 5)
-         119±4μs         38.5±2μs     0.32  solve.TimeMatrixArithmetic.time_dense_multiply(4, 0)
+         184±9μs         284±20μs     1.54  solve.TimeMatrixArithmetic.time_dense_multiply(4, 5)
-        388±20μs         82.1±5μs     0.21  solve.TimeMatrixArithmetic.time_dense_multiply(6, 0)
-         104±9μs         50.2±3μs     0.48  solve.TimeMatrixOperations.time_det(3, 0)
-        215±10μs         131±10μs     0.61  solve.TimeMatrixOperations.time_det(3, 2)
-        198±10μs          106±6μs     0.54  solve.TimeMatrixOperations.time_det(3, 5)
-         112±4μs         51.2±2μs     0.46  solve.TimeMatrixOperations.time_det_bareiss(3, 0)
-        219±10μs          110±2μs     0.51  solve.TimeMatrixOperations.time_det_bareiss(3, 2)
-        198±10μs          117±3μs     0.59  solve.TimeMatrixOperations.time_det_bareiss(3, 5)
+        594±30μs         909±20μs     1.53  solve.TimeMatrixOperations.time_det_bareiss(4, 0)
-         111±6μs         51.2±4μs     0.46  solve.TimeMatrixOperations.time_det_berkowitz(3, 0)
-         201±7μs          126±6μs     0.63  solve.TimeMatrixOperations.time_det_berkowitz(3, 2)
-         194±8μs          107±9μs     0.55  solve.TimeMatrixOperations.time_det_berkowitz(3, 5)
+        908±60μs      1.42±0.07ms     1.57  solve.TimeMatrixOperations.time_det_berkowitz(4, 0)
+     1.10±0.04ms      2.26±0.06ms     2.05  solve.TimeMatrixOperations.time_det_berkowitz(4, 2)
+     1.01±0.07ms       2.22±0.2ms     2.20  solve.TimeMatrixOperations.time_det_berkowitz(4, 5)
+        308±20μs         547±60μs     1.78  solve.TimeMatrixOperations.time_rank(3, 0)
+        525±30μs         809±30μs     1.54  solve.TimeMatrixOperations.time_rank(4, 0)
-      6.23±0.7ms       3.44±0.2ms     0.55  solve.TimeRationalSystem.time_linsolve(10)
-     1.21±0.07ms         779±20μs     0.64  solve.TimeRationalSystem.time_linsolve(5)
+     1.18±0.06ms      1.82±0.05ms     1.54  solve.TimeSparseSystem.time_linear_eq_to_matrix(10)
+      3.57±0.1ms       5.38±0.1ms     1.51  solve.TimeSparseSystem.time_linear_eq_to_matrix(20)
+      7.30±0.7ms       11.1±0.3ms     1.51  solve.TimeSparseSystem.time_linear_eq_to_matrix(30)
-      2.77±0.1ms      1.76±0.09ms     0.64  solve.TimeSparseSystem.time_linsolve_eqs(20)
-      3.99±0.2ms       2.47±0.2ms     0.62  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

@oscarbenjamin oscarbenjamin merged commit 8cb334c into sympy:master Aug 22, 2021
@oscargus oscargus deleted the fixissue19661 branch August 23, 2021 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues with Latex printing output in second quantization module
3 participants