Skip to content

Commit

Permalink
Update QPIC \otimes and ^ (#1186)
Browse files Browse the repository at this point in the history
* Add otimes replacement.

* Fix some latex translations for qpic.

---------

Co-authored-by: Matthew Harrigan <[email protected]>
  • Loading branch information
fdmalone and mpharrigan authored Jul 24, 2024
1 parent 8ffdfde commit 0b6c2ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qualtran/bloqs/arithmetic/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def wire_symbol(
if reg.name == 'x':
return TextBox("x")
if reg.name == 'target':
return TextBox("z^(x<a)")
return TextBox("z(x<a)")
raise ValueError(f'Unknown register name {reg.name}')

def registers(self) -> Sequence[Union[int, Sequence[int]]]:
Expand Down Expand Up @@ -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']:
Expand Down
3 changes: 3 additions & 0 deletions qualtran/drawing/qpic_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 0b6c2ee

Please sign in to comment.