Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.17k stars 2.35k forks source link

Given an IBM Quantum experience job id, how do you get the logical to physical layout? #6809

Open vtomole opened 3 years ago

vtomole commented 3 years ago

This question is a copy of https://quantumcomputing.stackexchange.com/questions/17391/qiskit-logical-to-physical-qubit-mapping.

I have an IBMQJob object that I call circuit = IBMQjob.circuits()[0] on. The problem is that circuit._layout returns None.

What is the expected behavior?

I should be able to call circuit._layout.get_virtual_bits() to get back a dictionary of the mapping of logical --> physical qubits, like {'q0': 0, 'q1': 9, 'q2': 13, 'q3': 14}.

nonhermitian commented 3 years ago

I do not think it is possible because as of right now the disassembler does not attach it https://github.com/Qiskit/qiskit-terra/blob/be0ed5f7b1c3b4057af941be65a8ff84b90a16e4/qiskit/assembler/disassemble.py#L102