Link to QuTip Library
import sys
sys.path.insert(0, '..')
import numpy as np
import qutip as qt
import src
from src import (utils, paulialg, stabilizer, circuit)
1.6. Link to QuTip Library#
Pauli operators can be easily converted to the Qobj
in qutip library
Pauli.to_qupit()
PauliList.to_qutip()
PauliMonomial.to_qutip()
PauliPolynomial.to_qutip()
paulialg.pauli('XY').to_qutip()
\[\begin{split}Quantum object: dims = [[2, 2], [2, 2]], shape = (4, 4), type = oper, isherm = True\begin{equation*}\left(\begin{array}{*{11}c}0.0 & 0.0 & 0.0 & -1.0j\\0.0 & 0.0 & 1.0j & 0.0\\0.0 & -1.0j & 0.0 & 0.0\\1.0j & 0.0 & 0.0 & 0.0\\\end{array}\right)\end{equation*}\end{split}\]
paulialg.paulis('XY','ZZ').to_qutip()
[Quantum object: dims = [[2, 2], [2, 2]], shape = (4, 4), type = oper, isherm = True
Qobj data =
[[0.+0.j 0.+0.j 0.+0.j 0.-1.j]
[0.+0.j 0.+0.j 0.+1.j 0.+0.j]
[0.+0.j 0.-1.j 0.+0.j 0.+0.j]
[0.+1.j 0.+0.j 0.+0.j 0.+0.j]],
Quantum object: dims = [[2, 2], [2, 2]], shape = (4, 4), type = oper, isherm = True
Qobj data =
[[ 1. 0. 0. 0.]
[ 0. -1. 0. 0.]
[ 0. 0. -1. 0.]
[ 0. 0. 0. 1.]]]
((2+3j)*paulialg.pauli('XY')).to_qutip()
\[\begin{split}Quantum object: dims = [[2, 2], [2, 2]], shape = (4, 4), type = oper, isherm = False\begin{equation*}\left(\begin{array}{*{11}c}0.0 & 0.0 & 0.0 & (3.0-2.0j)\\0.0 & 0.0 & (-3.0+2.0j) & 0.0\\0.0 & (3.0-2.0j) & 0.0 & 0.0\\(-3.0+2.0j) & 0.0 & 0.0 & 0.0\\\end{array}\right)\end{equation*}\end{split}\]
((2+3j)*paulialg.pauli('XY')+(1.5)*paulialg.pauli('ZZ')).to_qutip()
\[\begin{split}Quantum object: dims = [[2, 2], [2, 2]], shape = (4, 4), type = oper, isherm = False\begin{equation*}\left(\begin{array}{*{11}c}1.500 & 0.0 & 0.0 & (3.0-2.0j)\\0.0 & -1.500 & (-3.0+2.0j) & 0.0\\0.0 & (3.0-2.0j) & -1.500 & 0.0\\(-3.0+2.0j) & 0.0 & 0.0 & 1.500\\\end{array}\right)\end{equation*}\end{split}\]