Git Product home page Git Product logo

pycftboot's Introduction

PyCFTBoot

pycftboot Actions Status codecov.io

⚠️ This is a rewriting of cbehan/pycftboot and is not meant to be backward compatible with that version ⚠️

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 and MPFR >= 4.0. 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 library dependencies left. One is Symengine which probably needs to be compiled. One commit that has been tested is ec460e7. 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.

  5. Additionally, extracting the spectrum with PyCFTBoot will require the binary unisolve.

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 two 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. The other is setting the path of SDPB and related executables by searching for /usr/bin/sdpb and updating this. 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:

pycftboot's People

Contributors

cbehan avatar alepiazza avatar definelicht avatar chrispattison avatar abatanasov avatar spraharsh avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.