We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently ( as with PR: #5 ), we can only visualize Pauli gadgets and Pauli Polynomials in the terminal as follows:
pp = PauliPolynomial(num_qubits=4) pp >>= PPhase(0.5) @ [X, Y, Z, I] print(pp)
An interesting extension would be:
.tex
An extension towards Jupiter notebooks, already present with Phase gadgets plus Latex support, would be interesting.
For the Jupyter notebooks, one can orient himself at: https://github.com/sg495/pauliopt/blob/main/pauliopt/phase/phase_circuits.py#L937). Here the phase circuit is cast to an SVG. This can be shown in Pybooks using the display function.
display
For Latex support a template can be found in the following:
\documentclass[preview]{standalone} \usepackage{tikz} \usetikzlibrary{zx-calculus} \usetikzlibrary{quantikz} \usepackage{graphicx} \tikzset{ diagonal fill/.style 2 args={fill=#2, path picture={ \fill[#1, sharp corners] (path picture bounding box.south west) -| (path picture bounding box.north east) -- cycle;}}, reversed diagonal fill/.style 2 args={fill=#2, path picture={ \fill[#1, sharp corners] (path picture bounding box.north west) |- (path picture bounding box.south east) -- cycle;}} } \tikzset{ pauliY/.style={ anchor=center, minimum height=0.5em, minimum width=0.5em, draw, line width=\zxDefaultLineWidth, diagonal fill={colorZxX}{colorZxZ} } } \tikzset{ pauliX/.style={ anchor=center, minimum height=0.5em, minimum width=0.5em, draw, line width=\zxDefaultLineWidth, fill=colorZxX } } \tikzset{ pauliZ/.style={ anchor=center, minimum height=0.5em, minimum width=0.5em, draw, line width=\zxDefaultLineWidth, fill=colorZxZ } } \tikzset{ pauliPhase/.style={ anchor=center, minimum height=1em, minimum width=1em, draw, line width=\zxDefaultLineWidth, fill=white } } \begin{document} \begin{ZX} \zxNone{} & & |[pauliPhase]| {\alpha}\\ \\ \zxNone{} \rar & |[pauliX]| \ar[ruu, bend right] \rar & \zxNone{}\\ \zxNone{} \rar & |[pauliY]| \ar[ruuu, bend right] \rar & \zxNone{}\\ \zxNone{} \rar & |[pauliZ]| \ar[ruuuu, bend right] \rar & \zxNone{}\\ \zxNone{} \rar & \zxNone{} \rar & \zxNone{}\\ \end{ZX} \end{document}
This .tex code will render a Pauli gadget like this:
Note that this Latex Script is mainly based on the ZX-Calculus library (https://ctan.org/pkg/zx-calculus?lang=en)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently ( as with PR: #5 ), we can only visualize Pauli gadgets and Pauli Polynomials in the terminal as follows:
An interesting extension would be:
.tex
FilesDisplay Pauli Polynomials in Jupyter notebooks
An extension towards Jupiter notebooks, already present with Phase gadgets plus Latex support, would be interesting.
For the Jupyter notebooks, one can orient himself at: https://github.com/sg495/pauliopt/blob/main/pauliopt/phase/phase_circuits.py#L937). Here the phase circuit is cast to an SVG. This can be shown in Pybooks using the
display
function.Latex Support
For Latex support a template can be found in the following:
This
.tex
code will render a Pauli gadget like this:Note that this Latex Script is mainly based on the ZX-Calculus library (https://ctan.org/pkg/zx-calculus?lang=en)
The text was updated successfully, but these errors were encountered: