C L A S Sthe Cosmic Linear Anisotropy Solving System |
The purpose of CLASS is to simulate the evolution of linear perturbations in the universe and to compute CMB and large scale structure observables. Its name also comes from the fact that it is written in object-oriented style mimicking the notion of class. Classes are a wonderfull programming feature available e.g. in C++ and python, but these languages are known to be less vectorizable/parallelizable than plain C (or Fortran), and hence potentially slower. For CLASS we choose to use plain C for high performances, while organizing the code in a few modules that reproduce the architecture and philosophy of C++ classes, for optimal readability and modularity.
DownloadThe use of CLASS is free provided that when you use it in a publication, you cite at least the paper CLASS II: Approximation schemes (reference below). You are welcome to cite any other CLASS paper if relevant!
There are three ways to get to use CLASS. If you only want to use it through its python wrapper classy and not modify it, just install it as a python module with pip install classy. If you want to see the code and/or modify it just for yourself, download a tar.gz archive of the latest released (master branch) version, v3.2.3, by clicking class_public-3.2.3.tar.gz. But if you are familiar with git repositories, and you wish to develop a new branch of the code, or see all public branches and/or old versions, you will prefer to clone it from the class_public git repository.
DocumentationAfter downloading the code, unpack the archive (tar -zxvf class_public-vx.y.z.tar.gz), go to the class directory (cd class_public-vx.y.z/) and compile (make clean; make class; maybe with option -j to speed it up). If the first compilation attempt fails, you may need to open the Makefile and adapt the name of the compiler (default: gcc), of the optization flag (default: -O4 -ffast-math) and of the OpenMP flag (default: -fopenmp; this flag is facultative, you are free to compile without OpenMP if you don't want parallel execution; note that you need the version 4.2 or higher of gcc to be able to compile with -fopenmp). Several details on the CLASS compilation are given on the installation wiki page (in particular, for compiling on Mac OS >= 10.9 despite potential incompatibilities between clang, OpenMP, and versions of python compiled on your computer with gcc).To check that the code runs, type: ./class explanatory.ini The explanatory.ini file is a reference input file, containing and explaning the use of all possible input parameters. We recommend to read it, to keep it unchanged (for future reference), and to create for your own purposes some shorter input files, containing only the input lines which are useful for you. Input files must have a *.ini extension. If you want to play with the precision/speed of the code, you can use one of the provided precision files (e.g. cl_permille.pre) or modify one of them, and run with two input files (e.g. ./class test.ini cl_permille.pre). For more details, view our online html documentation generated by doxygen (credits D.C. Hooper). Other CLASS papers dedicated to various aspects of the code are listed below. You can also look at slides from CLASS-dedicated courses. To use CLASS from python, or ipython notebooks, or from the Monte Python parameter extraction code, you need to compile not only the code, but also its python wrapper. This can be done by typing just make instead of make class. More details on the wrapper and its compilation are found on the wiki page. Since version 2.3, the package includes an improved plotting script called CPU.py (Class Plotting Utility), written by Benjamin Audren and Jesus Torrado. It can plot the Cl's, the P(k) or any other CLASS puput, for one or several models, as well as their ratio or percentage difference. The syntax and list of available options is obtained by typing pyhton CPU.py --help. There is a similar script for MATLAB, written by Thomas Tram. To use it, once in MATLAB, type help plot_CLASS_output.m If you want to develop the code, we suggest that you download it from the github webpage rather than from class-code.net. Then you will enjoy all the feature of git repositories. You can even develop your own branch and get it merged to the public distribution, following the public contributing instructions. Papers
|