Linear Theory: Solving the Boltzmann...

109
Linear Theory: Solving the Boltzmann Equations Jascha Schewtschenko Institute of Cosmology and Gravitation, University of Portsmouth July 27, 2019 JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 1 / 35

Transcript of Linear Theory: Solving the Boltzmann...

Page 1: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Linear Theory: Solving the Boltzmann Equations

Jascha Schewtschenko

Institute of Cosmology and Gravitation, University of Portsmouth

July 27, 2019

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 1 / 35

Page 2: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Outline

1 Introduction

2 ApproximationsUltrarel.Fluid Approximation (UFA)Fluid approximationTight Coupling Approximation (TCA)Tight Coupling Approximation (TCA)Radiation Streaming Approximation (RSA)

3 Implementation - CLASSStructure of CLASSPython WrapperModifying CLASS

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 2 / 35

Page 3: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

History

overview of all the equations you may want to solve (for LCDM)

great starting point to implement any Boltzmann solver

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 3 / 35

Page 4: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

History

overview of all the equations you may want to solve (for LCDM)

great starting point to implement any Boltzmann solver

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 3 / 35

Page 5: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

History

overview of all the equations you may want to solve (for LCDM)

great starting point to implement any Boltzmann solver

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 3 / 35

Page 6: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

History (cont.)(Popular) Public Einstein-Boltzmann solver covering all basic cosmology(abandoned or active development)

COSMICS (1995; Bertschinger) written in Fortran55; Synchronous gauge;Peeblesrecombination; Integration of Boltzmann eq. forphotons/neutrinos up to 2500

CMBFAST (1996; Seljak & Zaldarriaga) Add a few functions to COSMICS forcomputing the source functions and convolve them with Besselfunctions; New code much faster

RECFAST (1999; Seager et al.) module/patch for CMBFAST; improvedrecombination, open/closed, lensing; more complicated code

CAMB (1999; Lewis et al.) Based on CMBFAST, but cut in pieces andreorganised differently in Fortran90 . Improved expressions forsources, initial conditions, lensing, etc.; highly optimised for speed;newest versions with Python interface

CMBEASY (2003; Doran et al.) Based on CMBFAST, reorganised in C++

CLASS (2011; Lesgourgues et al.) written in C; Alternative to CAMB;Highly improved user-friedliness (“easy-to-use”), flexibility(“easy-to-modify”)(, speed)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 4 / 35

Page 7: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

History (cont.)(Popular) Public Einstein-Boltzmann solver covering all basic cosmology(abandoned or active development)

COSMICS (1995; Bertschinger) written in Fortran55; Synchronous gauge;Peeblesrecombination; Integration of Boltzmann eq. forphotons/neutrinos up to 2500

CMBFAST (1996; Seljak & Zaldarriaga) Add a few functions to COSMICS forcomputing the source functions and convolve them with Besselfunctions; New code much faster

RECFAST (1999; Seager et al.) module/patch for CMBFAST; improvedrecombination, open/closed, lensing; more complicated code

CAMB (1999; Lewis et al.) Based on CMBFAST, but cut in pieces andreorganised differently in Fortran90 . Improved expressions forsources, initial conditions, lensing, etc.; highly optimised for speed;newest versions with Python interface

CMBEASY (2003; Doran et al.) Based on CMBFAST, reorganised in C++

CLASS (2011; Lesgourgues et al.) written in C; Alternative to CAMB;Highly improved user-friedliness (“easy-to-use”), flexibility(“easy-to-modify”)(, speed)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 4 / 35

Page 8: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

History (cont.)(Popular) Public Einstein-Boltzmann solver covering all basic cosmology(abandoned or active development)

COSMICS (1995; Bertschinger) written in Fortran55; Synchronous gauge;Peeblesrecombination; Integration of Boltzmann eq. forphotons/neutrinos up to 2500

CMBFAST (1996; Seljak & Zaldarriaga) Add a few functions to COSMICS forcomputing the source functions and convolve them with Besselfunctions; New code much faster

RECFAST (1999; Seager et al.) module/patch for CMBFAST; improvedrecombination, open/closed, lensing; more complicated code

CAMB (1999; Lewis et al.) Based on CMBFAST, but cut in pieces andreorganised differently in Fortran90 . Improved expressions forsources, initial conditions, lensing, etc.; highly optimised for speed;newest versions with Python interface

CMBEASY (2003; Doran et al.) Based on CMBFAST, reorganised in C++

CLASS (2011; Lesgourgues et al.) written in C; Alternative to CAMB;Highly improved user-friedliness (“easy-to-use”), flexibility(“easy-to-modify”)(, speed)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 4 / 35

Page 9: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

History (cont.)(Popular) Public Einstein-Boltzmann solver covering all basic cosmology(abandoned or active development)

COSMICS (1995; Bertschinger) written in Fortran55; Synchronous gauge;Peeblesrecombination; Integration of Boltzmann eq. forphotons/neutrinos up to 2500

CMBFAST (1996; Seljak & Zaldarriaga) Add a few functions to COSMICS forcomputing the source functions and convolve them with Besselfunctions; New code much faster

RECFAST (1999; Seager et al.) module/patch for CMBFAST; improvedrecombination, open/closed, lensing; more complicated code

CAMB (1999; Lewis et al.) Based on CMBFAST, but cut in pieces andreorganised differently in Fortran90 . Improved expressions forsources, initial conditions, lensing, etc.; highly optimised for speed;newest versions with Python interface

CMBEASY (2003; Doran et al.) Based on CMBFAST, reorganised in C++

CLASS (2011; Lesgourgues et al.) written in C; Alternative to CAMB;Highly improved user-friedliness (“easy-to-use”), flexibility(“easy-to-modify”)(, speed)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 4 / 35

Page 10: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

History (cont.)(Popular) Public Einstein-Boltzmann solver covering all basic cosmology(abandoned or active development)

COSMICS (1995; Bertschinger) written in Fortran55; Synchronous gauge;Peeblesrecombination; Integration of Boltzmann eq. forphotons/neutrinos up to 2500

CMBFAST (1996; Seljak & Zaldarriaga) Add a few functions to COSMICS forcomputing the source functions and convolve them with Besselfunctions; New code much faster

RECFAST (1999; Seager et al.) module/patch for CMBFAST; improvedrecombination, open/closed, lensing; more complicated code

CAMB (1999; Lewis et al.) Based on CMBFAST, but cut in pieces andreorganised differently in Fortran90 . Improved expressions forsources, initial conditions, lensing, etc.; highly optimised for speed;newest versions with Python interface

CMBEASY (2003; Doran et al.) Based on CMBFAST, reorganised in C++

CLASS (2011; Lesgourgues et al.) written in C; Alternative to CAMB;Highly improved user-friedliness (“easy-to-use”), flexibility(“easy-to-modify”)(, speed)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 4 / 35

Page 11: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

History (cont.)(Popular) Public Einstein-Boltzmann solver covering all basic cosmology(abandoned or active development)

COSMICS (1995; Bertschinger) written in Fortran55; Synchronous gauge;Peeblesrecombination; Integration of Boltzmann eq. forphotons/neutrinos up to 2500

CMBFAST (1996; Seljak & Zaldarriaga) Add a few functions to COSMICS forcomputing the source functions and convolve them with Besselfunctions; New code much faster

