Skip to content
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

Fix docstring of gates.PRX #1571

Merged
merged 1 commit into from
Feb 3, 2025
Merged

Fix docstring of gates.PRX #1571

merged 1 commit into from
Feb 3, 2025

Conversation

renatomello
Copy link
Contributor

@renatomello renatomello commented Jan 31, 2025

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

@renatomello renatomello added the documentation Improvements or additions to documentation label Jan 31, 2025
@renatomello renatomello added this to the Qibo 0.2.16 milestone Jan 31, 2025
@renatomello renatomello self-assigned this Jan 31, 2025
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.66%. Comparing base (66b1a0f) to head (9b3c276).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1571   +/-   ##
=======================================
  Coverage   99.66%   99.66%           
=======================================
  Files          76       76           
  Lines       11440    11440           
=======================================
  Hits        11402    11402           
  Misses         38       38           
Flag Coverage Δ
unittests 99.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +697 to +701
.. math::
\\begin{pmatrix}
\\cos{(\\theta / 2)} & -i e^{-i \\phi} \\sin{(\\theta / 2)} \\\\
-i e^{i \\phi} \\sin{(\\theta / 2)} & \\cos{(\\theta / 2)}
\\end{pmatrix}
Copy link
Member

@alecandido alecandido Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To save a few \, you can put an r in front of the docstring's opening quotes, i.e. r""" (r for raw). This will deactivate escape codes, so \n won't be any longer a newline, and \t is not a tab (but they will be literally interpreted as the two characters you typed). However, that's usually what you want in a docstring.
https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals

It will allow you to use a single \, and just write \begin, and so on.

You may have been already aware. In case you chose explicitly, sorry for the extra noise.

@renatomello renatomello added this pull request to the merge queue Feb 3, 2025
Merged via the queue into master with commit 45dee85 Feb 3, 2025
30 checks passed
@renatomello renatomello deleted the doc branch February 3, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants