Package: inflation
InflationInflation 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, seePhysical 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.StandardNavascuÃ©s-Pironio-AcÃ­n hierarchy.Scenarios with partial information.See the documentation for more details.DocumentationLatest version.InstallationTo install the package, run the following command:pip install inflationYou can also install directly from GitHub with:pip install git+https://github.com/ecboghiu/inflation.git@mainor download the repository on your computer and runpip install .in the repository folder. Install thedevelbranch 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 -vinside the repository folder.ExampleThe 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:frominflationimportInflationProblem,InflationSDPimportnumpyasnpP_W=np.zeros((2,2,2,1,1,1))fora,b,c,x,y,zinnp.ndindex(*P_W.shape):ifa+b+c==1:P_W[a,b,c,x,y,z]=1/3triangle=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)sdp.generate_relaxation('npa2')sdp.set_distribution(P_W)sdp.solve()print("Problem status:",sdp.status)print("Infeasibility certificate:",sdp.certificate_as_probs())For more information about the theory and other features, please visit thedocumentation, and more specifically theTutorialandExamplespages.How to contributeContributions are welcome and appreciated. If you want to contribute, you can read thecontribution guidelines. You can also read thedocumentationto learn more about how the package works.LicenseInflation is free open-source software released underGNU GPL v. 3.0.Citing InflationIf you use Inflation in your work, please citeInflation's paper:Emanuel-Cristian Boghiu, Elie Wolfe and Alejandro Pozas-Kerstjens, "Inflation: a Python package for classical and quantum causal compatibility", arXiv:2211.04483@misc{2211.04483,
  doi = {10.48550/arXiv.2211.04483},
  url = {https://arxiv.org/abs/2211.04483},
  author = {Boghiu, Emanuel-Cristian and Wolfe, Elie and Pozas-Kerstjens, Alejandro},
  title = {{Inflation}: a {Python} package for classical and quantum causal compatibility},
  publisher = {arXiv},
  year = {2022},
  copyright = {arXiv.org perpetual, non-exclusive license}
}