-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Optimize1qGates should allow rounding when calculating theta #4015
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1ucian0
added
the
Changelog: Bugfix
Include in the "Fixed" section of the changelog
label
Mar 24, 2020
1ucian0
requested review from
ajavadia,
itoko,
kdk and
mtreinish
as code owners
March 24, 2020 21:11
1ucian0
removed
the
Changelog: Bugfix
Include in the "Fixed" section of the changelog
label
Mar 24, 2020
1ucian0
added
the
Changelog: Bugfix
Include in the "Fixed" section of the changelog
label
Mar 25, 2020
kdk
reviewed
Mar 30, 2020
mtreinish
reviewed
Apr 2, 2020
releasenotes/notes/better-rounding-in-Optimize1qGates-7627d0426344b48d.yaml
Outdated
Show resolved
Hide resolved
mtreinish
approved these changes
Apr 3, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
kdk
approved these changes
Apr 3, 2020
mtreinish
added a commit
to mtreinish/qiskit-core
that referenced
this pull request
Jul 31, 2020
In Qiskit#4015 a fix was added to handle fp precision issues around 0 comparions that involved calling np.round to adjust the values for comparison. However this is kind of an antipattern for doing this type of check, since round involves making a copy of the input and truncating the value. Instead this commit adjusts the rounding to use a more standard pattern, using abs and an adjustable EPS value to use for comparing to 0. This should avoid the unecessary overhead caused by using round().
mergify bot
pushed a commit
that referenced
this pull request
Jul 31, 2020
In #4015 a fix was added to handle fp precision issues around 0 comparions that involved calling np.round to adjust the values for comparison. However this is kind of an antipattern for doing this type of check, since round involves making a copy of the input and truncating the value. Instead this commit adjusts the rounding to use a more standard pattern, using abs and an adjustable EPS value to use for comparing to 0. This should avoid the unecessary overhead caused by using round(). Co-authored-by: Luciano Bello <luciano.bello@ibm.com>
faisaldebouni
pushed a commit
to faisaldebouni/qiskit-terra
that referenced
this pull request
Aug 5, 2020
…4015) * allow rounding when calculating theta * docstring * release notes * fix * lint * more test * reduce diff * round after the mod * no release notes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed floating-point impression makes
Optimize1qGates
missing some situations to reduce the U-gate arity. For example:is "almost"
This PR fixes that.