Skip to content

Commit

Permalink
Merge pull request qutip#2272 from ejthomas/2172-latex-vscode
Browse files Browse the repository at this point in the history
Fix LaTeX display of Qobj state in Jupyter cell outputs
  • Loading branch information
Ericgig authored Nov 28, 2023
2 parents e841a89 + 3f0ad48 commit 253d91c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/changes/2272.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix LaTeX display of Qobj state in Jupyter cell outputs
4 changes: 2 additions & 2 deletions qutip/core/qobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,10 @@ def _repr_latex_(self):
cols.append(None)
cols += list(range(n_cols - half_length, n_cols))
# Make the data array.
data = r'\begin{equation*}\left(\begin{array}{*{11}c}'
data = r'$$\left(\begin{array}{cc}'
data += r"\\".join(_latex_row(row, cols, self.data.to_array())
for row in rows)
data += r'\end{array}\right)\end{equation*}'
data += r'\end{array}\right)$$'
return self._str_header() + data

def __and__(self, other):
Expand Down

0 comments on commit 253d91c

Please sign in to comment.