Guide for the new V2 broadcasting rules
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
Who is the right SME for this - @ElePT do you have a suggestion?
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).
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.
Whoops, I think Elena may have tagged the wrong person! Assuming she meant @ihincks. :-)
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?
A subject matter expert 😁
Maybe @samanthavbarron? Or me?
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?
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?