**PRECESSION** is an open-source python module to study the dynamics of precessing black-hole binaries in the post-Newtonian regime. The code provides a comprehensive toolbox to (i) study the evolution of the black-hole spins along their precession cycles, (ii) perform gravitational-wave driven binary inspirals using both orbit-averaged and precession-averaged integrations, and (iii) predict the properties of the merger remnant through fitting formulae obtained from numerical relativity simulations. **PRECESSION** is a ready-to-use tool to add the black-hole spin dynamics to larger-scale numerical studies such as gravitational-wave parameter estimation codes, population synthesis models to predict gravitational-wave event rates, galaxy merger trees and cosmological simulations of structure formation. **PRECESSION** provides fast and reliable integration methods to propagate statistical samples of black-hole binaries from/to large separations where they form to/from small separations where they become detectable, thus linking gravitational-wave observations of spinning black-hole binaries to their astrophysical formation history. The code is also a useful tool to compute initial parameters for numerical relativity simulations targeting specific precessing systems.

### Key links:

- Source code: github.com/dgerosa/precession.
- Online documentation: dgerosa.github.io/precession.
- Python Package Index: pypi.python.org/pypi/precession
- v1.0 of the code is carefully presented in the scientific paper 1605.01067:

D. Gerosa, M. Kesden.

* PRECESSION* :

*Dynamics of spinning black-hole binaries with python*.

arXiv:1605.01067, PRD 93 (2016) 124066.

### Credits

The code is developed and maintained by Davide Gerosa. Please, report bugs to me: dgerosa@caltech.edu.

This work is licensed under the CC BY 4.0 licence. Essentially, you can use **PRECESSION**** **as you like, but must make reference to our work. If you publish a paper using this code, please drop me an email, so that it can be included in this webpage.

**Thanks: ** E. Berti, M. Kesden, U. Sperhake, R. O’Shaughnessy, D. Trifiro’, A. Klein, J. Vosmera and X. Zhao**.**

### Results

**PRECESSION **has been used in the following published papers:

*Gerosa and Sesana*. MNRAS 446 (2015) 38-55. arXiv:1405.2072*Kesden et al.*PRL 114 (2015) 081103. arXiv:1411.0674*Gerosa et al.*MNRAS 451 (2015) 3941-3954. arXiv:1503.06807*Gerosa et al.*PRD 92 (2015) 064016. arXiv:1506.03492*Gerosa et al.*PRL 115 (2015) 141102. arXiv:1506.09116*Trifirò et al.*PRD 93 (2016) 044071. arXiv:1507.05587*Gerosa and Kesden.*PRD 93 (2016) 124066. arXiv:1605.01067*Gerosa and Moore.*PRL 117 (2016) 011101. arXiv:1606.04226*Rodriguez et al.*APJL 832 (2016) L2. arXiv:1609.05916*Gerosa et al.*CQG 34 (2017) 6, 064004. arXiv:1612.05263*Gerosa and Berti.*PRD in press. arXiv:1703.06223*Zhao et al.*Submitted to PRD. arXiv:1705.02369

### Installation

**PRECESSION** is uploaded in the Python Package Index PyPI. To install the code from PyPI type

pip install precession

To upgrade from a previous version use

pip install -U precession

If you are new to python or you don’t have pip, have a look at this guide I wrote. Alternatively, you can download the source of the latest version from GitHub.

The code has been tested on python 2.7 and currently is not compatible with python 3. The python libraries numpy, scipy, matplotlib and parmap are specified as essential prerequisites. They can all be installed using pip. If these packages are missing in your system, pip will try to install them when installing **PRECESSION**. Packages such as scipy are far more complex than **PRECESSION**: if the installation fail, please refer to their webpage.

### Usage

To start using the code, enter a python console and type

import precession

The submodule precession.test provides examples and introductory tutorial to start using the code.

import precession.test

A minimal working example, where a single PN inspiral is performed, can be executed typing

precession.test.minimal()

Various other tests are described in the paper above.

### Documentation

A detailed API documentation is regularly uploaded to a dedicated branch of the git repository and is available online. The python built-in help function also provides information on the module and its functions.

help(precession.FUNCTION)

### Units

All quantities in the code are specified in natural units c=G=1. Moreover, the binary total mass M=m1+m2 is set to 1 and everything else is computed accordingly. In practice, this means that e.g. the binary separation r is actually r/M. If you are trying to use **PRECESSION** from a code with different units (lal?), you should just pass r/M instead of your cgs or SI r. Equivalently, the angular momentum L, the spins Si and the total angular momentum J are actually L/M^2, Si/M^2 and J/M^2.

### Parallelization and checkpointing

Checkpointing is implemented in some functions for computational efficiency. Temporary data are stored in a local directory and will be read in if available. To delete all previous data run

precession.empty_temp()

By default, data are stored in a local directory called “precession_checkpoints”. You can change it setting

precession.storedir="[relative_or_absolute_path]"

PN integrations are parallelized using the parmap module. Instructions on code parallelization are set by the global integer variable CPUs which specifies the number of code available.

### Releases

**Picture**: under a highway bridge in Boston, USA