Skip to content

Version 0.2.1 released

Choose a tag to compare

@tiago939 tiago939 released this 18 Feb 11:02
· 14 commits to main since this release

This version adds a way to visualize vector states as a latex expression in a Jupyter notebook.

With a notebook open, you can visualize this as:

import quforge.statevector as sv
from IPython.display import Math

Math(sv.show(state, dim=dim, wires=wires))

There are a few options in the show class that allows the user to have more control over showing the state:

  • tol: Tolerance below which amplitudes are considered zero.
  • use_floats: If True, display amplitudes as floating point numbers.
  • float_precision: The number of significant digits for floats.
  • emphasize_index: If an integer is provided, the specified index is factored out and emphasized.
  • suppress_inner: If True (and emphasize_index is not None), the non-emphasized part is replaced by a placeholder ket (e.g. $|\phi_1\rangle, |\phi_2\rangle$, etc.) instead of showing its full expansion.