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 pi_check not handling large numbers properly #4853

Merged
merged 12 commits into from
Aug 28, 2020

Conversation

enavarro51
Copy link
Contributor

Summary

Fix #4777

Details and comments

This PR fixes a problem where large numbers were being displayed as pi/0. Now any number not a multiple of pi and larger than the largest fraction that pi_check will handle will be returned as is.

from qiskit.circuit import QuantumCircuit, Gate

def my_gate(*args):
    return Gate('my_gate', num_qubits=1, params=list(args))
    
qc = QuantumCircuit(1)
qc.append(my_gate(1e9), [0])
qc.draw()
     ┌────────────────┐
q_0: ┤ my_gate(1e+09) ├
     └────────────────┘

@enavarro51 enavarro51 requested a review from a team as a code owner August 3, 2020 18:09
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.

Thanks a lot!

@1ucian0 1ucian0 added Changelog: Bugfix Include in the "Fixed" section of the changelog automerge labels Aug 28, 2020
@mergify mergify bot merged commit 4d9f4cf into Qiskit:master Aug 28, 2020
@enavarro51 enavarro51 deleted the fix4777branch branch February 24, 2021 22:37
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pi_check cannot handle large values
2 participants