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

Conditions can sometimes cause stall when running on AerSimulator #2215

Open
IlanIwumbwe opened this issue Sep 2, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@IlanIwumbwe
Copy link

IlanIwumbwe commented Sep 2, 2024

Benny and I found this bug.

Informations

  • Qiskit Aer version: 0.15.0
  • Python version: 3.11.6
  • Operating system: Ubuntu 23.10

What is the current behavior?

Running on AerSimulator stalls

Steps to reproduce the problem

Create a conditional that is guaranteed to be true, but does nothing.

qc = QuantumCircuit(3)
qc.h(0)
r = ClassicalRegister(1, "r")
qc.add_register(r)

with qc.if_test((r,0)):
    pass

qc.measure_active()

print(qc)

s = AerSimulator()
c = s.run(qc).result().get_counts()
print(c)

This also affects other control flow constructs that have the same characteristic.

What is the expected behavior?

Do nothing to the circuit, run the original circuit as normal and return a result

Suggested solutions

This may be an issue on qiskit's side, but maybe add a true_body of identity when creating the IfElseOp, and other relevant ops for the other control flow statements.

@IlanIwumbwe IlanIwumbwe added the bug Something isn't working label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant