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 EstimatorV2 #2088

Merged
merged 8 commits into from
Mar 28, 2024
Merged

Add EstimatorV2 #2088

merged 8 commits into from
Mar 28, 2024

Conversation

ikkoham
Copy link
Collaborator

@ikkoham ikkoham commented Mar 26, 2024

Summary

Details and comments

@kevinsung
Copy link

Could you summarize how it's determined whether to use true sampling, or to use a normal distribution approximation? What happens if the user doesn't specify anything?

@ikkoham
Copy link
Collaborator Author

ikkoham commented Mar 26, 2024

@kevinsung I simplified because it is confusing and true sampling was deprecated in V1. As documented, there is only a normal distribution approximation

@doichanj doichanj mentioned this pull request Mar 27, 2024
).result()

# calculate expectation values (evs) and standard errors (stds)
rng = np.random.default_rng(self.options.run_options.get("seed_simulator"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering that rng should be shared in a _run() call.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. This is the point where we decided to make this specification for maintainability when we implemented SamplerV2.

return PrimitiveResult([self._run_pub(pub) for pub in pubs])

def _run_pub(self, pub: EstimatorPub) -> PubResult:
circuit = pub.circuit.copy()
Copy link
Collaborator

@hhorii hhorii Mar 27, 2024

Choose a reason for hiding this comment

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

I think pub.circuit should be compiled to AerCircuit here to avoid copy. This will be an optimization in next releases.

@doichanj doichanj added enhancement New feature or request Changelog: New Feature Include in the Added section of the changelog automerge This PR will automatically merge once its CI has passed labels Mar 28, 2024
@doichanj doichanj merged commit 4f5495a into Qiskit:main Mar 28, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge This PR will automatically merge once its CI has passed Changelog: New Feature Include in the Added section of the changelog enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants