Skip to content

Conversation

redeboer
Copy link
Contributor

@redeboer redeboer commented Jul 22, 2021

References to other Issues or PRs

Brief description of what is fixed or changed

Release Notes

  • physics.quantum
    • Added a precedence attribute to CG to fix latex rendering
    • Fixed argument order of the math in the CG documentation

@sympy-bot
Copy link

sympy-bot commented Jul 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:

  • physics.quantum
    • Added a precedence attribute to CG to fix latex rendering (#21769 by @redeboer)

    • Fixed argument order of the math in the CG documentation (#21769 by @redeboer)

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.
#### References to other Issues or PRs

- Fixes #18781
- Fixes #21001


#### Brief description of what is fixed or changed

- Fixed the order of the formula in the docstring (#18781)
- Added a link to the Particle Data Group for comparing the doctests
- Improved the LaTeX rendering so that it also renders if a `CG` is squared, for instance (#21001)


#### Release Notes

<!-- BEGIN RELEASE NOTES -->
* physics.quantum
  * Added a precedence attribute to `CG` to fix latex rendering
  * Fixed argument order of the math in the `CG` documentation
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@asmeurer
Copy link
Member

The LaTeX thing should be fixed by fixing the precedence in the printer. If you look at precedence.py, it looks like it needs to define a precedence attribute (this stuff really needs to be documented).

@redeboer
Copy link
Contributor Author

The LaTeX thing should be fixed by fixing the precedence in the printer. If you look at precedence.py, it looks like it needs to define a precedence attribute (this stuff really needs to be documented).

Ah ok, yeah that sounds like a better solution. Perhaps it's also a solution to #19661 and #20959?

@redeboer
Copy link
Contributor Author

As for #18781, I want to look into this a bit further, because it seems c3a1a40 is not the correct solution.

@redeboer
Copy link
Contributor Author

redeboer commented Jul 25, 2021

The LaTeX thing should be fixed by fixing the precedence in the printer. If you look at precedence.py, it looks like it needs to define a precedence attribute (this stuff really needs to be documented).

@asmeurer is this the idea? c07fc47

redeboer added 2 commits July 25, 2021 22:05
Clarifies the difference between total angular momentum and the angular
momenta of the sub-systems.

Also adds a link to Clebsch-Gordan in PDG to verify the doctests.
This correctly renders powers of a CG instance
@github-actions
Copy link

github-actions bot commented Jul 25, 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]       [12b7787c]
     <sympy-1.8^0>                 
-      9.83±0.01s       5.04±0.02s     0.51  integrate.TimeIntegrationRisch02.time_doit(100)
-      9.92±0.02s       4.96±0.07s     0.50  integrate.TimeIntegrationRisch02.time_doit_risch(100)
+        83.2±2μs       3.28±0.2ms    39.35  matrices.TimeDiagonalEigenvals.time_eigenvals
-      5.65±0.2ms       3.38±0.2ms     0.60  solve.TimeRationalSystem.time_linsolve(10)
-     3.77±0.07ms      2.43±0.03ms     0.65  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).

@redeboer redeboer marked this pull request as ready for review July 26, 2021 10:54
@asmeurer
Copy link
Member

asmeurer commented Jul 27, 2021

I would put the precedence on the class itself, rather than in precedence.py, since the latex printer is also defined there. I believe you can define precedence = PRECEDENCE["Pow"] - 1 on the class, although you may have to read the source code in the printer to verify that this is correct. I don't know enough about the object itself to confirm if this is the correct precedence for it.

@redeboer
Copy link
Contributor Author

Ah yes that makes more sense --> 2f5dd66

Hadn't noticed precedence() also checks class attributes:

if hasattr(item, "precedence"):
return item.precedence

@asmeurer
Copy link
Member

Looks good. Can you add release notes entries for the changes?

@redeboer
Copy link
Contributor Author

Looks good. Can you add release notes entries for the changes?

Done 👌

@oscarbenjamin
Copy link
Collaborator

Looks good, thanks!

@oscarbenjamin oscarbenjamin merged commit d9b18c5 into sympy:master Aug 9, 2021
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.

Latex repr of CG with power does not render correctly CG() docs are wrong?
4 participants