In [1]:
using Qlab
In [9]:
using Statistics, LinearAlgebra
In [4]:
DATAPATH = "/Users/mware/IpythonNotebooks/explorations/Tomography/";
DATE = "200428";
In [11]:
# The data here is just simple tomography of a qubit after a pi-pulse was applied
data, desc = load_data(DATAPATH,18,DATE,load_var=true);
# Note in this particular case, variance data was not saved with the averaged values
# Luckily, this could be calculated from a set of raw shots data
data["q2-main"]["variance"] = var(data["q2-rr"]["data"], dims=2);
# This also demonstrates how to easily add data sets to the data object
In [12]:
tomo = Qlab.StateTomo(data,desc);
In [13]:
rhoLSQ, rhoML = Qlab.analyzeStateTomo(tomo)
Out[13]:
Let's plot the reconstruction.
In [14]:
Qlab.pauli_set_plot(rhoLSQ)
For more informative plots we can use some nice existing libraries. Best to not reinvent the wheel. For this example, you'll need PyCall and Conda.jl with QuTip installed Conda.add("Qutip")
In [15]:
using PyCall
In [16]:
qutip = pyimport("qutip")
Out[16]:
In [17]:
qutip.matrix_histogram_complex(rhoLSQ)
Out[17]:
The interface will work the same for two-qubit data. Here we reconstruct one of the Bell states:
In [18]:
data, desc = load_data(DATAPATH,19,DATE,load_var=true);
In [19]:
tomo = Qlab.StateTomo(data,desc)
rhoLSQ, rhoML = Qlab.analyzeStateTomo(tomo);
Qlab.pauli_set_plot(rhoLSQ)
In [20]:
qutip.matrix_histogram_complex(rhoLSQ)
Out[20]:
In [ ]: