qiskit-community / qiskit-community/mapomatic
usage of deprecated Qiskit functionality
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 64
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
Deprecated / removed Qiskit APIs
| File | Line(s) | Deprecated component | Deprecated in | Removed in | Warns today? |
|---|---|---|---|---|---|
mapomatic/circuits.py |
51, 54, 55, 59, 80, 81, 84, 120, 121, 122, 123 | Treating CircuitInstruction as an iterable (item[0], item[1], item[2]) |
1.2 | planned 3.0 | yes |
mapomatic/layouts.py |
245–255 | Treating CircuitInstruction as an iterable |
1.2 | planned 3.0 | yes |
mapomatic/tests/test_best_layout_custom.py |
76–99 | Treating CircuitInstruction as an iterable |
1.2 | planned 3.0 | yes |
mapomatic/tests/test_inflate.py |
42, 43, 46, 47 | Treating CircuitInstruction as an iterable |
1.2 | planned 3.0 | yes |
mapomatic/layouts.py |
164, 202, 206 | backend.configuration() — BackendV1/BackendConfiguration API |
1.2 | 2.0 | no ¹ |
mapomatic/layouts.py |
240 | backend.properties() — BackendV1/BackendProperties API |
1.2 | 2.0 | no ¹ |
mapomatic/circuits.py |
113 | backend.configuration().num_qubits |
1.2 | 2.0 | no ¹ |
mapomatic/tests/test_matching_layout.py |
31 | backend.configuration().coupling_map |
1.2 | 2.0 | no ¹ |
mapomatic/tests/test_subgraphs.py |
30 | backend.configuration().coupling_map |
1.2 | 2.0 | no ¹ |
mapomatic/tests/test_transpiler_layout.py |
29 | backend.configuration().coupling_map |
1.2 | 2.0 | no ¹ |
mapomatic/tests/test_best_layout_custom.py |
59, 60, 61 | backend.properties(), backend.configuration().dt, .num_qubits |
1.2 | 2.0 | no ¹ |
README.md |
187, 188, 189 | backend.properties(), backend.configuration().dt, .num_qubits in the custom-cost example |
1.2 | 2.0 | n/a (docs) |
mapomatic/tests/test_best_layout_custom.py |
99 | Instruction.duration (item[0].duration) |
1.3 | 2.0 (base class) | no ² |
README.md |
221 | item.operation.duration |
1.3 | 2.0 (base class) | n/a (docs) |
mapomatic/tests/test_transpiler_layout.py |
16, 24 | qiskit.circuit.library.QuantumVolume class |
2.2 | planned 3.0 | yes |
mapomatic/circuits.py |
97 | BackendV1 named in the inflate_circuit docstring |
1.2 | 2.0 | n/a (docs) |
mapomatic/layouts.py |
153, 183, 233 | IBMQBackend in docstrings — class retired with qiskit-ibmq-provider (2023) |
— | — | n/a (docs) |
mapomatic/tests/test_best_layout_custom.py |
53 | IBMQBackend in docstring |
— | — | n/a (docs) |
¹ Removed from Qiskit in 2.0 — qiskit.providers.BackendV1 is absent on 2.5.2 and
import qiskit.providers.models raises ModuleNotFoundError. These calls only still
work because qiskit_ibm_runtime's FakeBackendV2 reimplements them (verified via the
MRO: configuration/properties are defined in
qiskit_ibm_runtime.fake_provider.fake_backend, not in qiskit.providers.backend.BackendV2).
² Instruction.duration was removed from the base class in 2.0
(hasattr(Instruction("x", 1, 0, []), "duration") is False on 2.5.2). The line survives
only because that branch is reached solely for Delay, which kept its own duration.
Private-API use (public equivalent was removed, so no warning is possible)
| File | Line(s) | Private API used | Public API it stands in for | Status of that public API | Risk |
|---|---|---|---|---|---|
README.md |
200, 201, 207, 212, 217 | Bit._index (item.qubits[0]._index) |
Bit.index |
Deprecated 0.25 (2021-04), removed 1.0 | returns None for bits with no owning register → downstream BackendPropertyError |
mapomatic/layouts.py |
244 | circ._data |
circ.data |
.data is current; _data is a different object |
qc._data is now qiskit._accelerate.circuit.CircuitData (Rust) while qc.data is QuantumCircuitData; qc._data is qc.data → False |
mapomatic/tests/test_best_layout_custom.py |
75 | circ._data |
circ.data |
same as above | same as above |
Bit._index is the sharper of the two. Qubit is now a Rust-native class with zero
public attributes — ['_from_anonymous', '_from_owned', '_index', '_register'] are all it has —
so the README reaches for a private attribute precisely because the public property it
replaced was removed in 1.0. There is no public accessor on the bit itself; the supported
route is circuit.find_bit(bit).index.
It also has a real failure mode, not just a style problem. _index is None for bits with no
owning register (Qubit(), or bits added via QuantumCircuit.add_bits):
loose-bit circuit _index values: [None, None, None]
cx -> q0=None q1=None
gate_error RAISED BackendPropertyError 'Could not find the desired property for cx'
The README example only works in practice because transpile re-registers loose bits into a
QuantumRegister (post-transpile _index is [0, 1, 2, 3, 4]), and the example runs on
transpiled circuits. Note mapomatic's own source never uses _index — all 16 index lookups
go through find_bit, which is correct. This one is README-only.
circ._data is milder: it is not removed and emits no warning, but it is private and the
type changed underneath (the circuit data structure was rewritten in Rust in 1.0). It still
iterates into CircuitInstructions, which is why the two call sites keep working. Swapping
both to the public .data is a no-op change today and removes the exposure.
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 with the deprecated-API tables and inspect the listed locations in mapomatic/circuits.py, mapomatic/layouts.py, the affected tests, and README.md. Run the test suite against the supported Qiskit versions, focusing on the named tests and custom-cost examples. Done means the listed deprecated and private API uses are addressed without regressions and the relevant tests and documentation examples pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design, documentation, testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100