From 0b6c2ee2db33b659032ca5a3b5596e289cbfd378 Mon Sep 17 00:00:00 2001 From: Fionn Malone Date: Wed, 24 Jul 2024 10:49:56 -0700 Subject: [PATCH] Update QPIC \otimes and ^ (#1186) * Add otimes replacement. * Fix some latex translations for qpic. --------- Co-authored-by: Matthew Harrigan --- qualtran/bloqs/arithmetic/comparison.py | 4 ++-- qualtran/drawing/qpic_diagram.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qualtran/bloqs/arithmetic/comparison.py b/qualtran/bloqs/arithmetic/comparison.py index 64881e075..2b324208c 100644 --- a/qualtran/bloqs/arithmetic/comparison.py +++ b/qualtran/bloqs/arithmetic/comparison.py @@ -81,7 +81,7 @@ def wire_symbol( if reg.name == 'x': return TextBox("x") if reg.name == 'target': - return TextBox("z^(x Sequence[Union[int, Sequence[int]]]: @@ -468,7 +468,7 @@ def wire_symbol( if reg.name == "y": return TextBox('y') if reg.name == "target": - return TextBox('z^(x<=y)') + return TextBox('z∧(x<=y)') raise ValueError(f'Unknown register name {reg.name}') def on_classical_vals(self, *, x: int, y: int, target: int) -> Dict[str, 'ClassicalValT']: diff --git a/qualtran/drawing/qpic_diagram.py b/qualtran/drawing/qpic_diagram.py index 583c42fcd..e4936b366 100644 --- a/qualtran/drawing/qpic_diagram.py +++ b/qualtran/drawing/qpic_diagram.py @@ -50,9 +50,12 @@ def _format_label_text(label: str, scale: float = 0.8) -> str: replacements = { '&': r'\&', '_': r'\_', + '<=': r'$\le$', + '>=': r'$\ge$', '<': r'$<$', '>': r'$>$', '⨁': r'$\oplus$', + '⨂': r'$\otimes$', '∧': r'$\land$', } for key, val in replacements.items():