Problem
CTRL_GATE_MAP in src/pyqasm/maps/gates.py contains:
"ccx": "c3x"
"c3x": "c4x"
But the inverse REV_CTRL_GATE_MAP (lines 1217-1229) is missing the mirror entries:
"c3x": "ccx"
"c4x": "c3x"
Impact
REV_CTRL_GATE_MAP is consumed by src/pyqasm/printer.py:516-523 (_mpl_draw_gate), which peels off controls one level at a time to draw the base gate plus control dots. A user who loads a circuit containing c3x/c4x (without unrolling) and tries to visualise it via the matplotlib printer falls through to raise NotImplementedError(f\"Unsupported gate: {name}\") at printer.py:533.
Suggested fix
Add the two mirror entries to REV_CTRL_GATE_MAP so the maps stay symmetric, plus a small printer round-trip test for c3x/c4x to lock it in.
Context
Surfaced during review of #320, which made c3x/c4x first-class gates and thus made this latent gap user-reachable.
Problem
CTRL_GATE_MAPinsrc/pyqasm/maps/gates.pycontains:"ccx": "c3x""c3x": "c4x"But the inverse
REV_CTRL_GATE_MAP(lines 1217-1229) is missing the mirror entries:"c3x": "ccx""c4x": "c3x"Impact
REV_CTRL_GATE_MAPis consumed bysrc/pyqasm/printer.py:516-523(_mpl_draw_gate), which peels off controls one level at a time to draw the base gate plus control dots. A user who loads a circuit containingc3x/c4x(without unrolling) and tries to visualise it via the matplotlib printer falls through toraise NotImplementedError(f\"Unsupported gate: {name}\")atprinter.py:533.Suggested fix
Add the two mirror entries to
REV_CTRL_GATE_MAPso the maps stay symmetric, plus a small printer round-trip test forc3x/c4xto lock it in.Context
Surfaced during review of #320, which made
c3x/c4xfirst-class gates and thus made this latent gap user-reachable.