{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Tutorial" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The Inflation package contains implementations of the inflation technique for causal compatibility. Currently it only supports the quantum inflation method of [[1](https://www.arxiv.org/abs/1909.10519)]. In the future, we plan adding support to the inflation hierarchy for classical causal compatibility of [[2](https://www.arxiv.org/abs/1609.00672)] and dedicated parts for analysing theory-independent correlations. The implementation of Inflation follows an object-oriented design. The workflow comprises of three main steps:\n", "\n", "* Encode the causal scenario and desired inflation as an instance of `InflationProblem`.\n", "* Generate the associated optimization problem for classical, quantum, or theory-independent inflation (currently, only `InflationSDP` is available).\n", "* Export the problem to a file and/or solve it.\n", "\n", "We will now go through the steps above in more detail. This tutorial is available on the [documentation webpage](https://ecboghiu.github.io/inflation/) and it can also be downloaded as a ready-to-run [Jupyter Notebook](https://github.com/ecboghiu/inflation/blob/main/examples/tutorial.ipynb) from the [GitHub repository](https://github.com/ecboghiu/inflation). If already familiar with quantum inflation, the quickest way to get started is to run some examples from the [Examples](https://ecboghiu.github.io/inflation/_build/html/examples.html) section, which can also be downloaded as a [Jupyter Notebook](https://github.com/ecboghiu/inflation/blob/main/docs/examples.ipynb).\n", "\n", "We start by importing everything that we will need:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from inflation import InflationProblem, InflationSDP\n", "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Encoding the inflation problem \n", "\n", "The first object of interest is [InflationProblem](https://ecboghiu.github.io/inflation/_build/html/inflationproblem.html#inflation.InflationProblem). When instantiating it, we pass all the relevant information about the causal scenario and the type of inflation we want to perform.\n", "\n", "#### Basics of causal diagrams\n", "\n", "Causal relationships are encoded through a Bayesian Directed Acyclic Graph, or DAG for short. The nodes of the graph represent random variables, which can be either observable (visible) or unobservable (hidden). Directed arrows encode causal influences between nodes. Arrows point from parent nodes to the nodes causally influenced by them, called children nodes. The acyclicity property avoids the presence of causal loops. \n", "\n", "For applications to physics, another class of random variables is often considered called \"settings\". These correspond to observable variables on whose outcome we condition in order to obtain the observed data. For example, this might correspond to measuring one property of a system versus another in an experiment. Furthermore, in physics we also have sources generating quantum correlations. These are modeled through the presence of quantum unobservable variables, which represent quantum systems. Arrows going into a quantum node represent controlling the corresponding quantum system. Arrows going out of the quantum node represent the children of the quantum node generating statistics by measuring the quantum system.\n", "\n", "#### The quantum tripartite line and an inflation\n", "\n", "As an example, let us consider the quantum tripartite line, or \"quantum bilocality scenario\" [[3](https://arxiv.org/abs/1112.4502)], which corresponds to the scenario where three space-like separated parties ($A$, $B$ and $C$) measure two quantum systems $\\rho_{AB}$, $\\rho_{BC}$ that never interacted in the past. The subindex of the quantum states indicates which parties have access to and can measure that state. This is a simple scenario where entanglement swapping [[4](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.71.4287)] can be performed, which is at the heart of the quantum teleportation protocol [[5](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.70.1895)]. The corresponding DAG is:\n", "\n", "