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

Consider handling rzz validation for parametrized angles #2000

Open
yaelbh opened this issue Oct 29, 2024 · 5 comments · May be fixed by #2021
Open

Consider handling rzz validation for parametrized angles #2000

yaelbh opened this issue Oct 29, 2024 · 5 comments · May be fixed by #2021
Assignees
Milestone

Comments

@yaelbh
Copy link
Collaborator

yaelbh commented Oct 29, 2024

rzz angle is allowed only in the range [0, pi/2].
If a user writes rzz(-1, qubit) or rzz(3, qubit) (i.e., the angle is a number) then our ISA validation will correctly fail.
But, if the user writes rzz(param, qubit), where param is a qiskit.circuit.Parameter, and assigns a negative (or greater than pi/2) value to the parameter - this will not be caught by the validation process, and therefore will fail much later in the stack.

@yaelbh
Copy link
Collaborator Author

yaelbh commented Oct 29, 2024

@yaelbh yaelbh self-assigned this Oct 29, 2024
@yaelbh
Copy link
Collaborator Author

yaelbh commented Nov 4, 2024

I want to change the signature of is_isa_circuit, such that it receives a pub instead of a circuit, but I don't know if it's considered to be an API break that requires deprecation.

@jyu00 @kevinsung @mberna Does it require deprecation?

To be on the safe side, for now I'll leave ISA validation unchanged. I'll add two new functions, validate_rzz_pub and is_rzz_pub.

@kevinsung
Copy link
Contributor

I don't really work on this repository, perhaps you mean to ping @kt474 .

@jyu00
Copy link
Collaborator

jyu00 commented Nov 4, 2024

I want to change the signature of is_isa_circuit, such that it receives a pub instead of a circuit, but I don't know if it's considered to be an API break that requires deprecation.

@jyu00 @kevinsung @mberna Does it require deprecation?

To be on the safe side, for now I'll leave ISA validation unchanged. I'll add two new functions, validate_rzz_pub and is_rzz_pub.

It's not an API break since is_isa_circuit is technically a private method (i.e. it's not documented in API reference).

@yaelbh yaelbh linked a pull request Nov 7, 2024 that will close this issue
@yaelbh
Copy link
Collaborator Author

yaelbh commented Nov 11, 2024

Following #2035, we should also take into account parameter expressions.

@kt474 kt474 added this to the 0.34.0 milestone Nov 18, 2024
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 a pull request may close this issue.

4 participants