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

SamplerV2 update #1420

Merged
merged 11 commits into from
Feb 29, 2024
Merged

SamplerV2 update #1420

merged 11 commits into from
Feb 29, 2024

Conversation

gadial
Copy link
Collaborator

@gadial gadial commented Feb 22, 2024

Summary

Finalizes the SamplerV2 class and adds relevant tests.

Replaces #1326

Details and comments

Fixes #1313

Most of the work required to run SamplerV2 was done in previous PR's and support for V2 containers in qiskit is now full, so this PR mainly adds SamplerV2 to the Primitives V2 unit tests, and copies over the SamplerV2 integration tests from qiskit.

@gadial gadial changed the title Clean version of SamplerV2 update SamplerV2 update Feb 22, 2024
@coveralls
Copy link

coveralls commented Feb 22, 2024

Pull Request Test Coverage Report for Build 8100319895

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 82.439%

Totals Coverage Status
Change from base Build 8085544401: 0.2%
Covered Lines: 5497
Relevant Lines: 6668

💛 - Coveralls

@mberna mberna marked this pull request as draft February 23, 2024 15:06
@mberna
Copy link
Collaborator

mberna commented Feb 23, 2024

Converting to draft as per @gadial's request.

@gadial gadial marked this pull request as ready for review February 24, 2024 08:03
@gadial gadial mentioned this pull request Feb 26, 2024
@@ -42,7 +42,7 @@ class Sampler:
version = 0


class SamplerV2(BasePrimitiveV2[SamplerOptions], Sampler, BaseSamplerV2):
class SamplerV2(BasePrimitiveV2, Sampler, BaseSamplerV2):
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 SamplerOptions removed? It's meant to set the expected options 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.

Seems to me I accidently reverted to an older version. Will fix.

@@ -148,23 +150,16 @@ class SamplerV1(BasePrimitiveV1, Sampler, BaseSampler):

Example::

from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit.test.reference_circuits import ReferenceCircuits
Copy link
Collaborator

Choose a reason for hiding this comment

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

qiskit.test no longer exists in 1.0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Replaced with explicit code for generating bell circuit - is there a better alternative? Also, we have similar example in provider_session.py

@jyu00 jyu00 merged commit 11f7793 into Qiskit:experimental-0.2 Feb 29, 2024
20 checks passed
@gadial gadial deleted the samplerv2-updates branch February 29, 2024 21:50
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.

4 participants