Skip to content

Updated Sampler#56

Merged
blakejohnson merged 13 commits into
Qiskit:masterfrom
ihincks:sampler-v2
Nov 6, 2023
Merged

Updated Sampler#56
blakejohnson merged 13 commits into
Qiskit:masterfrom
ihincks:sampler-v2

Conversation

@ihincks
Copy link
Copy Markdown
Contributor

@ihincks ihincks commented Oct 31, 2023

No description provided.

Comment thread 0017-sampler-interface.md Outdated
Co-authored-by: Jim Garrison <jim@garrison.cc>
Copy link
Copy Markdown
Member

@ajavadia ajavadia left a comment

Choose a reason for hiding this comment

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

overall direction and philosophy looks good to me

Comment thread 0017-sampler-interface.md
Comment thread 0017-sampler-interface.md
Comment thread 0017-sampler-interface.md
Comment thread 0017-sampler-interface.md
Copy link
Copy Markdown
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Thanks for this, Ian. I think there's a few things in here that treat IBM-specific extensions as if they are part of the backend.run general interface, which might want removing / reducing.

On a larger note, I'm wondering how / if we can ensure that Sampler (and to a degree, Estimator) are expandable interfaces, potentially with some form of version negotiation, so we don't end up needing to make a SamplerV3 in the future that might return different types. This maybe is a concern too far and too late at this stage, though.

Comment thread 0017-sampler-interface.md
Comment thread 0017-sampler-interface.md
Comment thread 0017-sampler-interface.md Outdated
Comment thread 0017-sampler-interface.md
@blakejohnson blakejohnson added the RFC proposal New RFC is proposed label Oct 31, 2023
@jlapeyre
Copy link
Copy Markdown
Contributor

jlapeyre commented Nov 2, 2023

My understanding is that primitives are meant to be universal interfaces. But references to other "tooling" above #56 (comment) make this less clear to me. The particular concern I have is that sampling a large number of shots from a modest number of qubits using a simulator might be inefficient to impossible without returning results in an associative array. Is there a way to accommodate this situation within this proposal? Or would that require completely separate tooling?

@blakejohnson
Copy link
Copy Markdown
Contributor

@jlapeyre that comment is in reference to streaming interfaces, which are out of scope of this RFC.

The particular concern I have is that sampling a large number of shots from a modest number of qubits using a simulator might be inefficient to impossible without returning results in an associative array. Is there a way to accommodate this situation within this proposal?

It is no more difficult than handling the same number of shots from hardware.

@jlapeyre
Copy link
Copy Markdown
Contributor

jlapeyre commented Nov 2, 2023

It is no more difficult than handling the same number of shots from hardware.

Yes, in principle. I used a simulator as an example because it's easy to quickly generate with a simulator more shots than you can store. Anyone currently doing experiments like this won't be able to use this interface.

Now that I think about it, if I understand you correctly, I agree that rather than special casing accumulating shots in a hash map, it's better handled as part of a more general streaming or "online" tool that can handle custom filters. And I see it's been suggested that this is out of scope: #56 (comment)

I'd consider making the streaming interface the fundamental one and provide a collect function to write to an array. Then build something like this proposal on top of that. But it looks like this is too late for this version.

EDIT: If this proposal is about an API boundary, suppose it doesn't preclude changing the implementation later.

Comment thread 0017-sampler-interface.md Outdated
Comment thread 0017-sampler-interface.md Outdated
blakejohnson and others added 2 commits November 6, 2023 09:51
Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com>
Comment thread 0017-sampler-interface.md Outdated
Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFC proposal New RFC is proposed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants