-
Notifications
You must be signed in to change notification settings - Fork 79
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
New Native Gates page #487
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Some thoughts (from @beckykd ):
This code works, but I didn’t go much further because I’m afraid to run things on real systems: service = QiskitRuntimeService(channel="ibm_quantum") backend = service.get_backend("ibm_brisbane") config = backend.configuration() config.supported_instructions
|
Definitely not. I'd assume our docs are for Qiskit 0.43 and newer, or maybe even 0.44 and newer. Once 1.0 is released, the plan is to focus on Qiskit 1.0. |
Clarification from Blake: I think all we need is a concise summary of the native gateset supported by our various hardware platforms. RESET needs a little additional explanation to communicate that RESET is not the same as the initialization done at the start of your circuit to prepare the all 0's state. |
Confirmed that Sampler and Estimator support init_qubits. |
docs/run/native-gates.mdx
Outdated
|
||
<Admonition type="tip" title="The init_qubits flag"> | ||
|
||
By default, the `init_qubits` flag is set to True. If the `init_qubits` flag is set to False, you must insert [resets](/api/qiskit/qiskit.circuit.library.Reset) at the start of your circuit to start your qubits in the ground state. Otherwise, if your job consists of multiple circuits, the qubits will begin in their state from the previous shot. (If a job consists of multiple circuits, the shots will be executed in a "round-robin" fashion. That is, one shot will be collected from every circuit, and then the next shot will be collected from every circuit, and so on.) |
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.
By default, the `init_qubits` flag is set to True. If the `init_qubits` flag is set to False, you must insert [resets](/api/qiskit/qiskit.circuit.library.Reset) at the start of your circuit to start your qubits in the ground state. Otherwise, if your job consists of multiple circuits, the qubits will begin in their state from the previous shot. (If a job consists of multiple circuits, the shots will be executed in a "round-robin" fashion. That is, one shot will be collected from every circuit, and then the next shot will be collected from every circuit, and so on.) | |
The `init_qubits` flag controls whether qubits are reset to the zero state at the start of each circuit. Its default value is True, indicating that the qubits should be reset. If False, the qubits will begin in the final state from the previous shot, and you must manually insert [resets](/api/qiskit/qiskit.circuit.library.Reset) if you want to reset them to the zero state. If a job consists of multiple circuits, then the shots are executed in a "round-robin" fashion. That is, each circuit will be executed in sequence to obtain one shot from each circuit. This process is then repeated until the requested number of shots has been obtained from all circuits. |
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.
If we include this note, we have to mention what function the init_qubits
flag is an argument of. A quick search of the source code suggests it is from assemble
. But is this function even mentioned elsewhere in the docs?
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.
I see that it is also from execute(). I found this from API docs old release notes:
A new kwarg for init_qubits has been added to assemble() and execute(). For backends that support this feature init_qubits can be used to control whether the backend executing the circuits inserts any initialization sequences at the start of each shot. By default this is set to True meaning that all qubits can assumed to be in the ground state at the start of each shot. However, when init_qubits is set to False qubits will be uninitialized at the start of each experiment and between shots. Note, that the backend running the circuits has to support this feature for this flag to have any effect.)
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.
Also, the Conditional Reset page (which has been removed) had this pph:
Note: If
init_qubits
is set to false and you want qubits to start in the ground state, you must insert resets at the start of your circuit. Otherwise, qubits will begin with their state from the previous shot (after undergoing some thermalization process for the interval between shots as set byrep_delay
). Note that the first shot of the first circuit may still be in the thermal ground state due to a longer delay existing during the loading of your job to hardware.
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.
So that's what I'm working with. Blake specifically mentioned the init_qubits flag, as long as it is supported by Sampler (which it is)... does it feel too much like it comes out of nowhere?
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.
The note seems to presuppose that the user already knows about the init_qubits
flag. Without further explanation, I would expect the init_qubits
text to be a hyperlink pointing to a documentation page explaining its syntax, or to the function that has it as an argument. From reading the note, it's not clear to me in what sense the init_qubits
flag is supported by Sampler. Is it Sampler(init_qubits=False)
?
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.
From reading the note, it's not clear to me in what sense the
init_qubits
flag is supported by Sampler. Is itSampler(init_qubits=False)
?
You specify it as an execution option: ExecutionOptions(shots=4000, init_qubits=True https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.ExecutionOptions
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.
Ah ok, the note should say that.
Co-authored-by: Kevin J. Sung <kevinjefferysung@gmail.com>
Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com>
|
||
## Next steps | ||
|
||
<Admonition type="tip" title="Recommendations"> |
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.
one of our goals is to have every docs page include a link to a learning platform topic where users can start using these concepts in practice, can you add a link to a sensible learning platform course/tutorial here please?
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.
How about the Submit transpiled circuits tutorial? Or we could do something broader like "Try one of the workflow example tutorials."
Co-authored-by: Abby Mitchell <23662430+javabster@users.noreply.github.com>
Co-authored-by: Abby Mitchell <23662430+javabster@users.noreply.github.com>
Closes Qiskit#113 Kevin noted that the native gates appear to be the same for all members of each processor family. I've added the gates associated with each family to the Processor types page as well. --------- Co-authored-by: Rebecca Dimock <beckyd@us.ibm.com> Co-authored-by: Kevin J. Sung <kevjsung@umich.edu> Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com> Co-authored-by: Kevin J. Sung <kevinjefferysung@gmail.com> Co-authored-by: Abby Mitchell <23662430+javabster@users.noreply.github.com>
Closes #113
Kevin noted that the native gates appear to be the same for all members of each processor family. I've added the gates associated with each family to the Processor types page as well.