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

Qiskit Aer does not handle isolated Clbits #1783

Closed
taalexander opened this issue Apr 18, 2023 · 2 comments
Closed

Qiskit Aer does not handle isolated Clbits #1783

taalexander opened this issue Apr 18, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@taalexander
Copy link

Informations

  • Qiskit Aer version: 0.11.2
  • Python version: 3.9
  • Operating system: OSX

What is the current behavior?

Qiskit Aer does not handle isolated qubits (ie., not in a register)

Steps to reproduce the problem

from qiskit import Aer, QuantumCircuit, execute
from qiskit.circuit import Qubit, Clbit

sim = Aer.get_backend("qasm_simulator")

bits = [Qubit(), Clbit(), Clbit()]
qc = QuantumCircuit(bits)
qc.x(bits[0])
qc.measure(bits[0], bits[1])
qc.measure(bits[0], bits[2])


result = execute(
    qc, backend=sim
).result()

Gives

Simulation failed and returned the following error message:
ERROR: Failed to load qobj: Invalid Qobj experiment: not enough memory slots.

What is the expected behavior?

Completes with

{'1 1': 1024}

Suggested solutions

As of https://github.com/Qiskit/qiskit-terra/blob/b4bc559228c3898817978c3d8c3fc97372beecad/qiskit/circuit/bit.py#L65
Qiskit Terra allows clbits to not be in registers (or be in multiple registers!). This seems to break result handling.

@hhorii
Copy link
Collaborator

hhorii commented Apr 18, 2023

@taalexander Could you test with 0.12.0? This looks similar to #1660 and resolved by #1717.

@taalexander
Copy link
Author

I can confirm 0.12.0 resolves this.

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

2 participants