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

Error when running final_index_layout(filter_ancillas=False) #13732

Open
victor-villar opened this issue Jan 24, 2025 · 0 comments
Open

Error when running final_index_layout(filter_ancillas=False) #13732

victor-villar opened this issue Jan 24, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@victor-villar
Copy link

Environment

  • Qiskit version: 1.3.2
  • Python version: 3.11
  • Operating system: macos/linux

What is happening?

On certain circuits transpiled with a backend and a coupling map, this call fails

transpiled_circuit.layout.final_index_layout(filter_ancillas=False)

raising KeyError: "The item Qubit(QuantumRegister(5, 'q'), 3) does not exist in the Layout".

This worked fine until qiskit 1.3.0

How can we reproduce the issue?

Running the following code:

from qiskit import QuantumCircuit, transpile, qasm2
from qiskit_ibm_runtime import QiskitRuntimeService

service = QiskitRuntimeService(channel="ibm_quantum")
backend = service.backend("ibmq_manila")

qc = qasm2.loads('OPENQASM 2.0;include "qelib1.inc";qreg q[3];rccx q[2],q[1],q[0];t q[2];u(0.28905709212845454,5.626877140821112,5.481851443455051) q[1];h q[0];cx q[1],q[2];s q[0];', custom_instructions=qasm2.LEGACY_CUSTOM_INSTRUCTIONS)

transpiled_circuit = transpile(qc,backend=backend,coupling_map=[[0,1],[1,2],[2,3]],optimization_level=2,seed_transpiler=42)
transpiled_circuit.layout.final_index_layout(filter_ancillas=False)

What should happen?

There should not be any error in the call. The output to that particular example in qiskit 1.2.4 is [3, 1, 2, 0]

Any suggestions?

No response

@victor-villar victor-villar added the bug Something isn't working label Jan 24, 2025
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