/pycftboot

A free frontend for the conformal bootstrap

Primary LanguagePythonMIT LicenseMIT

PyCFTBoot

PyCFTBoot is an interface for the conformal bootstrap as discussed in its 2008 revival. Starting from the analytic structure of conformal blocks, the code formulates semidefinite programs without any proprietary software. The code does NOT perform the actual optimization. It assumes you already have a program for that, namely SDPB by David Simmons-Duffin.

PyCFTBoot supports bounds on scaling dimensions and OPE coefficients in an arbitrary number of spacetime dimensions. The four-point functions used for the bounds must contain only scalars but they may have any combination of scaling dimensions and transform in arbitrary representations of a global symmetry.

Installation on Linux

If you use one of the mainstream Linux distributions, the following instructions should help you install PyCFTBoot and everything it depends on.

  1. Follow the instructions for installing SDPB. When this is done, you will have Boost and GMP as well, so we will not need to discuss those further.

  2. Additional run-time dependencies are: Sympy, Numpy and MPFR >= 3.1. The build-time dependencies are: Cython and CMake >= 2.8. You should install all of these. You will probably not need to compile them because most distros have these packages in their repositories.

  3. There are two dependencies left. One is Symengine which probably needs to be compiled. One commit that has been tested is 5427bbe. An even better idea is to use the latest commit that has been marked stable for language bindings. To compile it with the recommended settings, run:

     mkdir build && cd build
     # WITH_PTHREAD and WITH_SYMENGINE_THREAD_SAFE might be helpful as well
     cmake .. -DWITH_MPFR:BOOL=ON
     make
    
  4. Lastly, compile and install Symengine.py.

Installation on Mac

Thanks to Jaehoon Lee for writing these instructions and testing them on OS X 10.11 (El Capitan).

  1. Follow the instructions for installing SDPB on Mac OS X. Installing gcc takes a long time, so be patient. Also, you don't need sudo for installing boost due to recent changes. After that, you will have homebrew, gcc, gmp, mpfr and boost installed. The default compilers should be renamed as gcc and g++ following the instructions.

  2. Build all the required packages (Cython, Numpy, Sympy and Mpmath). One might alreday have these packages installed. The following assumes that no package other than the system's Python is installed.

     # Install homebrew's python which comes with pip
     brew install python
     brew linkapps python
     pip install --upgrade pip setuptools
    
     # Numpy
     brew install homebrew/python/numpy
    
     # Cython
     pip install cython
    
     # Sympy 
     pip install sympy
    
     # Mpmath - technically not required as it is included in sympy
     pip install mpmath
    
  3. Install cmake using homebrew:

     brew install cmake
    
  4. Download Symengine and compile it. If you fail to install and need to rebuild, remove the build folder and start remaking it. Unpack the source file within the directory and run:

     mkdir build && cd build
     # Turning on the MPFR option is critical for using PyCFTBoot 
     CC=gcc CXX=g++ cmake .. -DWITH_MPFR:BOOL=ON
     make
     # Test everything is built correctly
     ctest
     # Install files to default directories
     make install
    
  5. Install the Python bindings Symengine.py. Download the source and within the directory run:

     CC=gcc CXX=g++ python setup.py install
    

Usage

To test that PyCFTBoot is working, try to run:

    python
    import bootstrap

If that doesn't work, you should check if the dependencies import correctly.

    python
    import symengine

Assuming that all of this works, python tutorial.py will enter a tutorial with four examples. There are three changes that you might want to make to bootstrap.py. One is changing python2 to python in the first line, for systems that don't append a specific number. Another is setting the path of SDPB by searching for /usr/bin/sdpb and updating this. Finally, if the sympy package you installed does not have mpmath as a separate module, change import mpmath to import sympy.mpmath as mpmath. Have fun constraining CFTs and convincing cluster maintainers to install fairly new software!

Attribution

If PyCFTBoot is helpful in one of your publications, please cite: