Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LaTeX display of Qobj state in Jupyter cell outputs #2272

Merged
merged 4 commits into from Nov 28, 2023

Conversation

ejthomas
Copy link
Contributor

@ejthomas ejthomas commented Nov 28, 2023

Description
When a Qobj is present in the output of a Jupyter cell, e.g. when running:

import qutip as qt
qt.fock(2, 0)

the output, which contains LaTeX code, is displayed in Markdown. The aim of this PR is to display the LaTeX output correctly. Replacing the equation environment in the LaTeX code with $$...$$ and changing the array environment alignment from *{11}c to cc causes the vectors and matrices to display in the expected mathematical typeface. A test has not yet been provided, because the change was to a stored raw string; if a test is needed then the presence of this syntax in the string could be detected.

Related issues or PRs
Fixes #2172

@ejthomas ejthomas marked this pull request as ready for review November 28, 2023 14:52
@coveralls
Copy link

coveralls commented Nov 28, 2023

Coverage Status

coverage: 84.351%. remained the same
when pulling 3f0ad48 on ejthomas:2172-latex-vscode
into e841a89 on qutip:master.

Copy link
Member

@Ericgig Ericgig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution.

@Ericgig Ericgig merged commit 253d91c into qutip:master Nov 28, 2023
12 checks passed
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.

Quantum Object not rendered properly in Latex when using the VSCode IDE
3 participants