Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ _If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md#unreleased)._

### Fixed

- 🐛 Preserve the input circuit name during mapping ([#1154])
([**@burgholzer**])
- 🐛 Handle Qiskit targets without calibration properties ([#1152])
([**@burgholzer**])

Expand Down Expand Up @@ -304,6 +306,7 @@ _📚 Refer to the [GitHub Release Notes] for previous changelogs._

<!-- PR links -->

[#1154]: https://github.com/munich-quantum-toolkit/qmap/pull/1154
[#1152]: https://github.com/munich-quantum-toolkit/qmap/pull/1152
[#1126]: https://github.com/munich-quantum-toolkit/qmap/pull/1126
[#1116]: https://github.com/munich-quantum-toolkit/qmap/pull/1116
Expand Down
1 change: 1 addition & 0 deletions src/sc/Mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ void Mapper::initResults() {
results.output.name = qc.getName() + "_mapped";
results.output.qubits = architecture->getNqubits();
results.output.gates = std::numeric_limits<std::size_t>::max();
qcMapped.setName(qc.getName());
qcMapped.addQubitRegister(architecture->getNqubits());
}

Expand Down
9 changes: 9 additions & 0 deletions test/python/sc/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ def test_either_arch_or_calibration(example_circuit: QuantumCircuit) -> None:
compile_(example_circuit, arch=None, calibration=None)


def test_circuit_name_is_preserved(example_circuit: QuantumCircuit) -> None:
"""Test that mapping preserves the input circuit name."""
example_circuit.name = "my_bell_chain"

mapped, _ = compile_(example_circuit, arch=Arch.IBM_QX4, method=Method.exact)

assert mapped.name == example_circuit.name


# test that all available architecture enumerations can be properly used
@pytest.mark.parametrize(
"arch",
Expand Down
Loading