-
Notifications
You must be signed in to change notification settings - Fork 85
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
Update hello-world for 1.0 #1158
Conversation
Thanks for contributing to Qiskit documentation! Before your PR can be merged, it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. Thanks! 🙌 One or more of the the following people are requested to review this: |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Thank you! I've left some comments.
It sounds like you might be already, but make sure to run this from start to finish using EDIT: Actually I think there's a scheduled run on Monday morning so we can use the output from that.tox -- --write docs/start/hello-world.ipynb
to make sure the code outputs match what users will see.
docs/start/hello-world.ipynb
Outdated
"<Admonition type=\"note\" title=\"Important\">\n", | ||
"\n", | ||
"Often times you will find that jobs will sit in the queue for some time. If you'd like to quickly get results back for this small example circuit, use the code block provided below which utilizes the [`fake_provider`](../api/qiskit-ibm-runtime/fake_provider) submodule.\n", | ||
"\n", | ||
"</Admonition>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 22, | ||
"id": "057f38f1", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Use the following code instead if you want to run on a simulator:\n", | ||
"\n", | ||
"\n", | ||
"from qiskit_ibm_runtime.fake_provider import FakeAlmadenV2\n", | ||
"backend = FakeAlmadenV2()\n", | ||
"\n", | ||
"estimator = Estimator(backend)\n", | ||
"\n", | ||
"\n", | ||
"# Convert to an ISA circuit and layout-mapped observables.\n", | ||
"pm = generate_preset_pass_manager(backend=backend, optimization_level=1)\n", | ||
"isa_circuit = pm.run(qc)\n", | ||
"\n", | ||
"mapped_observables = [\n", | ||
" observable.apply_layout(isa_circuit.layout) for observable in observables\n", | ||
"]\n", | ||
"\n", | ||
"job = estimator.run([(isa_circuit, mapped_observables)])\n", | ||
"result = job.result()\n", | ||
"\n", |
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.
Thanks for providing full code for the simulator run! It might be cool to use tabs here, one for device run and the other for the simulator run. You can use the <Tab>
component across cells.
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 good idea yeah! I'll add that in.
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.
Actually in thinking about it, this would make the code cells unexecutable so CI wouldn't catch any problems and if a user downloads the notebook it would just be stored as some markdown and wouldn't be able to run it without modifying the notebook.
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 haven't tried it, but in recent discussions over converting tabs to notebooks, @frankharkins posted a workaround: #1143 (comment) - not sure if it would help out here?
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.
Except that in his output, there are no tabs :)
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.
Haha right.... nvm
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 tabs don't show in the rendered markdown (sorry), but they are there in the source and render on the website https://qiskit-docs-preview-pr-1160.1799mxdls7qz.us-south.codeengine.appdomain.cloud/verify/plot-quantum-states
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.
And yes I was imagining we'd wrap the code cells in the tab component
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.
Yes I see it in the preview!
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.
Do we have a higher-quality version of this image? If it was made in Figma, the author can export it as SVG.
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 it wasn't created in Figma, I could re-create it in Photoshop and export the SVG. That would make it translatable, too.
Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk>
Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk>
Decided to change the presentation of using the simulator in the example. It's instead contained within it's own admonition note. Also @frankharkins re:
I'm having trouble finding a high quality version of it, though I think instead @javabster has suggested to embed the "hello world" coding with qiskit video on the page once it's published. I think replacing it with the graphic would work well. |
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.
Looks good!
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> Co-authored-by: abbycross <across@us.ibm.com>
Closes Qiskit#699 Currently waiting for the job to finish in order to plot the last set of data. However, all the other content should be there and updated to support 1.0. --------- Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk> Co-authored-by: Rebecca Dimock <beckyd@us.ibm.com> Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com> Co-authored-by: abbycross <across@us.ibm.com>
Closes #699
Currently waiting for the job to finish in order to plot the last set of data. However, all the other content should be there and updated to support 1.0.