RECFAST (1999; Seager et al.) module/patch for CMBFAST; improvedrecombination, open/closed, lensing; more complicated code

CAMB (1999; Lewis et al.) Based on CMBFAST, but cut in pieces andreorganised differently in Fortran90 . Improved expressions forsources, initial conditions, lensing, etc.; highly optimised for speed;newest versions with Python interface

CMBEASY (2003; Doran et al.) Based on CMBFAST, reorganised in C++

CLASS (2011; Lesgourgues et al.) written in C; Alternative to CAMB;Highly improved user-friedliness (“easy-to-use”), flexibility(“easy-to-modify”)(, speed)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 4 / 35

Page 12: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

History (cont.)(Popular) Public Einstein-Boltzmann solver covering all basic cosmology(abandoned or active development)

COSMICS (1995; Bertschinger) written in Fortran55; Synchronous gauge;Peeblesrecombination; Integration of Boltzmann eq. forphotons/neutrinos up to 2500

CMBFAST (1996; Seljak & Zaldarriaga) Add a few functions to COSMICS forcomputing the source functions and convolve them with Besselfunctions; New code much faster

RECFAST (1999; Seager et al.) module/patch for CMBFAST; improvedrecombination, open/closed, lensing; more complicated code

CAMB (1999; Lewis et al.) Based on CMBFAST, but cut in pieces andreorganised differently in Fortran90 . Improved expressions forsources, initial conditions, lensing, etc.; highly optimised for speed;newest versions with Python interface

CMBEASY (2003; Doran et al.) Based on CMBFAST, reorganised in C++

CLASS (2011; Lesgourgues et al.) written in C; Alternative to CAMB;Highly improved user-friedliness (“easy-to-use”), flexibility(“easy-to-modify”)(, speed)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 4 / 35

Page 13: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

General numerical techniques

If using a C(omputer)A(lgebra)S(ystem) like Mathematica, you mayable to solve certain systems of differentational equations or integralsanalytically.

Provides the most accurate solutions, but rarely possible.

Instead numerical techniques have to be used solve such equation.Understanding your problem and the best approach is important as itmay strongly affect the precision and speed of your calculations.

