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

Update hello-world for 1.0 #1158

Merged
merged 27 commits into from
Apr 23, 2024
Merged

Update hello-world for 1.0 #1158

merged 27 commits into from
Apr 23, 2024

Conversation

kaelynj
Copy link
Collaborator

@kaelynj kaelynj commented Apr 10, 2024

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.

@qiskit-bot
Copy link
Contributor

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:

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Member

@frankharkins frankharkins left a 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 tox -- --write docs/start/hello-world.ipynb to make sure the code outputs match what users will see. EDIT: Actually I think there's a scheduled run on Monday morning so we can use the output from that.

docs/start/hello-world.ipynb Outdated Show resolved Hide resolved
docs/start/hello-world.ipynb Outdated Show resolved Hide resolved
Comment on lines 266 to 299
"<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",
Copy link
Member

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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?

Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Haha right.... nvm

Copy link
Member

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

Copy link
Member

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

Copy link
Collaborator

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!

Copy link
Member

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.

Copy link
Collaborator

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.

kaelynj and others added 2 commits April 11, 2024 09:50
Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk>
Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk>
@kaelynj
Copy link
Collaborator Author

kaelynj commented Apr 11, 2024

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:

Do we have a higher-quality version of this image? If it was made in Figma, the author can export it as SVG.

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.

Copy link
Collaborator

@abbycross abbycross left a comment

Choose a reason for hiding this comment

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

Looks good!

beckykd and others added 3 commits April 23, 2024 16:10
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>
@beckykd beckykd added this pull request to the merge queue Apr 23, 2024
Merged via the queue into main with commit 7a49dba Apr 23, 2024
5 checks passed
@beckykd beckykd deleted the kjf/hello-world-1.0 branch April 23, 2024 21:34
frankharkins added a commit to frankharkins/documentation that referenced this pull request Jul 22, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Install instructions Hello World does not work with Fakebackend update hello world post-1.0
7 participants