Added a new menu `Qiskit Runtime through REST APIs` under the `docs/run`
section to cater to the API-only IBM Quantum partners.
**Menu structure (all using REST APIs only):**
- Initialize account and setup tokens
- Qiskit Transpiler Service
- Working with Sampler Primitive
- Working with Estimator Primitive
- Run jobs in different Execution modes
@pacomf @johannesgreiner @Bagherpoor
---------
Co-authored-by: ABBY CROSS <across@us.ibm.com>
Part of https://github.com/Qiskit/documentation/issues/1043.
The new `scripts/pr-previews/builder.py` file builds a static copy of
the site using the Git branch's current copy of the docs, then writes
the static files to the folder specified, like
`scripts/pr-previews/builder.py pr-reviews/90`. The static site can then
be served with a simple server like `python3 -m http.server` or GitHub
Pages.
The script takes 57 seconds on my MacBook Pro.
## Docker auth
The script expects that the Docker image for the static builder can be
accessed via `docker pull`, i.e. that you already have authentication
and everything. For now, I'm using a local copy of the Docker image.
Once the new image is published, we'll switch to the Container Registry
copy. Setting up Container Registry will be handled in the GitHub
Action, rather than this script.
## GitHub pages in a follow up
I wanted to keep the GitHub Pages logic separate. This script only
worries about how to build the static website to a given folder. Another
script will deal with GitHub Pages.
## Skips building API docs
The API docs are huge and take substantial time to build. For example, a
trace shows that Runtime release notes take 10s (although that is not
considering the build's parallelism).
The content writers agreed they don't look at API docs in PR previews,
so they'd rather have faster PR previews than have the API docs loaded
in them.
Before:
```
304K ├── pulse.ipynb │ ███ │ 4%
496K ├── common-parameters.ipynb │ █████ │ 6%
564K ├── dynamical-decoupling-pass-manager.ipynb │ ██████ │ 7%
972K ├── represent-quantum-computers.ipynb │ █████████ │ 12%
3.1M ├── custom-backend.ipynb │ █████████████████████████████ │ 40%
7.7M ┌─┴ guides │█████████████████████████████████████████████████████████████████████████ │ 100%
```
After:
```
304K ├── pulse.ipynb │ █████ │ 6%
372K ├── custom-backend.ipynb │ ██████ │ 7%
496K ├── common-parameters.ipynb │ ████████ │ 10%
564K ├── dynamical-decoupling-pass-manager.ipynb │ █████████ │ 11%
972K ├── represent-quantum-computers.ipynb │ ██████████████ │ 19%
5.0M ┌─┴ guides │█████████████████████████████████████████████████████████████████████████ │ 100%
```
That is, `custom-backend.ipynb` used to be 3.1MB and made up 40% of the
guides/ folder size! This size has downsides:
* Makes the page slower for users to download, especially on slow
Internet
* Slows down our app's build. This file was causing the new PR previews
to time out
This is addressed by:
* Using PNGs in this file rather than PNGs, as they end up being much
smaller and the detail of the SVG isn't critical in this file
* Removing the last diagram, which is not necessary according to Kaelyn
and Kevin
* Making the second-to-last diagram much smaller. Kaelyn and Kevin
explained that the "vibe" of the image is more important than the actual
details - people won't read the diagram closely
We've found some more problems in the QAOA notebook after second review.
You may find it easier to review this commit-wise.
* Bit embarassed about this, but there were still two attached images in
the QAOA notebook, which are not supported by the learning platform. The
file no longer contains the string "attach" so there shouldn't be any
more.
* The `<details>` tag appeared to work, but on closer inspection it
turns out it was mangling the markdown inside the tag. I've replaced it
with a blockquote to visually separate it from the rest of the page.
* Some other minor formatting I noticed when reviewing the page.
A couple of issues slipped past in #1668.
- Minor formatting fix which was breaking math
- Removed image attachments as they aren't handled by the learning
platform. I saved the first image to file, I also had to reduce its
resolution by 50%. The other attachment was literally just text so I
transcribed it into a code block as an accessibility best practice.
Fixes a number of formatting problems in the new tutorial that became
apparent after previewing on staging. I've uploaded the this fixed
notebook to staging. To view, go to
`<staging-url>/tutorial/quantum-approximate-optimization-algorithm`.
## Changes
* **Wrap math in `$$` and remove `align`:** The learning platform
requires `$$` to recognize math. I believe Jupyter notebooks are more
forgiving which is why this probably didn't cause any problems in
review. I also removed the `align` environment because it's for aligning
lines of equations and we only have one line at a time.
* **Removed HTML:** The learning platform doesn't support HTML, it
either gets stripped or escaped. I've replaced any HTML with the closest
standard markdown.
* **Replaced top-level headings:** All top-level headings are stripped
by the learning platform and replaced with the title from the CMS. In
general, it's best practice to only have one top-level heading anyway.
* Ran linter on the notebook.
The requirements for the learning uploader have changed since it was
first created.
It was originally intended to be used locally by writers to quickly push
content to the platform. I wrote it in Python so writers would not need
to install node, and using string manipulations to interact with the
REST API was good enough for just uploading the zip and linking the new
file. It also included functionality for a writer to log into the
database through a CLI.
Now, the uploader is only used in CI, so we don't care about logging in
or sticking to Python, and we want to be able to do more complex
manipulations such as adding new lessons and changing metadata. For this
reason, this PR rewrites the uploader using the official [Directus
SDK](https://docs.directus.io/guides/sdk/), which makes interacting with
the API a lot easier.
---------
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
Co-authored-by: Abby Mitchell <23662430+javabster@users.noreply.github.com>
Adds a new tutorial for QAOA with code for running experiment at utility
scale. All dependencies from Application modules are removed
---------
Co-authored-by: ABBY CROSS <across@us.ibm.com>
Co-authored-by: Kaelyn Ferris <43348706+kaelynj@users.noreply.github.com>
Text from the hardware team:
HeronR2:
This is a revision of our original Heron processor. The chip has been
redesigned to now include 156 qubits in a heavy-hexagonal lattice. While
continuing to make use of the innovations of the original Heron systems,
it also introduces a new TLS mitigation feature that controls the TLS
environment of the chip, thereby improving coherence and stability
across the whole chip.
---------
Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com>
We'll update the redirect rules in closed source.
The page content will be updated in a follow up. For now, we need to get
the URLs and left ToC right to unblock the migration.
---------
Co-authored-by: Abby Mitchell <23662430+javabster@users.noreply.github.com>
This PR adds the new `guides/` folder with all the new docs, updates the
qiskit bot config, and removes the old folders `start/`, `build/`,
`transpiler/`, `verify/`, and `run/`
Commands used:
```bash
./scripts/patterns-reorg/update_internal_links.py
./scripts/patterns-reorg/update_qiskit_bot.py
./scripts/patterns-reorg/main.py --delete-existing
npm run fmt
```
Prep for https://github.com/Qiskit/documentation/pull/1499.
* `/configure-runtime-compilation` will become
`/configure-error-suppression`.
* `/advanced-runtime-options` is being deleted and replaced with
`/runtime-options-overview`, which isn't necessarily the same content.
Still, it costs us nothing to do a redirect; it avoids a 404 for users
and keeps our SEO we've built up for the page.
I didn't update the page titles yet, which will be done in
https://github.com/Qiskit/documentation/pull/1499. We only need to get
the URLs right here because those are hard to change.
Part of #154
This PR, following the idea of this
[comment](https://github.com/Qiskit/documentation/issues/154#issuecomment-2104751884),
moves all the images in the folders `start`, `build`, `transpile`,
`verify`, and `run` to a new folder called `guides`, updating all the
docs to point to that new folder.
To change the links, I used the following script that updates all but 3
links that are missed by the regex. I changed them manually.
<details>
<summary>Script</summary>
```python
from __future__ import annotations
import re
import glob
from pathlib import Path
from main import OLD_FOLDERS
def update_link(markdown: str, image_folder: str, link: str) -> str:
new_link = link.replace(f"/images/{image_folder}/", "/images/guides/")
return markdown.replace(link, new_link)
def main() -> None:
inline_link_re = re.compile(r"\!\[([^\]]+)\]\(([^)]+)\)")
for folder in [*OLD_FOLDERS, "api/migration-guides"]:
image_folder = folder if folder != "api/migration-guides" else "run"
for file_path in glob.glob(f"docs/{folder}/*"):
file = Path(file_path)
markdown = file.read_text()
new_markdown = re.sub(
inline_link_re,
lambda m: update_link(m[0], image_folder, m[2]),
markdown,
)
if markdown != new_markdown:
file.write_text(new_markdown)
if __name__ == "__main__":
main()
```
</details>
Part of https://github.com/Qiskit/documentation/issues/1043. Code Engine
is shut down tomorrow, so we need to turn off previews for now.
We're still working on what the replacement is. Once that's ready, we'll
revive whichever of these files are relevant.
The PR updates the `scripts/patterns-reorg/redirects.json` file to a
more convenient format that aligns better with our middleware. Having
the `/` at the beginning of the old paths and the `/guides/` prefix in
the new paths will allow us to have a more generic redirect file that
could be used in the future for different URLs than patterns, and it
will help us to set the redirects with a simpler logic.
e.g., `url.pathname = REDIRECTS[url.pathname]`
The PR also adds a missing redirect for `/start/latest-updates`.
We removed the remote refresh mechanism from the previews, so port 5001
is no longer relevant.
We also can now use the Dockerhub image for both `./start` and IBM Code
Engine PR previews, so we can be consistent and stop using the IBM
Container Registry version. That simplifies our infra.
Adds a latest updates page with some initial content. Closes#1301.
I've prioritised news that requires user action (i.e. deprecations), but
open to other ideas too.
Points from a recent meeting:
- We will want product owners to write a release summary for each
release - and specify that the url out to the release notes should
specify the version (this is mentioned in the Docs overview and
publishing processes page)
- Highlight product blogs, product announcements, and latest versions of
each API ref release
- Duplicate "what's new in the docs" from the announcements
---------
Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
Co-authored-by: ABBY CROSS <across@us.ibm.com>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Part of https://github.com/Qiskit/documentation/issues/1534
This PR fixes the incomplete sentence for the
generate_preset_pass_manager method for the historical versions of
qiskit 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 1.0,
and 1.1.
This PR bumps the `qiskit_ibm_runtime` version to the most recent, and
updates our code examples to work with that version.
---------
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>