munich-quantum-toolkit / munich-quantum-toolkit/qmap

🐛 [NA] Dropped Global Hadamard Gate

Open
#876 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
146
Forks
41
Avg merge
6h 47m
Merged PRs (30d)
45

Description

System and Environment Information

MAC OS 15.6.1
MQT QMAP 3.4.0dev@9c84575

Bug Description

When compiling a circuit with a global Hadamard Gate, this is dropped and does not exist in the resulting output.

Steps to Reproduce

Run the following contract:

from qiskit import QuantumCircuit
from mqt.core import load
from mqt.qmap.na.zoned import RoutingAgnosticCompiler, RoutingAwareCompiler
from mqt.qmap.na.zoned import ZonedNeutralAtomArchitecture

def global_h(num_qubits):
    """:returns: a global ry gate"""
    qc = QuantumCircuit(num_qubits)
    qc.h(range(num_qubits))
    return qc.to_gate(label="H")

qc = QuantumCircuit(5)
qc.append(global_h(5), range(5))

circ = load(qc)

arch = ZonedNeutralAtomArchitecture.from_json_string("""{
   "name": "Architecture with one entanglement and one storage zone",
   "operation_duration": {"rydberg_gate": 0.36, "single_qubit_gate": 52, "atom_transfer": 15},
   "operation_fidelity": {"rydberg_gate": 0.995, "single_qubit_gate": 0.9997, "atom_transfer": 0.999},
   "qubit_spec": {"T": 1.5e6},
   "storage_zones": [{
     "zone_id": 0,
     "slms": [{"id": 0, "site_separation": [3, 3], "r": 20, "c": 100, "location": [0, 0]}],
     "offset": [0, 0],
     "dimension": [297, 57]
   }],
   "entanglement_zones": [{
     "zone_id": 0,
     "slms": [
       {"id": 1, "site_separation": [12, 10], "r": 7, "c": 20, "location": [35, 67]},
       {"id": 2, "site_separation": [12, 10], "r": 7, "c": 20, "location": [37, 67]}
     ],
     "offset": [35, 67],
     "dimension": [230, 60]
   }],
   "aods": [{"id": 0, "site_separation": 2, "r": 100, "c": 100}],
   "rydberg_range": [[[30, 62], [270, 132]]]
 }""")

compiler = RoutingAwareCompiler(arch)

code = compiler.compile(circ)
print(code)

Got naviz:

atom (0.000, 57.000) atom0
atom (3.000, 57.000) atom1
atom (6.000, 57.000) atom2
atom (9.000, 57.000) atom3
atom (12.000, 57.000) atom4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Python reproduction using load, ZonedNeutralAtomArchitecture, RoutingAwareCompiler, and compiler.compile; inspect why the global_h gate is absent from the generated output. Compare the compiled result with the input circuit and confirm that the resulting naviz output represents the five-qubit global Hadamard operation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.