documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Guide for the new V2 broadcasting rules

Open beckykd opened this issue 1 year ago • 9 comments

URL, if applicable

No response

Describe the new content you are requesting.

@ElePT requested a guide for the new V2 statevector primitives that shows detailed edge cases and how to deal with broadcasting.

If this new content request is accepted, do you want to write the content?

no

beckykd avatar Feb 19 '24 20:02 beckykd

Who is the right SME for this - @ElePT do you have a suggestion?

abbycross avatar Feb 21 '24 15:02 abbycross

Just to clarify, I think that the guide should show the V2 broadcasting rules, which will be the same for all V2 primitives (we can run with the statevector primitives for convenience but the rules apply to all).

ElePT avatar Feb 21 '24 15:02 ElePT

The estimator RFC had a nice explanation of the broadcasting rules for the internal container classes used by the primitives: https://github.com/Qiskit/RFCs/blob/master/0015-estimator-interface.md#arrays-and-broadcasting-. I think that a relatively low-effort approach would be to take that as a reference and show more applied examples with the current statevector primitives and real circuits observables. Maybe @ihincks has a suggestion on which SME could work on it.

ElePT avatar Feb 21 '24 16:02 ElePT

Whoops, I think Elena may have tagged the wrong person! Assuming she meant @ihincks. :-)

abbycross avatar Apr 19 '24 18:04 abbycross

V2 broadcasting rules, which will be the same for all V2 primitives

This is true, but much more relevant to the estimator, because the sampler's "broadcasting" rules are trivial. This is because estimator pubs have two things with a shape, observables array and parameter set array, and they need to check if these two shapes are broadcastable, and compute the broadcast shape (which becomes the shape of all returned data). For sampler pubs, the parameter set array's (ie BindingArray) shape is the shape.

which SME could work on it

What is an SME?

ihincks avatar Apr 19 '24 18:04 ihincks

A subject matter expert 😁

abbycross avatar Apr 19 '24 18:04 abbycross

Maybe @samanthavbarron? Or me?

ihincks avatar Apr 19 '24 18:04 ihincks

Either or both would be great! 🎉 :) A first question would be, where's the right place to add this content? Would it be a standalone page under the "Run with primitives" section of the docs, or would it be added content to the Primitives examples page?

abbycross avatar Apr 19 '24 20:04 abbycross

We talk about broadcasting rules here: https://docs.quantum.ibm.com/run/primitives#broadcasting-rules so maybe that's where to add content? And maybe link to it from the other places we mention broadcasting?

beckykd avatar Apr 19 '24 21:04 beckykd