This change adds minimal working code examples to the API pages for each experiment,especially in characterizaion experiments. The minimal working code example is a code snippet which users can copy and paste to run the experiment.
Details and comments
This change solves the issue#1238 (See also the issue#1221).
In the API pages, the documentation for each experiment has been updated with its code example. Users are required to specify a backend in the code example. As a default, the backend is a simulator such as GenericBackendV2(num_qubits=27).
In some experiments,
CorrelatedReadoutErrorResonatorSpectroscopyCrossResonanceHamiltonian and
EchoedCrossResonanceHamiltonian,
the backend is an IBM Quantum real device due to the backend.defaults() dependence of the code example.
In these cases, the code example explicitly imports the module qiskit-ibm-provider in order to retrieve the job on IBM Quantum real devices.
Therefore, requirements-dev.txt has been updated to add the dependency on qiskit-ibm-provider for running tests and building documentation.
PR checklist (template)
[x] I have read the contributing guide CONTRIBUTING.md.
[ ] I have added the tests to cover my changes.
[x] I have updated the documentation accordingly.
[x] I have added a release note file using reno if this change needs to be documented in the release notes.
PR checklist (additional in CONTRIBUTING.md)
[x] The code follows the code style of the project and successfully passes the tests.
[x] The API documentation has been updated accordingly.
[x] You have updated the relevant documentation or written new docs. In case the PR needs
to be merged without delay (e.g. for a high priority fix), open an issue for updating
or adding the documentation later.
[] You've added tests that cover the changes you've made, if relevant.
[] If your change has an end user facing impact (new feature, deprecation, removal,
etc.), you've added or updated a reno release note for that change and tagged the PR
for the changelog.
[x] If your code requires a change to dependencies, you've updated the corresponding
requirements file: requirements.txt for core dependencies,
requirements-extras.txt for dependencies for optional features, and requirements-dev.txt
for dependencies required for running tests and building documentation.
Summary
This change adds minimal working code examples to the API pages for each experiment,especially in characterizaion experiments. The minimal working code example is a code snippet which users can copy and paste to run the experiment.
Details and comments
issue#1238
(See also theissue#1221
).GenericBackendV2(num_qubits=27)
.CorrelatedReadoutError
ResonatorSpectroscopy
CrossResonanceHamiltonian
andEchoedCrossResonanceHamiltonian
, the backend is an IBM Quantum real device due to thebackend.defaults()
dependence of the code example. In these cases, the code example explicitly imports the moduleqiskit-ibm-provider
in order to retrieve the job on IBM Quantum real devices. Therefore,requirements-dev.txt
has been updated to add the dependency onqiskit-ibm-provider
for running tests and building documentation.PR checklist (template)
CONTRIBUTING.md
.reno
if this change needs to be documented in the release notes.PR checklist (additional in CONTRIBUTING.md)
requirements.txt
for core dependencies,requirements-extras.txt
for dependencies for optional features, andrequirements-dev.txt
for dependencies required for running tests and building documentation.