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

Visualisation #14

Closed
wants to merge 0 commits into from
Closed

Visualisation #14

wants to merge 0 commits into from

Conversation

daehiff
Copy link
Collaborator

@daehiff daehiff commented May 31, 2023

Enables Visualization (Issue: #10 ) of Pauli Polynomials and latex export.

from pauliopt.pauli.pauli_polynomial import PauliPolynomial
from pauliopt.pauli.pauli_gadget import PPhase
from pauliopt.utils import Angle, pi
from pauliopt.pauli.utils import I, X, Y, Z

pp = PauliPolynomial(5)

pp >>= PPhase(Angle(pi)) @ [I, I, X, Z, Y]
pp >>= PPhase(Angle(pi)) @ [I, I, X, Z, Y]
pp >>= PPhase(Angle(pi / 2)) @ [I, I, X, Z, Y]

display(pp)
 # shows the Pauli Polynomial in jupyter notebooks

pp.to_svg(svg_code_only=True) 
 # provides the SVG code of the Pauli Polynomial

pp.to_latex()
# provides the latex code representing the PP

pp.to_latex(file_name="test")
# stores the Pauli Polynomial in 'text.tex'

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.

1 participant