Skip to content

Preserve math-mode gate names in latex drawer - #16321

Open
kelvinvelasquez-SDE wants to merge 1 commit into
Qiskit:mainfrom
kelvinvelasquez-SDE:issue-9208-latex-math-gate-names
Open

Preserve math-mode gate names in latex drawer#16321
kelvinvelasquez-SDE wants to merge 1 commit into
Qiskit:mainfrom
kelvinvelasquez-SDE:issue-9208-latex-math-gate-names

Conversation

@kelvinvelasquez-SDE

Copy link
Copy Markdown

Summary

  • preserve user-provided math-mode gate names in the LaTeX drawer instead of wrapping them a second time
  • keep the existing formatting behavior for non-math-mode labels unchanged
  • add a focused regression test for latex gate-name handling in the visualization utilities

Test plan

  • Run python -m unittest test.python.visualization.test_utils.TestVisualizationUtils.test_get_gate_ctrl_text_preserves_mathmode_gate_name test.python.visualization.test_utils.TestVisualizationUtils.test_generate_latex_label_mathmode_utf8char test.python.visualization.test_utils.TestVisualizationUtils.test_generate_latex_label_escaped_dollar_sign_in_mathmode in an isolated editable copy with compiled _accelerate

fixes #9208

AI assistance disclosure: GPT-5.4 (Cursor)

Keep user-provided math-mode gate labels intact in the latex drawer so custom LaTeX names are not wrapped and escaped a second time.
@kelvinvelasquez-SDE
kelvinvelasquez-SDE requested a review from a team as a code owner May 29, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

math mode in gate names is not working

1 participant