Skip to content

Conversation

ToastCheng
Copy link
Contributor

@ToastCheng ToastCheng commented Sep 17, 2025

In the docstring of ArithmeticGate.apply,
two exponentiation ** accidentally combine to a bold text syntax.
Here we add backtick quotes to avoid this, and also fix a few other
similar instances.

In the docstring of apply, two exponentiation "**" accidentally combine
to a bold text syntax. Use "^" instead as it's also being used in the rest
of the documentation.
@ToastCheng ToastCheng requested review from a team and vtomole as code owners September 17, 2025 15:13
@ToastCheng ToastCheng requested a review from fdmalone September 17, 2025 15:13
@github-actions github-actions bot added the Size: XS <10 lines changed label Sep 17, 2025
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.37%. Comparing base (7673240) to head (cbeca32).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7653      +/-   ##
==========================================
- Coverage   99.37%   99.37%   -0.01%     
==========================================
  Files        1080     1080              
  Lines       96378    96378              
==========================================
- Hits        95775    95774       -1     
- Misses        603      604       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

Please see the inline comment. Also, I found a few more places which show the same mix-up between the literal ** and a bold-face rendering in Cirq web docs.

Can you please fix these with double-backticks as well?

written as X**a Z**b for a,b=0,1,...,d-1. For a qubit, there is only one

exponent_neg: How much to phase vectors in the negative eigenspace,
in the form of the t in (-1)**t = exp(i pi t).
exponent_pos: How much to phase vectors in the positive eigenspace,
in the form of the t in (-1)**t = exp(i pi t).

exponent_neg: How much to phase vectors in the negative eigenspace,
in the form of the t in (-1)**t = exp(i pi t).
exponent_pos: How much to phase vectors in the positive eigenspace,
in the form of the t in (-1)**t = exp(i pi t).

than the registers they will be stored into. The extra bits are
simply dropped. For example, if the value 5 is returned for a 2
qubit register then 5 % 2**2 = 1 will be used instead. Negative
qubit register then 5 % 2^2 = 1 will be used instead. Negative
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use double backticks instead, ie, ``5 % 2**2 = 1``, to avoid having ** interpreted as a bold-face markdown.
2^2 is a valid XOR expression which may confuse readers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks for pointing this out!

@github-actions github-actions bot added size: S 10< lines changed <50 and removed Size: XS <10 lines changed labels Sep 18, 2025
Copy link
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this!

@pavoljuhas
Copy link
Collaborator

pavoljuhas commented Sep 18, 2025

I am updating the initial comment as it will become the merge commit message.
Here is the original PR description for reference:


In the docstring of ArithmeticGate.apply, two exponentiation ** accidentally combine to a bold text syntax. This PR changes ** to ^ to avoid this.

Screenshot 2025-09-17 at 6 51 35 PM

Note that my first attempt is to make it an inline latex expression, however the spacing of % looks a bit weird:
Screenshot 2025-09-17 at 11 08 01 PM
I could add some space, but that will make the expression even more difficult to read in source code (e.g. $-2\ \%\ 2^3 = 6$), so in the end I just use ^ instead as it's also being used in the rest of the documentation.

@pavoljuhas pavoljuhas added this pull request to the merge queue Sep 18, 2025
Merged via the queue into quantumlib:main with commit 163a087 Sep 18, 2025
64 of 66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: S 10< lines changed <50

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants