Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time



Inflation is a Python package that implements inflation algorithms for causal inference. In causal inference, the main task is to determine which causal relationships can exist between different observed random variables. Inflation algorithms are a class of techniques designed to solve the causal compatibility problem, that is, test compatibility between some observed data and a given causal relationship.

The first version of this package implements the inflation technique for quantum causal compatibility. For details, see Physical Review X 11 (2), 021043 (2021). The inflation technique for classical causal compatibility will be implemented in a future update.

Examples of use of this package include:

  • Feasibility problems and extraction of certificates.
  • Optimization of Bell operators.
  • Optimisation over classical distributions.
  • Standard Navascués-Pironio-Acín hierarchy.
  • Scenarios with partial information.

See the documentation for more details.



To install the package, run the following command:

pip install inflation

You can also install directly from GitHub with:

pip install git+

or download the repository on your computer and run pip install . in the repository folder. Install the devel branch for the latest features and bugfixes.

Tests are written outside the Python module, therefore they are not installed together with the package. To test the installation, clone the repository and run, in a Unix terminal, python -m unittest -v inside the repository folder.


The following example shows that the W distribution is incompatible with the triangle scenario with quantum sources by showing that a specific semidefinite programming relaxation is infeasible:

from inflation import InflationProblem, InflationSDP
import numpy as np

P_W = np.zeros((2, 2, 2, 1, 1, 1))
for a, b, c, x, y, z in np.ndindex(*P_W.shape):
    if a + b + c == 1:
        P_W[a, b, c, x, y, z] = 1 / 3

triangle = InflationProblem(dag={"rho_AB": ["A", "B"],
                                 "rho_BC": ["B", "C"],
                                 "rho_AC": ["A", "C"]},
                             outcomes_per_party=(2, 2, 2),
                             settings_per_party=(1, 1, 1),
                             inflation_level_per_source=(2, 2, 2))

sdp = InflationSDP(triangle, verbose=1)

print("Problem status:", sdp.status)
print("Infeasibility certificate:", sdp.certificate_as_probs())

For more information about the theory and other features, please visit the documentation, and more specifically the Tutorial and Examples pages.

How to contribute

Contributions are welcome and appreciated. If you want to contribute, you can read the contribution guidelines. You can also read the documentation to learn more about how the package works.


Inflation is free open-source software released under GNU GPL v. 3.0.

Citing Inflation

If you use Inflation in your work, please cite Inflation's paper:

  • Emanuel-Cristian Boghiu, Elie Wolfe and Alejandro Pozas-Kerstjens, "Inflation: a Python package for classical and quantum causal compatibility", Quantum 7, 996 (2023), arXiv:2211.04483
  doi = {10.22331/q-2023-05-04-996},
  url = {},
  title = {Inflation: a {P}ython library for classical and quantum causal compatibility},
  author = {Boghiu, Emanuel-Cristian and Wolfe, Elie and Pozas-Kerstjens, Alejandro},
  journal = {{Quantum}},
  issn = {2521-327X},
  publisher = {{Verein zur F{\"{o}}rderung des Open Access Publizierens in den Quantenwissenschaften}},
  volume = {7},
  pages = {996},
  month = may,
  year = {2023},
  archivePrefix = {arXiv},
  eprint = {2211.04483}


Implementations of the Inflation Technique for Causal Inference.








No packages published