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 for unintended rounding in 'state_to_latex' latex output #9300

Merged
merged 11 commits into from
Apr 27, 2023

Conversation

Slope86
Copy link
Contributor

@Slope86 Slope86 commented Dec 17, 2022

Summary

Fixes #9297

Details and comments

Use parameter decimals to determine number of decimal places to round to.
Fix unintended rounding when using parameter max_size

@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Dec 17, 2022
@CLAassistant
Copy link

CLAassistant commented Dec 17, 2022

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

1ucian0
1ucian0 previously approved these changes Apr 25, 2023
Copy link
Member

@1ucian0 1ucian0 left a comment

Choose a reason for hiding this comment

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

LGTM Thank you!

@1ucian0
Copy link
Member

1ucian0 commented Apr 25, 2023

Do you mind resolving the conflicts? I cannot change your main branch :-/

@Slope86
Copy link
Contributor Author

Slope86 commented Apr 26, 2023

Do you mind resolving the conflicts?

No problem!

I cannot change your main branch :-/

Ah~ sorry github noob here, should have created a new branch.

@coveralls
Copy link

coveralls commented Apr 26, 2023

Pull Request Test Coverage Report for Build 4816373182

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • 18 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.03%) to 85.91%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 2 91.9%
crates/accelerate/src/sabre_swap/layer.rs 4 97.32%
crates/qasm2/src/parse.rs 12 97.11%
Totals Coverage Status
Change from base Build 4815482842: 0.03%
Covered Lines: 71194
Relevant Lines: 82870

💛 - Coveralls

@Slope86 Slope86 requested a review from 1ucian0 April 26, 2023 15:27
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Nice catch, and thanks for this fixing PR. It all looks logically correct to me, and the test is nice.

@jakelishman jakelishman added stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: Bugfix Include in the "Fixed" section of the changelog mod: visualization qiskit.visualization labels Apr 27, 2023
@jakelishman jakelishman added this to the 0.24.0 milestone Apr 27, 2023
@jakelishman jakelishman added this pull request to the merge queue Apr 27, 2023
Merged via the queue into Qiskit:main with commit 4df6f3d Apr 27, 2023
mergify bot pushed a commit that referenced this pull request Apr 27, 2023
* [fix] unintended rounding cause by param max_size

* reformatted

* reformatted

* Deprecated num_to_latex_ket

Replace "numbers_to_latex_terms" with "_numbers_to_latex_terms"

* reformatted

(cherry picked from commit 4df6f3d)
mtreinish pushed a commit that referenced this pull request Apr 27, 2023
…10048)

* [fix] unintended rounding cause by param max_size

* reformatted

* reformatted

* Deprecated num_to_latex_ket

Replace "numbers_to_latex_terms" with "_numbers_to_latex_terms"

* reformatted

(cherry picked from commit 4df6f3d)

Co-authored-by: Slope <60516263+Slope86@users.noreply.github.com>
king-p3nguin pushed a commit to king-p3nguin/qiskit-terra that referenced this pull request May 22, 2023
…9300)

* [fix] unintended rounding cause by param max_size

* reformatted

* reformatted

* Deprecated num_to_latex_ket

Replace "numbers_to_latex_terms" with "_numbers_to_latex_terms"

* reformatted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo mod: visualization qiskit.visualization stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Statevector drawer - state_to_latex's max_size parameter cause unintended rounding
6 participants