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

Incorrect expectation estimation when Reset is used in circuit #12519

Closed
SillieWous opened this issue Jun 6, 2024 · 2 comments · Fixed by #12862
Closed

Incorrect expectation estimation when Reset is used in circuit #12519

SillieWous opened this issue Jun 6, 2024 · 2 comments · Fixed by #12862
Labels
bug Something isn't working mod: primitives Related to the Primitives module

Comments

@SillieWous
Copy link

Environment

  • Qiskit version: 1.1.0
  • Python version: 3.12.3
  • Operating system: Fedora 40 Workstation

What is happening?

In a circuit (aimed at simulation of a hamiltonian with disipation) I am getting incorrect estimation values of observables. The system I am simulating has two identical (non-interacting) qubit oscilators. For dissipation a non-unitary operation is implemented with an ancilla qubit that is reset at the start of a trotterisation step and measured at the end of the step to get the dissipation factor.

How can we reproduce the issue?

See GitLab repo for an example.

What should happen?

Since these are two identical systems without interaction they ought to measure the exact same state trajectory. However there are frequently values that do not agree between the two systems.

The image that is in the example (Out[8]) illustrates this pretty obviously.

Moreover the way the observables are defined they should always sum to 1 (see Out[6] in the example notebook). But at the indices where the image shows odd behaviour this is not the case. Looking at the values of the observables it seems a value of an earlier measurement is used instead of the correct one.

Any suggestions?

No response

@SillieWous SillieWous added the bug Something isn't working label Jun 6, 2024
@jakelishman jakelishman added the mod: primitives Related to the Primitives module label Jun 6, 2024
@t-imamichi
Copy link
Member

I made a fix #12862. I modified the notebook to use StatevectorEstimator (EstimatorV2) and confirmed that #12862 behaves fine.
script: https://gist.github.com/t-imamichi/81f4b38ee572af03cf0c3d6b34e4ebd4

main branch:
12519_main

#12862
12519_fixed

@t-imamichi
Copy link
Member

t-imamichi commented Aug 1, 2024

I updated #12862 based on @Cryoris's comment.

I confirmed that the sum of all observables are 1.

the new output of https://gist.github.com/t-imamichi/81f4b38ee572af03cf0c3d6b34e4ebd4
tmp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mod: primitives Related to the Primitives module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants