-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Seed transpiler takes list but it is not in the docstrings #7883
Comments
It's not just That said, if we're going to have type hints, they should at least be accurate. It'll look super ugly, though - for long ones, it may be better to define aliases at the top of the file, so we can do |
Note that the behavior is also not consistent with Aer, where |
I would say I don't like this undocumented behavior because it makes #7789 and similar refactors much harder to work with. #7789 still supports the list input (except on optimization level and basis gates because the PR assume they're always shared on each circuit in the list), but not having to worry about whether it's a single input or a list is kind of annoying. |
If a passed int seed was used to seed an RNG to make a list of seeds, one for each process, would that not work here? I have done that elsewhere for some time now and it works well. |
Hi @nonhermitian, just checking to see how this is going, I would like to try my hand with this issue if thats fine with you? |
@aniken04: the current actionable part of this issue is to update all the type hints in the manner I'd described in my comment above. The other discussion here is more about design choices that we can't immediately change without breaking compatibility for users, but that's separate to the original issue. If you'd like to work on the type hints, let me know and I'll assign you. (On the subject of the design choices: given that transpile can take a list of circuits, in general I'd err on the side of the current "broadcast-like" behaviour, even if it's a bit more complex for us to deal with internally. I feel like we should be able to handle sending the arguments over the wire sensibly in the current form, even if that means just re-broadcasting the arguments within each process to save wire time. I start changing my tune if there are any cases where the singleton has a type of |
Hey @jakelishman, I'd love to work on the type hints if that's fine! |
Thanks, I've assigned you, and let us know if you've got questions! |
@jakelishman looking around, I can't see that this issue was closed. Could you assign this to me so I can work on the type hints? Just to clarify if this issue is still open: when changing seed_transpiler, it should be or should it be and then within transpile it would look like this or is there another preferred way? |
hey @Eriken79 thanks for jumping on this, I've assigned to you! As for the preferred implementation, Jake is on leave at the moment, perhaps @mtreinish could weigh in? |
Hi @Eriken79, sorry for the delay: for simple things like |
@jakelishman thank you for the response, sorry I'm a bit confused still. So am I just updating the type hinting or are there also changes I should be making to the docstring? As far as my current understanding goes, I should be updating the type hints so seed transpiler changes from |
The docstring looks fine as it is to me - the comment at the top addresses that all options are also allowed to be a list of values, and there's no explicit types given elsewhere in it. The type hints just need to include the
|
Thanks @jakelishman, sorry I have a few more question and I should be able to square this issue away. Should type hints like Also, with type hints that have multiple distinct unioned types like Finally, for Thank you so much for helping me out! |
Hi @Eriken79, sorry, I didn't see this at the time.
|
@Eriken79 how are you? Did you already complete this one? I was thinking to hop on and help or take it in case you want to donate it to me? |
They ended up going with a different design on the transpiler that makes this issue invalid. @jakelishman This issue should probably be closed! PR #8814 is the one I submitted. You can follow the chain there to see what direction they ended up taking this issue. |
Environment
What is happening?
In order to seed transpiler for a list of circuits a list of seeds is required. This is supported, but not mentioned anywhere:
https://github.com/Qiskit/qiskit-terra/blob/a296ca009bf440b5a2cb00f61b8221c6ce9aa044/qiskit/compiler/transpiler.py#L65
How can we reproduce the issue?
See the docstring
What should happen?
It should be listed as an option because I originally assumed having all processes set with a single int seed was a bug.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: