Skip to content

Conversation

@nkanazawa1989
Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 commented Jul 28, 2021

Summary

This is an example of how to migrate to autodoc syntax.

What you need to do is

  • add :template: under autosummary directive
  • use custom section tag, e.g. # section: overview
  • write analysis options documentation in AnalysisClass._default_options method **
  • write experiment options documentation in ExperimentClass._default_experiment_options method **
  • (for curve analysis) use defpar syntax for fit parameter description

** Use Google style docstring. Documentation of arguments in the superclass is automatically extracted so you only need to write documentation for newly introduced argument in the class.

Tips for math

To write math equations, you need to avoid writing something like **n, e**(a+b), a*b, 3*x etc... Note that in the math directive you need to use standard latex syntax.

Details and comments

See example documentation for available syntax.
https://github.com/Qiskit/qiskit-experiments/blob/a8b0210f5a6eed2d13e5129e15e766b6a0e7fd2f/docs/_ext/custom_styles/example/example_experiment.py#L120-L170

Local build

For the first time

rm -rf docs/_build docs/stubs
tox -r -edocs

I added one package to the requirements-dev so you may need -r option to recreate the environment This will take some itme. If you have already renewed the environment after #116, -r is not necessary.

the interleaved gate error. See Ref. [1] for details.
See :class:`InterleavedRBAnalysis` documentation for additional
information on interleaved RB experiment analysis.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really want to remove this sentence? Maybe it can be helpful.

Copy link
Collaborator Author

@nkanazawa1989 nkanazawa1989 Jul 29, 2021

Choose a reason for hiding this comment

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

Do we need this? Because another dedicated section for analysis class reference is generated and other experiment class doesn't write this.

`arXiv:quant-ph/1203.4550 <https://arxiv.org/pdf/1203.4550>`_
Analysis Class
:class:`InterleavedRBAnalysis`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe it's good to refer to the corresponding analysis class

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's automatically generated.

- **lengths**: A list of RB sequences lengths.
- **num_samples**: Number of samples to generate for each sequence length.
- **interleaved_element**: The element to interleave,
given either as a group element or as an instruction/circuit
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why was this section removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's automatically generated.

@nkanazawa1989
Copy link
Collaborator Author

Thanks @yaelbh for the comments. I reverted some changes.

@coruscating coruscating added this to the Release 0.2 milestone Aug 2, 2021
@coruscating coruscating merged commit 32bbbb2 into qiskit-community:main Aug 3, 2021
paco-ri pushed a commit to paco-ri/qiskit-experiments that referenced this pull request Jul 11, 2022
* autodoc migration

* remove change

* revert changes

Co-authored-by: Helena Zhang <Helena.Zhang@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants