qiskit-community / qiskit-community/mapomatic
score for default Qiskit transpiler mapping
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 64
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
the mm.evaluate_layouts(..) returns your scores for all mapping you found.
I'd like to see your score for the the layout which Qiskit would give me, using generate_preset_pass_manager()
This layout was selected: [30, 29, 28, 36, 31].
The attached code gives me [] - no score at all.
Can you help me to make it work?
Thanks
Jan
This is my software stack
qiskit 1.2.2
qiskit-aer 0.15.1
qiskit-algorithms 0.3.0
qiskit-ibm-experiment 0.4.8
qiskit-ibm-runtime 0.29.0
qiskit-ionq 0.5.6
qiskit-machine-learning 0.7.2
Here is the code
import numpy as np
from qiskit import *
from qiskit_aer import AerSimulator
import mapomatic as mm
from qiskit_ibm_runtime import QiskitRuntimeService
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
qc = QuantumCircuit(5)
qc.h(0)
qc.cx(0,1)
qc.cx(0,2)
qc.cx(0,3)
qc.cx(0,4)
qc.measure_all()
print(qc)
service = QiskitRuntimeService()
noisy_backend = service.backend('ibm_torino')
backend = AerSimulator.from_backend(noisy_backend)
print('\n 1st pass, to convert circuit to naitive gates for ',backend.name)
pm = generate_preset_pass_manager(optimization_level=3, backend=backend)
qcT1 = pm.run(qc)
print(qcT1.draw('text', idle_wires=False))
layout0 = qcT1._layout.final_index_layout(filter_ancillas=True)
print(' initial phys layout:%s'%(layout0))
# remove idle qubits
qcT2 = mm.deflate_circuit(qcT1)
score0 = mm.evaluate_layouts(qc, [layout0], backend)
print('score0:',score0)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied Python example and inspect the interaction between generate_preset_pass_manager(), qcT1._layout.final_index_layout(), mm.deflate_circuit(), and mm.evaluate_layouts(). Compare the selected layout [30, 29, 28, 36, 31] with the layout passed to evaluate_layouts and determine why the result is []. Done means the default Qiskit layout produces a score.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100