Talking about them all in detail, would exceed the scope of thislecture. For a great overview, see the “Numerical Recipes” bookseries (http://numerical.recipes/)

We will instead introduce certain important concepts where needed

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 5 / 35

Page 14: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

General numerical techniques

If using a C(omputer)A(lgebra)S(ystem) like Mathematica, you mayable to solve certain systems of differentational equations or integralsanalytically.

Provides the most accurate solutions, but rarely possible.

Instead numerical techniques have to be used solve such equation.Understanding your problem and the best approach is important as itmay strongly affect the precision and speed of your calculations.

Talking about them all in detail, would exceed the scope of thislecture. For a great overview, see the “Numerical Recipes” bookseries (http://numerical.recipes/)

We will instead introduce certain important concepts where needed

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 5 / 35

Page 15: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

General numerical techniques

If using a C(omputer)A(lgebra)S(ystem) like Mathematica, you mayable to solve certain systems of differentational equations or integralsanalytically.

Provides the most accurate solutions, but rarely possible.

Instead numerical techniques have to be used solve such equation.Understanding your problem and the best approach is important as itmay strongly affect the precision and speed of your calculations.

Talking about them all in detail, would exceed the scope of thislecture. For a great overview, see the “Numerical Recipes” bookseries (http://numerical.recipes/)

We will instead introduce certain important concepts where needed

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 5 / 35

Page 16: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

General numerical techniques

If using a C(omputer)A(lgebra)S(ystem) like Mathematica, you mayable to solve certain systems of differentational equations or integralsanalytically.

Provides the most accurate solutions, but rarely possible.

Instead numerical techniques have to be used solve such equation.Understanding your problem and the best approach is important as itmay strongly affect the precision and speed of your calculations.

Talking about them all in detail, would exceed the scope of thislecture. For a great overview, see the “Numerical Recipes” bookseries (http://numerical.recipes/)

We will instead introduce certain important concepts where needed

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 5 / 35

Page 17: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

General numerical techniques

If using a C(omputer)A(lgebra)S(ystem) like Mathematica, you mayable to solve certain systems of differentational equations or integralsanalytically.

Provides the most accurate solutions, but rarely possible.

Instead numerical techniques have to be used solve such equation.Understanding your problem and the best approach is important as itmay strongly affect the precision and speed of your calculations.

Talking about them all in detail, would exceed the scope of thislecture. For a great overview, see the “Numerical Recipes” bookseries (http://numerical.recipes/)

We will instead introduce certain important concepts where needed

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 5 / 35

Page 18: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Solving Linearized Boltzmann equations

In this lecture, we will limit the discussion on how to solve theBoltzmann equations to linear order

A basic Boltzmann solver is not complicated, just a bit complex(implementing naively the equations found in Ma&Bertschinger tolinear order)

Boltzmann codes have improved considerably in terms of precisionand speed with respect to the pioneering COSMICS code

Several sophisticated optimisation methods and approximationschemes have been introduced in each new code

Improving the speed while keeping the precision sufficiently high isessential. MCMC runs invoke the Boltzmann solver for each of the104 − 105 steps

In the following, we will introduce a few of the importantapproximation you may encounter in modern codes like CAMB orCLASS (see e.g. Blas et al.,2011)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 6 / 35

Page 19: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Solving Linearized Boltzmann equations

In this lecture, we will limit the discussion on how to solve theBoltzmann equations to linear order

A basic Boltzmann solver is not complicated, just a bit complex(implementing naively the equations found in Ma&Bertschinger tolinear order)

Boltzmann codes have improved considerably in terms of precisionand speed with respect to the pioneering COSMICS code

Several sophisticated optimisation methods and approximationschemes have been introduced in each new code

Improving the speed while keeping the precision sufficiently high isessential. MCMC runs invoke the Boltzmann solver for each of the104 − 105 steps

In the following, we will introduce a few of the importantapproximation you may encounter in modern codes like CAMB orCLASS (see e.g. Blas et al.,2011)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 6 / 35

Page 20: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Solving Linearized Boltzmann equations

In this lecture, we will limit the discussion on how to solve theBoltzmann equations to linear order

A basic Boltzmann solver is not complicated, just a bit complex(implementing naively the equations found in Ma&Bertschinger tolinear order)

Boltzmann codes have improved considerably in terms of precisionand speed with respect to the pioneering COSMICS code

Several sophisticated optimisation methods and approximationschemes have been introduced in each new code

Improving the speed while keeping the precision sufficiently high isessential. MCMC runs invoke the Boltzmann solver for each of the104 − 105 steps

In the following, we will introduce a few of the importantapproximation you may encounter in modern codes like CAMB orCLASS (see e.g. Blas et al.,2011)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 6 / 35

Page 21: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Solving Linearized Boltzmann equations

In this lecture, we will limit the discussion on how to solve theBoltzmann equations to linear order

A basic Boltzmann solver is not complicated, just a bit complex(implementing naively the equations found in Ma&Bertschinger tolinear order)

Boltzmann codes have improved considerably in terms of precisionand speed with respect to the pioneering COSMICS code

Several sophisticated optimisation methods and approximationschemes have been introduced in each new code

Improving the speed while keeping the precision sufficiently high isessential. MCMC runs invoke the Boltzmann solver for each of the104 − 105 steps

In the following, we will introduce a few of the importantapproximation you may encounter in modern codes like CAMB orCLASS (see e.g. Blas et al.,2011)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 6 / 35

Page 22: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Solving Linearized Boltzmann equations

In this lecture, we will limit the discussion on how to solve theBoltzmann equations to linear order

A basic Boltzmann solver is not complicated, just a bit complex(implementing naively the equations found in Ma&Bertschinger tolinear order)

Boltzmann codes have improved considerably in terms of precisionand speed with respect to the pioneering COSMICS code

Several sophisticated optimisation methods and approximationschemes have been introduced in each new code

Improving the speed while keeping the precision sufficiently high isessential. MCMC runs invoke the Boltzmann solver for each of the104 − 105 steps

In the following, we will introduce a few of the importantapproximation you may encounter in modern codes like CAMB orCLASS (see e.g. Blas et al.,2011)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 6 / 35

Page 23: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Solving Linearized Boltzmann equations

In this lecture, we will limit the discussion on how to solve theBoltzmann equations to linear order

A basic Boltzmann solver is not complicated, just a bit complex(implementing naively the equations found in Ma&Bertschinger tolinear order)

Boltzmann codes have improved considerably in terms of precisionand speed with respect to the pioneering COSMICS code

Several sophisticated optimisation methods and approximationschemes have been introduced in each new code

Improving the speed while keeping the precision sufficiently high isessential. MCMC runs invoke the Boltzmann solver for each of the104 − 105 steps

In the following, we will introduce a few of the importantapproximation you may encounter in modern codes like CAMB orCLASS (see e.g. Blas et al.,2011)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 6 / 35

Page 24: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Massless neutrinos - Ultrarel. Fluid Approximation (UFA)

all ultrarelativistic relics (e.g. massless neutrinos) can be treated as asingle species assuming they are fully decoupled

obtain Boltzmann hierarchy for such free-streaming relics

Ma & Bertschinger proposed truncation of hierarchy for l ≥ lmax, butto avoid any un-physical side-effect due to thus approximation l hasto be at least around 30.

UFA proposes to apply a flexible lmax with two regimes depending onwavelengths: super-Hubble & sub-Hubble

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 7 / 35

Page 25: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Massless neutrinos - Ultrarel. Fluid Approximation (UFA)

all ultrarelativistic relics (e.g. massless neutrinos) can be treated as asingle species assuming they are fully decoupled

obtain Boltzmann hierarchy for such free-streaming relics

Ma & Bertschinger proposed truncation of hierarchy for l ≥ lmax, butto avoid any un-physical side-effect due to thus approximation l hasto be at least around 30.

UFA proposes to apply a flexible lmax with two regimes depending onwavelengths: super-Hubble & sub-Hubble

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 7 / 35

Page 26: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Massless neutrinos - Ultrarel. Fluid Approximation (UFA)

all ultrarelativistic relics (e.g. massless neutrinos) can be treated as asingle species assuming they are fully decoupled

obtain Boltzmann hierarchy for such free-streaming relics

Ma & Bertschinger proposed truncation of hierarchy for l ≥ lmax, butto avoid any un-physical side-effect due to thus approximation l hasto be at least around 30.

UFA proposes to apply a flexible lmax with two regimes depending onwavelengths: super-Hubble & sub-Hubble

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 7 / 35

Page 27: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Massless neutrinos - Ultrarel. Fluid Approximation (UFA)

all ultrarelativistic relics (e.g. massless neutrinos) can be treated as asingle species assuming they are fully decoupled

obtain Boltzmann hierarchy for such free-streaming relics

Ma & Bertschinger proposed truncation of hierarchy for l ≥ lmax, butto avoid any un-physical side-effect due to thus approximation l hasto be at least around 30.

UFA proposes to apply a flexible lmax with two regimes depending onwavelengths: super-Hubble & sub-Hubble

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 7 / 35

Page 28: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Massless neutrinos - Ultrarel. Fluid Approximation (UFA)(cont.)

for super-Hubble (kτ < (kτ)UFA), set lmax ∼ (kτ)UFA

for sub-Hubble, δ,Θ, σ ((non-perfect) fluid) are followed, butmultipoles for l > 2 are suppressed and can be dropped using

σ′ur = −3

τσur +

2

3Θur +

1

3h′

is more accurate and runs about 10% faster than fixed truncation

could be used until present time, but later, a more aggressiveapproximation may be applied (→ RSA)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 8 / 35

Page 29: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Massless neutrinos - Ultrarel. Fluid Approximation (UFA)(cont.)

for super-Hubble (kτ < (kτ)UFA), set lmax ∼ (kτ)UFA

for sub-Hubble, δ,Θ, σ ((non-perfect) fluid) are followed, butmultipoles for l > 2 are suppressed and can be dropped using

σ′ur = −3

τσur +

2

3Θur +

1

3h′

is more accurate and runs about 10% faster than fixed truncation

could be used until present time, but later, a more aggressiveapproximation may be applied (→ RSA)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 8 / 35

Page 30: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Massless neutrinos - Ultrarel. Fluid Approximation (UFA)(cont.)

for super-Hubble (kτ < (kτ)UFA), set lmax ∼ (kτ)UFA

for sub-Hubble, δ,Θ, σ ((non-perfect) fluid) are followed, butmultipoles for l > 2 are suppressed and can be dropped using

σ′ur = −3

τσur +

2

3Θur +

1

3h′

is more accurate and runs about 10% faster than fixed truncation

could be used until present time, but later, a more aggressiveapproximation may be applied (→ RSA)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 8 / 35

Page 31: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Massless neutrinos - Ultrarel. Fluid Approximation (UFA)(cont.)

for super-Hubble (kτ < (kτ)UFA), set lmax ∼ (kτ)UFA

for sub-Hubble, δ,Θ, σ ((non-perfect) fluid) are followed, butmultipoles for l > 2 are suppressed and can be dropped using

σ′ur = −3

τσur +

2

3Θur +

1

3h′

is more accurate and runs about 10% faster than fixed truncation

could be used until present time, but later, a more aggressiveapproximation may be applied (→ RSA)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 8 / 35

Page 32: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Non-Cold DM relics - Fluid approximation

Apply UFA for relativistic regime, while in the non-relativistic limit allmultipoles with l > 1 decay (pressure-less fluid)

Evolution of δ and p is given by

For the shear

with cg and cvis = 3wc2g being the adiabatic and viscosity sound

speed resp.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 9 / 35

Page 33: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Non-Cold DM relics - Fluid approximation

Apply UFA for relativistic regime, while in the non-relativistic limit allmultipoles with l > 1 decay (pressure-less fluid)

Evolution of δ and p is given by

For the shear

with cg and cvis = 3wc2g being the adiabatic and viscosity sound

speed resp.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 9 / 35

Page 34: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Non-Cold DM relics - Fluid approximation

Apply UFA for relativistic regime, while in the non-relativistic limit allmultipoles with l > 1 decay (pressure-less fluid)

Evolution of δ and p is given by

For the shear

with cg and cvis = 3wc2g being the adiabatic and viscosity sound

speed resp.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 9 / 35

Page 35: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Baryons/Photons - Tight Coupling Approximation (TCA)

For baryons, we get the Boltzmann eq.

with R =4ργ3ρb

and H = a′

a

for photons, the hierarchy reads

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 10 / 35

Page 36: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Baryons/Photons - Tight Coupling Approximation (TCA)

For baryons, we get the Boltzmann eq.

with R =4ργ3ρb

and H = a′

a

for photons, the hierarchy reads

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 10 / 35

Page 37: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Baryons/Photons - Tight Coupling Approximation (TCA)(cont.)

For the TCA, it is now possible to find a solution for the evolution ofthe baryon slip Θ′γb and photon shear σγ in terms of δγ/b,Θγ/b thatholds for any order of τc . This approximation has been alreadydiscussed in the Theoretical Cosmology lectures, so we won’t do ithere. Additionally, you may find a detailed description e.g. in [Blas2011].

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 11 / 35

Page 38: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Photons/rel.relics - Radiation Streaming Approximation(RSA)

After decoupling from baryons, photons free-stream like neutrinos andother relativistic relics

could use UFA, but in matter- and DE-dominated era (Ωr 1) wecan go further as they all simply behave like test particles in externalgrav. field → feedback/coupling minimal, but still exist (Einstein eq.,temp./pol. source function, reionisation)

hence, truncation with lmax possible, but reflected power still maypropagate into final results

instead we use an analytic approximation (→ RSA) to calculate thedensity, velocity and shear.

avoids unphysical truncation errors and increase speed

we need sufficient precision at early times where radiation alreadysub-dominant, but not insignificant, but far less at late times. Alsohigher precision allows us to switch earlier to RSA

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 12 / 35

Page 39: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Photons/rel.relics - Radiation Streaming Approximation(RSA)

After decoupling from baryons, photons free-stream like neutrinos andother relativistic relics

could use UFA, but in matter- and DE-dominated era (Ωr 1) wecan go further as they all simply behave like test particles in externalgrav. field → feedback/coupling minimal, but still exist (Einstein eq.,temp./pol. source function, reionisation)

hence, truncation with lmax possible, but reflected power still maypropagate into final results

instead we use an analytic approximation (→ RSA) to calculate thedensity, velocity and shear.

avoids unphysical truncation errors and increase speed

we need sufficient precision at early times where radiation alreadysub-dominant, but not insignificant, but far less at late times. Alsohigher precision allows us to switch earlier to RSA

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 12 / 35

Page 40: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Photons/rel.relics - Radiation Streaming Approximation(RSA)

After decoupling from baryons, photons free-stream like neutrinos andother relativistic relics

could use UFA, but in matter- and DE-dominated era (Ωr 1) wecan go further as they all simply behave like test particles in externalgrav. field → feedback/coupling minimal, but still exist (Einstein eq.,temp./pol. source function, reionisation)

hence, truncation with lmax possible, but reflected power still maypropagate into final results

instead we use an analytic approximation (→ RSA) to calculate thedensity, velocity and shear.

avoids unphysical truncation errors and increase speed

we need sufficient precision at early times where radiation alreadysub-dominant, but not insignificant, but far less at late times. Alsohigher precision allows us to switch earlier to RSA

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 12 / 35

Page 41: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Photons/rel.relics - Radiation Streaming Approximation(RSA)

After decoupling from baryons, photons free-stream like neutrinos andother relativistic relics

could use UFA, but in matter- and DE-dominated era (Ωr 1) wecan go further as they all simply behave like test particles in externalgrav. field → feedback/coupling minimal, but still exist (Einstein eq.,temp./pol. source function, reionisation)

hence, truncation with lmax possible, but reflected power still maypropagate into final results

instead we use an analytic approximation (→ RSA) to calculate thedensity, velocity and shear.

avoids unphysical truncation errors and increase speed

we need sufficient precision at early times where radiation alreadysub-dominant, but not insignificant, but far less at late times. Alsohigher precision allows us to switch earlier to RSA

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 12 / 35

Page 42: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Photons/rel.relics - Radiation Streaming Approximation(RSA)

After decoupling from baryons, photons free-stream like neutrinos andother relativistic relics

could use UFA, but in matter- and DE-dominated era (Ωr 1) wecan go further as they all simply behave like test particles in externalgrav. field → feedback/coupling minimal, but still exist (Einstein eq.,temp./pol. source function, reionisation)

hence, truncation with lmax possible, but reflected power still maypropagate into final results

instead we use an analytic approximation (→ RSA) to calculate thedensity, velocity and shear.

avoids unphysical truncation errors and increase speed

we need sufficient precision at early times where radiation alreadysub-dominant, but not insignificant, but far less at late times. Alsohigher precision allows us to switch earlier to RSA

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 12 / 35

Page 43: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Photons/rel.relics - Radiation Streaming Approximation(RSA)

After decoupling from baryons, photons free-stream like neutrinos andother relativistic relics

could use UFA, but in matter- and DE-dominated era (Ωr 1) wecan go further as they all simply behave like test particles in externalgrav. field → feedback/coupling minimal, but still exist (Einstein eq.,temp./pol. source function, reionisation)

hence, truncation with lmax possible, but reflected power still maypropagate into final results

instead we use an analytic approximation (→ RSA) to calculate thedensity, velocity and shear.

avoids unphysical truncation errors and increase speed

we need sufficient precision at early times where radiation alreadysub-dominant, but not insignificant, but far less at late times. Alsohigher precision allows us to switch earlier to RSA

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 12 / 35

Page 44: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Radiation Streaming Approximation (RSA) (rel. relics)For rel. relics, we get the density from substituting Θ′ur into δ′′ur termin Boltmann hierarchy.

δ′′ur + δurk2

3= −2

3h′′ +

4

3k2σ2

ur

Inside the Hubble scale, we can assume in first approximation that thedensity perturbation exceeds the shear by far.

Furthermore, for a smooth particular solution, we can assume that|δ′′ur| δurk

2|.Hence, our previous eq. simplifies to

δur = − 2

k2h′′

Notice that as h ∼ δcdm in MD era in sync. gauge, h′′ is constant andthus δur static. Using the Einstein eq. (and a few approximations forthe post RD-era), we can determine h′′ in terms of h′ and get

δur = − 4

k2(a′

ah′ − k2η)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 13 / 35

Page 45: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Radiation Streaming Approximation (RSA) (rel. relics)For rel. relics, we get the density from substituting Θ′ur into δ′′ur termin Boltmann hierarchy.

δ′′ur + δurk2

3= −2

3h′′ +

4

3k2σ2

ur

Inside the Hubble scale, we can assume in first approximation that thedensity perturbation exceeds the shear by far.Furthermore, for a smooth particular solution, we can assume that|δ′′ur| δurk

2|.

Hence, our previous eq. simplifies to

δur = − 2

k2h′′

Notice that as h ∼ δcdm in MD era in sync. gauge, h′′ is constant andthus δur static. Using the Einstein eq. (and a few approximations forthe post RD-era), we can determine h′′ in terms of h′ and get

δur = − 4

k2(a′

ah′ − k2η)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 13 / 35

Page 46: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Radiation Streaming Approximation (RSA) (rel. relics)For rel. relics, we get the density from substituting Θ′ur into δ′′ur termin Boltmann hierarchy.

δ′′ur + δurk2

3= −2

3h′′ +

4

3k2σ2

ur

Inside the Hubble scale, we can assume in first approximation that thedensity perturbation exceeds the shear by far.Furthermore, for a smooth particular solution, we can assume that|δ′′ur| δurk

2|.Hence, our previous eq. simplifies to

δur = − 2

k2h′′

Notice that as h ∼ δcdm in MD era in sync. gauge, h′′ is constant andthus δur static. Using the Einstein eq. (and a few approximations forthe post RD-era), we can determine h′′ in terms of h′ and get

δur = − 4

k2(a′

ah′ − k2η)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 13 / 35

Page 47: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Radiation Streaming Approximation (RSA) (rel. relics)For rel. relics, we get the density from substituting Θ′ur into δ′′ur termin Boltmann hierarchy.

δ′′ur + δurk2

3= −2

3h′′ +

4

3k2σ2

ur

Inside the Hubble scale, we can assume in first approximation that thedensity perturbation exceeds the shear by far.Furthermore, for a smooth particular solution, we can assume that|δ′′ur| δurk

2|.Hence, our previous eq. simplifies to

δur = − 2

k2h′′

Notice that as h ∼ δcdm in MD era in sync. gauge, h′′ is constant andthus δur static. Using the Einstein eq. (and a few approximations forthe post RD-era), we can determine h′′ in terms of h′ and get

δur = − 4

k2(a′

ah′ − k2η)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 13 / 35

Page 48: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Radiation Streaming Approximation (RSA) (rel. relics)

Θur now follow simply from the exact energy-conservation eq.

δ′ur = −4

3Θur −

2

3h′

!= 0

⇒ Θur = −1

2h′

Finally, we set σur = 0.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 14 / 35

Page 49: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Radiation Streaming Approximation (RSA) (photons)

For photos, we start with a similar substitution, but get an additionalterm for the non-negligible baryon-photon interactions duringreionisation:

δ′′γ + δγk2

3= −2

3h′′ +

4

3k2σ2

ur −4

3τc(Θb −Θγ)

Neglecting shear and density derivatives again, we further expand theinteraction term in τ−1

c around 0 up to first order. Using our resultfrom the ultra-rel. particles and substitution h′′ again, we get

δγ = − 4

k2

(a′

ah′ − k2η

)+

4

k2τc

(Θb +

1

2h′)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 15 / 35

Page 50: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Radiation Streaming Approximation (RSA) (photons)

For photos, we start with a similar substitution, but get an additionalterm for the non-negligible baryon-photon interactions duringreionisation:

δ′′γ + δγk2

3= −2

3h′′ +

4

3k2σ2

ur −4

3τc(Θb −Θγ)

Neglecting shear and density derivatives again, we further expand theinteraction term in τ−1

c around 0 up to first order. Using our resultfrom the ultra-rel. particles and substitution h′′ again, we get

δγ = − 4

k2

(a′

ah′ − k2η

)+

4

k2τc

(Θb +

1

2h′)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 15 / 35

Page 51: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Radiation Streaming Approximation (RSA) (photons)

Θur now follow again from the exact energy-conservation eq. andsubstitute both h′′ and the derivative of the result for δγ

⇒ Θγ = −1

2h′ − 3

4δ′γ

⇒ Θγ = −1

2h′

+3

k2τc

[−τ′c

τc

(Θb +

1

2h′)

+

(−a′

aΘb + c2

bk2δb −

a′

ah′ + k2η

)]

Finally, we set the shear to zero again i.e. σγ = 0.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 16 / 35

Page 52: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Radiation Streaming Approximation (RSA) (photons)

Θur now follow again from the exact energy-conservation eq. andsubstitute both h′′ and the derivative of the result for δγ

⇒ Θγ = −1

2h′ − 3

4δ′γ

⇒ Θγ = −1

2h′

+3

k2τc

[−τ′c

τc

(Θb +

1

2h′)

+

(−a′

aΘb + c2

bk2δb −

a′

ah′ + k2η

)]

Finally, we set the shear to zero again i.e. σγ = 0.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 16 / 35

Page 53: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Implementation - CLASS

Project started on request of Planck science team to have a toolindependent from CAMB (and to check for possibleBoltzmann-code-induced bias)

CLASS is an Einstein-Boltzmann code written in C (with anautomatically generated interface for python & C++)

it was designed with user-friendliness in mind, i.e. both for those ofyou who simply want to run the code as well as those who are lookinginto implementing their own model i.e.

I Modularized - clear separation of different physics (background,perturbation, lensing, etc)

I User-friendly units - ~ = kB = c = 1, dimensionful quantities have unitMpcn

I Equations follow literally notations of most famous papers

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 17 / 35

Page 54: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Implementation - CLASS

Project started on request of Planck science team to have a toolindependent from CAMB (and to check for possibleBoltzmann-code-induced bias)

CLASS is an Einstein-Boltzmann code written in C (with anautomatically generated interface for python & C++)

it was designed with user-friendliness in mind, i.e. both for those ofyou who simply want to run the code as well as those who are lookinginto implementing their own model i.e.

I Modularized - clear separation of different physics (background,perturbation, lensing, etc)

I User-friendly units - ~ = kB = c = 1, dimensionful quantities have unitMpcn

I Equations follow literally notations of most famous papers

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 17 / 35

Page 55: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Implementation - CLASS

Project started on request of Planck science team to have a toolindependent from CAMB (and to check for possibleBoltzmann-code-induced bias)

CLASS is an Einstein-Boltzmann code written in C (with anautomatically generated interface for python & C++)

it was designed with user-friendliness in mind, i.e. both for those ofyou who simply want to run the code as well as those who are lookinginto implementing their own model i.e.

I Modularized - clear separation of different physics (background,perturbation, lensing, etc)

I User-friendly units - ~ = kB = c = 1, dimensionful quantities have unitMpcn

I Equations follow literally notations of most famous papers

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 17 / 35

Page 56: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Implementation - CLASS

In CLASS you can calculate a wide range of quantities e.g.I CMB spectraI matter power spectraI transfer function at a given time/redshiftI matter density and lensing Cl ’sI background evolutionI thermal historyI distance-redshift relations, sound horizon

with a broad selection of models already implemented e.g.I Darm Matter (cold, warm, decaying, annihilating, interacting, ...)I Dark Energy (fluid with CLP+ sound speed, quintessence with given

V (φ))I Neutrinos (chemical potentials, arbitrary phase-space distributions,

flavormixing ...)I Primordial perturbationsI Modified Gravity (with HiCLASS version)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 18 / 35

Page 57: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Implementation - CLASS

In CLASS you can calculate a wide range of quantities e.g.I CMB spectraI matter power spectraI transfer function at a given time/redshiftI matter density and lensing Cl ’sI background evolutionI thermal historyI distance-redshift relations, sound horizon

with a broad selection of models already implemented e.g.I Darm Matter (cold, warm, decaying, annihilating, interacting, ...)I Dark Energy (fluid with CLP+ sound speed, quintessence with given

V (φ))I Neutrinos (chemical potentials, arbitrary phase-space distributions,

flavormixing ...)I Primordial perturbationsI Modified Gravity (with HiCLASS version)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 18 / 35

Page 58: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS

We will have a quick look at the structure of the source code to showyou where to find everything.

in the class public-2.7.2/ folder, you should find the followingcontent:

source/ the 10 modules of CLASS - ALL THE PHYSICStools/ auxiliary numerical methods - ALL THE MATHmain/ main CLASS function (just calls modules)

output/ directory for output filesinclude/ header files containing declarations

test/ CLASS functions for testing part of the codepython/,cpp/ python/C++ wrapper of CLASSbbn/,hyrec/ data files, external codeexplanatory.ini reference input file

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 19 / 35

Page 59: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS

We will have a quick look at the structure of the source code to showyou where to find everything.

in the class public-2.7.2/ folder, you should find the followingcontent:

source/ the 10 modules of CLASS - ALL THE PHYSICStools/ auxiliary numerical methods - ALL THE MATHmain/ main CLASS function (just calls modules)

output/ directory for output filesinclude/ header files containing declarations

test/ CLASS functions for testing part of the codepython/,cpp/ python/C++ wrapper of CLASSbbn/,hyrec/ data files, external codeexplanatory.ini reference input file

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 19 / 35

Page 60: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS

We will have a quick look at the structure of the source code to showyou where to find everything.

in the class public-2.7.2/ folder, you should find the followingcontent:

source/ the 10 modules of CLASS - ALL THE PHYSICS

tools/ auxiliary numerical methods - ALL THE MATHmain/ main CLASS function (just calls modules)

output/ directory for output filesinclude/ header files containing declarations

test/ CLASS functions for testing part of the codepython/,cpp/ python/C++ wrapper of CLASSbbn/,hyrec/ data files, external codeexplanatory.ini reference input file

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 19 / 35

Page 61: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS

We will have a quick look at the structure of the source code to showyou where to find everything.

in the class public-2.7.2/ folder, you should find the followingcontent:

source/ the 10 modules of CLASS - ALL THE PHYSICStools/ auxiliary numerical methods - ALL THE MATH

main/ main CLASS function (just calls modules)output/ directory for output filesinclude/ header files containing declarations

test/ CLASS functions for testing part of the codepython/,cpp/ python/C++ wrapper of CLASSbbn/,hyrec/ data files, external codeexplanatory.ini reference input file

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 19 / 35

Page 62: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS

We will have a quick look at the structure of the source code to showyou where to find everything.

in the class public-2.7.2/ folder, you should find the followingcontent:

source/ the 10 modules of CLASS - ALL THE PHYSICStools/ auxiliary numerical methods - ALL THE MATHmain/ main CLASS function (just calls modules)

output/ directory for output filesinclude/ header files containing declarations

test/ CLASS functions for testing part of the codepython/,cpp/ python/C++ wrapper of CLASSbbn/,hyrec/ data files, external codeexplanatory.ini reference input file

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 19 / 35

Page 63: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS

We will have a quick look at the structure of the source code to showyou where to find everything.

in the class public-2.7.2/ folder, you should find the followingcontent:

source/ the 10 modules of CLASS - ALL THE PHYSICStools/ auxiliary numerical methods - ALL THE MATHmain/ main CLASS function (just calls modules)

output/ directory for output files

include/ header files containing declarationstest/ CLASS functions for testing part of the code

python/,cpp/ python/C++ wrapper of CLASSbbn/,hyrec/ data files, external codeexplanatory.ini reference input file

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 19 / 35

Page 64: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS

We will have a quick look at the structure of the source code to showyou where to find everything.

in the class public-2.7.2/ folder, you should find the followingcontent:

source/ the 10 modules of CLASS - ALL THE PHYSICStools/ auxiliary numerical methods - ALL THE MATHmain/ main CLASS function (just calls modules)

output/ directory for output filesinclude/ header files containing declarations

test/ CLASS functions for testing part of the codepython/,cpp/ python/C++ wrapper of CLASSbbn/,hyrec/ data files, external codeexplanatory.ini reference input file

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 19 / 35

Page 65: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS

We will have a quick look at the structure of the source code to showyou where to find everything.

in the class public-2.7.2/ folder, you should find the followingcontent:

source/ the 10 modules of CLASS - ALL THE PHYSICStools/ auxiliary numerical methods - ALL THE MATHmain/ main CLASS function (just calls modules)

output/ directory for output filesinclude/ header files containing declarations

test/ CLASS functions for testing part of the code

python/,cpp/ python/C++ wrapper of CLASSbbn/,hyrec/ data files, external codeexplanatory.ini reference input file

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 19 / 35

Page 66: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS

We will have a quick look at the structure of the source code to showyou where to find everything.

in the class public-2.7.2/ folder, you should find the followingcontent:

source/ the 10 modules of CLASS - ALL THE PHYSICStools/ auxiliary numerical methods - ALL THE MATHmain/ main CLASS function (just calls modules)

output/ directory for output filesinclude/ header files containing declarations

test/ CLASS functions for testing part of the codepython/,cpp/ python/C++ wrapper of CLASS

bbn/,hyrec/ data files, external codeexplanatory.ini reference input file

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 19 / 35

Page 67: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS

We will have a quick look at the structure of the source code to showyou where to find everything.

in the class public-2.7.2/ folder, you should find the followingcontent:

source/ the 10 modules of CLASS - ALL THE PHYSICStools/ auxiliary numerical methods - ALL THE MATHmain/ main CLASS function (just calls modules)

output/ directory for output filesinclude/ header files containing declarations

test/ CLASS functions for testing part of the codepython/,cpp/ python/C++ wrapper of CLASSbbn/,hyrec/ data files, external code

explanatory.ini reference input file

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 19 / 35

Page 68: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS

We will have a quick look at the structure of the source code to showyou where to find everything.

in the class public-2.7.2/ folder, you should find the followingcontent:

source/ the 10 modules of CLASS - ALL THE PHYSICStools/ auxiliary numerical methods - ALL THE MATHmain/ main CLASS function (just calls modules)

output/ directory for output filesinclude/ header files containing declarations

test/ CLASS functions for testing part of the codepython/,cpp/ python/C++ wrapper of CLASSbbn/,hyrec/ data files, external codeexplanatory.ini reference input file

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 19 / 35

Page 69: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS - Source / Modules

The physics implemented in CLASS are separated into 10 modules

Each module consists of one header file, one source file and a datastructure

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 20 / 35

Page 70: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS - Source / Modules

The physics implemented in CLASS are separated into 10 modules

Each module consists of one header file, one source file and a datastructure

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 20 / 35

Page 71: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS - Source / Modules

The physics implemented in CLASS are separated into 10 modules

Each module consists of one header file, one source file and a datastructure

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 20 / 35

Page 72: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Input Module

reads input parameters

Input parameters are “interpreted” i.e. prevents you from settingconflicting parameters e.g. only one from each of the following groupsaccepted:

H0, h, 100×Θs, Tcmb,Ωγ , ωγ, Ωncdm, ωncdm,mν, Ωur, ωur,Nur, ...

The others from each group are then inferred from the given one

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 21 / 35

Page 73: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Input Module

reads input parameters

Input parameters are “interpreted” i.e. prevents you from settingconflicting parameters e.g. only one from each of the following groupsaccepted:

H0, h, 100×Θs, Tcmb,Ωγ , ωγ, Ωncdm, ωncdm,mν, Ωur, ωur,Nur, ...

The others from each group are then inferred from the given one

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 21 / 35

Page 74: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Input Module

reads input parameters

Input parameters are “interpreted” i.e. prevents you from settingconflicting parameters e.g. only one from each of the following groupsaccepted:

H0, h, 100×Θs, Tcmb,Ωγ , ωγ, Ωncdm, ωncdm,mν, Ωur, ωur,Nur, ...

The others from each group are then inferred from the given one

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 21 / 35

Page 75: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Background Module

Evolves the background equations (in particular, the Friedmannequation)

stores in structure background an interpolation table for allbackground quantities (e.g. ρi ,Ωi ,H) as a function of time

functions like background at tau() or background at z() recoverthese quantities interpolated for a specific conf. time or redshift resp.

also calculates and stores further useful background-related quantitiese.g. TUniv.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 22 / 35

Page 76: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Background Module

Evolves the background equations (in particular, the Friedmannequation)

stores in structure background an interpolation table for allbackground quantities (e.g. ρi ,Ωi ,H) as a function of time

functions like background at tau() or background at z() recoverthese quantities interpolated for a specific conf. time or redshift resp.

also calculates and stores further useful background-related quantitiese.g. TUniv.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 22 / 35

Page 77: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Background Module

Evolves the background equations (in particular, the Friedmannequation)

stores in structure background an interpolation table for allbackground quantities (e.g. ρi ,Ωi ,H) as a function of time

functions like background at tau() or background at z() recoverthese quantities interpolated for a specific conf. time or redshift resp.

also calculates and stores further useful background-related quantitiese.g. TUniv.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 22 / 35

Page 78: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Background Module

Evolves the background equations (in particular, the Friedmannequation)

stores in structure background an interpolation table for allbackground quantities (e.g. ρi ,Ωi ,H) as a function of time

functions like background at tau() or background at z() recoverthese quantities interpolated for a specific conf. time or redshift resp.

also calculates and stores further useful background-related quantitiese.g. TUniv.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 22 / 35

Page 79: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Thermodynamics Module

Solves for the thermodynamical evolution with RECFAST and HyRec

with corrections for reionisation

BBN data (YHe) separately calculated by code Parthenope and theninterpolated from table

stores in structure thermo an interpolation table for allthermodynamical quantities (e.g. xe , τd , dκ/dτ , Tb,c2

b) as a functionof redshift

also calculates and stores further useful background-related quantitiese.g. various quantities at recombination (zrec, rsrec,...)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 23 / 35

Page 80: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Thermodynamics Module

Solves for the thermodynamical evolution with RECFAST and HyRec

with corrections for reionisation

BBN data (YHe) separately calculated by code Parthenope and theninterpolated from table

stores in structure thermo an interpolation table for allthermodynamical quantities (e.g. xe , τd , dκ/dτ , Tb,c2

b) as a functionof redshift

also calculates and stores further useful background-related quantitiese.g. various quantities at recombination (zrec, rsrec,...)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 23 / 35

Page 81: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Thermodynamics Module

Solves for the thermodynamical evolution with RECFAST and HyRec

with corrections for reionisation

BBN data (YHe) separately calculated by code Parthenope and theninterpolated from table

stores in structure thermo an interpolation table for allthermodynamical quantities (e.g. xe , τd , dκ/dτ , Tb,c2

b) as a functionof redshift

also calculates and stores further useful background-related quantitiese.g. various quantities at recombination (zrec, rsrec,...)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 23 / 35

Page 82: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Thermodynamics Module

Solves for the thermodynamical evolution with RECFAST and HyRec

with corrections for reionisation

BBN data (YHe) separately calculated by code Parthenope and theninterpolated from table

stores in structure thermo an interpolation table for allthermodynamical quantities (e.g. xe , τd , dκ/dτ , Tb,c2

b) as a functionof redshift

also calculates and stores further useful background-related quantitiese.g. various quantities at recombination (zrec, rsrec,...)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 23 / 35

Page 83: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Perturbation Module

Solves solves the evolution of all perturbations (→Einstein-Boltzmann eq.)

Stores the source functions S(k , τ) in structure perturbs:I sources for CMB temperatureI sources for CMB polarisationI metric perturbations and derivatives (used e.g. for lensing)I density perturbations of all components δiI velocity perturbations of all components Θi

When perturbations are integrated, interpolated quantities fromthermodynamics and background are used

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 24 / 35

Page 84: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Perturbation Module

Solves solves the evolution of all perturbations (→Einstein-Boltzmann eq.)

Stores the source functions S(k , τ) in structure perturbs:I sources for CMB temperatureI sources for CMB polarisationI metric perturbations and derivatives (used e.g. for lensing)I density perturbations of all components δiI velocity perturbations of all components Θi

When perturbations are integrated, interpolated quantities fromthermodynamics and background are used

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 24 / 35

Page 85: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Perturbation Module

Solves solves the evolution of all perturbations (→Einstein-Boltzmann eq.)

Stores the source functions S(k , τ) in structure perturbs:I sources for CMB temperatureI sources for CMB polarisationI metric perturbations and derivatives (used e.g. for lensing)I density perturbations of all components δiI velocity perturbations of all components Θi

When perturbations are integrated, interpolated quantities fromthermodynamics and background are used

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 24 / 35

Page 86: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Primordial Module

Computes the primordial power spectra (for each mode and initialcondition) and stores them in its structure primordial.

a number of different ways to infer the primordial power spectrum ofperturbations:

I Analytic parametrisationI Taylor expansion of inflationary potential V (φ− φ∗) or H(φ− φ∗)I Parametrisation of V (φ)I Import spectra from external code

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 25 / 35

Page 87: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Primordial Module

Computes the primordial power spectra (for each mode and initialcondition) and stores them in its structure primordial.

a number of different ways to infer the primordial power spectrum ofperturbations:

I Analytic parametrisationI Taylor expansion of inflationary potential V (φ− φ∗) or H(φ− φ∗)I Parametrisation of V (φ)I Import spectra from external code

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 25 / 35

Page 88: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Nonlinear Module

contains HALOFIT, Time Renormalization Group (TRG), 1-loopperturb.theory

computes factors RNL = δNLm

δLmto correct source functions S(k , τ) for

non-linear contributions (see more on Monday)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 26 / 35

Page 89: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Nonlinear Module

contains HALOFIT, Time Renormalization Group (TRG), 1-loopperturb.theory

computes factors RNL = δNLm

δLmto correct source functions S(k , τ) for

non-linear contributions (see more on Monday)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 26 / 35

Page 90: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Transfer Module

computes harmonic transfer functions

∆Xl =

∫dτSX (k(q), τ)φXl (q, (τ0 − τ))

for each mode l , initial conditions and several types of sourcefunctions

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 27 / 35

Page 91: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Transfer Module

computes harmonic transfer functions

∆Xl =

∫dτSX (k(q), τ)φXl (q, (τ0 − τ))

for each mode l , initial conditions and several types of sourcefunctions

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 27 / 35

Page 92: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Spectra Module

Computes observable power spectra out of source functions,transferfunctions:

I Linear matter power spectra

P(k , z) = (δm(k , τ(z)))2P(‖)

I Angular power spectra

CXYl = 4π

∫dk

k∆X

l (k)∆Yl (k)P(k)

withXY ∈ TT ,TE ,EE ,BB,PP,TP, ...

and stores them in its structure spectra.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 28 / 35

Page 93: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Lensing Module

uses unlensed CMB spectra CTT ,TE ,EE ,BBl and the spectrum of the

lensing potential CPPl to compute the lensed spectra CTT ,TE ,EE ,BB

l

follows all-sky method [Challinor & Lewis]

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 29 / 35

Page 94: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Lensing Module

uses unlensed CMB spectra CTT ,TE ,EE ,BBl and the spectrum of the

lensing potential CPPl to compute the lensed spectra CTT ,TE ,EE ,BB

l

follows all-sky method [Challinor & Lewis]

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 29 / 35

Page 95: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Output Module

writes requested output files

uses external interpolation functions of other modules (→ same datacan also be obtained by directly calling these functions e.g. fromanother C program)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 30 / 35

Page 96: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Structure of CLASS: Output Module

writes requested output files

uses external interpolation functions of other modules (→ same datacan also be obtained by directly calling these functions e.g. fromanother C program)

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 30 / 35

Page 97: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Python Wrapper: classy

CLASS installs a python module called ’classy’

all its functionality is included in a class called Class

a typical execution of a computation in Python looks like this

from classy import Class

import numpy as np

import matplotlib.pyplot as pltcosmo = Class()

cosmo.set(’output ’:’tCl ,pCl ,lCl ’,’lensing ’:’yes

’,’modes ’:’s,t’,’r’: ’0.2’)

cosmo.compute ()

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 31 / 35

Page 98: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Python Wrapper: classy

CLASS installs a python module called ’classy’

all its functionality is included in a class called Class

a typical execution of a computation in Python looks like this

from classy import Class

import numpy as np

import matplotlib.pyplot as pltcosmo = Class()

cosmo.set(’output ’:’tCl ,pCl ,lCl ’,’lensing ’:’yes

’,’modes ’:’s,t’,’r’: ’0.2’)

cosmo.compute ()

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 31 / 35

Page 99: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Python Wrapper: classy

many of the module structures and their data can be obtained bymethods of that Class class:

get background()

get thermodynamics()

get primordial()

get perturbations()

get transfer(z,format)

besides this many more small,useful functions likeraw cl(),pk(k,z),etc.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 32 / 35

Page 100: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Python Wrapper: classy

many of the module structures and their data can be obtained bymethods of that Class class:

get background()

get thermodynamics()

get primordial()

get perturbations()

get transfer(z,format)

besides this many more small,useful functions likeraw cl(),pk(k,z),etc.

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 32 / 35

Page 101: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Modifying CLASS

Thanks to the clear structure introduced earlier and the fact thatimplemented equations are following most commonly used forms, it isrelatively easy to implement own models.

I will try to outline this process with an example from my ownresearch interests, namely adding DM-ν interactions

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 33 / 35

Page 102: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Modifying CLASS

Thanks to the clear structure introduced earlier and the fact thatimplemented equations are following most commonly used forms, it isrelatively easy to implement own models.

I will try to outline this process with an example from my ownresearch interests, namely adding DM-ν interactions

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 33 / 35

Page 103: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Modifying CLASS

Thanks to the clear structure introduced earlier and the fact thatimplemented equations are following most commonly used forms, it isrelatively easy to implement own models.

I will try to outline this process with an example from my ownresearch interests, namely adding DM-ν interactions

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 33 / 35

Page 104: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Example: Interacting DM

Let’s assume that a (weak) interaction exists between DM and(cosmic) neutrinos. The modified Boltzmann/Euler equations canthen be written (in Newtonian gauge) as

where µ = aσDM−νcnDM is the interaction rate and S = 34ρDMρν

is afactor to ensure energy conservation.

Requires the following few modifications to CLASS1 have to modify input module to read new parameter i.e. cross-section

u nudm2 modify thermodynamics module to calculate interaction rate and its

derivatives and store it in structure (requires adding new fields to pth

in header)3 in perturbation module, simply add interaction contributions to

ΘCDM/ν as well as to higher mode terms in the Boltzmann hierarchy

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 34 / 35

Page 105: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Example: Interacting DM

Let’s assume that a (weak) interaction exists between DM and(cosmic) neutrinos. The modified Boltzmann/Euler equations canthen be written (in Newtonian gauge) as

where µ = aσDM−νcnDM is the interaction rate and S = 34ρDMρν

is afactor to ensure energy conservation.

Requires the following few modifications to CLASS

1 have to modify input module to read new parameter i.e. cross-sectionu nudm

2 modify thermodynamics module to calculate interaction rate and itsderivatives and store it in structure (requires adding new fields to pth

in header)3 in perturbation module, simply add interaction contributions to

ΘCDM/ν as well as to higher mode terms in the Boltzmann hierarchy

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 34 / 35

Page 106: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Example: Interacting DM

Let’s assume that a (weak) interaction exists between DM and(cosmic) neutrinos. The modified Boltzmann/Euler equations canthen be written (in Newtonian gauge) as

where µ = aσDM−νcnDM is the interaction rate and S = 34ρDMρν

is afactor to ensure energy conservation.

Requires the following few modifications to CLASS1 have to modify input module to read new parameter i.e. cross-section

u nudm

2 modify thermodynamics module to calculate interaction rate and itsderivatives and store it in structure (requires adding new fields to pth

in header)3 in perturbation module, simply add interaction contributions to

ΘCDM/ν as well as to higher mode terms in the Boltzmann hierarchy

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 34 / 35

Page 107: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Example: Interacting DM

Let’s assume that a (weak) interaction exists between DM and(cosmic) neutrinos. The modified Boltzmann/Euler equations canthen be written (in Newtonian gauge) as

where µ = aσDM−νcnDM is the interaction rate and S = 34ρDMρν

is afactor to ensure energy conservation.

Requires the following few modifications to CLASS1 have to modify input module to read new parameter i.e. cross-section

u nudm2 modify thermodynamics module to calculate interaction rate and its

derivatives and store it in structure (requires adding new fields to pth

in header)

3 in perturbation module, simply add interaction contributions toΘCDM/ν as well as to higher mode terms in the Boltzmann hierarchy

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 34 / 35

Page 108: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Example: Interacting DM

Let’s assume that a (weak) interaction exists between DM and(cosmic) neutrinos. The modified Boltzmann/Euler equations canthen be written (in Newtonian gauge) as

where µ = aσDM−νcnDM is the interaction rate and S = 34ρDMρν

is afactor to ensure energy conservation.

Requires the following few modifications to CLASS1 have to modify input module to read new parameter i.e. cross-section

u nudm2 modify thermodynamics module to calculate interaction rate and its

derivatives and store it in structure (requires adding new fields to pth

in header)3 in perturbation module, simply add interaction contributions to

ΘCDM/ν as well as to higher mode terms in the Boltzmann hierarchy

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 34 / 35

Page 109: Linear Theory: Solving the Boltzmann Equationsicg.port.ac.uk/~schewtsj/TPCosmoV/L3/lecture-Boltzmann.pdf · Solving Linearized Boltzmann equations In this lecture, we will limit the

Web-/Bibliography

http://class-code.net - you can find here links to the CLASS

publications describing all of the methods outlined here aswell as additional lectures on how to use CLASS

JAS (ICG, Portsmouth) Linear Theory: Solving the Boltzmann Equations July 27, 2019 35 / 35