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

Add QVM pages and mentions in other pages #5794

Merged
merged 16 commits into from
Jul 19, 2022

Conversation

augustehirth
Copy link
Collaborator

@augustehirth augustehirth commented Jul 18, 2022

New pages and supporting changes documenting the use of a quantum virtual machine in cirq.
Six new pages:

  • Quantum Virtual Machine - Overview
  • QVM Creation Template - Code blocks to copy paste if you just want to use it
  • QVM Basic Example - Code that steps through how to use a QVM with explanations, and preparing a device-ready circuit
  • QVM Stabilizer Example - Using the QVM with a much larger circuit
  • Virtual Engine Interface - Explanation of the code virtualized Engine interface the QVM uses
  • Qubit picking - How to visualize available calibration data to inform qubit selection

Plus mentions in other related and top-level pages to mention the QVM and how you might use it.

@augustehirth augustehirth requested review from a team, vtomole and cduck as code owners July 18, 2022 16:15
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@augustehirth augustehirth requested a review from maffoo July 18, 2022 16:15
@CirqBot CirqBot added the size: XL lines changed >1000 label Jul 18, 2022
@95-martin-orion
Copy link
Collaborator

Initially reviewed via external channels.

@95-martin-orion
Copy link
Collaborator

@augustehirth, the failing notebook tests are due to reliance on unreleased features. Our options are either to (a) wait until 1.0 releases, then re-run the checks, or (b) follow the dev guidance for prerelease notebooks for now, then update after 1.0 comes out.

Given how close 1.0 is, I'm in favor of (a).

Copy link
Collaborator

@dstrain115 dstrain115 left a comment

Choose a reason for hiding this comment

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

Some minor nits. Most I marked as Optional. Preemptively approving, since I probably won't have time for a second pass.

docs/hardware/qubit_picking.ipynb Outdated Show resolved Hide resolved
docs/hardware/qubit_picking.ipynb Outdated Show resolved Hide resolved
docs/hardware/qubit_picking.ipynb Outdated Show resolved Hide resolved
docs/hardware/qubit_picking.ipynb Outdated Show resolved Hide resolved
docs/simulate/_index.yaml Outdated Show resolved Hide resolved
docs/simulate/qvm_basic_example.ipynb Outdated Show resolved Hide resolved
docs/simulate/qvm_basic_example.ipynb Outdated Show resolved Hide resolved
docs/simulate/qvm_basic_example.ipynb Outdated Show resolved Hide resolved
docs/simulate/qvm_basic_example.ipynb Outdated Show resolved Hide resolved
docs/simulate/qvm_basic_example.ipynb Outdated Show resolved Hide resolved
@95-martin-orion
Copy link
Collaborator

Okay, there's a bit of a catch-22 here:

  • The latest version of qsim is not compatible with the Cirq prerelease.
  • Updating qsim to be compatible with the Cirq prerelease breaks compatibility with Cirq v0.15, which breaks the qsim tests, which blocks the qsim update PR.

We can either (a) do a break-glass change of qsim to force Cirq 1.0 compatibility before the release, or (b) wait for the release and bump qsim then. Either way, this PR is blocked on the qsim update unless we do a break-glass submit of this PR.

@95-martin-orion
Copy link
Collaborator

Discussed offline: holding this PR for post-1.0 release, where qsim can be updated to match.

@95-martin-orion
Copy link
Collaborator

95-martin-orion commented Jul 18, 2022

Enqueued behind quantumlib/qsim#555 (and quantumlib/qsim#557, to release the previous PR).

@augustehirth
Copy link
Collaborator Author

Waiting on qsimcirq pypi update

@augustehirth augustehirth added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 19, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 19, 2022
@CirqBot
Copy link
Collaborator

CirqBot commented Jul 19, 2022

Automerge cancelled: A status check is failing.

@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jul 19, 2022
@augustehirth augustehirth added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 19, 2022
@CirqBot
Copy link
Collaborator

CirqBot commented Jul 19, 2022

Automerge cancelled: A status check is failing.

@CirqBot CirqBot removed the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 19, 2022
@augustehirth augustehirth added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 19, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 19, 2022
@CirqBot
Copy link
Collaborator

CirqBot commented Jul 19, 2022

Automerge cancelled: A status check is failing.

@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jul 19, 2022
"outputs": [],
"source": [
"# create your device ready circuit here!\n",
"your_circuit_name = cirq.Circuit()"
Copy link
Collaborator

Choose a reason for hiding this comment

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

You probably want to add a measurement here.

"\n",
"reps = 3000\n",
"start = time.time()\n",
"results = sim_engine.get_sampler(processor_id).run(circuit, repetitions=reps)\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

We either need to comment this out, add output for it, or add a measurement (ideally to a qubit both on weber and rainbow) in the circuit (see above).

Comment on lines +198 to +202
"circuit = your_circuit_name # @param\n",
"\n",
"reps = 3000\n",
"start = time.time()\n",
"results = sim_engine.get_sampler(processor_id).run(circuit, repetitions=reps)\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is causing a notebook test error - a circuit with no measurements can't be passed to Simulator.run.

@augustehirth
Copy link
Collaborator Author

QVM builder code is template code that isn't supposed to be run for outputs by the pipeline. I've added it to the skip notebooks lists. @dstrain115 @95-martin-orion is this a satisfactory solution?

@95-martin-orion
Copy link
Collaborator

QVM builder code is template code that isn't supposed to be run for outputs by the pipeline. I've added it to the skip notebooks lists. @dstrain115 @95-martin-orion is this a satisfactory solution?

That seems reasonable to me.

@augustehirth
Copy link
Collaborator Author

Upon further reflection I've made both changes (added a measure and added to the skip files), so that the output isn't generated, and the user can run the page end to end without changes if they want.

@augustehirth augustehirth merged commit 4453167 into quantumlib:master Jul 19, 2022
@augustehirth augustehirth deleted the qvm_rebase branch July 19, 2022 01:11
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
* Add QVM pages and mentions in other pages

* Pre fix

* Pre fix 2

* pre fix 3

* Pre fix 4

* Test fix and feedback

* Pre fix 5

* Pre revert

* Don't run qvm_builder_code

* Don't run qvm_builder_code 2.0

* Make qvm_builder_code USER runnable
@augustehirth augustehirth restored the qvm_rebase branch August 25, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: XL lines changed >1000
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants