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

Add release notes for V2 of the primitives #11589

Merged
merged 32 commits into from
Feb 15, 2024

Conversation

ihincks
Copy link
Contributor

@ihincks ihincks commented Jan 17, 2024

Summary

Release notes for all of the new features added in V2 of the primitives.

Details and comments

@ihincks ihincks added the mod: primitives Related to the Primitives module label Jan 17, 2024
@ihincks ihincks added this to the 1.0.0 milestone Jan 17, 2024
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core
  • @ajavadia
  • @ikkoham
  • @levbishop
  • @t-imamichi

@mtreinish mtreinish added the Changelog: None Do not include in changelog label Jan 17, 2024
@coveralls
Copy link

coveralls commented Jan 17, 2024

Pull Request Test Coverage Report for Build 7916552177

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 11 (100.0%) changed or added relevant lines in 4 files are covered.
  • 182 unchanged lines in 23 files lost coverage.
  • Overall coverage increased (+0.02%) to 89.216%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 93.81%
qiskit/synthesis/clifford/clifford_decompose_ag.py 1 98.72%
qiskit/synthesis/clifford/clifford_decompose_full.py 1 87.5%
qiskit/synthesis/linear/cnot_synth.py 1 98.0%
qiskit/synthesis/clifford/clifford_decompose_greedy.py 2 98.88%
qiskit/synthesis/linear/linear_depth_lnn.py 2 98.33%
qiskit/synthesis/stabilizer/stabilizer_decompose.py 2 96.83%
qiskit/synthesis/unitary/qsd.py 2 97.52%
qiskit/synthesis/clifford/clifford_decompose_bm.py 3 97.83%
qiskit/synthesis/cnotdihedral/cnotdihedral_decompose_general.py 3 96.05%
Totals Coverage Status
Change from base Build 7893751411: 0.02%
Covered Lines: 58854
Relevant Lines: 65968

💛 - Coveralls

chriseclectic
chriseclectic previously approved these changes Jan 17, 2024
Copy link
Member

@chriseclectic chriseclectic left a comment

Choose a reason for hiding this comment

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

Looks ok, though I wonder if we want to separate bullets for the release note of introducing the new API, and adding the new reference implementations of Sampler and Estimator that probably deserve their own reno including something like the code snippet you added

@ihincks
Copy link
Contributor Author

ihincks commented Jan 17, 2024

Looks ok, though I wonder if we want to separate bullets for the release note of introducing the new API, and adding the new reference implementations of Sampler and Estimator that probably deserve their own reno including something like the code snippet you added

Yeah I wasn't sure of style conventions or expectations of a reno for such a big thing should be, so I decided just to open something as a placeholder and wait for the reviews.

@ihincks
Copy link
Contributor Author

ihincks commented Jan 19, 2024

I split it into three files: one for the new abstract API and container types, and one for each of the new implementations. I made sure that all of the code runs.

@mtreinish
Copy link
Member

You don't need to use separate files. You can have multiple release notes in a single file, you just put multiple yaml list entries in the file with each note. For example https://github.com/Qiskit/qiskit/blob/main/releasenotes/notes/add-synth-circuit-from-stabilizer-list-4cf9cfa01bbc7ddf.yaml has 2 feature release notes in one file. You can also have multiple categories of notes in a single file too.

@ihincks
Copy link
Contributor Author

ihincks commented Jan 19, 2024

Just did something dumb with a push. Will fix.

@ihincks
Copy link
Contributor Author

ihincks commented Jan 22, 2024

I'm going to wait for #11227 to merge before attempting to finalize this PR. Then we can do it all at once.

t-imamichi
t-imamichi previously approved these changes Jan 23, 2024
Copy link
Member

@t-imamichi t-imamichi left a comment

Choose a reason for hiding this comment

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

LGTM. We can merge it after #11227 is merged.

@jakelishman
Copy link
Member

jakelishman commented Feb 14, 2024

The last three commits I've just pushed up should fix the docs build. The principal issue is that

.. automodule:: qiskit.primitives.base.base_sampler

is not just a simple "text-only include", it's got some side-effects:

  1. It documents qiskit.primitives.base.base_sampler as a public module. There's no obvious user-facing heading included in the output from our own docs build, but it's generated into the Sphinx inventory and into the HTML structure, so later API-documentation processing may well include something.
  2. It sets the currentmodule to qiskit.primitives.base.base_sampler until the current module is overridden again. This means that all objects documented below it in the file are attempted to be documented as being under qiskit.primitives.base.base_sampler (which is very much not intended).
  3. Autosummary uses the currentmodule to "know" how to import objects. Since this was set to a module from which BaseEstimatorV1, etc etc, couldn't be imported from, it complained.

4269544 puts a currentmodule directive in to fix up that module declaration. 7370fa8 fixes up a couple of minor syntactic mistakes that I happened to spot that probably would have failed the Sphinx build later (or at least would have made the output appear unexpected), and 663dab1 just fixes up some whitespace mistakes.

Copy link
Member

@chriseclectic chriseclectic 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. Quickly skimming I noticed a couple of types, and added a couple other suggestions for clarity

@ihincks
Copy link
Contributor Author

ihincks commented Feb 15, 2024

This PR should be ready to merge, from my perspective. There is only the question about whether its worth making the column width smaller for all of the code snippets.

@jakelishman
Copy link
Member

There is only the question about whether its worth making the column width smaller for all of the code snippets.

The current styling on docs.quantum.ibm.com should give you 80 columns safely within a release note (assuming it's not within a subbullet or anything), and on my device you get a couple of spare. If you can easily keep it down to (say) 72, the display shouldn't have any problems.

@ihincks
Copy link
Contributor Author

ihincks commented Feb 15, 2024

should give you 80 columns safely within a release note

And do you happen to know for the module documentation as well?

@jakelishman
Copy link
Member

It'll be a shade wider, just because there's no bullet using up margin on the left. I don't know what the actual styles target or anything, I just measured it on a live page.

@ihincks
Copy link
Contributor Author

ihincks commented Feb 15, 2024

Thanks, done in cfe2699.

@ihincks ihincks enabled auto-merge February 15, 2024 13:48
Copy link
Member

@t-imamichi t-imamichi left a comment

Choose a reason for hiding this comment

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

LGTM

@t-imamichi
Copy link
Member

The API doc of StatevectorSampler.run and StatevectorEstimator.run look very complicated compared to those of BaseSamplerV2.run and BaseEstimatorV2.run. It would be great if we can simplify those of Statevector{Sampler,Estimator}. But it's not urgent.

BaseEstimatorV2
image

StatevectorEstimator
image

@ihincks
Copy link
Contributor Author

ihincks commented Feb 15, 2024

Good spot, that is unfortunate. Do you have any idea how to change it? All of that _NestedSequence stuff is from numpy.typing via ArrayLike.

@t-imamichi
Copy link
Member

I'm afraid that I have no idea how to change it. Perhaps @jakelishman can help us if he has time to spare.

@ihincks ihincks added this pull request to the merge queue Feb 15, 2024
@jakelishman
Copy link
Member

It's likely something we'd have to do in Sphinx configuration to make it treat type aliases as opaque, linked objects or something. I've not looked into it before, but it's probably hiding away somewhere in the options. It's also possibly a thing that's not properly available to us until we're using a later version of Python for the documentation build, since the Python internal handling of type hints changes quite a lot between versions right now.

@ihincks
Copy link
Contributor Author

ihincks commented Feb 15, 2024

I found this conf option: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_type_aliases

I'm not sure if we would want to go down this route.

Merged via the queue into Qiskit:main with commit 172fa04 Feb 15, 2024
12 checks passed
mergify bot pushed a commit that referenced this pull request Feb 15, 2024
* Add release notes for V2 of the primitives

* Update releasenotes/notes/primitives-v2-df871c0c6ac0b94a.yaml

Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>

* Add separate release notes for the statevector estimators.

* update base class reno

* fix typo

* Copy example into StaevectorSampler

* Move all renos into one file, as suggested by @mtreinish

* Removed references to privatized classes

* typo

* Modify statevector sampler docs to not talk about SamplerPub

* remove more references to BindingsArray and ObservablesArray

and add Estimator example

* lint

* Apply suggestions from code review

Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>

* minor fixes from CR

* switch to pub variables instead of inline

* switch to quantum_info types in examples

* remove references to removed BasisObservable type

* do a bit of reorganization and write a migration section

* make the statevectorestimator do the plot in docs

* Apply suggestions from code review

Co-authored-by: Ikko Hamamura <ikkoham@users.noreply.github.com>
Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>

* remove comma

* address various minor code suggestions

* switch to get_bitstrings()

* revert accidental removal of V1 sections

* Fix Sphinx module-path imports

* Fix minor syntax errors

* Fix whitespace

* Stop importing docs with automodule

* add raw string directive

* add PrimitiveJob to the public API

* make some of Chris' changes

* rewrap textblocks to < 80 chars

---------

Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
Co-authored-by: Ikko Hamamura <ikkoham@users.noreply.github.com>
Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>
Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
(cherry picked from commit 172fa04)
github-merge-queue bot pushed a commit that referenced this pull request Feb 15, 2024
* Add release notes for V2 of the primitives

* Update releasenotes/notes/primitives-v2-df871c0c6ac0b94a.yaml

Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>

* Add separate release notes for the statevector estimators.

* update base class reno

* fix typo

* Copy example into StaevectorSampler

* Move all renos into one file, as suggested by @mtreinish

* Removed references to privatized classes

* typo

* Modify statevector sampler docs to not talk about SamplerPub

* remove more references to BindingsArray and ObservablesArray

and add Estimator example

* lint

* Apply suggestions from code review

Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>

* minor fixes from CR

* switch to pub variables instead of inline

* switch to quantum_info types in examples

* remove references to removed BasisObservable type

* do a bit of reorganization and write a migration section

* make the statevectorestimator do the plot in docs

* Apply suggestions from code review

Co-authored-by: Ikko Hamamura <ikkoham@users.noreply.github.com>
Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>

* remove comma

* address various minor code suggestions

* switch to get_bitstrings()

* revert accidental removal of V1 sections

* Fix Sphinx module-path imports

* Fix minor syntax errors

* Fix whitespace

* Stop importing docs with automodule

* add raw string directive

* add PrimitiveJob to the public API

* make some of Chris' changes

* rewrap textblocks to < 80 chars

---------

Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
Co-authored-by: Ikko Hamamura <ikkoham@users.noreply.github.com>
Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com>
Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
(cherry picked from commit 172fa04)

Co-authored-by: Ian Hincks <ian.hincks@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog documentation Something is not clear or an error documentation mod: primitives Related to the Primitives module stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants