-
Notifications
You must be signed in to change notification settings - Fork 368
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
Add EstimatorV2 #2088
Conversation
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? |
@kevinsung I simplified because it is confusing and true sampling was deprecated in V1. As documented, there is only a normal distribution approximation |
).result() | ||
|
||
# calculate expectation values (evs) and standard errors (stds) | ||
rng = np.random.default_rng(self.options.run_options.get("seed_simulator")) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think implementation of rng is as same as that of qiskit.primitives https://github.com/Qiskit/qiskit/blob/090b2b193d6de88017e26d99c0ac379b85382395/qiskit/primitives/statevector_estimator.py#L142
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.
Summary
Details and comments