In [1]:
from qitensor import *
ha = qudit('a', 3, latex_label='\\alpha')
hb = qubit('b', latex_label='\\beta')
x = (ha*hb).O.array()
x[{hb: 0, hb.H: 0}] = ha.O.random_unitary()
x[0,1,0,1] = 1e-3
po_qi_save = get_qitensor_printoptions()
po_np_save = np.get_printoptions()
In [2]:
x.space
Out[2]:
In [3]:
x
Out[3]:
In [4]:
set_qitensor_printoptions(zero_color_html='lightgreen')
np.set_printoptions(precision=2, suppress=True)
x
Out[4]:
In [5]:
set_qitensor_printoptions(ipy_table_format_mode='latex', zero_color_latex='orange')
x
Out[5]:
In [6]:
set_qitensor_printoptions(ipy_table_format_mode='plain')
x
Out[6]:
In [7]:
set_qitensor_printoptions(**po_qi_save)
np.set_printoptions(**po_np_save)