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: The imaginary part of a complex number is no longer moved incorrectly to the outside of a binary expression. #1756

Merged
merged 6 commits into from
Apr 11, 2024

Conversation

MarquessV
Copy link
Contributor

Description

Fixes #1734

Checklist

  • The PR targets the master branch
  • The above description motivates these changes.
  • The change is atomic and can be described by a single commit (your PR will be squashed on merge).
  • All changes to code are covered via unit tests.
  • Parameters and return values have type hints with PEP 484 syntax.
  • Functions and classes have useful Sphinx-style docstrings.
  • (Bugfix) The associated issue is referenced above using auto-close keywords.

@MarquessV MarquessV linked an issue Mar 25, 2024 that may be closed by this pull request

assert str(quil_sin(x)) == "SIN(%x)"
assert str(3 * quil_sin(x + y)) == "3*SIN(%x + %y)"
assert (
str(quil_exp(-1j * x / 2) * np.exp(1j * np.pi / 4)) == "EXP(-i*%x/2)*(0.7071067811865476+0.7071067811865475i)"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

github-actions bot commented Mar 25, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7167 6313 88% 87% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
pyquil/quilatom.py 83% 🟢
TOTAL 83% 🟢

updated for commit: 88b2054 by action🐍

@MarquessV MarquessV marked this pull request as ready for review March 26, 2024 02:14
@MarquessV MarquessV requested a review from a team as a code owner March 26, 2024 02:14
pyquil/quilatom.py Outdated Show resolved Hide resolved
@MarquessV MarquessV merged commit 6cccb01 into master Apr 11, 2024
22 checks passed
@MarquessV MarquessV deleted the 1734-expressions-are-parsed-incorrectly-by-defgate branch April 11, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expressions are parsed incorrectly by Defgate
2 participants