Commit Graph

781 Commits

Author SHA1 Message Date
Eric Arellano dedfc4159c Remove stale translations (#1040)
I was keeping these around to debug
https://github.com/Qiskit/documentation/issues/705, but the files are
resulting in issues because the docs are out of date. For example,
they're blocking us from removing unused images.

We can debug https://github.com/Qiskit/documentation/issues/705 by
reverting this commit when iterating locally.
2024-03-15 20:59:23 +00:00
Rebecca Dimock e75699974a Clarify that Sampler V2 does not support optimization_level (#1030)
closes #1027
2024-03-15 20:50:10 +00:00
Rebecca Dimock 203e991fef Fix ISA note (#1038)
Sampler V2 doesn't allow optimization level. Also, some instances still
mentioned skip_transpilation, which is not supported in V2.
2024-03-15 15:50:31 +00:00
Takashi Imamichi 6f16b1ff26 Fix a code about `get_bitstrings` (#1039)
The migration guide of qiskit 1.0 has some mistakes about SamplerV2
result.

- Method name: `get_bitstring` -> `get_bitstrings`
- This method returns a list of bitstrings not an ndarray.

Note: If you want to access the shape, you can do it by
`data_pub.meas.array.shape`.

---------

Co-authored-by: Toshinari Itoko <15028342+itoko@users.noreply.github.com>
2024-03-15 12:35:50 +00:00
Eric Arellano 2e4beb0995 Fix staging deploy from inlining gh-actions (#1036)
Fixes https://github.com/Qiskit/documentation/pull/1033. I improbably
tried simplifying this code but that was a mistake. This restores the
original code from
https://github.com/Qiskit/gh-actions/blob/main/.github/workflows/code-engine-preview.yml.
2024-03-14 20:02:23 +00:00
Kaelyn Ferris 58be416c03 Add API entries to allowed urls (#1021)
Closes #1014 

In the interest of readability, the list of allowed urls includes pages
that don't exist. There is a small risk of a false positive if there are
any new pages that get added to the api docs of the same name which
should actually be checked against their toc instead of ignored.
2024-03-14 19:04:43 +00:00
Eric Arellano ddb50b80b9 Inline `qiskit/gh-actions` (#1033)
This is the only repository still using
https://github.com/Qiskit/gh-actions, so we can inline its logic and
then archive the repository. That allows us to make the workflow file
less generic and remove some indirection. It simplifies the overall
infrastructure.

I think PR previews might have been broken for a while, but I want to
address this in a follow up.
https://github.com/Qiskit/documentation/issues/1034

---------

Co-authored-by: Va Barbosa <va@us.ibm.com>
2024-03-14 18:14:13 +00:00
Jake Lishman 77d3c715e2 Complete OpenQASM 2 interoperation guide (#1029)
This finishes off the guide to interoperation with OpenQASM 2, including
more tutorial-like versions of how to work with custom quantum and
classical instructions, specific instructions on how to import programs
created by the (to-be-fixed) exporter, and how to export programs to
OpenQASM 2.

Close #240.

---------

Co-authored-by: abbycross <across@us.ibm.com>
2024-03-14 17:10:03 +00:00
Rebecca Dimock 4d0c393773 Change V2 Estimator to Estimator V2 (#1028)
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-03-14 14:33:47 +00:00
Rebecca Dimock dcdde8aed1 Describe broadcasting rules (#983)
closes #981

---------

Co-authored-by: ABBY CROSS <across@us.ibm.com>
Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
2024-03-13 19:27:00 +00:00
Eric Arellano e1a7e6abfb Rename API files to use MDX extension (#1013)
API docs use Markdown components, and are about to use a lot more of
them with the new API components like
https://github.com/Qiskit/documentation/issues/1008. It's confusing to
pretend they're MD files.

This PR makes things consistent, which allows us to simplify some of our
scripts to only deal with MDX and IPYNB extensions.

The API docs were manually changed with this Bash snippet:

```bash
for file in docs/api/**/*.md; do
  if [ -f "$file" ]; then
    mv "$file" "${file%.md}.mdx"
  fi
done
```
2024-03-13 09:03:29 -04:00
abbycross cac6217370 Add info for Cloud users to access support (#1017)
Requested by @fvarchon to clarify for PayGO users how to contact
support.
2024-03-12 20:30:31 +00:00
Kevin J. Sung e45ce70dbc Convert common-parameters.mdx to Jupyter notebook (#1015)
Part of https://github.com/Qiskit/documentation/issues/169

---------

Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk>
Co-authored-by: Abby Mitchell <23662430+javabster@users.noreply.github.com>
Co-authored-by: nick bronn <ntbronn@us.ibm.com>
2024-03-12 12:21:59 -04:00
Kevin J. Sung d78489f971 Rewrite "optimization level" documentation (#1007)
Part of #885 

- Convert from MDX to Jupyter notebook
- Rewrite introduction to be more concise
- Use preset pass manager instead of `transpile`
- Use Eagle device and ECR gates instead of retired Falcon device and CX
gates

---------

Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk>
Co-authored-by: Abby Mitchell <23662430+javabster@users.noreply.github.com>
Co-authored-by: nick bronn <ntbronn@us.ibm.com>
2024-03-12 14:58:02 +00:00
abbycross 634f528b59 add Q-CTRL exception to ISA circuit notifications (#1009)
Adding this text wherever the notification about ISA circuits appears:



```

> **Exception**: When you initialize the Qiskit Runtime Service with the Q-CTRL channel strategy (example below), abstract circuits are still supported.
> ``` python
> service = QiskitRuntimeService(channel="ibm_cloud", channel_strategy="q-ctrl")
> ```
> 

```

Files where the notification appears:

- [x] docs/run/primitives-examples.mdx
- [x] docs/run/primitives-get-started.mdx
- [x] docs/run/configure-error-mitigation.mdx
- [x] docs/start/hello-world.ipynb
- [x] docs/run/estimate-job-run-time.mdx
- [x] docs/run/advanced-runtime-options.mdx
- [x] docs/run/configure-runtime-compilation.mdx
- [x] docs/run/primitives.mdx
2024-03-12 14:21:01 +00:00
Kevin J. Sung 6949c628be add script to remove stale images (#1016)
Fixes #194
2024-03-12 14:13:54 +00:00
Rebecca Dimock 0089cddebf Fix hello world (#1010)
shots were moved
2024-03-11 21:56:59 +00:00
Rebecca Dimock 6bb92f596b Remove extra tab (#1011) 2024-03-11 21:51:23 +00:00
Rebecca Dimock aa681ef41e restructure image (#992)
I thought it would look better this way
2024-03-11 19:45:49 +00:00
Eric Arellano de696f48b4 Future proof pages render check for new Patterns folders (#1012)
Closes https://github.com/Qiskit/documentation/issues/998. Before this
PR, new folders like `docs/analyze` would not be included in `npm run
check:pages-render -- --non-api`.
2024-03-11 19:01:12 +00:00
abbycross bb7ce62bb5 Call out Qiskit 1.0 on start/index pg (#764)
UPDATE: sync publishing this with blogs/announcements/banners

Closes #700 

Reminder: Blog link added here is a placeholder -- to be replaced with
whatever new blog comes out!

---------

Co-authored-by: Abby Mitchell <23662430+javabster@users.noreply.github.com>
2024-03-11 17:22:59 +00:00
Arnau Casau 131cbec150 Split `generateToc` into helper functions (#1005)
This PR refactors the `generateToc.ts` script splitting out the
`generateToc` function into some helper functions. It also removes the
if condition to check if the length of the modules is greater than 0
because it's not necessary.

The PR added a test to check the latter, and it was tested regenerating
every qiskit and provider versions.
2024-03-11 15:27:51 +00:00
Arnau Casau 5efb0176d2 Refactor `mergeClassMembers` unified plugin (#1006)
Small PR to add some missing types to variables and merge two unified
plugins into one. Both unified plugins were using different phases of
the whole process (parse, run, and stringify).
2024-03-11 14:06:05 +00:00
Arnau Casau 7797e9b550 Fix `processHtml.ts` metadata (#1004)
Reverts the order changes when we set the metadata introduced by #954.
It turned out that setting the metadata outside the `map()` adds some
duplicated `<span>` tags for qiskit legacy versions. This PR moves the
code back to where it originally was.
2024-03-11 14:00:59 +00:00
Kevin J. Sung cad1de9699 Fix tabs and improve prose of primitives-get-started (#999)
- Removes unnecessary tabs
- Reword some sentences for clarity
- Move V2 explanatory prose outside of tabs so that it's easier to see
the difference between the tabs when switching between them.
2024-03-11 13:41:49 +00:00
Arnau Casau 5bfe0a8ebd Add last sections to `htmlToMd.test.ts` (#1003)
Closes #845

The PR finishes classifying all tests into sections and removes
unnecessary HTML code from `handle inlined methods and attributes`
2024-03-11 12:46:09 +00:00
abbycross 02176a11b9 Update SamplerV2 example to use a list of circuits (#1002)
Closes #1001
2024-03-08 21:56:10 +00:00
abbycross 6f03749a63 update the blog link on the start/index page (#1000)
Point [here](https://www.ibm.com/quantum/blog?topic=qiskit) instead of
to Medium.
2024-03-08 21:52:27 +00:00
Eric Arellano dbbc1fa0fb Generate Qiskit 0.46.1 and 1.0.2 (#995) 2024-03-08 14:52:34 -05:00
Arnau Casau 8485f89434 Create more sections for `htmlToMd.test.ts` and merge tests (#993)
### Summary

Part of  #845

This PR creates more sections for the `htmlToMd.test.ts` and merges some
tests.

### Changes

- Merged `parse inline attributes section` and `convert method and
attributes to titles and handle inlined methods` into `handle inlined
methods and attributes`
- Merged `handle <` and `handle {` into `handle special characters: <
and {`.
- Created three new sections to classify some tests:
  1. Transform methods and attributes
  2. transform description HTML tags
  3. transform admonitions
2024-03-08 18:06:07 +00:00
Kaelyn Ferris 24f709eb48 Check for orphan pages (#951)
Close #388 

I ended up not using `zxMain` and set a few different options for
choosing which api docs to look through (similar to
`checkPagesRender.ts`). @Eric-Arellano Let me know if there's anything
that needs fixed or should be refactored!

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-03-08 17:32:34 +00:00
abbycross efed5d9523 updates to fair-share file (#987)
updated language based on recent clarifications

CC: @marcolincs
2024-03-08 15:49:55 +00:00
Arnau Casau 71169720d6 Refactor `htmlToMd.test.ts` (#989)
### Summary

Part of  #845

This PR refactors the `htmlToMd.test.ts` test file.

### Changes

- Three tests were removed
1. `merge contiguous emphasis` was merged with `remove spaces from
emphasis boundaries`. They were using the same HTML but only adding
spaces
2. `convert method and attributes to titles`. This test was incomplete
and it's implicitly checked at `convert inline methods`.
3. `convert class method with a problematic output`. The test wasn't
checking anything related to the script behavior. The problematic output
is due to a bad HTML that should be fixed in the original repo.

- Input HTML trimmed for some tests. We were using long inputs to test
certain behaviors that don't need it. For example, we were testing the
transformation of a table with 11 entries when the same test could use 2
or 3.

- Some tests have been organized into sections to easily find them
scanning the file. These sections can be found at the end of the test
file leaving the uncategorized tests at the beginning.

- We were using two helper functions for the tests named `toMd` and
`toMdWithMeta` with the only difference that in the first one, we
returned the markdown attribute of the transformation instead of the
whole object. I merged these two functions with an extra argument to
specify when we need to return the metadata.
2024-03-08 14:03:59 +00:00
Rebecca Dimock 23cd443d39 add runtimejobv2 link (#982)
Merge after API docs are updated.
2024-03-07 20:29:29 +00:00
Arnau Casau d0d60d74e1 Update api-html-artifacts.json (#988)
This PR updates the Box artifacts links for runtime to the ones used on
https://github.com/Qiskit/documentation/pull/986
2024-03-07 20:06:30 +00:00
abbycross 28860d3eb1 Post-release cleanup: Typos, spelling dictionary, and "the" (#985)
To verify all instances were properly changed, I used `rg ' SDK' -g
'!/api'` to view each instance in its context
2024-03-07 19:27:52 +00:00
Arnau Casau 28f25f7a31 Generate qiskit-ibm-runtime 0.21.0 (#986)
This PR regenerates qiskit-ibm-runtime 0.22.0, 0.21.1, and makes 0.20.0
historical

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-03-07 18:20:18 +00:00
Kevin J. Sung f1017834db Rename "Use the transpile function" section to "Configuring transpilation" and update defaults and configuration options docs (#970)
Part of #885

---------

Co-authored-by: abbycross <across@us.ibm.com>
2024-03-06 21:11:50 +00:00
Eric Arellano 53b0ee6c5e Work around Reno release notes issue with Runtime (#980)
Work around https://github.com/Qiskit/documentation/issues/978.
2024-03-06 18:41:54 +00:00
abbycross 3ba662e228 Add SDK to clarify Qiskit where applicable (#976)
For pages mentioning specifically the Qiskit SDK, update the title and
first instance of the term "Qiskit" to be "Qiskit SDK".

---------

Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk>
2024-03-06 17:44:43 +00:00
Kevin J. Sung 22c0b19992 update "Transpile with pass managers" to show calling the run method (#969) 2024-03-06 17:11:52 +00:00
Eric Arellano c55bf108a4 Call Qiskit API docs "Qiskit SDK" (#975)
This is to better clarify the word "Qiskit". This changes what shows up
in the left ToC.

Change was generated with `rg '"title": "Qiskit",' -l | xargs sd
'"title": "Qiskit",' '"title": "Qiskit SDK",'`
2024-03-06 16:46:01 +00:00
Rebecca Dimock 8106385914 Updates for V2 primitives (#711)
- [x] Remove various transpilation options for v2 primitives
- [x] Update code examples
- [x] Describe new features
- [x] Add migration guide to TOC and index
- [x] Check for outdated information
- [x] Check Cloud for outdated information

---------

Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>
2024-03-06 15:50:20 +00:00
abbycross ce8b56b8cd Add h2 to Sessions intro page to improve formatting (#968)
To improve the squished feel of two admonition boxes sandwiching a small
paragraph, adding a header to the paragraph to space out the page and
make easier to read.
2024-03-05 21:25:45 +00:00
Eric Arellano 12545a380f Add integration test of qiskit-sphinx-theme (#960)
Closes https://github.com/Qiskit/documentation/issues/715.

This is useful generally for better testing of our conversion pipeline,
as it's our only test that tests the entire conversion pipeline.

It also is useful to allow us to easily compare Sphinx's behavior vs.
our app's behavior, like the PDFs I uploaded in
https://github.com/Qiskit/documentation/issues/947.

--

I didn't document this in the README because we don't talk about testing
in the README currently. Our README is already quite long, so I was
hesitant to add to it since most technical writers don't care about
testing, unlike Jupyter notebook testing that we do document.

Instead, I documented the test file itself. I'm not sure if this is
clear enough.

---------

Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
2024-03-05 20:27:29 +00:00
Arnau Casau 4895682986 Improve Qiskit release notes ToC settings (#965)
Closes #941

This PR sets the `in_page_toc_max_heading_level` to 4 for legacy
versions of qiskit (< 0.45) and to 3 for 0.45+ versions. It also changes
the description of all the release notes to match the one we are using
in the API generation script: `Changes made in Qiskit {version}`

Given that we don't regenerate legacy release notes using the script, we
can set the `in_page_toc_max_heading_level` to 3 for all qiskit versions
and 2 for the rest of the APIs.

The changes to the latest release note were done by removing the file
and regenerating the 1.0.1 version. The rest of the files we manually
updated.
2024-03-05 18:21:18 +00:00
Arnau Casau f083023235 Fix incorrect removal of GitHub source links by `prepareGitHubLink` (#964)
The `prepareGitHubLink` function calls `remove() `on the closest `<a>`.
This can be a problem when used before the following early return:
```ts
if (child.name !== "dt" || !apiType) {
    return `<div>${$child.html()}</div>`;
}
```
Calling the function in a case where we should enter into the early
return leads us to remove the link for a child element when we
shouldn't. To fix this, this PR moves the `prepareGitHubLink` call to be
performed inside the `processMember` function.

The PR also regenerates all versions of qiskit, runtime, and provider to
add some links we were incorrectly removing.
2024-03-05 18:18:29 +00:00
Arnau Casau 12baecdbab Fix sequence of operations in `conversionPipeline.ts` (#966)
This PR fixes the order of the operations we are doing in
`conversionPipeline.ts`. The important change is to call
`maybeUpdateReleaseNotesFolder` before `writeTocFile`. This is because,
in the former, we call to `addNewReleaseNotes`, which modifies the
`_toc.json` file that we write in the latter.
2024-03-05 18:18:07 +00:00
Eric Arellano f3fa4ead11 Regenerate Runtime and Qiskit dev docs (#963)
Note that this also brings in script improvements we've made:

* Precise source code links
* Modules set min heading level to 2
2024-03-05 16:47:01 +00:00
Arnau Casau 6b885e8961 Split `processMembersAndSetMeta` function into helper functions (#954)
## Summary

This PR splits the `processMembersAndSetMeta` function from the
`processHtml.ts` script into several helper functions to process each
`apiType`.

## Changes

These changes are done to the `map()` used to create the `replacement`
variable (line 291). The map used to have all the logic to process each
child depending on its `apiType`. Now the map starts by early returning
in the case we are not processing a `<dt>` tag and calling to a new
helper function to process an individual child.

Before the `map()` was setting the metadata, the refactor moved the code
outside of it, given that the metadata doesn't depend on the elements
iterated.

The new helper function is called `processMember` and starts by
preparing the GitHub source link, removing the `apiType` from the
`em.property` selector, and calling other new helper functions to
process each of our available `apiType`.

All the process `apiType` functions have the same code as before but
`processAttribute`, which has been refactored to find the name, type,
and default value of an attribute in a more concise way
2024-03-05 16:16:55 +00:00