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

New Native Gates page #487

Merged
merged 30 commits into from
Jan 30, 2024
Merged

New Native Gates page #487

merged 30 commits into from
Jan 30, 2024

Conversation

abbycross
Copy link
Collaborator

@abbycross abbycross commented Dec 6, 2023

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.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@abbycross
Copy link
Collaborator Author

Some thoughts (from @beckykd ):

  • update language "Now..."

  • how do you know which backends support condiditonal reset? Clarify in the beginning that not all support it and tell them how to figure it out. **note: this IS explained later. Move up that instruction to before you specify your backend. This just checks a specific backend though. How to find one except by trial and error? maybe it's supported on all backends now?

  • ibmq_paris has been retired. Should this run on a fake backend? But fake backends don't seem to have configuration objects.

  • On the code IBMQ.load_account(): DeprecationWarning: The qiskit.IBMQ entrypoint and the qiskit-ibmq-provider package (accessible from 'qiskit.providers.ibmq`) are deprecated and will be removed in a future release. (need job monitor from elsewhere?)

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

  • Do we still need "Note: These features require qiskit > 0.22.0 as they rely on qiskit-terra > 0.16.0." ? Is anyone using something that old?

  • Verify "Note that reset is currently only enabled for quantum circuits (not pulse schedules)."

@Eric-Arellano
Copy link
Collaborator

Do we still need "Note: These features require qiskit > 0.22.0 as they rely on qiskit-terra > 0.16.0." ? Is anyone using something that old?

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.

@abbycross
Copy link
Collaborator Author

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.
Also, init_qubits flag if it is an option supported by Sampler

@abbycross abbycross changed the title Re-add and refactor Conditional Reset page New Native Gates page Jan 18, 2024
@beckykd
Copy link
Collaborator

beckykd commented Jan 19, 2024

init_qubits flag if it is an option supported by Sampler

Confirmed that Sampler and Estimator support init_qubits.


<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.)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Collaborator

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?

Copy link
Collaborator Author

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.)

Copy link
Collaborator Author

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 by rep_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.

Copy link
Collaborator Author

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?

Copy link
Collaborator

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)?

Copy link
Collaborator

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 it Sampler(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

Copy link
Collaborator

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>
docs/run/native-gates.mdx Outdated Show resolved Hide resolved
Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com>
docs/run/native-gates.mdx Outdated Show resolved Hide resolved
docs/run/native-gates.mdx Outdated Show resolved Hide resolved

## Next steps

<Admonition type="tip" title="Recommendations">
Copy link
Collaborator

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?

Copy link
Collaborator Author

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>
docs/run/native-gates.mdx Outdated Show resolved Hide resolved
docs/run/native-gates.mdx Outdated Show resolved Hide resolved
@abbycross abbycross added this pull request to the merge queue Jan 30, 2024
Merged via the queue into main with commit 75aaa31 Jan 30, 2024
4 checks passed
@abbycross abbycross deleted the ajc/conditional-reset branch January 30, 2024 21:27
frankharkins pushed a commit to frankharkins/documentation that referenced this pull request Jul 22, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[ NEW PAGE ] Native Gates and operations
5 participants