qutip/qutip-doc

Ipython error while building the documentation

nathanshammah opened this issue · 2 comments

The documentation can be built according to the Readme.

For 4.5.0, make html fails due to problems in Ipython.

It picks up some issues in guide-visualization after line 399.

It seems that IPython has become more strict.
pandas-dev/pandas#23257

This seems a possible fix:
ipython/ipython#11402 (comment)

I could build the html only by changing these last ipython instances in the guide-visualization to ticks like this:

Implementation in QuTiP

In QuTiP, the procedure described above is implemented in the function :func:qutip.tomography.qpt, which returns the :math:\chi matrix given a density matrix propagator. To illustrate how to use this function, let's consider the :math:i-SWAP gate for two qubits. In QuTiP the function :func:qutip.qip.operations.iswap generates the unitary transformation for the state kets:

U_psi = iswap()

To be able to use this unitary transformation matrix as input to the function :func:qutip.tomography.qpt, we first need to convert it to a transformation matrix for the corresponding density matrix:

In [1]: U_rho = spre(U_psi) * spost(U_psi.dag())

Next, we construct a list of operators that define the basis :math:\{B_i\} in the form of a list of operators for each composite system. At the same time, we also construct a list of corresponding labels that will be used when plotting the :math:\chi matrix.

In [1]: op_basis = [[qeye(2), sigmax(), sigmay(), sigmaz()]] * 2

In [1]: op_label = [["i", "x", "y", "z"]] * 2

We are now ready to compute :math:\chi using :func:qutip.tomography.qpt, and to plot it using :func:qutip.tomography.qpt_plot_combined.

In [1]: chi = qpt(U_rho, op_basis)

In [1]: fig = qpt_plot_combined(chi, op_label, r'$i$SWAP')

@savefig visualization-chi-iswap.png width=5.0in align=center
In [1]: plt.show()

Closed by #120