Author of this file: Corsin Pfister

This file explains the usage of the Python script "analysis.py" that accompanies the
article "Capacity estimation and verification of quantum channels with
arbitrarily correlated errors" by C. Pfister, M. A. Rol, A. Mantri, 
M. Tomamichel and S. Wehner. This file takes an hdf5 file with experimental data
as its input and produces three plots, corresponding to figures 4(b), 5(a) and
5(b) of the article.

In this readme file, I assume that you use Linux or MacOS. If you use a
different operating system, the commands given in this readme file need to be
modified accordingly.

To use "analysis.py", open a terminal emulator and change to the directory that
contains "analysis.py". Then execute it by typing

./analysis.py datafile.hdf5

where "datafile.hdf5" is the hdf5-file containing the experimental data for
which the plots are to be generated. Some information is printed to standard
output, and eventually, a window should pop up, showing the three plots. For
more information on what the three plots show, see the captions of figures 4(b),
5(a) and 5(b) of the article.

This script makes the following assumptions:

(*) The file "analysis.py" is executable. If it is not executable, make it
    executable by typing

    sudo chmod +x analysis.py

(*) Python 3 is installed on your system (it's been tested with Python 3.5.2).
    If it is not installed, install it with your operating system's packet
    manager or visit www.python.org for more information.

(*) The Python modules numpy, matplotlib, argparse, h5py, scipy and sys are
    installed. If they are not installed, install them using pip (see
    https://pip.pypa.io/en/stable/ for more information on pip).

(*) The data of the experiment is stored in an hdf5 file, in a group named
    "Experimental Data" and in a dataset called "Data" within that group. If
    your hdf5 file uses different names for the group and the dataset, change
    the value of the "groupname" and "datasetname" variable in the CONFIGURATION
    AND PARAMETERS section of the "analysis.py" file.

    The dataset is assumed to have three columns, where
    - the first column indicates the used basis (either 0 or 1)
    - the second column indicates the prepared state (either 0 or 1)
    - the third column indicates the measured state (either 0 or 1)

    If your data is not available in the hdf5 format, you need to write a
    replacement for the "extract" function in "analysis.py". It needs to return
    a NumPy array with three columns as described above (the NumPy array is what
    the calculation is performed on, eventually).

You may want to modify some of the parameters that are set in the CONFIGURATION
AND PARAMETERS section of the "analysis.py" file. Currently, the parameters are
set to the same parameters that we used to generate our plots for the article.
The comments in that section should be sufficient to explain the meaning of the
parameters.
