Keywords: Gravitational wave, Data analysis, Bayesian inference, Hamiltonian Monte Carlo, Deep neural network

DeepHMC: A deep learning Hamiltonian Monte Carlo algorithm for Bayesian inference of compact binary sources of gravitational waves.

Résumé

DeepHMC: Un algorithme Hamiltonian Monte Carlo utilisant un réseau de neurones profond pour l'inférence bayesienne des sources binaires compactes d'ondes gravitationnelles.

Mot clés-Analyse de données, Inférence bayesienne, Hamiltonian Monte Carlo, Deep neural network En septembre 2015 a eu lieu la première détection directe d'une onde gravitationnelle par les interféromètres LIGO, mettant en évidence la coalescence d'un système binaire compact composé de deux trous noirs et ouvrant ainsi la voie de l'astronomie gravitationnelle. S'ensuivirent de nombreuses détections, notamment celle, deux ans plus tard, de la fusion de deux étoiles à neutrons (système dit BNS), nommée GW170817, qui a permis d'observer sa contre-partie électromagnétique dans une large gamme spectrale. Les multiples implications de ces observations dans des domaines aussi divers que la cosmologie, la matière ultra-dense ou les théories de gravité modifiée ont ouvert une nouvelle ère dans l'astronomie multi-messager et confirmé l'essor de l'astronomie gravitationnelle.

L'estimation des valeurs les plus probables des paramètres qui définissent la source de l'onde (e.g. masses des deux composants, distance, angles dans le ciel) et des incertitudes entourant notre mesure est effectuée par inférence bayesienne de la distribution postérieure en probabilité des paramètres. À l'heure actuelle, des algorithmes de type Markov Chain Monte Carlo (MCMC) permettent ce travail en utilisant une marche aléatoire dans l'espace des paramètres qui échantillonne adéquatement la distribution postérieure. Cependant ces algorithmes nécessitent plusieurs semaines (mois) pour converger lorsqu'ils analysent des signaux gravitationnels de longue durée, typiquement des BNSs comme GW170817. À mesure que les détecteurs sont améliorés, non seulement la fréquences de détection augmente mais les signaux sont également observés sur des durées plus longues ce qui crée une tension croissante au vue de l'important temps de calcul nécessaire à l'estimation de leur paramètres. La prochaine campagne d'observation prévoie en effet jusqu'à 70 BNSs détectés sur une année.

Pour répondre à cette problématique, nous proposons dans cette thèse un algorithme alternatif, le Hamiltonian Monte Carlo (HMC), qui remplace la marche aléatoire des algorithmes MCMC classiques par des trajectoires hamiltoniennes qui utilisent le gradient de la distribution pour l'échantillonner efficacement. N'existant pas de forme analytique permettant un calcul rapide des gradients en chaque point des trajectoires, ces derniers doivent être calculés numériquement ce qui est très coûteux en ressources informatiques, et, dans ces conditions, le HMC n'apparaît pas plus compétitif que ses homologues. Pour surmonter cet obstacle, nous avons développé l'algorithme DeepHMC qui permet de remplacer le calcul numérique des gradients par une approximation analytique un millier de fois plus rapide. Pour ce faire DeepHMC utilise un réseau de neurones profond qui, après avoir été entraîné sur un ensemble de gradients numériques initialement calculés, est capable de prédire les gradients en des points de l'espace des paramètres encore inexplorés.

Notre algorithme a été calibré et testé avec succès sur le signal GW170817 dans un modèle à 12 paramètres qui inclut les composantes axiales des spins des étoiles à neutrons ainsi que leur paramètre de déformation. Une comparaison de DeepHMC avec l'algorithme MCMC de la collaboration LIGO-Virgo montre que nous obtenons les mêmes estimations de paramètres mais en un peu moins de trois jours, ce qui correspond à un facteur d'accélération d'environ 80 en temps CPU. Testé avec succès sur le signal GW170817, il faudra encore confirmer les performances de DeepHMC sur un panel plus large de signaux gravitationnels avant de pouvoir l'utiliser en complément des algorithmes actuels. Toutefois nos travaux démontrent que DeepHMC s'avère très prometteur pour répondre aux fréquences croissantes de détection, ce qui permettra une analyse fiable et rapide des futurs signaux pour exploiter pleinement tout le potentiel de l'astronomie gravitationnelle.

It is well known that a PhD experience very much depends on one's supervisor. In this regard I feel very glad and lucky to have worked under the direction of Dr. Ed Porter whom I would like to thank gratefully for his careful supervision over these three (and a half...) years. While struggling to make our algorithm (simply) work and I began to become weary, Ed would always play down the situation and find new ways to investigate the different problems we were facing. This led to new perspectives after each of our many meetings and set me back on the right track. I can only praise his patience, when answering to the same question I would have asked twice already or when listening to my arguments over and over before I would acknowledge my mistake 1 , his scientific rigor which made me a better physicist, the time he dedicated to helping me on this thesis, and finally the fact that he certainly believed more in my abilities than I did.

So many people should be thanked that I unfortunately doubt being able not to forget any. Beginning with those most directly involved in the work I pursued, I would like to dearly thank Eric who has always been supportive and guided me inside the collaboration. Ken and Matteo for their important support as commité de suivi. Calum, my fellow APC mate during this PhD whom I'm happy to count as a close friend of mine. Mike, firstly for having suggested to me the idea of the optimized version of the numerical gradients when working at APC during his PhD, and then for the nice moments we spent in Paris. Philippe for the interesting discussions we shared and his insights on deep learning which helped me developed the DNN. Yann whose work I pursued, his PhD constantly opened on my computer. The Virgo and Gravitation group, may they keep the spirit and port GWs to new scientific discoveries. The LVC and its members, for their warm welcome (in particular Eve, the warmest of all), impressive scientific expertise and rigor, to which I sincerely hope that the work achieved here will be useful (especially since I feel I owe the collaboration a lot more than I gave during these 3 years, even on PhD standards), and finally for proving once again that people from all over the world are capable of amazing and fruitful collaborations when serving a noble cause. Clara, Alexandre, Baptiste, Jean-Baptiste, Hamza and Dominic for the good atmosphere in our office, cookies and our beloved summer-bodies. Dimitri for our many political discussions and his constant good mood. Konstantin for his always relevant questions and for knowing in advance a future prize winner. Marion, Bastien, Thomas, Louise, Guillaume.

Even though not directly involved in the scientific work I did, this thesis would not have happened without the support of my astonishing family and groups of friends. My dear Mom, often worried, always encouraging, who deeply touches me in her efforts to better understand astrophysics and to whom I owe my first observation in a telescope, an incredible experience in Chile. My Dad with whom I would have loved to have conversations about everything that I learnt, and so much more; thank you for not being here, again, you could have made the effort for once. My brother, who forged me more than he reckons and who demonstrates an inspiring courage in his struggle. Julie, who made me a better person; this PhD is imprinted by our story, by your support, by you. My aunt and godmother for their tender support, as that of Fabrice and Céline, Clarisse, Margaux and Victor. How can I rightfully thank my exceptional group of friends, this Rendez-Vous Manqué qui ne cesse de se donner tort. I would probably not have made the decision to quit my job for a PhD without your many encouragements. Now I am unemployed, thanks guys. You keep pulling me to higher levels in many fields, and life would seem tastless without our reunions. All your names deserve to be cited here but as any personal ordering on my side would lead to an oral fight and prove fatal to the survival of the group, I'll just order them starting by whom I met first: Sean, Thomas, Xavier, Youenn, Pierre, Antoine, Muss, Quentin, Adrien, JB, Thomus, Cyprien, Matthieu, Jordan, Baptiste and Baptiste. Peculiar mention to the Dog for his careful English spell check of chapter 2. Dear Momo, I'm really glad to count you as a close friend of mine, warm thanks to you and Marie for your support, whether it was for the thesis or when I felt down, and for these great Sunday lunch times. Thanks Alexis, one day I'll come to Granada. Then I would like to deeply thank my flatmates: Jérémie, Christian, Bastard and Victor, who were probably the closest witnesses of this PhD experience, who supported me during the hard times, beared my imposed time in the bathrooms, and with whom I spent most of this amazing COVID period. Many thanks to my Supélec group of friends: Estelle, Marine, Laëtitia, Adeline, Chris, Jerem, Bastard, Philip, Thomas, Karim, Aymeric, Maxime, who kindly came to listen to me at the Palais de la Découverte and have always shown interest and support for my work; may our werewolf never die! Sylvain, Philip and Ah Sue for representing PhDs from Supélec with me (and Karim); Gabriel, who initially tried to drive me away from that path, but supported me in the end. I should not forget Luisa and Paul, always in my heart, especially when it comes to physics. Okay Anton, your name goes here as well. Thank you Ben for nourishing our friendship more than I do and, together with Tom and Rogy, for this amazing cycling trip we did. Olivier, we don't see each other often now but I was touched knowing you would come to the defense.

Finally I would like to sincerely thank every Physics teacher I ever had. I cannot recall any who was bad2 , most of them were excellent and some of them brilliant. You teach an amazing discipline and are clearly part of the success of this PhD.

Introduction

The publication of General Relativity (GR) by Einstein in 1915 irrevocably modified our understanding of the mechanisms governing the universe by revealing a deep bond between the spacetime continuum, introduced earlier with Special Relativity in 1905, and its energy content. As the curvature of spacetime and the motion of massive objects are dynamically entangled, the theory provides a geometrical essence to gravitation. Since spacetime is no longer flat and fixed, the propagation of spacetime perturbations at the speed of light is naturally predicted by GR in the same way that electromagnetic waves emerged from Maxwell's equations. These gravitational waves (GWs) were foreseen by Einstein in 1916 but he doubted they could ever be detected given the stiffness of spacetime which makes it extremely difficult to perturb [1]. It is only in 1974 that J. Taylor and R. Hulse highlighted for the first time the existence of GWs by observing the orbital decay of a binary pulsar in perfect agreement with the emission of GWs as predicted by the theory [START_REF] Weisberg | Relativistic Binary Pulsar B1913+16: Thirty Years of Observations and Analysis[END_REF][START_REF] Damour | The Discovery of the First Binary Pulsar[END_REF]. Some years later, two projects entirely dedicated to the observation of GWs emerged: Virgo [START_REF] Acernese | Advanced Virgo: A 2nd Generation Interferometric Gravitational Wave Detector[END_REF], Franco-Italian3 , and the American LIGOs [START_REF] Aasi | Advanced LIGO[END_REF]. The construction of these laser interferometers ended in the 2000s and was crowned with success first in 2015 when the two LIGOs detected for the first time a GW produced by a system of two inspiralling black holes and second in 2017 when Virgo participated to the first detection of a binary neutron star system. These ground-breaking observations opened the era of GW astronomy a century after their prediction by Einstein. While the universe was until then exclusively observed through electromagnetic radiations, neutrinos or highly energetic particles, GWs appear as a new messenger which open a novel window of observation on the universe. The domains of application of GW science are numerous, ranging from cosmology to physics of ultra-dense matter, through astrophysics of compact binaries and theoretical physics; making this field of study one of the most exciting of this early century.

To fully exploit the information carried by GWs about their source, advanced data analysis techniques correlate theoretical waveform models, derived from GR, with the signals detected in the interferometer network. In particular, the parameters defining a binary system and the uncertainties surrounding the GW measurement are inferred through a Bayesian approach which estimates the probability density, or posterior distribution, that a set of parameter values are the true ones given the signal detected and the underlying assumptions in our models. This parameter inference is performed by stochastic algorithms which wander in parameter space until convergence to a satisfying estimate of the posterior distribution. Nonetheless this process remains computationally expensive as it requires from weeks to months of CPU time when analyzing long duration signals and when using advanced waveform models. As the sensitivity of GW interferometers is being improved years after years, the rate of detection and duration of exploitable signal increase, requiring more and longer analysis which creates an important tension with the time required to perform each of them. Not to mention that a fourth detector, KAGRA in Japan [START_REF] Akutsu | Overview of KAGRA: Calibration, Detector Characterization, Physical Environmental Monitors, and the Geophysics Interferometer[END_REF], recently joined the international collaboration, adding up to the amount of data to analyze.

To respond to this challenge, we propose in this thesis a Hamiltonian Monte Carlo based algorithm intended to accelerate the inference of parameters by several orders of magnitude. Building on a previous work carried in [START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF] on fiducial signals, we largely extend the original algorithm to new use cases, in particular through the inclusion of aligned-spins and tidal parameters in the analysis. We then modify its core module with a more efficient deep learning algorithm and demonstrate the superiority of our newly developed algorithm, named DeepHMC, with current algorithms of the collaboration through a direct comparison with the latter. To present our work, we organized the manuscript as follows.

In Chapter 1 we briefly review how GWs emerge from the theory of GR, focus on their generation by binary systems of two massive bodies and detail how laser interferometers are able to detect such tiny fluctuations of spacetime. Chapter 2 is dedicated to compact binary systems which are the primary source of GWs for ground-based detectors. After a discussion of the different star evolution scenarios which can lead to the formation of a compact object, namely a white dwarf, a neutron star or a black hole, we describe the latter and detail the formation and evolution of a binary system.

In Chapter 3 we dive into GW data analysis to highlight how one can extract a GW buried into a noisy signal and calculate the significance of a detection. Then we present the ins and outs of our field of research: the inference of GW parameters. In Chapter 4 we review the main observations which have been made by the interferometer network since 2015 and give future prospects for GW science. Chapter 5 focuses on stochastic samplers used to perform the estimation of GW parameters. After a description of Markov Chain Monte Carlo algorithms, we develop onto the Hamiltonian Monte Carlo (HMC) and detail the advantages and difficulties offered by this algorithm.

In Chapter 6 we describe how a Hamiltonian Monte Carlo can be implemented to efficiently estimate GW parameters and detail the layout of the original algorithm which served as a starting point for this work. In Chapter 7 we go through the many obstacles we faced when porting the original HMC algorithm, written in the computer language C, to its new Python based framework. After including astrophysical priors in our analysis, we run the HMC on a real signal for the first time and finally develop on some important improvements we implemented. Chapter 8 focuses on a major extension of the HMC as we include aligned-spins and tides in the analysis, crucial parameters for a complete modeling of the dynamics of the binary system.

In Chapter 9 we replace one of the core module of our HMC with a deep neural network. This radical modification improves the performance of the algorithm and make it more robust to the analysis of different types of signal. In Chapter 10 we finally compare side by side, on the inference of GW parameters of a single signal, DeepHMC with an algorithm used daily in the collaboration. Thanks to this first apples-to-apples comparison, not only do we demonstrate that DeepHMC is exact as it produces the same inference, but we show that it is about a hundred times faster than its counterpart, thus responding to the challenges we face.

The final Chapter 11 details the different perspectives opened to the algorithm we built, firstly focusing on some inescapable developments which will have to be carried out for our algorithm to be operational to the collaboration, and then on further interesting enhancements which could be brought to DeepHMC.

While an article containing the main results from Chapters 8 to 10 is in preparation, the author of this manuscript is part, to this date, of the Virgo collaboration and as such is also co-author of articles published by the collaboration since summer 2018.

Chapter 1

From General Relativity to gravitational waves and their detection General Relativity describes the gravitational motion of matter by the curvature of spacetime, rather than gravitation as a fundamental force. In turn, this motion modifies curvature making the connection between matter and spacetime not only intrinsically dynamic and subtle, but also complicated to explicit in the general case. Nevertheless the bulk of the theory is elegantly contained into a single tensorial equation, famously known as Einstein's field equations of General Relativity

G µν = 8πG c 4 T µν , (1.1)
where G µν is the Einstein tensor, T µν the stress-energy-momentum tensor (energy-momentum for short), G the universal constant of gravitation and c the speed of light. Spacetime curvature is fully described by the Riemann tensor, R µ νρσ (also known as the curvature tensor), which is contained in G µν , defined as

G µν = R µν - 1 2 Rg µν . (1.2)
R µν , the Ricci tensor and R, the Ricci scalar, are derived from successive contractions of the Riemann tensor and g µν is the spacetime metric describing the geometry of spacetime itself. On the right hand side of Einstein's field equations, the energy-momentum tensor contains information about the distribution of matter and momentum and hence the energy content of spacetime.

Once we understand that spacetime can be curved and that curvature might evolve with time, we can naturally consider the propagation of a perturbation of the metric g µν itself, that is to say a gravitational wave (GW). To understand how GWs arise from General Relativity, we shall start by linearizing Einstein's field equations which will allow us to make the link between the perturbation and the energy-momentum tensor [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]9]. Then in the simpler case where T µν = 0, we will see how GWs propagate in vacuum [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]9]. After this we shall describe how GWs interact with matter, a necessary step in the understanding of gravitational wave detection [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]9]. Then the third section will be devoted to the generation of GWs, hence when the energy-momentum tensor is not null, and we will focus our attention on the peculiar case of two massive orbiting bodies [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]9]. Finally we will explain how laser interferometry enables the detection of GWs with a network of ground-based detectors [9].

The linearized Einstein equations

Let us consider a small perturbation h µν to the flat Minkowski metric background, η µν = diag(-1,1,1,1). The total metric tensor then becomes

g µν = η µν + h µν + O(h 2 ), (1.3)
where |h µν | 1. As mentioned before, our goal is to express the Einstein tensor as a function of the perturbation h µν . We have shown that G µν is linked to the Riemann tensor, itself defined as a function of the Christoffel symbols Γ ρ µν which describe the metric connection, and can be expressed as a function of the metric tensor as [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]9,10] Γ ρ µν = 1 2 g ρλ (∂ µ g νλ + ∂ ν g λµ -∂ λ g µν ).

(1.4)

Here we use the following notation for partial derivatives

∂ µ = ∂ ∂x µ , (1.5)
and define an inverse metric tensor g ρλ such that g ρλ g λτ = δ ρ τ , where δ ρ τ is the Kronecker delta. The inverse metric tensor can be expressed to first order in the metric perturbation by

g ρλ = η ρµ η λν g µν + O(h 2 ) (1.6) = η ρλ -h ρλ + O(h 2 ). (1.7)
Eq. (1.6) shows that we can use the Minkowski metric to raise and lower indices as usual. Linearizing GR allows us to interpret h µν as a propagating gravitational field on a flat background spacetime. With this in hand we can rewrite the Christoffel symbols as a function of the perturbation

Γ ρ µν = 1 2 η ρλ (∂ µ h νλ + ∂ ν h λµ -∂ λ h µν ) + O(h 2 ). (1.8)
The Riemann tensor is defined by

R µ νρσ = ∂ ρ Γ µ σν -∂ σ Γ µ ρν + Γ µ ρλ Γ λ σν -Γ µ σλ Γ λ ρν , (1.9)
and since we neglect all second order terms in h, the two Christoffel symbol products in this equation will be neglected as well. Then the Riemann tensor can be expressed exclusively as a function of second order derivatives of the perturbation

R µ νρσ = 1 2 (∂ ρ ∂ ν h µ σ + ∂ µ ∂ σ h νρ -∂ σ ∂ ν h µ ρ -∂ µ ∂ ρ h νσ ) + O(h 2 ).
(1.10)

The Riemann tensor describes entirely the curvature of spacetime. By contracting two indices, we can define the Ricci tensor R µν = R σ µσν , and then by taking the trace of the latter to create the Ricci scalar R = R µ µ . Using Eq. (1.10) for the Ricci tensor yields [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]10]

R µν = 1 2 (∂ σ ∂ µ h σν + ∂ σ ∂ ν h σµ -∂ µ ∂ ν h -h µν ) + O(h 2 ), (1.11)
where = ∂ µ ∂ µ denotes the D'Alembertian operator on a Minkowski spacetime and where h = η µν h µν = h µ µ is the trace of h µν . This in turn allows us to express the Ricci scalar as

R = ∂ σ ∂ µ h σµ -h + O(h 2 ).
(1.12)

Using the definition of the Einstein tensor from Eq. (1.2) we finally arrive at an expression at first order in h µν [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]

G µν = 1 2 (∂ σ ∂ µ h σν + ∂ σ ∂ ν h σµ -∂ µ ∂ ν h -h µν -η µν ∂ σ ∂ ρ h σρ + η µν h) + O(h 2 ).
(1.13) Plugging Eq. (1.13) into Eq. (1.1) leads to the linearized version of Einstein's field equations. Before stating these equations, let us first let us demonstrate that our setting is invariant under a coordinate transformation which will allow us to simplify the linearized equations [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]9]. To do this, we begin by considering the infinitesimal coordinate transformation

x µ = x µ + ξ µ , (1.14)
where we take |∂ µ ξ ν | = O(h). Under any coordinate transformation, a new metric is given by

g µν = g αβ ∂x α ∂x µ ∂x β ∂x ν , (1.15)
allowing us to express the perturbation in this new coordinate system

h µν (x ) = h µν (x) -(∂ µ ξ ν + ∂ ν ξ µ ) . (1.16)
Thus we can write the infinitesimal variation of the Riemann tensor using Eq. (1.10) [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]9] δR

µ νρσ = 1 2 [∂ ρ ∂ ν ∂ µ ξ σ + ∂ ρ ∂ ν ∂ σ ξ µ + ∂ σ ∂ µ ∂ ν ξ ρ + ∂ σ ∂ µ ∂ ρ ξ ν -∂ ρ ∂ ν ∂ µ ξ σ -∂ ρ ∂ ν ∂ σ ξ µ -∂ σ ∂ µ ∂ ν ξ ρ -∂ σ ∂ µ ∂ ρ ξ ν ] ,
(1.17) = 0, (1.18) and we see that the transformation defined in Eq. (1.14) leaves the curvature of spacetime unchanged meaning that the laws of physics are the same when moving to this new coordinate system. This defines a gauge freedom and we are allowed to fix any ξ µ that suits us and which might simplify the equations we have in hand. We shall choose the harmonic gauge defined by

x µ = 0.

(1. [START_REF] Baumgarte | Numerical Relativity: Solving Einstein's Equations on the Computer[END_REF] Using the covariant definition of the D'Alembertian = ∇ µ ∇ µ , the harmonic gauge condition translates into [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]

g ρσ ∂ ρ ∂ σ x µ -g ρσ Γ λ ρσ ∂ λ x µ = 0, (1.20)
g ρσ Γ λ ρσ = 0 (1.21)
and at first order in the perturbation h µν we get

1 2 η ρσ η µν (∂ ρ h σν + ∂ σ h νρ -∂ ν h ρσ ) = 0, (1.22
)

1 2 η µν (∂ σ h σν + ∂ ρ h νρ -∂ ν h ) = 0, (1.23)
and finally

∂ σ h νσ - 1 2 ∂ ν h = 0. (1.24)
Replacing h νσ by the expression in Eq. (1.16), one can display that the harmonic gauge condition is equivalent to choosing a coordinate transformation ξ µ such that it satisfies

ξ ν = ∂ σ h νσ - 1 2 ∂ ν h. (1.25)
We note at this point that after making this particular choice for ξ µ we are still left with some gauge freedoms since any new coordinate transformation x µ → x µ +ζ µ will remain in the harmonic gauge as long as ζ µ = 0.

(1.26)

For the moment let us fix ξ µ according to Eq. (1.25) (also known in this formulation as the Lorentz gauge). Dropping the prime notation, we can use Eq. (1.22) and Eq. (1.24) to simplify the expression of the Einstein tensor in Eq. (1.13) which then directly yields the linearized version of Einstein's field equations in the Lorentz gauge:

h µν - 1 2 η µν h = - 16πG c 4 T µν . (1.27)
Finally we will further simplify the previous equation by considering the trace-reversed perturbation defined by

h µν = h µν - 1 2 η µν h, (1.28)
where one can check that h µ µ = h = -h. We note here that the Lorentz gauge condition, Eq. (1.24), on h µν takes the simpler form of ∂ µ h µν = 0.

(1.29)

We will see later that h µν and h µν are equivalent perturbations once we use the additional gauge symmetry we mentioned. For the moment we can formulate the full field equations as [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]9] h µν = -16πG c 4 T µν .

(1.30)

Since the D'Alembertian in flat spacetime is simply = -∂ 2 t + ∂ i ∂ i , where i refers to the spacial coordinates, this expression tells us that h µν obeys a wave equation governed by a source term described by T µν . This propagating perturbation of spacetime is a gravitational wave.

Vacuum solutions in linearized gravity

A vacuum is defined by the absence of any energy density, i.e. T µν = 0. In this case, the field equations for the trace-reversed perturbation becomes h µν = 0.

(1.31)

This type of wave equation is very common in physics and its natural solution is the family of plane waves which take the following general form [START_REF] Carroll | Lecture Notes on General Relativity[END_REF] h µν = C µν e ikρx ρ , (1.32) where k ρ is the wave vector and C µν is a constant and symmetric amplitude. Applying Eq. (1.31) to the plane wave leads to k µ k µ = 0.

(1.33)

Therefore a plane wave is solution to the linearized Einstein field equations in vacuum if its wave vector is null, meaning that GWs must propagate at the speed of light. Applying the Lorentz gauge condition as expressed in Eq. (1.29) yields

k µ C µν = 0, (1.34)
meaning the gravitational pertubation induced by h µν is orthogonal to its direction of propagation. The Lorentz gauge is thus a transverse gauge. This condition reduces the number of free components in C µν from 10 (for a symmetric (0,2) tensor) to 6. We can now use the gauge freedom from Eq. (1.26). Being itself a wave equation, we can write

ζ µ = B µ e ikν x ν , (1.35)
where k ν is the same wave vector as before. Under this transformation, the metric h µν transforms similarly as Eq. (1.16) (but swapping ξ µ with ζ µ ) meaning that the trace-reversed perturbation transforms as

h µν = h µν -∂ µ ζ ν -∂ ν ζ µ + η µν ∂ λ ζ λ , (1.36)
and using the plane wave formula for ζ µ , we can write [START_REF] Carroll | Lecture Notes on General Relativity[END_REF] C µν = C µνik µ B νik ν B µ + iη µν k λ B λ .

(1.37)

Following [START_REF] Carroll | Lecture Notes on General Relativity[END_REF], it can be shown that we can choose the coefficients of B µ as functions of C µν such that the new amplitude tensor C µν is traceless, i.e.

C µ µ = 0, (1.38)
and also satisfies C 0ν = 0.

(1.39)

Adding the traceless property defines the transverse traceless gauge, which we denote C T T µν = C µν . Under these conditions, we need to solve a total of five equations. However Eq. (1.39) is redundant with k µ C µν = 0 when ν = 0, thus we add 4 additional constraints in total. This means that, C T T µν is a traceless symmetric (0,2) tensor with 2 degrees of freedom and satisfies Eq. (1.39). Without loss of generality, we take the wave to be propagating in the x 3 -direction, i.e. k µ = (ω, 0, 0, ω) where ω is the angular frequency of the GW. In this context C T T µν can be written in the most general case as

C T T µν =     0 0 0 0 0 C 11 C 12 0 0 C 12 -C 11 0 0 0 0 0     , (1.40)
and as long as we remain in the T T gauge, both h µν and h µν are traceless allowing us to drop the bar notation h

T T µν = h T T µν .

(1.41)

The interaction of gravitational waves with matter

Now that we have detailed the theoretical prediction for GWs and their propagation in vacuum, it is necessary to study their effect on matter if we want to understand how we can detect and measure them. Let us first consider a single free-falling test mass in the presence of a GW. The evolution of its coordinate vector x µ is described by the geodesic equation

d 2 x µ dτ 2 + Γ µ νρ dx ν dτ dx ρ dτ = 0, (1.42)
where τ denotes proper time. Still considering a wave propagating in the x 3 -direction, the fact that the perturbation is transverse implies that the test mass movements are constrained in the (x 1 , x 2 ) plane. Hence we are only interested in the motion d 2 x i /dτ 2 , i ∈ {1, 2}. The Christoffel symbols are related to the first derivative of h T T µν via Eq. (1.8), but using the expression of h T T µν from Eq. (1.32) we directly see that all Christoffel symbols are null to first order in h T T µν . As a result d 2 x i dτ 2 = 0, (1.43) meaning that, in the traceless transverse gauge, the presence of a GW has no influence on the spatial coordinates of a free-falling test mass. The coordinate system we have chosen is simply moving with the GW and this situation is not very informative to us. However, if we consider two nearby free-falling test-masses, we shall see that their geodesic paths, which are parallel in the absence of a GW, deviate when the GW passes. This effect can be studied by measuring the relative acceleration of the two geodesics, i.e. the acceleration of the separation vector S µ between the two masses. This acceleration depends on the curvature of spacetime, thus on the Riemann tensor, and on the four-velocities U µ = dx µ /dτ of each mass. It is governed by the following equation

[8] D 2 S µ Dτ 2 = R µ νρσ U ν U ρ S σ , (1.44)
where D/Dτ refers to the directional covariant derivative along U µ . To first order in h µν , and if the two test-masses are slowly-moving, we can assume that proper and coordinate time are equivilant, i.e. τ = t [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]. This simplifies the above equation to [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]]

∂ 2 S µ ∂t 2 = 1 2 S σ ∂ 2 h µ σ ∂t 2 .
(1. [START_REF] Ohme | Analytical Meets Numerical Relativity -Status of Complete Gravitational Waveform Models for Binary Black Holes[END_REF] We saw previously that the gravitational wave amplitude was characterized by only two numbers C 11 and C 12 which we shall rename respectively C + and C × and to which we shall refer to as the "plus" and "cross" polarizations of the gravitational wave. Extending the + and × notation to the perturbation h and using Eq. (1.40) we can write

∂ 2 S 1 ∂t 2 = 1 2 S 1 ∂ 2 h + ∂t 2 + 1 2 S 2 ∂ 2 h × ∂t 2 , (1.46) ∂ 2 S 2 ∂t 2 = 1 2 S 1 ∂ 2 h × ∂t 2 - 1 2 S 2 ∂ 2 h + ∂t 2 .
(1.47)

By linearity of the previous equation, we can consider the effect of each polarization independently.

Starting with the case where only the plus-polarization is present and to first order in h µν

∂ 2 S 1 ∂t 2 = 1 2 S 1 (0) ∂ 2 C + e ikρx ρ ∂t 2 , (1.48) ∂ 2 S 2 ∂t 2 = - 1 2 S 2 (0) ∂ 2 C + e ikρx ρ ∂t 2 (1.49)
yielding

S 1 = 1 + 1 2 C + e ikρx ρ S 1 (0), (1.50)
S 2 = 1 - 1 2
C + e ikρx ρ S 2 (0).

(1.51)

Since both S 1 and S 2 evolve proportionally to their initial values, two test-masses which are only separated along one direction (x 1 or x 2 , thus either S 2 (0) = 0 or S 1 (0) = 0) will oscillate back and forth along that axis, thus describing a + sign if there is one pair of test masses on each axis. For an entire ring of particles, the movement is described on Fig. 1.1. Similarly but this time when Figure 1.1: Evolution of a ring of test-masses in the presence of the plus-polarization of a GW (illustration taken from [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]).

only the cross-polarization is present we find

S 1 = S 1 (0) + 1 2 C × e ikρx ρ S 2 (0), (1.52)
S 2 = S 2 (0) + 1 2 C × e ikρx ρ S 1 (0). (1.53)
Now S 1 and S 2 evolve proportionally to each other's initial value, hence only test-masses both located on the x 2 = x 1 or x 2 = -x 1 lines where S 1 (0) = S 2 (0) will oscillate back and forth along these axis, describing a × shape. The movement of an entire ring of particles is now described on Fig. 1.2.

Gravitational wave generation

The quadrupole moment formula

To understand how GWs are generated, we must re-introduce the source term in the linearized Einstein's field equations, thus considering Eq. (1.30) but with T µν = 0. The solution to the wave equation when the source is a point-pariticle, defined by a Dirac delta-function, is the Green's function G(x µy µ ) satisfying [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]9] G(x σy σ ) = δ (4) (x σy σ ).

(1.54)

Taking the energy-momentum tensor as a continuum of point sources, we can use the linearity of Eq. (1.30) and therefore decompose the trace-reversed perturbation as a sum of Green's functions over spacetime

h µν (x σ ) = - 16πG c 4
G(x σy σ )T µν (y σ )d 4 y.

(1.55)

In the most general case this solution can be split between a causal part travelling forward in time, the retarded Green's function, and a non-causal part travelling backward in time, the advanced Green's functions. We are only interested in the retarded part of the solution which is given by [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]9] G(x σy σ ) = -1 4π|x -y| δ[|x -y| -(x 0y 0 )]θ(x 0y 0 ), (1.56) where boldface variables denote spatial vectors and the norm is the Euclidian norm in 3D space. The quantity θ(x 0y 0 ), which equals unity when x 0 > y 0 and zero otherwise, is the standard Heaviside function. Plugging this expression into Eq. (1.55) and integrating over time yields [START_REF] Carroll | Lecture Notes on General Relativity[END_REF] h µν (t, x) = 4G c 4 1 |x -y| T µν (t R , y)d 3 y, (1.57) Figure 1.2: Evolution of a ring of test-masses in the presence of the cross-polarization of a GW (illustration taken from [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]).

where t R = t -|x -y|/c is the retarded time. As h µν (t, x) is a wave, it is useful to work in terms of its Fourier transform H µν (ω, x) = 1 √ 2π e iωt h µν (t, x)dt.

(1.58)

Replacing h µν (t, x) with Eq. (1.57) and integrating over time leads to

H µν (ω, x) = 4G c 4
e iω|x-y|/c |x -y| Tµν (ω, y)d 3 y,

where Tµν (ω, y) is the Fourier transform of the energy-momentum. Now we make two important assumptions. The first one is to consider that the source is located at a large distance D L1 with its spatial extension r very small compared to D L , i.e. r D L . Then we consider that the source is non-relativistic, i.e. v = ω 0 r c where v and ω 0 are respectively the typical internal velocity and internal frequency motion of the source. This last assumption essentially means that the GW is radiated away much faster than any internal source movement, or that the GW wavelength is much bigger than the spatial extension of the source. It allows us to make an expansion in v/c in the exponential term [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]9], i.e. ω|x -y|/c ω(D L + r)/c = ωD L /c + O(v/c). Finally, to leading order in v/c and r/D L , we can write [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]9] H µν (ω, x) = 4G c 4 e iωD L /c D L Tµν (ω, y)d 3 y.

(1.60)

Then, after using the harmonic gauge condition, integrating by parts and reverting to the time domain [START_REF] Carroll | Lecture Notes on General Relativity[END_REF], one can finally express the gravitational perturbation as

h ij (t, x) = 2G 3c 4 D L d 2 Q ij (t R ) dt 2 , (1.61)
where Q ij is the quadrupole moment tensor of the source, defined by Q ij (t) = 3 y i y j T 00 (t, y)d 3 y.

(1.62)

While electromagnetic radiation can be traced back to the time variability of a dipole moment, i.e. the motion of the center charge density, conservation of momentum prevents the center of mass of an isolated object from oscillating which means that gravitational dipole moment radiation is impossible. As a consequence, we rather find that gravitational radiation is linked to the time variation of the quadrupole moment of a matter (energy) field. These variations are generally much weaker than that of a dipole moment. Adding to this the stiffness of spacetime, numerically described by the factor G/c 4 ∼ 10 -44 m -1 kg -1 s 2 , we understand why GWs are much weaker than their electromagnetic counterparts.

Application to a binary system

Throughout this work we will focus our attention on GWs emitted by binary systems of compact objects, typically two black holes and/or neutron stars. To get a better understanding of such systems we will explicitly derive the gravitational perturbation produced in a simplified set up, represented in Fig. 1.3, where two point bodies of equal masses m 1 = m 2 = M move in a circular orbit around each other, at a distance r from the center of mass with a velocity v = ωr, where ω denotes the angular velocity. We can explicitly define the evolution of the cartesian coordinates, x i (m j ) = x i j , of each body as (1.66)

Our point mass model implies that the energy density T 00 (t, x) of this system is a Dirac deltafunction, proportional to M . As a result we can write

T 00 (t, x) = M δ(x 3 ) δ(x 1 -x 1 1 )δ(x 2 -x 2 1 ) + δ(x 1 -x 1 2 )δ(x 2 -x 2 2 ) , (1.67)
= M δ(x 3 ) δ(x 1 -r cos(ωt))δ(x 2 -r sin(ωt)) + δ(x 1 + r cos(ωt))δ(x 2 + r sin(ωt)) . (1.68)
Using Eq. (1.62) we can easily express the components of the quadrupole moment tensor by successive integration of the delta-functions

Q 11 = 6M r 2 cos 2 (ωt) = 3M r 2 (1 + cos(2ωt)), (1.69) Q 22 = 6M r 2 cos 2 (ωt) = 3M r 2 (1 -cos(2ωt)), (1.70) Q 12 = Q 21 = 6M r 2 cos(ωt) sin(ωt) = 3M r 2 sin(2ωt), (1.71) Q i3 = Q 3i = 0 for i = 1, 2, 3.
(1.72)

We note that the quadrupole moment has a period twice shorter than the orbital period of each body which is consistent with the fact that Q ij measures the shape of the system, here invariant by a π rotation of the system. By considering an observer at a distance D L r, we can use Eq. (1.61) which finally allows us to express the spatial components of the metric perturbation induced by this system, i.e. [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]

h ij (t, x) = 8GM c 4 D L ω 2 r 2   -cos(2ωt R ) -sin(2ωt R ) 0 -sin(2ωt R ) cos(2ωt R ) 0 0 0 0   . (1.73)
We note at this point that the GW frequency is twice the orbital frequency of the binary.

In the case where the masses (m 1 , m 2 ) of each component are different, it is easier to go the center-of-mass frame where the dynamics of the system reduce to that of single fictitious body of mass µ in a circular orbit of radius a = |x 1x 2 | around another body of mass m, where

µ = m 1 m 2 m 1 + m 2 (1.74) m = m 1 + m 2 (1.75)
are the reduced mass and the total mass respectively. In this formalism, it can be shown [9] that the GW amplitude A produced by this system is given (to first order) by

A = 4Gµ D L c 4 ω 2 a 2 , (1.76)
which is consistent with Eq. (1.73) since in the equal mass case we have M = 2µ and r = a/2. Assuming a Keplerian orbit, we can relate the orbital angular frequency ω to the distance a separating the two bodies using Kepler's third law

ω 2 = Gm a 3 . (1.77)
Thus we can eliminate the separation a in favor of ω leading to

A = 4G 5/3 c 4 D L µm 2/3 ω 2/3 . (1.78) Defining the chirp mass M M = µm 2/3 3/5 = (m 1 m 2 ) 3/5 (m 1 + m 2 ) 1/5 , (1.79)
and the GW frequency f GW = ω/π, we can express the amplitude as

A = 4 c 4 D L (GM) 5/3 (πf GW ) 2/3 . (1.80)
Finally it is interesting to compute the amplitude of a wave which propagates in a generic direction n towards the observer located at distance D L . It can be shown [9] that the corresponding amplitudes of the two polarizations only depend on the inclination angle ι between n and the binary's orbital angular momentum L, here by convention parallel to the coordinate direction x 3 , thus cos ι = n. L. We can now express each GW polarization in the form

h + (t) = 4 c 4 D L (GM) 5/3 (πf GW ) 2/3 1 + cos 2 ι 2 cos (2πf GW t R + φ 0 ) (1.81) h × (t) = 4 c 4 D L (GM) 5/3 (πf GW ) 2/3 cos ι sin (2πf GW t R + φ 0 ) (1.82)
where φ 0 is the initial phase which was previously arbitrarily set to 0.

1.5 Inspiral motion of a binary system

Equations of motion for an inspiralling orbit

Neglecting the effects of eccentricity, the gravitational potential energy for two bodies in a binary system is given by -Gm 1 m 2 /a = -Gµm/a and, the total kinetic energy is µv 2 /2. We can thus express the total energy for the system as

E = 1 2 µv 2 - Gµm a (1.83) = 1 2 µ(ωa) 2 - Gµm a (1.84) = 1 2 Gµm a - Gµm a (1.85) = - 1 2 Gµm a (1.86)
where we used Kepler's third law, Eq. (1.77), to go from the second to the third line. However we saw that when such a system emits GWs, it loses energy and E decreases. As a result, according to Eq. (1.86), the distance a separating the two objects must decrease as well to account for this loss.

In turn Kepler's law indicates that when the separation decreases, the frequency ω increases, which then means that the gravitational wave amplitude gets larger, thus more energy is radiated via GWs, and a must decrease even further etc. This unstable process sees the two bodies inspiralling around each other in an accelerated motion leading to the coalescence of the two objects. Due to this inspiral motion, the previous expressions for the two polarizations, Eq. (1.81) and Eq. (1.82), need to be corrected to account for the time dependence of the gravitational wave frequency, i.e. f GW = f GW (t). To derive the speed at which f GW increases, we use the energybalance equation which relates the GW flux F, or luminosity, with the rate of change of the orbital energy -dE/dt [11,[START_REF] Buonanno | Comparison of Post-Newtonian Templates for Compact Binary Inspiral Signals in Gravitational-Wave Detectors[END_REF], i.e.

F = - dE dt . (1.87)
On the one hand, continuing with the Newtonian approximation by using once again Kepler's law, we can replace a in favor of ω in Eq. (1.86) yielding

E = - 1 2 G 2 M 5 ω 2 1/3 . (1.88)
On the other hand the following expression for F can be derived [9,11]

F = 32 5 c 5 G GMω c 3 10/3 . (1.89)
Equating F with -dE/dt, and using f GW = ω/π leads to

ḟGW = 96 5 π 8/3 GM c 3 5/3 f 11/3 GW , (1.90)
where ḟGW = df GW (t)/dt. Before giving the solution to this differential equation, let us note that the time evolution of the frequency is entirely controlled by M. Since f GW increases with time, so does the amplitude of the GW which is characteristic of a chirp signal. Integrating the previous equation gives an expression for f GW that formally diverges at a finite value of time which we note as the time of coalescence, t c , i.e.

f GW (t) = 1 π 5 256 1 (t c -t) 3/8 GM c 3 -5/8 . (1.91)
Finally the expressions of the two polarizations during the inspiral in the limit of the circular orbit approximation and to leading order in v/c can be read from the Eq. (1.81) and (1.82) but including the time dependency on f GW (t) from Eq. (1.91). However these equations remain a Newtonian approximation to the true dynamic of the system. More advanced techniques must be used to account for the highly relativistic nature of some binaries.

Inspiral, merger, ringdown phases and their modelisation

For compact objects such as neutron stars and black holes, the primary sources of detectable GWs for current ground based GW detectors, the Newtonian framework breaks down due to the highly curved spacetime in their neighbourhood. This is problematic since, as will be explained later in Chapter 3, an accurate model of the waveform is crucial in GW data analysis in order to detect the GW signal and subsequently infer the parameters defining the source. As the Newtonian approximation is not accurate enough to model the inspiral of two compact bodies [START_REF] Cutler | The Last Three Minutes: Issues in Gravitational Wave Measurements of Coalescing Compact Binaries[END_REF][START_REF] Cutler | Gravitational Waves from Mergin Compact Binaries: How Accurately Can One Extract the Binary's Parameters from the Inspiral Waveform?[END_REF][START_REF] Blanchet | Gravitational Radiation from Post-Newtonian Sources and Inspiralling Compact Binaries[END_REF], it is inherently unable to describe neither the merger, nor the ringdown phase which corresponds to a phase of relaxation of the remnant object. Given a set of parameters λ µ , accurately modeling the inspiral-merger-ringdown (IMR) phases of the gravitational waveform requires different techniques we will review below.

A full and non-approximated implementation of GR is technically feasible using Numerical Relativity (NR) methods to accurately model the IMR phases [START_REF] Pretorius | Evolution of Binary Black-Hole Spacetimes[END_REF][START_REF] Campanelli | Accurate Evolutions of Orbiting Black-Hole Binaries without Excision[END_REF][START_REF] Baker | Gravitational-Wave Extraction from an Inspiraling Configuration of Merging Black Holes[END_REF][START_REF] Baumgarte | Numerical Relativity: Solving Einstein's Equations on the Computer[END_REF][START_REF] Hinder | Error-Analysis and Comparison to Analytical Models of Numerical Waveforms Produced by the NRAR Collaboration[END_REF][START_REF] Ajith | The NINJA-2 Catalog of Hybrid Post-Newtonian/Numerical-Relativity Waveforms for Non-Precessing Black-Hole Binaries[END_REF]. However the generation of a single NR template requires weeks to months of CPU time, making it computationally too expensive to be used in daily GW analysis. To go beyond the standard Newtonian approximation of the inspiral phase, a post-Newtonian formalism (PN) can be used to account for higher order gravitational effects (see for example [START_REF] Blanchet | Gravitational Radiation from Post-Newtonian Sources and Inspiralling Compact Binaries[END_REF][START_REF] Buonanno | Comparison of Post-Newtonian Templates for Compact Binary Inspiral Signals in Gravitational-Wave Detectors[END_REF] and references therein). This formalism is applicable to slowly moving and weakly stressed sources. This approximation is based on an expansion of the equations of motion in powers of (v/c) n , where v is a typical velocity of the source satisfying v c, and are referred to as n 2 PN terms [START_REF] Blanchet | Gravitational Radiation from Post-Newtonian Sources and Inspiralling Compact Binaries[END_REF][START_REF] Blanchet | Gravitational Waves from Inspiralling Compact Binaries: Energy Loss and Waveform to Second-Post-Newtonian Order[END_REF][START_REF] Buonanno | Comparison of Post-Newtonian Templates for Compact Binary Inspiral Signals in Gravitational-Wave Detectors[END_REF]. For example, the TaylorF2-3.5PN [START_REF] Blanchet | Gravitational-Radiation Damping of Compact Binary Systems to Second Post-Newtonian Order[END_REF][START_REF] Blanchet | Gravitational-Wave Inspiral of Compact Binary Systems to 7/2 Post-Newtonian Order[END_REF] waveform approximant is a rapid analytical waveform in the Fourier domain with phase corrections to the (v/c) 7 order. Nevertheless, the PN expansion breaks down in the last few cycles of the inspiral as the two bodies approach the non-linear regime close to merger. To estimate when the transition between the two phases occurs we often use the Inner-most Stable Circular Orbit (ISCO) of a test mass orbiting in a Schwarzschild background. Its value is given in natural units2 by [START_REF] Carroll | Lecture Notes on General Relativity[END_REF] r

ISCO = 6m, (1.92)
where m is the mass of the black hole and would correspond to the total mass of a binary system in this case. The derivation of r ISCO assumes a negligible mass of the orbiting body with respect to the black hole mass, thus the concept of ISCO must be used carefully when applied to a binary where m 2 ≈ m 1 . Nevertheless it was shown in [START_REF] Blanchet | Gravitational Radiation from Post-Newtonian Sources and Inspiralling Compact Binaries[END_REF] that Eq. (1.92) is valid up to 1PN for any symmetric mass ratio η = m 1 m 2 /(m 1 + m 2 ) 2 . By substituting r ISCO in Kepler's third law, Eq.

(1.77), we can derive the corresponding ISCO frequency

f ISCO = v 3 ISCO π c 3 Gm = 1 6 3/2 π c 3 Gm 4.4 kHz M m , (1.93)
where we have used v ISCO = m/r ISCO in the above expression. For a typical system of two neutron stars of equal masses m 1 = m 2 = 1.4 M , we find f ISCO 1.6 kHz and r ISCO 25 km which is to be compared with the typical radius of a neutron star ∼ 10 km. Thus beyond the ISCO, the two objects are very close and start to plunge towards each other because they now orbit in the strong-field regime. Furthermore, we can see that beyond the ISCO, the two objects orbit at velocities v > v ISCO = 0.4.

In order to successfully carry out rapid detection and parameter estimation, a number of different methods, or waveform families, have been developed.

Firstly the Effective-One-Body (EOB) analytical formalism [START_REF] Buonanno | Effective One-Body Approach to General Relativistic Two-Body Dynamics[END_REF][START_REF] Buonanno | Transition from Inspiral to Plunge in Binary Black Hole Coalescences[END_REF][START_REF] Thibault Damour | Effective One Body Approach to the Dynamics of Two Spinning Black Holes with Next-to-Leading Order Spin-Orbit Coupling[END_REF][START_REF] Damour | Improved Analytical Description of Inspiralling and Coalescing Black-Hole Binaries[END_REF][START_REF] Barausse | Improved Effective-One-Body Hamiltonian for Spinning Black-Hole Binaries[END_REF] is a time-domain family which is physically well motivated as it maps the motion of the two components of the binary to that of a single test particle evolving in an external metric. However generating waveforms is quite slow with this method3 . Then the phenomenological family, denoted IMRPhenom, produces analytic Fourier domain waveforms and for this reason are much faster to generate [START_REF] Ajith | Phenomenological Template Family for Black-Hole Coalescence Waveforms[END_REF][START_REF] Ajith | Template Bank for Gravitational Waveforms from Coalescing Binary Black Holes: Nonspinning Binaries[END_REF][START_REF] Yi Pan | Data-Analysis Driven Comparison of Analytic and Numerical Coalescing Binary Waveforms: Nonspinning Case[END_REF] 4 . Both are calibrated using numerical relativity results and with each other.

Over the past decades, the LIGO Virgo Collaboration (LVC) has developed the library LAL-Simulation, part of the LALSuite software [START_REF][END_REF], which gathers almost all existing approximants and is central to most of the GW data analysis codes in the collaboration. For a deeper overview of the ins and outs of waveform template generation and further references, we refer the reader to [START_REF] Ohme | Analytical Meets Numerical Relativity -Status of Complete Gravitational Waveform Models for Binary Black Holes[END_REF] and references therein.

Detecting gravitational waves

Given the stiffness of spacetime, encapsulated by the factor G/c 4 ∼ 10 -44 m -1 kg -1 s 2 in Eq. (1.73), GWs are much weaker than their electromagnetic counterparts, with nature providing a typical GW strain for compact binaries on the order of h ∼ 10 -21 . Being able to measure such tiny fluctuations in spacetime necessitates the development of high precision instruments. The idea behind current GWs detectors is (i) to create an apparatus that replicates two objects in free-fall such that if a GW passes it will influence their spacetime separations similarly to the ring of freefalling particles we described in section 1.3 and (ii) to be able to measure h(t) continuously over time with enough precision to separate it from other sources of displacement.

Laser interferometry

Laser interferometry is precisely able to perform both these tasks. In this section we will describe in a simplified manner how this technique allows for the precise and continuous measurement of the GW strain h(t). For further details, we refer the reader to [9] and references therein.

A laser beam is split into two orthogonal arms of equal length L, at the end of which are two suspended mirrors that are free-falling in the horizontal plane. The reflected beams are then recombined on a photodetector measuring the received power. The free-falling mirrors' separation evolves as a GW passes through the interferometer thus modifying the light path in each arm. The wave nature of light induces constructive or destructive recombinations on the photodetector if the beams are respectively in or out of phase, allowing the observation and precise measurement of the GW. Therefore, laser interferometry essentially converts a GW perturbation into a phase-shift on the recombined laser beams.

To understand how, let us consider the interaction of a GW with an interferometer by putting ourselves in the TT gauge. We choose our coordinate system to be (t, x, y, z), with our frame centered on the beam splitter and with the wave propagating in the -z direction (see Fig. 1.5). Out of simplicity for the moment, we will assume that (i) the GW is composed only of its "+" polarization and (ii) the first and second arms are perfectly aligned with respectively the x and y axis of the TT gauge frame. Thus, the end mirrors occupy positions (L x , 0) and (0, L y ) in the (x, y) plane. The spacetime interval along the arms in the TT frame is given by [9]

ds 2 = -c 2 dt 2 + (1 + h + (t))dx 2 + (1 -h + (t))dy 2 .
(1.94)

Photons follow null geodesics, implying ds 2 = 0, hence along the x arm we get

dt = ± 1 c (1 + h + (t)) 1/2 dx ± 1 c 1 + 1 2 h + (t) dx. (1.95)
For a photon which started its trip at t x 0 before being reflected and recombined at the beam splitter at time t, one can integrate the previous equation to compute the duration δt x = tt x 0 of a round-trip in the x arm

δt x = 2L x c + 1 2 t t x 0 h + (t )dt . (1.96)
From Eq. (1.81) we can express the plus polarization as h + (t) = h 0 (t) cos(ω GW t). The time-scale variation of the amplitude h 0 (t) is very long compared to the GW period and even longer compared to the round-trip duration of a photon, thus we can take h 0 as a constant [9]. As we are interested in computing the round-trip duration to first order in h + , we can approximate the lower limit of the integral by t x 0 = t -2L x /c. Integration then yields

δt x = 2L x c + h 0 2ω GW [sin(ω GW t) -sin (ω GW (t -2L x /c))] . (1.97)
Using sin(a)sin(a -2b) = 2 sin(b) cos(ab), the previous expression simplifies to

δt x = 2L x c + 1 ω GW sin(ω GW L x /c)h 0 cos (ω GW (t -L x /c)) , (1.98)
which we can again rewrite since h

+ (t -L x /c) = h 0 cos (ω GW (t -L x /c)) giving δt x = 2L x c + 1 ω GW sin(ω GW L x /c)h + (t -L x /c). (1.99)
Similarly we can define the equivalent round-trip duration in the y arm (note the minus sign)

δt y = 2L y c - 1 ω GW sin(ω GW L y /c)h + (t -L y /c). (1.100)
At recombination on the beam splitter, the phase shift at time t is given by ∆φ(t) = ω L (δt x (t)δt y (t)), where ω L is the angular frequency of the laser. In practice the two arms lengths L x and L y are made as equal as possible such that δL L with L = (L x + L y )/2 and δL = (L x -L y )/2. Therefore we can write L x = L + δL/2 and L y = L -δL/2, and at first order in δL, we are finally able to express the phase-shift at the output photodetector of the interferometer as a function of the GW perturbation

∆φ(t) = ω L 2δL c + 2 ω L ω GW sin(ω GW L/c)h + (t -L/c). (1.101)
In the absence of GWs we retrieve the phase-shift of a classical Michelson's interferometer, i.e. ∆φ = ω L 2δL/c, where destructive interference are obtained when δL = λ L /4. When it comes to measuring GWs, this term is essentially a constant set by the experimenter [9] and all the information of interest resides in the second term. The regime of interest to us is when ω GW L/c 1, leading to sin(ω GW L/c) ω GW L/c. This regime corresponds to a round-trip duration of photons that is much shorter than the period of the GW, indicating that each photon effectively sees a constant GW perturbation. We see that in this limit the phase-shift induced by h + is

∆φ(t) = 2ω L Lh + (t -L/c)/c. (1.102)
From the photodetector's point of view, this is formally equivalent to a phase-shift 2ω L ∆L/c induced by an additional length difference ∆L between the arms in the absence of a GW. Therefore we often say that the GW is a strain, which when applied on an arm of length L induces a change of length ∆L given by

∆L L h(t -L/c). (1.103)
For this reason gravitational wave interferometers are often thought of as rulers measuring length differences induced by a GW on the arms; but we understand now that a more accurate picture is to describe them as clocks measuring the differences in duration of photons round-trips in the arms. And since time is not influenced by the GW in the TT gauge, this description avoids legitimate questions arising from the first description about our ability to make a distance measurement in a frame where space itself varies. Assuming we aim to build a simple Michelson interferometer to detect GWs, one of the first question would be to determine how long its arms should be for this purpose. Clearly we want the effect of the GW on ∆φ to be the highest possible to get the best possible measurement. Therefore the optimal length of the arms is given by sin(ω GW L/c) = 1, i.e. L = c/(4f GW ) = λ GW /4. As we shall see in Chapter 4, the highest frequencies are achieved by binary neutron star systems (BNS), close to merger. For a typical (1.4, 1.4) M system, f ISCO computed from Eq. (1.93) yields 1 570 Hz leading to L 47 km. This is the minimum optimal length that a Michelson interferometer should have to detect the last stages only of a BNS merger. More massive systems merge at lower frequencies, so detecting them would require L ∼ 10 3 km. However the construction of such big apparatus is unfeasible. Real interferometers are in fact much more advanced than the simple Michelson scheme we used for the previous computations. Using cutting-edge technologies, not only are they able to avoid building such prohibitive arm lengths, with current interferometers being at most 4 km long, but they also manage to drastically reduce most of the noise sources they face.

Advanced interferometers

The current network of ground-based detectors is composed of the two Advanced LIGO detectors [START_REF] Aasi | Advanced LIGO[END_REF] (hereafter aLIGO) located in Handford and Livingston in the USA, the European Advanced Virgo detector [START_REF] Acernese | Advanced Virgo: A 2nd Generation Interferometric Gravitational Wave Detector[END_REF] (hereafter AdV) in Cascina Italy , the Anglo-German GEO 600 detector [START_REF] Willke | The GEO 600 Gravitational Wave Detector[END_REF][START_REF] Willke | The GEO-HF Project[END_REF] in Garching, Germany and the Japanese KAGRA detector in Kamioka, Gifu [START_REF] Akutsu | Overview of KAGRA: Calibration, Detector Characterization, Physical Environmental Monitors, and the Geophysics Interferometer[END_REF]. An additional aLIGO is currently being built in India [48]. Fig. 1.4 shows their locations on the world map. The two aLIGOs have arms lengths of 4 km, while AdV and KAGRA both have arm lengths of 3 km and GEO 600 has arm lengths of 600 m. The two aLIGOs started their first Advanced Detector Era observations in 2015, denoted O1, and were joined two years later by Virgo during the second run, denoted O2. GEO 600 is operational but contributes little to common observations with other detectors due to its smaller arm lengths, and hence lower sensitivity. KAGRA conducted its first observation run together with GEO 600 in April 2020. In comparison to its counterparts, KAGRA is located underground, with core optical systems that work at cryogenic temperatures (20K).

Main extensions from a Michelson interferometer

Fig. 1.5 gives a sketch of the main additional components added to the initial Michelson setup and which we are going to describe here. A more complete description of the AdV and aLIGO interferometers can be found here [START_REF] Acernese | Advanced Virgo: A 2nd Generation Interferometric Gravitational Wave Detector[END_REF][START_REF] Aasi | Advanced LIGO[END_REF]. To start with, two supplementary partially reflective test mass mirrors are installed close to the beam-splitter in order to create a Fabry-Pérot cavity in each arm. Photons are thus reflected back and forth many times on average before leaving the cavity, resulting in an increase of their optical path by 2F/π, where F is the finesse of the cavity5 [9]. With respective finesses of 440 and 500 [START_REF] Acernese | Advanced Virgo: A 2nd Generation Interferometric Gravitational Wave Detector[END_REF][START_REF] Aasi | Advanced LIGO[END_REF] the arm lengths of 3 km and 4 km become equivalent to that of a ∼ 10 3 km detector for a simple Michelson. Furthermore if L satisfies 2k L L = 2πn, where n is an integer, then the cavity is resonant and beams bouncing back and forth will interfere constructively allowing the electric field inside the cavity, and thus the transmitted one to the photodetector as well, to raise to a very large value. This effect improves the measurement on the phase-shift by a factor also ∼ F [9].

Even with Fabry-Pérot cavities, a more precise measurement of the phase-shift is necessary, which dictates a high intensity of the input electric field (cf shot noise described in the following section). However the interferometers input lasers operate at 40W when the required intensity is closer to ∼ 750kW. To fill this gap, let us note that beams leaving the Fabry-Pérot cavities are also transmitted back to the laser since the beam splitter is essentially half transparent and half reflective. Therefore a clever way to increase the effective laser power is to recycle the light transmitted back to the laser by introducing a power recycling mirror which will re-inject these beams back into the interferometer.

Finally, at the output of the interferometer, a partially transmissive signal recycling mirror is installed, which sends photons back into the arm cavities. This forms another resonant cavity able to broaden the bandwidth of the interferometer [START_REF] Buonanno | Signal Recycled Laser-Interferometer Gravitational-Wave Detectors as Optical Springs[END_REF].

All these enhancements from the simple Michelson interferometer make is possible for AdV and aLIGO to measure the phase-shift with enough precision that it can track mirror displacements ∆L ∼ 10 -18 m, thus enabling the observation of a gravitational strain h ∼ 10 -21 .

Noise sources in the interferometer

Despite these improvements, interferometers still suffer from different noise sources limiting the measurements of a GW. We present in Fig. 1.6 an example of the main noise sources in the Advanced Virgo and Advanced LIGO detectors. We see that quantum noise, which includes both photon shot noise and radiation pressure noise, is present over the entire frequency band but is dominant in the high frequencies. Photon shot noise appears at high frequencies and corresponds to a quantum statistical uncertainty in the number of photons the photodetector receives in a given period of time. As with the uncertainty of any random process, this decreases with the square root of the number of photons, therefore the more photons used, the smaller the uncertainty meaning photon shot noise can be reduced by increasing the laser power inside the cavity (hence the need for the power recycling mirror) [START_REF] Sathyaprakash | Physics, Astrophysics and Cosmology with Gravitational Waves[END_REF]. However doing so increases radiation pressure noise on the mirrors which appears at low frequencies and also thermal noise from the mirrors [START_REF] Hild | Beyond the Second Generation of Laser-Interferometric Gravitational Wave Observatories[END_REF]. Radiation pressure can be reduced by using heavier test masses, but this in turn implies a more delicate handling of the suspension system which controls seismic noise. In fact, the latter is greatly reduced thanks to a system of multiple-stage pendulums at the end of which each mirror is suspended using fusedsilica fibers. Seismic noise appears at low frequencies and is a limiting source for ground-based detectors, even though building the interferometer underground, as with KAGRA, enables them to mitigate the impact of seismic vibrations on the surface [START_REF] Akutsu | Construction of KAGRA: An Underground Gravitational-Wave Observatory[END_REF]. The thermal noise curve represented in Fig. 1.6 includes terms due to the suspensions, the test masses and the coatings. Newtonian gravitational noise originates from pressure waves or thermal perturbations in the atmosphere which create fluctuations of the gravitational potential. Contrary to seismic noise from which the test masses can be isolated thanks to the suspension system, there is no way to shield them from Newtonian noise. Strong line features in the displacement sensitivity of the interferometer are due to the violin modes of the suspension wires which enter in resonance at different harmonics, and also to the AC power line (50 Hz in Europe, 60 Hz in the USA) and calibration lines [START_REF]GW150914: The Advanced LIGO Detectors in the Era of First Discoveries[END_REF]. Finally cross couplings from the auto-alignment system and from the auxiliary lengths are combined into the curve labeled other DOF (degrees-of-freedom) [START_REF]GW150914: The Advanced LIGO Detectors in the Era of First Discoveries[END_REF].

GW strain of an interferometer

The antenna pattern functions

In section 1.6.1 we derived the effect of a GW on the displacement of the mirrors in the case of an incoming wave for which (i) the direction of propagation was orthogonal to the plane formed by the arms of the detector and (ii) constituted by its "+" polarization only. However in the general case the strain measured by the interferometer h if o (t) depends on the orientation of the detector with respect to the direction of propagation of the GW and on both polarizations. Each detector's response is encoded in its antenna pattern functions6 , (F + , F × ), which involve the projection of the source frame GW polarizations onto the interferometer.

The antenna patterns are a function of a number of parameters: the detector response depends on the sky position of the source, which is encoded by two angles defined in a fixed celestial frame, i.e. the right-ascension α ∈ [0, 2π] and the declination δ ∈ [-π/2, π/2] of the source. As the Earth is constantly rotating around its axis, the interferometer is not at a fixed position in this fixed celestial frame, therefore the orientation of the earth at the time of detection is also needed. This is determined by the Greenwich Mean Sideral Time (GMST), an angle measuring the rotation of the earth relative to the fixed celestial frame in which {α, δ} are defined. Defining an Earth fixed frame where the coordinate axes (x, y, z) pierce the earth at latitude and longitude ({ϕ, λ}) of ({000, 000}, {000, 090E}, {090N, 000}) respectively, and using the usual spherical polar altitude and azimuth coordinates {θ, φ} ∈ {[0, π], [0, 2π]} in this frame, GMST follows the convention

φ = α -GM ST (1.104) θ = π/2 -δ.
(1.105)

The GMST is computed at the time of the detection and can be considered constant throughout the entire analysis since the angle by which the earth rotates during a signal duration is negligible. Lastly we introduce the polarization angle ψ which measures the orientation of the projection of the orbital angular momentum of the binary onto a plane orthogonal to the direction of propagation (see [START_REF] Anderson | An Excess Power Statistic for Detection of Burst Sources of Gravitational Radiation[END_REF][START_REF] Veitch | Parameter Estimation for Compact Binaries with Ground-Based Gravitational-Wave Observations Using the LALInference Software Library[END_REF] for a formal definition of ψ and [START_REF] John T Whelan | The Geometry of Gravitational Wave Detection[END_REF] for a full geometrical explanation). Finally we can write the time domain strain measured by the interferometer as:

h if o (t) = F + (ψ, α, δ, GM ST )h + (t) + F × (ψ, α, δ, GM ST )h × (t). (1.106)
In practice, the computation of (F + , F × ) for each detector, given the parameters {ψ, α, δ, GM ST } is done via successive projections starting from the source frame onto the Earth fixed frame and then onto the detector frame which (x, y) axis are oriented along the arms. The detailed derivation of the antenna pattern functions can be found in [START_REF] Anderson | LIGO-T010110-v1: Beam Pattern Response Functions and Times of Arrival for Earthbound Interferometer[END_REF][START_REF] Anderson | An Excess Power Statistic for Detection of Burst Sources of Gravitational Radiation[END_REF][START_REF] Nishizawa | Probing Non-Tensorial Polarizations of Stochastic Gravitational-Wave Backgrounds with Ground-Based Laser Interferometers[END_REF], 52]7 . For a fiducial interferometer located at the center of the Earth having its arms aligned with the axis of the Earth fixed frame, it reads in spherical polar coordinates

F + = - 1 2 1 + cos 2 θ cos 2φ cos 2ψ -cos θ sin 2φ sin 2ψ, (1.107)
F × = + 1 2
1 + cos 2 θ cos 2φ sin 2ψcos θ sin 2φ cos 2ψ.

(1.108)

We note that the final detector-frame expressions are too long to reproduce here, but can be found in the above reference.

In the end, the GW strain detected by an interferometer can be expressed as a function of λ µ which refers to every parameter entering our GR model. The simplest model, which we have described so far, uses 9 parameters which are represented on Fig. 1.7 and have been introduced earlier. However there can be up to 17 if one includes the spin vectors of both components and two tides parameters accounting for matter effects.

Inclination and distance measurement

In Eq. (1.81) and (1.82) we saw that h + (t) and h × (t) are in phase quadrature. Hence the amplitude of h if o in Eq. (1.106) will be a quadratic combination of the two polarizations' amplitudes, proportional to the a factor Q reading

Q = F 2 + 1 + cos 2 ι 2 2 + F 2 × cos 2 ι 1/2 , (1.109)
while its phase will be that of h + shifted by an overall value ϕ(F + , F × , cos ι) reading

ϕ(F + , F × , cos ι) = arctan 2 F × cos ι, 1 2 (1 + cos 2 ι)F + (1.110)
where arctan 2(y, x) is the 2-argument arc-tangent that returns the phase of the complex number x + iy and simplifies to arctan(y/x) only when x > 0. Finally we can rewrite the strain detected

h if o (t) = 4Q c 4 D L (GM) 5/3 (πf GW (t)) 2/3 cos [2πf GW (t)t R + φ 0 + ϕ(F + , F × , cos ι)] (1.111)
The term ϕ(F + , F × , cos ι) being time independent can be absorbed by the intial phase φ 0 for a single interferometer measurement, i.e. we could define a phase shift φ 0 = φ 0 + ϕ(F + , F × , cos ι) without a loss in consistency. As a result the GW strain detected by a single interferometer only depends on cos 2 ι, and not cos ι, via the factor Q in the amplitude. It follows that a natural degeneracy in the measurement of the inclination leads to two modes in ι, mirroring each other with respect to the axis ι = π/2. However, for a strong enough signal, a network of detectors can break this degeneracy. In fact, a coherent analysis between the different signals observed in the detector network will phase-match the terms φ 0 + ϕ(F + , F × , cos ι) in all interferometers at the same time. Since each of them have different antenna patterns, this reintroduces the dependence on cos ι via the cross polarization therefore enabling us to discriminate between the two modes.

Then when it comes to measuring D L , we see that we only have access to an effective distance D L /Q implying that D L and ι cannot be determined separately from a single amplitude measurement only. Their correlation can be understood with more intuition: since most of the GW power is radiated orthogonal to the plane of orbit, i.e. in directions close to ι = 0 or ι = π, a single interferometer can hardly make the difference between a source close to us but edge-on, i.e. ι = π/2 and a source at a high distance but face-on/off, i.e. ι ∈ {0, π} [START_REF] Usman | Constraining the Inclinations of Binary Mergers from Gravitational-Wave Observations[END_REF]. However this is not a lost cause: inclusion of higher order multipoles than the quadrupole formula (see [START_REF] Cutler | Gravitational Waves from Mergin Compact Binaries: How Accurately Can One Extract the Binary's Parameters from the Inspiral Waveform?[END_REF][START_REF] London | First Higher-Multipole Model of Gravitational Waves from Spinning and Coalescing Black-Hole Binaries[END_REF][START_REF] Abbott | Gravitational Waves from the Coalescence of a 23 Solar Mass Black Hole with a 2.6 Solar Mass Compact Object[END_REF]), precession effects (see Chapter 8) and the determination of a fixed sky position (see section 4.1.3.2 and [START_REF] Chassande-Mottin | Gravitational Wave Observations, Distance Measurement Uncertainties, and Cosmology[END_REF]) can reduce this correlation.

Triangulation of the source

Contrary to usual electromagnetic telescopes which can be pointed towards the particular area of the sky they observe, a GW detector is essentially listening to the whole sky at the same time, even though its sky sensitivity depends on its orientation via the antenna pattern functions (see Fig. 4 of [START_REF] Sathyaprakash | Physics, Astrophysics and Cosmology with Gravitational Waves[END_REF] for an example plot of the antenna pattern). As such each detector taken independently of the other has a very poor resolution of the sky location of the source which emitted the GW it detected, i.e. {α, δ} are measured with a lot of uncertainty. This is where the need for a coherent analysis of the signal via a network of detectors is very important. In fact, as each detector is situated at a different location on the surface of the Earth, the GW will reach them at different times, with different relative amplitudes of the wave, translating into different measurements of the times of coalescence t c,if o . This then allows the computation of the time delays needed by the GW to travel from one interferometer to another. Knowing that a GW travels at the speed of light and knowing the distance between two detectors, one time delay between two interferometers translates into a possible localization of the source in the sky in the shape of an annulus. For instance if the time delay is null, the annulus is that generated by the rotation of any perpendicular bisector of the segment linking the two concerned interferometers. Thus, as shown on Fig. 1.8, a network of three detectors generates three annuli translating into only two possible point-like sky localizations of the source: the real one and a mirror image; the source has been triangulated [START_REF] Fairhurst | Triangulation of Gravitational Wave Sources with a Network of Detectors[END_REF][START_REF] Fairhurst | Source Localization with an Advanced Gravitational Wave Detector Network[END_REF]. Even though we are usually able to break this degeneracy by playing on the amplitude consistency of each interferometer in the sky [START_REF] Fairhurst | Triangulation of Gravitational Wave Sources with a Network of Detectors[END_REF], a 4-detector network would break it entirely (their would be six annuli) and bring even more confidence in the measurement of {α, δ} [START_REF]Prospects for Observing and Localizing Gravitational-Wave Transients with Advanced LIGO[END_REF].

Figure 1.8: Triangulation of a GW source using the 3-detector network composed of the two LIGO Handford ("H") and Livingston ("L") and the Virgo ("V") interferometers. Each time delay between the times of coalescence measured by two detectors induces an annulus on the sky to which the source position belongs. At the two intersections of the three annuli is the true sky localization ("S") and a mirror image ("S'"). Figure taken from [START_REF] Chatterji | Coherent Network Analysis Technique for Discriminating Gravitational-Wave Bursts from Instrumental Noise[END_REF].

Chapter 2

Astrophysics of compact binaries

While there are many sources of GWs, the one we will focus on in this thesis is the production of GWs from the inspiral and merger of compact binary systems. To understand the physical properties of such systems, we will start by detailing the evolution of single stars which lead to the possible formation of compact objects, namely white dwarfs (WDs), neutron stars (NSs) or black holes (BHs), at the end of their lives. Then after a description of these compact objects we will investigate how they might evolve in binary stellar systems, eventually leading to compact binary systems that are of interest for GW emission. This chapter has mainly been written using [START_REF] Postnov | The Evolution of Compact Binary Star Systems[END_REF] and references therein; standard results on stellar evolution and compact objects can respectively be found in [START_REF] Arnett | Supernovae and Nucleosynthesis: An Investigation of the History of Matter, from the Big Bang to the Present[END_REF] and [START_REF] Stuart | Black Holes, White Dwarfs, and Neutron Stars[END_REF].

Single star evolution

Clouds of interstellar gas are mostly composed of hydrogen atoms. If sufficiently massive and dense, a cloud will collapse under gravity to form a protostar, a phenomenon known as Jean's instability. During this process, thermal pressure and thus temperature increase. When the core of the cloud reaches ∼ 5 × 10 6 K, nuclear fusion of hydrogen atoms into helium begins, generating heat and radiation pressure that balance gravity. The protostar can now be classified as a star in hydrostatic and thermal equilibrium, and moves onto the main sequence in the Hertzsprung-Russell diagram shown on Fig. 2.1. Then two different scenarios can take place depending on the mass M of the star: we can define low stellar mass evolution for stars with masses in the range 0.3 M M 8 M , and high stellar mass evolution for those where M 8 M . The major steps in the life of a star, schematically represented in Fig. 2.2, are detailed hereafter for both cases.

Low stellar mass evolution

Nuclear reactions taking place in the core of low mass stars convert hydrogen atoms into helium via the proton-proton chain reaction (PP-cycle). Once most of the hydrogen has been consumed in the core, there is not enough nuclear fusion, and thus thermal pressure, to counteract gravity. Hence the star starts to collapse onto its helium core and temperature rises again. Before reaching the threshold for helium burning in the core, the temperature increases sufficiently to trigger nuclear fusion in the outer shells of the star. These reactions cause a massive expansion of the stellar envelope, decreasing its surface temperature, and shifting the emitted radiation to the red part of the visible spectrum. The star is then said to have evolved from the main sequence onto the red giant branch. Then gravitational collapse of the core continues until it finally reaches a high enough temperature to trigger nuclear reactions converting helium into carbon and oxygen atoms. The star has now moved on the horizontal branch. Once there is no helium left, the star faces another gravitational collapse, creating a similar expansion of its envelope due to nuclear reactions on helium left in the outer shells, sending it on the asymptotic giant branch. The temperature needed to trigger carbon-oxygen nuclear reactions is never reached for low mass stars. During the horizontal and asymptotic giant branches, successive shell burning and contractions develop instable pulsations inside the star, also known as thermal pulses or helium shell flashes [START_REF] Schwarzschild | Red Giants of Population II. II[END_REF]. This is a destructive runaway process and evolves to the point where the pulsations become so large that they eject the outer stellar layers from the inert carbon-oxygen core [START_REF] Vassiliadis | Evolution of Low-and Intermediate-Mass Stars to the End of the Asymptotic Giant Branch with Mass Loss[END_REF]. A planetary nebula is formed and the core contracts onto itself until degenerate pressure stabilizes it: the star ends its life as a white dwarf, a peculiar object we will described in section 2.2.1.

High stellar mass evolution

Although high mass stars follow a similar evolution as their low mass counterparts, we can note that (i) the main process through which hydrogen is burnt into helium is the carbon-nitrogenoxygen (CNO) cycle, (ii) the time of core hydrogen burning follows t nucl ∝ M -2 [START_REF] Postnov | The Evolution of Compact Binary Star Systems[END_REF] thus the more massive the star is the shorter this phase will last and (iii) the expansion of the envelope is even larger, hence the name red super-giant. Contrary to low mass stars, the contraction of the carbon-oxygen core will reach a high enough temperature so to trigger nuclear reactions creating neon and magnesium. Then a succession of contraction → nuclear reactions → contraction cycles take place, creating heavier and heavier elements in the periodic table, until nuclear fusion creating iron occurs. This last reaction being endothermic, no additional heat is produced in the core which is now under a massive gravitational pressure. The outer parts of the core collapse towards the center at relativistic velocities before bouncing off it. This leads to a rapid temperature rise at the origin of a variety of new nuclear reactions producing an incredible amount of neutrinos. Being weakly interacting with matter, part of the neutrinos carry most of the energy through the core to the outer layers of the star which get ejected in a violent explosion referred to as a Type II supernova explosion. We note that the detailed mechanisms explaining core collapse supernovae explosions are still under debate, see [START_REF] Papish | A Call for a Paradigm Shift from Neutrino-Driven to Jet-Driven Core-Collapse Supernova Mechanisms[END_REF] and references therein. Two scenarios are again possible depending on the initial mass of the star. If 8 M M 18 M the remnant of the core is a neutron star ; if M 18 M the remnant is a stellar-mass black hole; two compact objects we will describe in the next section.

Compact objects

We have just seen how a single star naturally evolves at the end of its life into a stellar object which, depending on its initial mass, can take three different forms of compact object. Compacity is directly linked to density ρ, which is the ratio of mass over volume. The higher the density, the more compact the object. The sun's radius is R ∼ 700 000 km and its mass is 1 M ∼ 2 × 10 30 kg leading to a mean density of 1.4 g cm -3 , while the mean density for the Earth is 5.4 g cm -3 . On the contrary we will see that WDs, NSs and BHs display densities orders of magnitude larger than these, hence earning their status of compact. Let us briefly describe these three objects.

White dwarfs

The radii of WDs range from ∼ 3000 -30 000 km and their allowed masses range from ∼ 0.1 -1.4 M . This leads to densities between 10 6 -10 7 g cm -3 , thus millions of times that of the sun. As we mentioned, the force which counteracts gravity and holds a WD together is a degenerate pressure, in this case produced by electrons. As gravity pulls on the electrons, it tries to force them to occupy the same quantum state, a phenomenon not allowed by the Pauli exclusion principle. The electrons thus produce a degenerate pressure that counteracts gravity. The equation of state of a WD, linking its mass M and radius R, can be described to good approximation by that of a degenerate gas of electrons whose distribution is governed by Fermi-Dirac statistics. In the case of ultra-relativistic electrons, we find that R ∼ M -1/3 , thus quite counter-intuitively the bigger the mass, the smaller the radius of a WD, thus the more compact. The degenerate gas of electrons approximation leads to the existence of a maximum mass called the Chandrasekhar mass, i.e. M Ch = 1.44M .

In terms of population, it can be estimated from the initial mass function of stars that about 97% will follow the low-stellar mass evolution leading to the formation of a WD [START_REF] Daigne | Objects Compacts & Phénomènes Associés -Cours ET9 Master 2 AAIS[END_REF]. Therefore, given the stellar formation history of our Galaxy and the lifetime of such stars, it was inferred from a local observation of 10 kpc 3 around our sun [START_REF] Ledrew | [END_REF] that WDs might represent about 25% of all the stars in the Milky-way, i.e. ∼ 50 billion [START_REF] Daigne | Objects Compacts & Phénomènes Associés -Cours ET9 Master 2 AAIS[END_REF]. Even though the surface temperature of a WD is quite high, between 6 000 K and 12 000 K when that of the sun is 5 800 K, their luminosity is rather small due to their small size. As a result we have observed relatively few of them, 10 4 [START_REF] Daigne | Objects Compacts & Phénomènes Associés -Cours ET9 Master 2 AAIS[END_REF], yet enough to make measurements of their masses and radii which turn out to be in very good agreement with the theoretical models on their equation of states.

Neutron stars

With masses ranging from ∼ 1 -3 M and a typical radius of R ∼ 10 km, NSs have a mean density ρ ∼ 10 15 g.cm -3 making them orders of magnitude more compact than WDs. The core of the NS has a density exceeding atom nuclear density, i.e. ρ nuc = 2.6 × 10 17 g cm -3 . In fact, during the core collapse supernova process for high mass stars satisfying 8 M M 18 M , electron degeneracy pressure in the core cannot support the gravitational contraction beyond the Chandrasekhar limit. At this point, atoms are stripped apart and the electrons are pulled inside the nucleus where they combine with protons to form neutrons via the inverse beta decay reaction. The sudden loss of volume causes the core to shrink until the creation a degenerate gas of neutrons which counteracts gravity, thanks to Pauli's exclusion principle and to strong force interactions between neutrons. Their gravitational equilibrium is governed by a set of two differential equations (the Tolman-Oppenheimer-Volkoff equations [START_REF] Oppenheimer | On Massive Neutron Cores[END_REF][START_REF] Tolman | Static Solutions of Einstein's Field Equations for Spheres of Fluid[END_REF][START_REF] Özel | Masses, Radii, and the Equation of State of Neutron Stars[END_REF]) linking pressure, mass, energy density and radius of the star. Nevertheless, an additional relationship between the mass m and the radius R must be specified to complete the previous equations: this relationship is the ultra-dense matter equation of state (EoS) R = R(m). Up until now numerous propositions of potential EoSs, each founded on different assumptions, have been formulated (for further details about NSs and their EoS, see [START_REF] Özel | Masses, Radii, and the Equation of State of Neutron Stars[END_REF] and references therein). Determining which EoS-model describes best the internal structure of a NS remains a pending question in physics, and we shall explain in section 8.3 how GW astronomy has a role to play in answering that question. Due to their very high densities, NSs have a very intense gravitational field at their surface with typical values of g ∼ 2 × 10 12 m s -2 . The corresponding escape velocity is between a third to half the speed of light, making NSs the first example of a relativistic object where the effect of gravitational curvature must be described in a full GR framework.

Given that NSs are produced by Type II supernovae explosions, we can infer an order of magnitude of their number in the Milky-way by considering that the rate of Type II explosions (∼ 1/100 y) was constant over the lifetime of the Galaxy. This leads to a rough estimation that the Milky-way contains ∼ 100 million NSs formed by this channel [START_REF] Daigne | Objects Compacts & Phénomènes Associés -Cours ET9 Master 2 AAIS[END_REF] (we should note that uncertainties in stellar evolution models, population synthesis studies and star formation rates remain large). The surface temperature is ∼ 10 6 K, but their tiny size makes them even harder to observe through thermal radiation than WDs. So far only about 10 of them have been detected through that emission process, the closest one, RX J 185635-3754, being ∼ 120 pc far from Earth. However, NSs often present a high rotational velocity ranging from some milliseconds to several seconds only which they acquire at birth and/or via mass transfer if part of a binary system. If so, the NS turns into a rotating magnetic dipole which emits focalized pulses of electromagnetic radiation in the radio, x-ray or even gamma ray domain1 ; these NSs are named pulsars. Thanks to these pulsed emissions, we have been able to detect ∼ 2 000 pulsars. Nonetheless, contrary to WDs, it is much harder to precisely measure the mass and radius of NSs, thus leaving more uncertainty on the EoS governing their structure. Finally, we indicate that NSs possess a maximum allowed mass ranging between 2 -3 M depending on the mass of the progenitor and on the EoS considered. Note however that the most massive NS observed to date has a mass of 2.14M [START_REF] Cromartie | Relativistic Shapiro Delay Measurements of an Extremely Massive Millisecond Pulsar[END_REF]. Beyond this upper limit, degenerate neutron pressure cannot counteract gravity and the star collapses into a BH.

Black holes

Black holes are simulatneously the most simple and most complex objects in the universe. Below, we will examine the most interesting aspects of these objects.

The event horizon

Stellar BHs are the next stage of evolution for high-mass stars whose masses are superior to 18 M . In these cases, no interaction is strong enough to counter-balance the intensity of the gravitational field and the star collapses under its own weight into a single point of spacetime where density cannot be defined in the frame of General Relativity: a singularity. However BHs keep a spacetime extension called the event horizon which is the spacetime limit beyond which gravitational attraction (or spacetime curvature) is so strong that no particle can escape the BH, not even light. Therefore we can still compute the density of a BH by dividing the mass, concentrated in the singularity, by the volume of the event horizon, even though one could cross the horizon and continue his journey inside the BH without being stopped by a matter boundary.

A geometrical explanation to gravitational collapse

To explain these facts, let us adopt a more theoretical point of view. BHs appear as exact solutions to Einstein fields equations of GR; thus we talk about black holes metrics. The simplest one was derived by Schwarzschild in 1915, two months after GR was published by Einstein, and this metric is the unique spherically symmetric solution of (1.1) in vacuum. As such it describes the geometry of spacetime around any uncharged and non-rotating mass M . In usual spherical coordinates it reads [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]

ds 2 = g µν dx µ dx ν = -1 - R Sch r c 2 dt 2 + 1 - R Sch r -1 dr 2 + r 2 dθ 2 + sin 2 θdφ 2 , (2.1)
where R Sch is the Schwarzschild radius defined by2 [8]

R Sch = 2GM c 2 . (2.2)
This geometry is also the one created by the earth or the sun (if we neglect their rotation) but only applies outside their envelope where, for the sun for instance, r > R ∼ 700 000 km. Since R Sch, ∼ 3 km (note that it is just below the typical radius of NSs), (1 -R Sch, /r) is positive for any observer located at a distance r from the center of the sun and the metric keeps its usual signature: -, +, +, +.

On the contrary when it comes to BHs, nothing prevents an observer from going beyond the Schwarzschild radius. Now the metric signature is inverted between t and r: +, -, +, +. Setting dr = dθ = dφ = 0 inside the horizon would imply a spacelike evolution since -c 2 dτ = ds 2 = -(1 -R Sch /r) c 2 dt 2 > 0. Therefore we see that no observer can remain static inside the horizon. In this region of spacetime, t and r are somewhat inverted meaning that in the same way that time must flow from past to future outside the horizon, i.e. dt > 0, one can show that inside the horizon we must have dr < 0, implying that any particle must move towards the singularity, photons included. As a consequence, if a star accretes some external mass in a process that brings its outter shell at a radius smaller than R Sch , as is happening during the core collapse of high mass stars with M 18 M , then all its mass is inevitably driven towards the center (the newly created singularity) and we say that the star collapses into a BH [START_REF] Scott | Trust but Verify: The Case for Astrophysical Black Holes[END_REF].

A more complete description of spacetime geometry is the Kerr metric which takes into account the rotation of the massive body using its angular momentum J. Then, by defining the dimensionless Kerr spin parameter a = Jc/(GM 2 ), one can show that the Kerr radius defining the event horizon is given by [START_REF] Carroll | Lecture Notes on General Relativity[END_REF]

R h = R Sch 2 1 + 1 -a 2 . (2.
3)

It reduces to the Schwarzschild radius when a = 0 but shrinks to R Sch /2 when the BH is maximally rotating (we say extremal) when |a| = 1 3 . Coming back to the radius of the Innermost Stable Circular Orbit defined in Eq. (1.92), we see that in the case of a Schwarzschild BH4 [START_REF] Carroll | Lecture Notes on General Relativity[END_REF] r ISCO = 3 × R Sch .

(2.4)

Thus only NSs and BHs are sufficiently compact objects to allow a massive particle to approach their surface beyond r ISCO .

Different types of black holes

BHs formed by high-mass stars are named stellar mass BHs and their mass range from ∼ 5-65 M . The lower limit of ∼ 5 M , which is higher than the maximum inferred NS mass ∼ 3 M , is suggested by empirical X-ray observations [START_REF]Binary Black Hole Population Properties Inferred from the First and Second Observing Runs of Advanced LIGO and Advanced Virgo[END_REF] and thus leads to an expected mass gap for stellar formed compact objects between ∼ 2 -5 M . The upper limit of ∼ 65 M is due to a complicated process believed to take place in stars of mass ∼ 64 -135 M : the pair-instability of supernovae [START_REF] Woosley | Pulsational Pair-Instability Supernovae[END_REF][START_REF] Heger | The Nucleosynthetic Signature of Population III[END_REF]. This instability ejects the stellar envelope which either suppresses the formation of a back hole or leads to a lighter one than would have been expected otherwise.

Stars born over ∼ 135 M are thought to collapse rapidly into BHs which are no longer named stellar mass but intermediate mass BHs [START_REF] Koliopanos | Intermediate Mass Black Holes: A Brief Review[END_REF]. Thus there exists an upper mass gap between ∼ 65 -135 M where no stellar formed BHs is expected. The other class of BHs which have been observed are supermassive BHs whose masses range between 10 6 -10 9 M . It is inferred that every galaxy hosts a supermassive BH at its center but the possible scenario explaining their formation are not well understood. Sagittarius A * , at the center of the Milky-way, has a mass ∼ 4 × 10 6 M [START_REF] Abuter | A Geometric Distance Measurement to the Galactic Center Black Hole with 0.3% Uncertainty[END_REF]. Finally it is believed that another class of BHs could have formed in the very early universe due large inhomogeneities and/or quantum fluctuations leading to the collapse of dense regions: primordial BHs. Contrary to stellar mass BHs, they have little constraints on their allowed mass at formation: from 10 -5 g for regions which collapsed at Planck time (10 -43 s) to 10 5 M if they formed 1 s after the Big Bang [START_REF] Carr | Constraints on Primordial Black Holes[END_REF], however no evidence or observation of such BHs have been produced yet.

Since the three-dimensional volume of a BH goes as ∼ R 3 Sch , we see that its mean density follows ρ ∝ M -2 meaning that the more massive the BH is the less dense it becomes which is a bit counter-intuitive. As a result a stellar mass BHs of mass 5 M has a density 10 15 g.cm -3 , just below that of the most massive NS, when a supermassive BH of mass 10 8 M displays a density of only ∼ 2 g.cm -3 , i.e. twice that of water. We remind once again that this is only a mean density since, in the frame of GR, all the mass of the BH is contained into a point of infinite density: the singularity.

Binary star evolution

Now that we have described how compact objects arise as the end product of the evolution of isolated stars, we investigate stellar evolution in binary star systems and the production of compact binaries.

Binary systems detectable by terrestrial detectors

A compact binary system can be composed of any combination of WD, NS or BH. Binaries which components have the same nature are named BWD, BNS and BBH, while hybrid binaries will use the abreviation of each component: WDNS, WDBH and NSBH. While all compact binary systems emit GWs, not all are detectable with ground based detectors such as AdV and aLIGO. We saw in section 1.6.2.2 that current detectors are limited by terrestrial noise sources at low frequencies which prevent them from detecting GWs with frequencies below ∼ 20 Hz. We explained previously that WDs have a radius much bigger than r ISCO , hence the inspiral of a BWD can be described with the quasi-circular approximation, and using Kepler's law Eq. (1.77), we can express f GW as a function of the separation a between the two WDs, i.e.

f GW = 1 16π 2 Gm a 3 , (2.5)
where again m is the total mass of the system. Then if we consider a BWD composed of two maximally massive WDs, i.e. 1.4 M each, and hence a minimal radius of r ∼ 3000 km, we can estimate the maximum GW frequency that a BWD can have. So, if we neglect tidal interactions and mass transfer between the two WDs, we can assume that the inspiral will end when the two stars touch each other, i.e. when a = 2r. This assumption gives f max GW ∼ 10 -2 Hz, three orders of magnitude below aLIGO-AdV's low frequency cutoff. As a consequence, the main target of current ground based detectors consists only of BNSs, BBHs and NSBHs.

In section 2.2 we argued for the existence of several expected mass gaps in the formation of NSs and BHs. Between 1 -3 M for NSs and ∼ 5 -65 M for stellar mass BHs. Hence when it comes to detecting compact binary systems composed of these objects, any observation falling into one of these gaps would be of particular interest as it would prove the existence of a new type of object requiring formation mecanisms which are yet to be found or deepened.

Evolution of high-mass binaries

Let us focus on the evolution scenario of high-mass stars binary systems (as opposed to low-mass stars binaries) which are able to produce compact binary systems detectable by Virgo and LIGO, i.e. composed of NSs and BHs. The formation scenario presented in Fig. 2.3 [START_REF] Postnov | The Evolution of Compact Binary Star Systems[END_REF] summarizes the main steps which are believed to take place in the lifetime of a typical high-mass binary system. However, we should point out that there are a number of unresolved uncertainties in the models due to a lack of a full understanding of certain aspects of binary evolution, e.g. mass transfer efficiency, the common envelope phase etc., which could alter the timescales and outcomes presented in the model. This particular scenario limits itself to close binaries forming in the galactic field where the most massive star, which we shall name the primary by convention, has a mass 40 -50 M . We refer the reader to [START_REF] Benacquista | Relativistic Binaries in Globular Clusters[END_REF] for details about scenarios involving dynamical captures in globular clusters, and to [START_REF] Han | Binary Population Synthesis[END_REF] for a more recent and complete picture of evolution scenarios. An important notion appearing in binary systems is the Roche lobe of each star which defines the region around the star where a massive particle is gravitationally bound to that star and not the other one. We will now detail the steps of the evolution illustration in Fig. 2.3.

1. The binary starts off with two high-mass stars in their main-sequence. The primary being more massive than its counterpart it burns its hydrogen core more rapidly, since t nucl ∝ M -2 , and thus goes into its expansion phase first, leaving a core of helium.

2. During the expansion phase the primary will overfill its Roche lobe. Therefore its external shells, composed of hydrogen, are more attracted by the secondary star and a mass transfer starts.

3. Once the mass transfer is over, the primary will enter its supernovae explosion phase leaving as compact remnant a NS or a BH depending on its initial mass as we explained previously. The explosion is however very likely to disrupt the binary.

4.

If not disrupted, the secondary star, now more massive than its counterpart, will also expand once its hydrogen core burnt. The mass ratio between the two components is now very high and the compact object can only be encompassed by the outter shells of the secondary in a common envelope phase. The binary now looks like a single object with two nuclei: the NS or BH coming from the primary and the helium core of the secondary.

5. At this stage the compact object can merge with the helium core or it could also collapse into a BH if it was a NS. Some other complicated processes might also take place such as hyper-Eddington accretion and we refer the reader to [START_REF] Postnov | The Evolution of Compact Binary Star Systems[END_REF] for more details and references.

6. If no merger takes places during the common envelope phase, the secondary helium core will finally produce another supernovae explosion. If the system is once again not disrupted the explosion leaves a binary systems of two compact objects which are either NSs or BHs.

7. Quite remarkably, the rest of the evolution of the binary system is solely governed by GW emission which, as we explained, will lead to the merger of the two components.

8. Note that even if the orbit of the system is initially eccentric, in most cases it is expected, due to GW radiation, to circularize by the time we are able to detect them such that the eccentricity is completely negligible 5 [91, 92, 93, 15].

The model presented in Fig. 2.3 predicts at each step of the evolution the estimated number of binaries in the galactic disk at that given evolutionary stage. The relative estimation between each phase depends essentially on the expected duration T of the phase, also indicated in the figure, which is computed from our understanding of the physical processes at work; quite naturally the longer T the bigger N . Fig. 2.3 indicates that we should expect ∼ 10 6 compact binary systems composed of NSs and/or BHs in our galaxy. Nevertheless, this estimation depends on many other T is the typical time scale of an evolutionary stage, N is the estimated number of objects in the given evolutionary stage in the galactic disk. SN, ECSN stand respectively for supernovae and electron-capture supernovae. OB refers to the spectral type of the stars and implicitly means that these stars are in their early life with an initial mass M > 2 M even though we only consider here cases where M 8 M . factors than T , for example, the birth rate of binaries, stellar metalicity or the orientation of the component spins. One common approach for population estimation is to numerically simulate a large number of newly born binaries with a priori chosen initial conditions, and evolve them through the different stages described here. Further details of this method, called binary population synthesis, can be found in [START_REF] Postnov | The Evolution of Compact Binary Star Systems[END_REF][START_REF] Han | Binary Population Synthesis[END_REF].

Chapter 3

Detection and parameter estimation of Compact Binary Coalescences

In this chapter we will review two core aspects of GW data analysis. First is the ability to infer, with a high level of significance, the presence of a GW signal in the data streams of a network of interferometers. Once a segment of the time series has been identified to contain such a signal, the next step is to estimate the values of the astrophysical parameters of the source which produced this GW. In both cases, we use a matched filter method using theoretical waveform models that we will describe below.

In the first section we will start by reviewing Fourier analysis, at the heart of most signal processing techniques. This will allow us to develop on matched-filtering methods, how they are used in the GW community to extract a signal buried in noise and to estimate the parameters. Note that only the theoretical formalization of parameter estimation will be tackled here since its practical implementation is entirely devoted to chapter 5.

Fourier analysis

Continuous Fourier analysis

A continuous and integrable time domain signal h(t) can be decomposed as a sum of simple sinusoids of different amplitudes, periods and phases. The extension of these so called Fourier series is the Fourier transform h(f ) which refers to the transformation

h(f ) = +∞ -∞ h(t)e -i2πf t dt. (3.1)
Thus, we can express the decomposition of h(t) over frequency with the inverse Fourier transformation

h(t) = +∞ -∞ h(f )e i2πf t df. (3.2)
Note that to follow standard notations used in GW data analysis we use the frequency f as a conjugate variable rather than the angular frequency ω = 2πf used in Chapter 1. Furthermore the conventions on using ±i2πf t in the exponential for one or the other formula can differ from a text book or data analysis library to another. We use here the same convention as that adopted by the LVC collaboration in their code packages, which is also that of the extensively used Numpy library in Python [START_REF]Discrete Fourier Transform (Numpy.Fft)[END_REF]. If h(t) is a real signal, as will always be the case in this work, we immediately obtain the relation h(-f ) = h * (f ), where the asterix denotes a complex conjugate. The power content of the signal at a given frequency f is fully determined by the square amplitude of h(f ) reading h(f )

2 = h(f ) h * (f ). (3.3)
Then the energy content of the signal can be read equivalently in the time and frequency domain using Parseval's theorem

+∞ -∞ |h(t)| 2 dt = +∞ -∞ h(f ) 2 df. (3.4) C(τ ) = +∞ -∞ h 1 (t)h 2 (t + τ )dt. (3.5)
The cross-correlation can be thought of as sliding h 2 (t) along the time axis and then calculating the integral of the product at each position. Hence in the simple case where h 2 (t) is the same as h 1 (t) but shifted by a constant time τ 0 , i.e. h 2 (t) = h 1 (tτ 0 ), C(τ ) will be maximized when the two functions match perfectly, that is to say at τ = τ 0 and C(τ 0 ) will be equal to the energy content of h 1 (t). We say that we have phase-matched h 2 (t) with h 1 (t) since a time-translation is equivalent to a phase-shift in the frequency domain. Importantly, the Fourier transform of the cross-correlation adopts the simple following form

C(f ) = +∞ -∞ C(τ )e -i2πf τ dτ (3.6) = h1 (f ) h * 2 (f ). (3.7)
So we understand that correlation allows for a measurement of how much two signals match each other.

Discrete Fourier analysis

While a data stream might be continuous over time, as experimenters we are forced to record it numerically in a discretized fashion at a given sampling rate, named the sampling frequency f s , such that every sample h j in the time series is separated by a time interval ∆t = 1/f s . For a duration T of the recorded signal, the number of recorded data samples is given by N = T /∆t = T f s . Then the lowest frequency component any signal of duration T can contain is ∆f = 1/T = f s /N which is the frequency resolution of our observation. The correct description of the recorded strain must thereby appeal to the discrete Fourier analysis and hk , the discrete Fourier transform (DFT) of h j , reads

hk = N -1 j=0 h j e -i2πjk/N (3.8)
where its associated frequency is f k = k/T , and the inverse DFT is given by

h j = 1 N N -1 k=0 hk e i2πjk/N . (3.9)
The choice of the sampling frequency is very important due to the Nyquist-Shannon sampling theorem: if a signal h(t) is bandwidth limited by a highest frequency f max , then all the information it contains can be entirely described by its discretized counterpart if the latter is sampled at least at f s = 2f max . On the contrary if the sampling process is less than twice as fast as the highest frequency in the signal, i.e. f s < 2f max , there exists a critical frequency f c = f s /2, also name the Nyquist frequency, above which the power spectrum of h(t) is spuriously folded at lower frequencies; this effect is called aliasing and has the effect of making different signals indistinguishable (see for example [START_REF] Winkler | Numerical Recipes in C: The Art of Scientific Computing, Second Edition[END_REF]). For technical reasons, the detectors of the LVC sample at a high rate: 16 384 Hz for Advanced LIGO [START_REF] Aasi | Advanced LIGO[END_REF] and 20 000 Hz for Advanced Virgo [START_REF] Acernese | Advanced Virgo: A 2nd Generation Interferometric Gravitational Wave Detector[END_REF]. Nevertheless, the strain is not calibrated above 2 048 Hz meaning that data with higher frequency content cannot be trusted. Therefore, for data analysis purposes, we only use a down-sampled version of the data streams at 4 096 Hz which is enough to capture all of the information content of the recorded signals of interest.

Detection or the extraction of a signal buried in noise

In GW data analysis, we take the signal detected by an interferometer, s(t), to be the sum of a noise process in the detector, n(t), with a potential GW signal denoted h(t; λ µ ). We can therefore write s(t) = n(t) + h(t; λ µ ).

(3.10)

To lighten further notations, we will drop the dependency on the astrophysical parameters λ µ when referring to the real signal and to theoretical waveforms templates.

Noise characterization and the power spectral density

Understanding how the noise behaves in the detector is of crucial importance for both detection and parameter inference if one does not want to introduce a bias in one's conclusions. Given the high number of independent noise sources in the interferometers, the central limit theorem indicates that the total resulting noise is well approximated by a Gaussian distribution which we consider zero-mean valued (a non zero mean would be easy to compensate for anyway)

n(t) = 0 (3.11)
where the overbar refers to a time average. We know that there are in fact important nongaussianities, or glitches, in the data but these are taken care of independently of the general noise characterization [START_REF] Abbott | Characterization of Transient Noise in Advanced LIGO Relevant to Gravitational Wave Signal GW150914[END_REF]. Then since n(t) is a random process, it is best characterized by the average energy it contains in a frequency bin f +df . However n(t) is not square integrable between t = -∞ and +∞ (it would yield an infinite energy) which forbids the use of Parseval's theorem, Eq. (3.4), directly. Therefore we are more interested in the average power contained in a frequency bin f + df , which is given by the power spectral density (PSD). As

n(t) is purely real, ñ(-f ) = ñ * (f ) implying |ñ(f )| 2 = |ñ(-f )| 2 .
This means that only positive frequencies are relevant power-wise which lead to consider the one-sided PSD S n (f ), an even function in units of (strain 2 / Hz) defined by [START_REF] Samuel Finn | Detection, Measurement and Gravitational Radiation[END_REF][START_REF] Winkler | Numerical Recipes in C: The Art of Scientific Computing, Second Edition[END_REF][START_REF] Cutler | Gravitational Waves from Mergin Compact Binaries: How Accurately Can One Extract the Binary's Parameters from the Inspiral Waveform?[END_REF][START_REF] Moore | Gravitational-Wave Sensitivity Curves[END_REF]]

|n(t)| 2 = +∞ 0 S n (f )df. (3.12)
To compute the average noise power we take an average over a duration T allowing us to express

|n(t)| 2 = lim T →+∞ 1 T T /2 -T /2 |n(t)| 2 dt. (3.13)
Supposing that n(t) is an ergodic stochastic process, meaning that its statistical properties can be inferred from a sufficient long segment of noise, the time average can be swapped with an average over many noise realizations, noted < . >. Assuming that the noise is stationary, its expectation value can be computed regardless of the origin of time. Then one can show that [START_REF] Cutler | Gravitational Waves from Mergin Compact Binaries: How Accurately Can One Extract the Binary's Parameters from the Inspiral Waveform?[END_REF][START_REF] Moore | Gravitational-Wave Sensitivity Curves[END_REF]

|n(t)| 2 = +∞ -∞ ñ(f )ñ * (f ) df df , (3.14)
= 2 +∞ 0 ñ(f )ñ * (f ) df df . (3.15)
Comparing Eq. (3.15) and (3.12) we can write

ñ(f )ñ * (f ) = 1 2 S n (f )δ(f -f ), (3.16)
where δ(ff ) is the Dirac-delta function. This last equation is formally equivalent to [START_REF] Cutler | Gravitational Waves from Mergin Compact Binaries: How Accurately Can One Extract the Binary's Parameters from the Inspiral Waveform?[END_REF] S where C n (τ ) is the auto-correlation function of the noise n(t) defined by

n (f ) = 2 +∞ -∞ C n (τ )e -i2πf τ dτ, (3.17
C n (τ ) = n(t + τ )n(t) -n(t + τ ) n(t) , (3.18) = n(t + τ )n(t) , (3.19)
and where we used n(t) = 0. We note that Eq. (3.17) is usually taken to be the formal definition of the one-sided PSD [START_REF] Moore | Gravitational-Wave Sensitivity Curves[END_REF][START_REF] Cutler | Gravitational Waves from Mergin Compact Binaries: How Accurately Can One Extract the Binary's Parameters from the Inspiral Waveform?[END_REF][START_REF] Cutler | Gravitational Waves from Mergin Compact Binaries: How Accurately Can One Extract the Binary's Parameters from the Inspiral Waveform?[END_REF], and to make the link between S n (f ) and the noise auto-correlation function which will be used later to define the likelihoood function. Note that for stationary noise, S n (f ) is independent of time. Importantly, there exist different methods for estimating S n (f ) accurately [START_REF] Winkler | Numerical Recipes in C: The Art of Scientific Computing, Second Edition[END_REF] which can account for deviations from stationarity, thus the PSD should be understood as an input quantity that needs to be modelled when it comes to detecting a GW or estimating its parameters. Now that we know how to empirically characterize the noise in our detectors, let us see how we can use this information to build an efficient filter.

Optimal linear filter

To measure the strength of a GW signal in the data stream, we are going to define a statistical quantity called the signal-to-noise ratio (SNR), denoted ρ, and simply defined for the moment as

ρ = S N (3.20)
where S denotes a signal term and N a noise term. To begin, we define the cross-correlation between a signal s(t) and a linear filter K(t) as

C(τ ) = +∞ -∞ s(t)K(t + τ ) dt, (3.21)
= +∞ -∞ s(f ) K * (f )e i2πf τ df, (3.22)
where we used the definition of C(f ) from Eq. (3.6). The idea is to define S, and thus find a K(t), such that C(τ ) is maximized in the presence of a gravitational wave, but over an average of many noise realizations since we cannot predict in advance the exact noise behaviour. As a result we take S to be the statistical mean of C(τ ) in the presence of a GW, i.e.

S = C(τ ) h(t) =0 , (3.23)
= +∞ -∞ h(f ) + ñ(f ) K * (f )e i2πf τ df h(t) =0 , (3.24) = +∞ -∞ h(f ) K * (f )e i2πf τ df, (3.25)
where we used the fact that the ergodicity of the noise implies ñ(f ) = 0. Next, we define N as the statistical standard deviation of C(τ ) in the absence of GW, i.e.

N 2 = (C(τ ) -C(τ ) ) 2 h(t)=0 = C 2 (τ ) -C(τ ) 2 h(t)=0 = C 2 (τ ) h(t)=0 , (3.26) = +∞ -∞ +∞ -∞ s(f )s * (f ) h(t)=0 K(f ) K * (f )e i2πf τ e -i2πf τ df df , (3.27)
= +∞ -∞ +∞ -∞ ñ(f )ñ * (f ) K(f ) K * (f )e i2π(f -f )τ df df , (3.28)
= +∞ -∞ 1 2 S n (|f |) K(f ) 2 df, (3.29)
where we firstly used the fact that C(τ ) h(t)=0 = n(τ ) = 0, and then used the expression for S n (f ) in Eq. (3.16). The SNR can be interpreted as a ranking statistic which allows the comparison of the strength of potential signals in the data stream, named colloquially triggers. With these definitions in hand, we can now derive an expression for the optimal linear filter K(t). We begin by writing the expression for ρ in the form

ρ(τ ) = +∞ -∞ h(f ) K * (f )e i2πf τ df +∞ -∞ 1 2 S n (|f |) K(f ) 2 df 1/2 . (3.30)
Then we introduce the following noise-weighted inner product [START_REF] Cutler | Gravitational Waves from Mergin Compact Binaries: How Accurately Can One Extract the Binary's Parameters from the Inspiral Waveform?[END_REF][START_REF] Samuel Finn | Detection, Measurement and Gravitational Radiation[END_REF] h|g

= +∞ -∞ h(f )g * (f ) + h * (f )g(f ) S n (|f |) df, (3.31)
= 2 +∞ 0 h(f )g * (f ) + h * (f )g(f ) S n (f ) df, (3.32)
= 4R +∞ 0 h(f )g * (f ) S n (f ) df , (3.33)
where R denotes the real part of a complex number, allowing us to rewrite the SNR as

ρ(τ ) = 1 2 S n (f ) K(f )e -i2πf τ h(f ) 1 2 S n (f ) K(f ) 1 2 S n (f ) K(f ) 1/2 . (3.34)
Since Eq. (3.31) defines an inner-product, we know directly from the Cauchy-Schwartz inequality that ρ(τ ) is maximised when S n (f ) K(f )e i2πf τ and h(f ) are parallel vectors. This then allows us to define the optimal linear filter Kopt (f )

Kopt (f ) = h(f )e i2πf τ S n (f ) . (3.35)
Given an expression for the optimal linear filter, we can also define the optimal SNR, ρ opt , as

ρ opt = h |h . (3.36)
Assuming that we can model accurately the true GW signal, there are several interesting ways to represent the GW strength with respect to the noise [START_REF] Moore | Gravitational-Wave Sensitivity Curves[END_REF]. One of them arises from rewriting ρ opt where starting from the previous equation we have

ρ 2 opt = 4 +∞ 0 h(f ) 2 S n (f ) df (3.37) = +∞ 0 4 h(f ) 2 S n (f ) f ln(10)d (logf ) (3.38)
= +∞ 0 hc (f ) A n (f ) 2 d(logf ) (3.39)
where hc (f ) = 2[ln(10)f ]1/2h (f ) is a characteristic strain 1 [14, 99] and A n (f ) = S n (f ) is the amplitude spectral density (ASD). Plotting hc (f ) against A n (f ) on a log-log scale allows for a visual comparison between the GW strain and the noise in the detector, as the integral between the curves relates to ρ 2 opt from Eq. (3.39). To illustrate the ASD on a concrete example, in Fig 3 .1 we plot the ASD and the characteristic strain for a BNS signal (in this case GW170817 which we will describe later in the thesis).

The Matched-filter and GW template banks

Assuming GR, and hence the waveform model constructed within this framework, is correct, our next goal is to develop a way of detecting potential GW signals in the universe. The solution used by the LVC is to build a template bank containing a large number (∼ 10 5 ) of pre-generated templates h(t, λ µ ) which will efficiently span the parameter space of possible astrophysical values {λ µ } a CBC source can possess.

Each template is then used as a matched-filter by correlating it with the detected signal s(t), producing a matched-filter SNR ranking statistics ρ mf (h). The idea is to have enough templates such that any real GW signal will be triggered by a template in the bank, but not so many that computing the SNRs over the entire bank would become computationally unaffordable (see [START_REF] Owen | Search Templates for Gravitational Waves from Inspiraling Binaries: Choice of Template Spacing[END_REF] for more details about efficient strategies to build banks of templates).

Amongst the parameters entering the generation of h(t) in the bank, the time and phase at coalescence and distance, (t c , φ c , D L ) are set to predetermined values. Distance is of no matter as it only modifies the amplitude of the template and acts as a constant of proportionality which as we saw does not change the values of the SNR. To maximize over φ c , one only needs to take the modulus of the complex matched-filter SNR which is calculated using the complex noise-weighted inner product, noted .|. C , given by Eq. (3.31) but removing the real part [START_REF] Allen | FINDCHIRP: An Algorithm for Detection of Gravitational Waves from Inspiraling Compact Binaries[END_REF]. We are then left Comparison of the characteristic strain for GW170817 and of the amplitude spectral densities (ASD) A n (f ) for each detector at the time of GW170817. | hc (f )| is common to all three interferometers as we neglected the antenna pattern functions influence. The data for the ASD was derived from GWTC-1 [START_REF]GWTC-1: A Gravitational-Wave Transient Catalog of Compact Binary Mergers Observed by LIGO and Virgo during the First and Second Observing Runs[END_REF].

with t c to maximize over allowing us to define the complex matched-filter SNR is a time series

ρ mf (t; h) = s(f ) h(f )e i2πf t C h(f ) h(f ) . ( 3.40)
By convention templates are pre-generated with a time of coalescence set at t = 0. Then to find the best t c matching the signal for a given template, one only needs to slide the template along the data stream, i.e. to phase-match it. This is exactly what computing the times series ρ mf (t) does and the time at which ρ mf (t) is maximum yields the inferred t c . Then we often implicitly refer to ρ mf (t c ) by simply dropping the time dependence, and ρ mf (h) is understood as the matched-filter SNR related to h(t) and is given by

ρ mf (h) = | s |h C | h |h . (3.41)
where h(t) is generated with the correct t c . In the absence of GW, ρ mf is a normal variable (for Gaussian noise) with mean zero and variance one, while in the presence of a GW the mean is given by h|h [START_REF] Cutler | Gravitational Waves from Mergin Compact Binaries: How Accurately Can One Extract the Binary's Parameters from the Inspiral Waveform?[END_REF]. Therefore, it can be shown that in the case of Gaussian noise, filtering with ρ mf maximizes the probability of a correct detection, given a probability of false detection, making it the optimal linear filtering technique.

Every template from the bank is continuously correlated with segments of the data stream of an interferometer in order to find that template that produces the highest ρ mf . This maximum SNR found over all templates yields the SNR of the given segment, at a given time and related to a particular template. Then one defines a ρ mf -threshold above which we claim the presence of a trigger in the data. Finally the total coherent SNR of the trigger is computed as a quadratic sum A template h(t) from the bank is correlated with the strain signal s(t) detected (bottom panel ). When the phases do not match ( green), the corresponding matched-filter SNR ρ mf is low (top panel ). However, when the phases match (orange), we see a significant peak in the SNR time series, yielding the time of detection. Signals in the bottom panel have been windowed, whitened and band-passed, in accordance with the data analysis scheme used by the collaboration and described in [START_REF]A Guide to LIGO-Virgo Detector Noise and Extraction of Transient Gravitational-Wave Signals[END_REF]. The whitening procedure is responsible for the peculiar unit in noise-standard-deviation σ. This figure has been produced from a largely adapted version of the tutorial in [104] and using open data from the interferometers available on the GWOSC website [105].

over the SNRs in each interferometer of the network [14]

ρ net mf 2 = if o ρ if o mf 2 . (3.42)
We illustrate on Fig. 3.2 and 3.3 the matched-filter procedure for GW150914 and GW170817, where GW150914 refers to a real BBH signal which detection will also be detailed in chapter 4 and whose strain amplitude is typically on the order ∼ 10 -21 . As a BNS system, GW170817 involves much lower masses than GW150914, therefore the induced strain has an amplitude much smaller than GW150914, on the order of ∼ 10 -22 . This means that the GW signal of GW170817 is more deeply buried in noise; interestingly however its coherent SNR is higher: ∼ 32 for GW170817 vs ∼ 24 for GW150914. This is because GW170817's detected signal stretches over a much longer duration: ∼ 57 s vs ∼ 0.2 s for GW150914, which leaves enough time to accumulate a lot more phase-matching and therefore statistical strength.

Significance of a detection

At this point the trigger is not yet qualified as a GW detection. Nevertheless we must remember that in observational physics there is no such thing as claiming a detection with certainty. We are always subject to the possibility that somehow, unlikely as it may be, all the random processes which can influence the experimental data taking conspired to reproduce a signal looking exactly ) but for a typical BNS system, here GW170817 in the Livingston detector. Even though the signal is more deeply buried in noise than GW150914, GW170817 has a higher matched-filter SNR than GW150914 as the entire signal stretches over ∼ 57 s vs ∼ 0.2 s allowing to accumulate a lot more phase-matching. Only the last 0.2 s are plotted here.

as the one we are looking for. Therefore the best approach is to quantify the significance of a detection, that is to say our confidence that the signal measured has an astrophysical origin and not a terrestrial one.

Assessing the significance of a trigger involves advanced methods which details are out of scope for this thesis but can be reviewed in [START_REF] Usman | The PyCBC Search for Gravitational Waves from Compact Binary Coalescence[END_REF], so we will limit ourselves to a simple outline of the guiding principles used. Each interferometer is polluted by many noise sources, some of which we described earlier. Others, colloquially named glitches, are non-Gaussian transient noises of sometimes unknown origins that have the ability to mimic GWs [START_REF] Abbott | Characterization of Transient Noise in Advanced LIGO Relevant to Gravitational Wave Signal GW150914[END_REF]. Therefore one needs to carefully estimate the background noise in the detectors, using additional tools to the PSD, which only assumes Gaussian noise. Since the interferometers cannot be isolated from passage of GWs, the main idea is to use the principle of coincident detection which, together with triangulation of the source, emphasises the importance of using a network of GWs detectors. Contrary to GWs, glitches appear randomly and independently in each detector which makes it very unlikely that they could create similar signals, at coincident times, in all the detectors in the network. To quantify this likelihood, the default method is to simulate thousands of years of fiducial observations by artificially time-shifting the recorded time series at each detector by the intersite propagation time between interferometers. Then one can count all of the fiducial coincident triggers originating from terrestrial noise sources, whose coherent SNRs are ranked at least as high as that of the real signal. The False Alarm Rate (FAR) of the real trigger is finally computed as the ratio between this count and the duration of the simulated observation. If for instance the FAR is equal to 1 event per 203 000 yr, as it was for GW150914, it means that if we were to make 203 000 yr of continuous observations with the detector network at the sensitivity and noise background levels fixed to those at the time of the detection, we would report at most one erroneous GW detection of similar or greater strength than the one being reported. Given the data from a particular observation run, the LVC decided on the threshold that is required to assign the GW designation to a trigger, and it's subsequent labelling as a GW detection.

We highlight here that the principle of coincident detection appears as an efficient rejection test to discriminate potentially real signals from glitches and is the main mean by which nongaussianities of the noise are treated [START_REF] Usman | The PyCBC Search for Gravitational Waves from Compact Binary Coalescence[END_REF]. Thus, in practice, the FAR and p astro are only computed on coincident triggers.

Estimating the parameters of a GW detection

With infinite computing power, one could construct a template bank spanning all parameter dimensions such that any trigger h(λ µ trig ) provides a proper description of the true signal. In reality, we are always limited by computational power, so our template banks are dense enough to provide detections, but not to estimate the parameters of the system with the required accuracy. To do so, GW data analysis adopts a Bayesian approach to estimate the probability that the parameters of the best-fit template, λ µ , are the true parameters, given the signal detected s(t), and given the underlying assumptions in the models that form the basis of our analysis (e.g. GR being correct, the waveform model used to generate the template being the most physically realistic, the assumption of Gaussian noise etc.), M . This probability density, noted p(λ µ |s, M ), is named the posterior probability. Before describing how p(λ µ |s, M ) arises from Bayes' theorem and how we calculate it, we must define the likelihood function to which the posterior is closely related.

The likelihood function

In contrast to the posterior, the likelihood function is the probability to measure the signal s(t) given that there exists in the data a GW with true parameters of the source λ µ and given our model assumptions M . Strictly speaking it writes p(s|λ µ , M ) but is usually noted L(s|λ µ ). By assuming that λ µ are the true parameter values and that M is correct, one can generate a template h(λ µ ) which is close to the true GW signal under such assumptions. Thereby, subtracting it from s(t) should yield a pure noise residual. Given our assumption of Gaussian noise, the likelihood becomes the probability that the residual r(t) = s(t)h(t) follows a normal distribution in accordance with the PSD S n (f ) estimated from the noise n(t). In terms of the discretized residual vector measured {r k } and noise {n k } we can use the expression of the multi-variate normal distribution reading

L(s|λ µ ) = exp -1 2 N j,k=1 C -1 n jk r j r k [(2π) N det(C n )] 1/2 (3.43)
where C n is the noise auto-correlation matrix defined by

C n, jk = n i n j . (3.44)
To make the link with S n (f ), it was demonstrated in [START_REF] Samuel Finn | Detection, Measurement and Gravitational Radiation[END_REF], see Eq. (2.20), that in the continuum limit we have

lim ∆t→0 T →∞ N j,k=1 C -1 n,jk r j r k = 2 +∞ -∞ r(f )r * (f ) S n (f ) df. (3.45)
Since, as we will see later, we are only interested in ratios of likelihoods, without loss of generality we can drop the normalization constant at the denominator of Eq. (3.43). Then using the definition of the noise-weighted inner product from Eq. (3.31) we can write

L [s|h (λ µ )] = exp - 1 2 s -h|s -h . (3.46)
To make the link with the SNR, let us consider the log-likelihood:

ln L = s|h - 1 2 h|h - 1 2 s|s . (3.47)
Again s|s appears as a constant which will cancel out in likelihood ratios, thus it is more convenient to only manipulate the reduced log-likelihood

ln L R = s|h - 1 2 h|h . ( 3
ρ mf = s |h h |h , (3.49)
allowing us to rewrite the reduced log-likelihood as

ln L R = ρ mf ρ opt - 1 2 ρ 2 opt . (3.50)
In parameter inference, templates are always generated close to the true signal detected, meaning ρ mf ρ opt , therefore we obtain the relationship

ln L R 1 2 ρ 2 opt . (3.51)
Finally we perform a coherent analysis by considering the likelihood over the entire network of detectors which is naturally the product of each individual likelihood. Thus we obtain the expression for the reduced log-likelihood of the network

ln L net,R = if o ln L if o,R (3.52)
which justifies the quadratic sum of the SNRs in Eq. (3.42).

The Fisher Information Matrix

The Fisher Information Matrix (FIM) will be an important tool we will use to build our Hamiltonian Monte Carlo algorithm. Therefore, before developing on the posterior probability, let us take a detour to explore the geometry arising from the likelihood function with the help of this important matrix.

Geometrical interpretation

The noise-weighted inner product from Eq. (3.31) defines a natural noise-dependent norm of GW vectors h(λ µ ) living on manifold defined by the set of parameters λ µ . Therefore we can give a geometrical interpretation of ρ opt (h) from Eq. (3.36) as the norm of the GW template h and write

h 2 = h|h . (3.53)
If we now consider two close templates of the manifold only separated by ∆λ µ , the infinitesimal proper distance between them is

ds 2 = h(λ µ + ∆λ µ ) -h(λ µ ) 2 (3.54)
and by keeping only first order terms in ∆λ µ we get

ds 2 = ∂h ∂λ µ ∆λ µ 2 (3.55) = ∂h ∂λ µ ∂h ∂λ ν ∆λ µ ∆λ ν . (3.56)
This expression enjoins us to define the following metric on the manifold

Γ µν = ∂h ∂λ µ ∂h ∂λ ν (3.57)
which, consistently, is a symmetric tensor. It is defined locally and known as the Fisher Information Matrix.

Statistical interpretation Parallel to this geometrical interpretation, the FIM can be interpreted statistically. To do se, we link it with the likelihood by deriving Eq. (3.48) twice

∂ 2 ln L ∂λ µ λ ν = s -h ∂ 2 h ∂λ µ λ ν - ∂h ∂λ µ ∂h ∂λ ν , (3.58)
then we can take the expectation value over many noise realisations, noted here E[.] =< . > to avoid confusion with brackets referring to the noise-weighted inner product, and since noise is zero-mean valued

E[n] = E[s -h] = 0 we obtain Γ µν = -E ∂ 2 ln L ∂λ µ λ ν . (3.59)
Therefore the FIM appears as a local approximation to the curvature of the log-likelihood surface.

Let us now consider the set of parameters λ µ ML maximizing the likelihood (and thus the loglikelihood). We expand ln L around λ µ ML to second order since the first derivative vanishes at the maximum

ln L (λ µ ML + ∆λ µ ) = ln L (λ µ ML ) + 1 2 ∂ 2 ln L ∂λ µ λ ν ∆λ µ ∆λ ν + O(∆λ 3 ). (3.60)
In the so called high-SNR limit and close to λ µ ML , we can approximate the Hessian of ln L in the previous equation with Eq. (3.59), therefore yielding

L (∆λ µ ) = Aexp - 1 2 ∆λ µ Γ µν ∆λ ν (3.61)
where A is a normalization constant and ∆λ µ is implicitly the separation from λ µ ML . As a consequence, in the high-SNR regime we can interpret the inverse of the FIM as the variance-covariance matrix of the Gaussian distribution for the parameters uncertainties, C µν = Γ -1 µν , meaning that their standard deviation is σ = C µµ . For a formal proof of Eq. (3.61) in the high-SNR regime we refer the reader to [START_REF] Vallisneri | Use and Abuse of the Fisher Information Matrix in the Assessment of Gravitational-Wave Parameter-Estimation Prospects[END_REF][START_REF] Adams | Astrophysical Model Selection in Gravitational Wave Astronomy[END_REF].

Limits of the FIM interpretations

The FIM is a local approximation to the log-likelihood curvature. It assumes a Gaussian distribution of the uncertainties in the parameters, negligible noise and little correlation between the parameters. Moreover it is unaware of any physical boundaries and is experiment-independent.

As such, contrary to the exact definition of the likelihood in Eq. (3.46), its FIM approximation in Eq. (3.61) does not use the signal detected s(t). Uncertainties predicted by the FIM are therefore a purely geometrical and local inference one can expect given the average noise measured. As it relies on the waveform approximant used, two different models will produce two very different FIMs. Furthermore, let us not forget that it is only valid close to λ µ ML which in unknown a priori. Importantly, from the FIM's perspective the log-likelihood surface is defined on a R n manifold meaning that every parameters forming the set λ µ is seen unbounded. However this is not true in GW astronomy as (α, φ c ) ∈ [0, 2π], (δ, ψ) ∈ [0, π], spin magnitudes range between 0 -1 in natural units, and there exists physical boundaries such as the m 1 = m 2 line of which the FIM is completely unaware of. Therefore one has to be careful when inferring the expected uncertainties from the FIM: what interpretation can be given if the standard deviation of a parameter, σ F IM , is larger than its range? Additionally, the FIM assumes a multivariate-normal distribution of the uncertainties in every direction. However parameter inference of GW generally faces distributions which cannot be described analytically and which furthermore can be multi-modal, as for instance with the inclination angle (cf section 1.6.3.2). In these cases, the FIM predictions must be interpreted with a lot of caution.

Last but not least, one must invert the FIM to obtain the pseudo variance-covariance matrix associated with the Gaussian likelihood. Nevertheless it is not rare in GW data analysis for the FIM to be singular or ill-conditioned. In these cases the inversion of the matrix is numerically unstable, thus the predicted standard deviations over the parameters might be completely off-scale and cannot be trusted. It was shown however in [START_REF] Adams | Astrophysical Model Selection in Gravitational Wave Astronomy[END_REF][START_REF] Porter | Bayes : A Comparison of Parameter Estimation Techniques for Massive Black Hole Binaries to High Redshifts with eLISA[END_REF] that some re-parametrization of the initial coordinate system λ µ can mitigate this effect.

The posterior probability

The posterior probability of the set of parameters λ µ to be the true parameters given the signal s(t) detected and given our assumptions M is related to the likelihood function through Bayes theorem by

p (λ µ |s, M ) = p (s|λ µ , M ) p(λ µ |M ) p(s|M ) (3.62)
where p (s|λ µ , M ) = L (λ µ ) is the likelihood defined in Eq. (3.46). Then for the two other terms we have:

• The prior p(λ µ |M ) = π (λ µ ). It refers to any prior knowledge we have on the distributions of λ µ . These can be astrophysically motivated: for example the fact that the number of sources in the local Universe scales linearly with the volume, i.e. with (D L ) 3 , usually leads to considering a prior π(D L ) ∝ (D L ) 2 ; or motivated from past and well established results.

If no prior information is known to us for a parameter, we consider an uninformative flat prior, which is constant over the range of the parameter considered. The precise derivation of priors for each parameter will be tackled in more details in section 7.3.1.1.

• The evidence p(s|M ). It is the probability of the signal itself to be detected given our model assumptions M . The posterior being a probability density, it must sum up to one when integrating it over the entire parameter space, hence the evidence appears as a normalization factor which can be expressed as

p(s|M ) = L (λ µ ) π (λ µ ) dλ µ . (3.63)
While necessary when comparing the relevance of different models with respect to the observation made, it only acts as a constant when it comes to Bayesian inference. Since only ratios of posterior probabilities between two sets of parameters will come into play, the evidence will cancel out and we do not take it into account in our derivations.

Since the model assumptions M is a constant when estimating the posterior, we usually drop it in our notations. All in all, Bayesian inference uses an observation, statistically quantified by a likelihood function, to update a prior knowledge into a posterior one, allowing to constrain the uncertainties around the true parameters of the source. Once the posterior estimated, it only remains to quantify these uncertainties.

To do so, we essentially derive a credible interval (CI) for each of the D parameters λ µi , i ∈ [1, D], defining the source, since the X%-CI allows for the statement: given the signal observed and given our underlying model assumptions, there is X% probability that the true value of λ µi belongs to this interval. Now let us assume for the moment that we have been able to obtain a faithful estimate of the full D-dimensional posterior density, p (λ µ |s), over the entire parameter space. To derive a CI, we need to integrate the marginal posterior distribution of λ µi which is a function of the desired parameter only. It relates to p (λ µ |s) by successive integrations over the other parameters, thus marginalizing them out

p(λ µi |s, M ) = S µ 1 ... S µ i-1 S µ i+1 ... S µ D p (λ µ |s, M ) dλ µ1 ... dλ µi-1 dλ µi+1 ... dλ µ D . (3.64)
It is most common to quote the symmetric X% CI around the median value for λ µi which lower (upper) bound is found by integrating on the left (right) side of p(λ µi |s, M ) until (1 -X/100)/2 is reached in the integral. Similarly, when representing the marginal 2D posterior distribution for two parameters, levels of credible regions can be represented to have a better understanding of the correlation between the two parameters. Before detailing in chapter 5 the algorithms used to estimate the posterior density, in the next chapter, we will first describe some of the most significant results from the beginning of the GW astronomy era.

Chapter 4

Gravitational wave astronomy

At the time this manuscript is being written, the LVC collaboration has conducted three distinct observation runs, named O1, O2 and O3. In the first two sections of this chapter we review each campaign and detail some of the most ground-breaking GW detections, together with their scientific implications. We end this chapter with open prospects concerning the observation of GWs with next generation detectors.

The first two observation runs: O1 & O2

4.1.1 O1 and the discovery of gravitational waves O1 began on the 18 th of September 2015 with the two LIGO detectors participating in the campaign [START_REF]Binary Black Hole Mergers in the First Advanced LIGO Observing Run[END_REF]. Four days before the official start, on the 14 th of September 2015, the first GW was detected [START_REF]Observation of Gravitational Waves from a Binary Black Hole Merger[END_REF] (thus named GW150914) while the detectors were operating in "engineering mode". This incredible discovery opened up the era of gravitational wave astronomy.

The signal from GW150914 was produced by the coalescence of two BHs of masses 35.6 +4.8 -3.0 M and 30.6 +3.0 -4.4 M , at a luminosity distance D L = 430 +150 -170 Mpc. The mass of the resulting BH was estimated to be 63.1 +3.0 -3.0 M , inferring that 3.1 +0.4 -0.4 M c 2 were radiated in GWs [START_REF]GWTC-1: A Gravitational-Wave Transient Catalog of Compact Binary Mergers Observed by LIGO and Virgo during the First and Second Observing Runs[END_REF]. The GW signal was observed in the LIGO frequency band between 35 Hz and 150 Hz for 0.2 s, corresponding to only 8 GW cycles, reaching a peak strain amplitude of 1.0 × 10 -21 at the time of coalescence as shown on Fig. 4.1. As only two detectors were in operation, the source was poorly localized to a sky area of 610 deg 2 . GW150914 was observed with a coherent matched-filter SNR of 24 and a FAR of less than 1/203 000 years. The detection also provided the first opportunity to test GR in a genuinely strong field dynamics of gravity. After analysis, no evidence for violations of the theory were found [START_REF]Tests of General Relativity with GW150914[END_REF].

In total O1 lasted 4 months. Following GW150914, two other BBH systems were detected: GW151012 and GW151226, with matched-filter SNRs of 9.7 and 13.0 and inferred component masses of (23 +18 -6 , 13 +4 -5 ) M and (14.

2 +8.3 -3.7 , 7.5 +2.3 -2.
3 ) M respectively [START_REF]Binary Black Hole Mergers in the First Advanced LIGO Observing Run[END_REF]. The spin amplitudes of the components of each binary were weakly constrained in their a i ∈ [0, 1] range, with a preference for low spins, even though it could be inferred at the 99% credible level that at least one of the BHs in GW151226 had a spin 0.2. On the other hand, the spins of the remnant BHs were all measured around a f = 0.7 in accordance with the expectation that it should be dominated by the orbital angular momentum of the binary.

O2 as a new era in multi-messenger astronomy

A bit more than a year later, during which time the interferometers were upgraded , O2 started on November 30 th 2016 again initially with the two LIGO interferometers. They were joined towards the end of run on the 1 st of August 2017 by Advanced Virgo, resulting some days later in the first triple-interferometer GW detection: GW170814 [START_REF]A Three-Detector Observation of Gravitational Waves from a Binary Black Hole Coalescence[END_REF]. Because of the addition of Advanced Virgo in the network, the sky localization of this BBH system was reduced to 60 deg 2 . Furthermore, in previous detections, the polarization content of the GW signal could not be tested as the two LIGO interferometers are almost aligned, meaning the same combination of polarization was measured. The light blue curve combines results from the IMRPhenomP [START_REF] Hannam | Simple Model of Complete Precessing Black-Hole-Binary Gravitational Waveforms[END_REF][START_REF] Chatziioannou | Constructing Gravitational Waves from Generic Spin-Precessing Compact Binary Inspirals[END_REF] and SEOBNR [START_REF] Buonanno | Effective One-Body Approach to General Relativistic Two-Body Dynamics[END_REF][START_REF] Buonanno | Transition from Inspiral to Plunge in Binary Black Hole Coalescences[END_REF][START_REF] Buonanno | Effective-One-Body Waveforms Calibrated to Numerical Relativity Simulations: Coalescence of Non-Spinning, Equal-Mass Black Holes[END_REF] templates while the dark blue was obtained with a wavelet method agnostic to the morphology of the waveform. See [START_REF] Abbott | Properties of the Binary Black Hole Merger GW150914[END_REF] for further details.

The addition of Virgo permitted this test for the first time on GW170814 and confirmed the tensorial nature of the GW polarization.

Three days after GW170814, an even more ground-breaking observation occurred: the first GW detection of a BNS merger, GW170817 [START_REF] Abbott | Observation of Gravitational Waves from a Binary Neutron Star Inspiral[END_REF]. This observation was followed up by electromagnetic observations all around the world which marked a new era in multi-messenger astronomy; we review this event in detail in section 4.1.3.

O2 ended on the 25 th of August 2017 after a prolific campaign where 7 additional BBHs systems were detected, 3 online and 4 offline. The total number of GW events detailed in the first ever Gravitational Wave Transient Catalog, GWTC-1 [START_REF]GWTC-1: A Gravitational-Wave Transient Catalog of Compact Binary Mergers Observed by LIGO and Virgo during the First and Second Observing Runs[END_REF], was now 11: 10 BBHs and 1 BNS. In this catalog the component masses of the BHs range between 7.6 +1. 3 -2.1 M and 50.6 +16.6 -10.2 M and the maximum mass of the remnants is estimated to 80.3 +14.6 -10.2 M . The luminosity distance of the BBHs range between 320 +120 -110 Mpc and 2750 +1350 -1320 Mpc, while the BNS merger GW170817, at 40 +10 -10 Mpc, is the closest binary detected. Except for two events, GW151226 and GW170729, all other detections were found to have weakly spinning components. With 11 detections in hand, it was possible to infer new merger rates for the three categories of compact binaries: BNS, BBH and NSBH. These rates express, for the given category, an expected number of mergers to take place per year and unit volume in the local universe. For BNS systems the rate was estimated to be between 110 -3840 Gpc -3 y -1 where the uncertainty remains high since only one BNS had been detected. On the other hand for BBHs, the rate estimation of 9.7 -101 Gpc -3 y -1 is tighter since 10 of them were observed. As no NSBH had been detected, only a merger rate 90% upper limit was estimated, i.e. 610 Gpc -3 y -1 . Finally to illustrate the fruitful campaign of O1 and O2 we display in Fig. 4.2 the distribution of masses and spins of the 11 events detected.

Focus on GW170817 and its scientific implications

In this section we will take some time to review this historical observation as it will be the main signal analyzed throughout this work.

The discovery

On the 17 th of August 2017, the LIGO-Virgo detector network observed a GW signal for ∼ 100 s, with a coherent matched-filter SNR of 32.4, consistent with the inspiral of a potential BNS system due to the low inferred masses of the two compact objects, and at a distance of 40 +8 -14 Mpc [START_REF] Abbott | Observation of Gravitational Waves from a Binary Neutron Star Inspiral[END_REF]. About 1.7 s later, the Fermi Gamma-ray Burst Monitor independently detected a short gamma-ray burst (sGRB), providing for the first time direct evidence that BNS mergers are the progenitors of a least a fraction of sGRBs. This triple detection permitted a rapid and accurate measurement of the sky localization of source1 to ∼ 31 deg2 initially (see Fig. 4.3). The distance and sky position estimation from GW data provided a three-dimensional localization region enabling the launch of an unprecedented campaign of electromagnetic (EM) follow-up around the world. It would lead 11 hours later to the identification of the host galaxy of the GW source: NGC 4993 [START_REF]Multi-Messenger Observations of a Binary Neutron Star Merger[END_REF] where many optical telescopes observed a luminous transient, named SSS17a, which did not correspond to any known asteroid or supernova. Transient counterparts were observed across the entire EM spectrum (γ-rays, X-rays, UV, optical, infra-red and radio) at that location thus confirming the interpretation of the GW signal as emanating from a BNS merger as opposed to a BBH for which no EM signal is expected. This was the first time that both gravitational and EM waves were observed from the same source, marking a new era in multi-messenger astronomy 2 .

Main properties

The inferred masses (in the low spin prior case, cf section 8.2.1 for details), 1.46 +0.12 -0.10 M and 1.27 +0.09 -0.09 M [100], are consistent with those expected for NSs. With such a small total mass, the binary merges at a much higher frequency than GW150914 since f ISCO ∼ 1.6 kHz. Therefore the signal was analyzed in the frequency band 30 -2048 Hz corresponding to ∼ 57 s of data from start to merger during which the GW performed ∼ 3000 cycles when only 8 were in the band for GW150914 over 0.2 s. Contrary to GW150914 where the GW signal is visible by eye in the time series (see Fig. 4.1), GW170817 has an amplitude ∼ 10 -22 which leaves it buried into noise. As we explained in section 1.6.3.1, the inclination angle estimation is usually degenerate since the strain amplitude is sensitive to cos 2 ι and not cos ι. This was the case for GW150914 as can be seen on Fig. 2 of [START_REF]Observation of Gravitational Waves from a Binary Black Hole Merger[END_REF]. However we highlight here that for GW170817 the degeneracy could be broken down to a single mode: as a triple detection, the coherent analysis over the network of detectors Figure 4.3: GW170817 sky map inferred from GW data at the 50% (light green) and 90% (dark green) credible regions. The gray dotted region corresponds to the 90% region initially derived which allowed the identification of SSS17a, the EM counterpart. Figure taken from [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF].

was able to discriminate between the two modes by taking advantage of the phase-dependence to cos ι, see Eq. (1.111). We show on Fig. 4.4 the result of the coherent estimation for D L and θ JN , the angle between the line of sight N and the total angular momentum J. In a non-spining model J = L thus θ JN and ι are equal, however, as will be explained later in chapter 8, θ JN has the advantage of remaining approximately constant during the inspiral of precessing systems which is not the case for ι. As a consequence θ JN is preferred over ι when estimating parameters. On Fig. 4.4 we see that the mode θ JN > π/2 was selected. However the strong correlation between the two parameters leaves a large 90% credible region which can only be sensibly reduced when using prior information on the distance of the host galaxy coming for EM observations [START_REF] Cantiello | A Precise Distance to the Host Galaxy of the Binary Neutron Star Merger GW170817 Using Surface Brightness Fluctuations[END_REF].

Speed of GWs and implications for non-GR theories

We explained in section 1.2 that GR predicts a propagation of GWs at the speed of light. However some alternative theories of gravity modify GR in such ways that GWs are no longer predicted to have this property. Thanks to Fermi's detection of a sGRB ∼ 1.7 s after merger of the binary, unambiguously associated with GW170817, the speed of GWs, c g , was measured with incredible accuracy with respect to the speed of light confirming GR's prediction that c g = c with a 3 × 10 -15 relative accuracy between the two velocities [START_REF] Abbott | Gravitational Waves and Gamma-Rays from a Binary Neutron Star Merger: GW170817 and GRB 170817A[END_REF]. As a consequence many modified GR theories had to be revised or even abandoned to account for this new measurement (see [START_REF] María | Dark Energy in Light of Multi-Messenger Gravitational-Wave Astronomy[END_REF] for more details).

Expansion of the Universe

The expansion of the Universe is primarily quantified by the Hubble constant, H 0 , expressed in km s -1 Mpc -1 , which can be well approximated for distances d < 50 Mpc by H 0 = v H /d where v H is the "Hubble flow" velocity of a source. Standard candles are supernovae explosions whose intrinsic luminosity is known a priori, thus their observed brightness directly leads to a measurement of their distance from us, and in turn allow for a measurement of H 0 = 74.03 ± 1.42 km s -1 Mpc -1 [START_REF] Riess | Large Magellanic Cloud Cepheid Standards Provide a 1% Foundation for the Determination of the Hubble Constant and Stronger Evidence for Physics Beyond LambdaCDM[END_REF]. However there exists a tension between this value and observations at high redshifts from the Cosmic Microwave Background predicting H 0 = 67.4 ± 0.5 km s -1 Mpc -1 [START_REF] Aghanim | Planck 2018 Results -VI[END_REF]. While this tension still lacks explanation, GWs observations will be able to shed light on it. Indeed the sole multimessenger observation of GW170817 allowed for the first independent measurement of H 0 using Figure 4.4: GW170817 posterior distribution marginalized over D L and θ JN . The blue curve uses only GW data while in purple is the result of an analysis making use of prior information on the estimated distance of the host galaxy coming from EM observations [START_REF] Cantiello | A Precise Distance to the Host Galaxy of the Binary Neutron Star Merger GW170817 Using Surface Brightness Fluctuations[END_REF]. The dashed and solid contours enclose respectively the 50% and 90% credible regions. The vertical and horizontal lines in the 1D marginal distributions mark the 90% credible intervals. Figure taken from [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF].

GWs and GW170817 appeared as the first standard siren ever detected. Its luminosity distance was directly measured from the amplitude of the wave. Then thanks to its association with the host galaxy NGC 4993, its redshift and thus corresponding Hubble flow could be derived leading to the new measure of H 0 = 70.0 +12.0 -8.0 km s -1 Mpc -1 (68% credible interval) [START_REF] Abbott | A Gravitational-Wave Standard Siren Measurement of the Hubble Constant[END_REF]. Uncertainties cover both previous estimations hence not resolving the tension. The first reason is that this GW estimation comes from a single detection and the second is the high degeneracy between inclination and distance. However the H 0 estimation from GWs will undoubtedly sharpen in the future as more standard sirens will be detected but also thanks to a statistical method which, even without the association of a EM counterpart, accounts for the probability of the GW source belonging to galaxies part of its derived 3D-localization [START_REF] Fishbach | A Standard Siren Measurement of the Hubble Constant from GW170817 without the Electromagnetic Counterpart[END_REF].

The third observation run: O3

Summary of the campaign

A year and a half later, after further upgrades to the detectors, O3 began in early April 2019 and was predicted to last a full calendar year. However, due to certain detector related issues, it was decided to split O3 into two 6 month segments denoted O3a and O3b. Results from the first half of the campaign (∼ 26 weeks) have been published in a second catalog, GWTC-2 [START_REF] Abbott | GWTC-2: Compact Binary Coalescences Observed by LIGO and Virgo During the First Half of the Third Observing Run[END_REF], while analysis of the second half of O3 is currently in progress. With a FAR threshold set to 2.0 yr -1 and given the improved sensitivities of the three interferometers, 39 additional GW event candidates are reported of which less than 10% are expected to have a terrestrial origin. Among these, 36 are confirmed BBHs with m 2 3 M , 1 is a potential BNS and 2 are potential NSBHs. The component masses from the 36 BBHs range between 5.0 +1.3 -1.9 M and 91.4 +29.3 -17.5 M . Sources from GWTC-2 were found up to redshift ∼ 0.8, translating into luminosity distances ranging from 0.57 +0. 22 -0.22 Gpc to 5.15 +2.44 -2.34 Gpc for the confirmed BBHs, while the closest source is one of the two potential BNS at 0.16 +0.07 -0.07 Mpc. Contrary to O2, there were no EM counterparts. As a consequence, there was no way to independently confirm that the suspected events actually contained a NS. Most of the events reported are found consistent with the absence of spins, but 10 of them present a non zero spin magnitude for at least one of the component at the 95% credible level. Merger rate densities from O2 were updated3 to 23.9 +14.9 -8.6 Gpc -3 y -1 for BBHs and 320 +490 -240 Gpc -3 y -1 for BNSs [START_REF]Population Properties of Compact Objects from the Second LIGO-Virgo Gravitational-Wave Transient Catalog[END_REF]. Before the publication of GWTC-2, four exceptional events were announced during the run: GW190412, GW190425, GW190521 and GW190814. Below, we highlight these exceptional observations.

GW190412: first BBH with asymmetric component masses

Detected with a network SNR of 19, this system is composed of two BHs with (m 1 , m 2 ) = (30.1 +4. 6 -5.3 , 8.3 +1.6 -0.9 ) M , which translates into an inferred mass ratio of q = 0.28 +0.12 -0.07 , clearly deviating away from the equal mass binary case [START_REF]Observation of a Binary-Black-Hole Coalescence with Asymmetric Masses[END_REF]. The contribution of higher order multipoles (i.e. beyond the leading quadrupolar order derived in section 1.4.1) in the spherical harmonic decomposition of the waveform is expected to be more important for asymmetric binaries. Due to the asymmetry of GW190412, we were able to confirm their presence for the first time. Furthermore these multipoles present a different distance-inclination correlation compared with the dominant quadrupolar order. Consequently the distance-inclination degeneracy could be broken by adding these higher order multipoles to the analysis, resulting in a single mode where θ JN π/2. The spin magnitude of the primary component was also tightly constrained to a 1 = 0.44 +0. 16 -0.22 thanks to the asymmetric mass ratio of the system, however only mild evidence of precession was inferred even though it is most expected for such asymmetric systems. Finally, even though current scenarios give a lower formation probability to asymmetric systems with respect to equal mass ones, GW190412 was found to be consistent with the population model of BBHs inferred from previous observations.

GW190425: a likely BNS system with a high total mass

This event is most likely to be a BNS system since the component masses range from 1.12 -2.52 M with a total mass estimated at 3.4 +0. 3 -0.1 M . However it was only detected by the two LIGOs, preventing any hope to observe an EM counterpart due to the poor sky map resolution. Furthermore the analysis of the signal shows no evidence of matter effects which could have ruled out the possibility for at least one of the components to be a BH. As a consequence GW190425 cannot be excluded from being a NSBH or a BBH using GWs alone. In the hypothesis that the system is a BNS, the previously quoted merger rate can be updated to the tighter value of 250 -2810 Gpc -3 y -1 . Continuing with this hypothesis, the high total mass of this system stands out from the 17 known Galactic BNSs which have a total masses ranging from 2.50 M to 2.89 M , thus questioning the canonical channels explaining its formation. On the other hand, if GW190425 contains one or two BHs, their mass would be in the lower mass gap previously discussed (see section 2.2.3), leading to the more speculative possibility of primordial BHs. Therefore GW190425 is of particular interest as in any case it represents a new type of astrophysical system. The detection, associated results and interpretations were published in [START_REF]Observation of a Compact Binary Coalescence with Total Mass $\sim 3.4 M_{\odot}[END_REF].

GW190521: a mass gap event for BH

This event has a very short duration of about 0.1 s, corresponding to around 4 cycles in the analyzed frequency band 30 -80 Hz. Such a short number of cycles can question the signal interpretation as emanating from a quasi-circular compact binary merger. As a result scenarios involving as origins a cosmic string cusp or kink [START_REF] Damour | Gravitational Wave Bursts from Cosmic Strings[END_REF], or the core collapse supernova [START_REF] Powell | Gravitational Wave Emission from 3D Explosion Models of Core-Collapse Supernovae with Low and Normal Explosion Energies[END_REF][START_REF] Andresen | Gravitational Waves from 3D Core-Collapse Supernova Models: The Impact of Moderate Progenitor Rotation[END_REF][START_REF] Mezzacappa | Gravitational-Wave Signal of a Core-Collapse Supernova Explosion of a 15 Solar Mass Star[END_REF] (other possible sources of GW) were considered but very strongly disfavored. Under the likely hypothesis of a quasi-circular orbit, the signal is consistent with a BBH merger with component masses of 85 +21 -14 M and 66 +17 -18 M . Hence a 99% probability was derived that at least one of the two BHs is in the commonly accepted mass gap produced by (pulsational) pair-instability supernova processes, 65 M , which suggests that at least the primary BH was not formed via the canonical stellar mass evolution scenario but through a different formation channel. Amongst the proposed alternatives, we find hierarchical mergers of lower mass BHs, stellar merger scenarios avoiding the pair-instability regime and taking place in star clusters, the complex dynamics occurring in active galactic nuclei disks around the supermassive BH but also again the possibility for primordial BHs. In any case the remnant BH of the coalescence has an estimated mass of 142 +28 -16 M which provides the first conclusive observational evidence for an IMBH 100 M . GW190521's detection was reported in [START_REF]A Binary Black Hole Merger with a Total Mass of $150 ~M_{\odot}$[END_REF] and its properties and analysis of the different formation scenarios detailed in [START_REF]Properties and Astrophysical Implications of the 150 Msun Binary Black Hole Merger GW190521[END_REF].

GW190814: heaviest NS or lightest BH

This system was observed by all three interferometers. Using 16 s of data starting at 20 Hz, corresponding to ∼ 300 cycles, an accurate sky localization of source to only 18.5 deg 2 at a distance 241 +41

-45 Mpc was produced. Unfortunately, no EM counterpart was found. The event consists of one BH of mass 23.2 +1.1 -1.0 M and a secondary compact object of mass 2.59 +0.08 -0.09 M . The latter would thus be either the lightest BH or heaviest NS observed to date in a compact binary system. None of these two possibilities can be firmly excluded, making GW190814 a unique event by challenging formation scenarios of NSs and BHs. If GW190814 was to be a NSBH, no matter effect signatures were observed which still remains consistent with such asymmetric masses since the NS would merge with (or be swallowed by) the BH before it gets deformed, whichever NS EoS is considered. GW190814 has the most unequal mass ratio observed to date with GWs: q = 0.112 +0.008 -0.009 . As for GW190412, this property allowed for the unambiguous observation of higher-order multipoles contributions to the signal, which in turn enabled an independent measurement of the inclination angle thus breaking the distance-inclination degeneracy. GW190814's detection and inferred properties can be reviewed in [START_REF] Abbott | Gravitational Waves from the Coalescence of a 23 Solar Mass Black Hole with a 2.6 Solar Mass Compact Object[END_REF].

Future prospects for GW observations

The next observation run: O4

The GW era started with GW150914's resounding detection and after only five years and three observing runs the impact of GW observations from the LVC collaboration is huge, as we have seen. Physics of ultra-dense matter in NS could be probed, new merger rates and population inferred, GR could be tested in new regimes of gravity, formation and evolution scenarios of binaries have been challenged by new types of astrophysical systems detected, such as GW190425, GW190521 and GW190814, an independent measurement of the expansion of Universe, H 0 , could be made and the speed of GWs measured with high precision having crucial implications for theories of modified gravity. The two LIGO detectors and Virgo are once again being upgraded before starting O4, the fourth run of observation. During this run, the newly build Japanese interferometer, KAGRA, will fully participate to the campaign forming for the first time a network of four detectors: the HLVK network, overseen by the new LIGO-Virgo-KAGRA (LVK) collaboration. Thanks to the foreseen improved sensitivities, the expected number of detections in O4 will increase to 10 +52 -10 for BNSs, 1 +91 -1 for NSBHs and 79 +89 -44 for BBHs [START_REF]Prospects for Observing and Localizing Gravitational-Wave Transients with Advanced LIGO[END_REF]. Furthermore the inclusion of KAGRA will drastically improve the estimated sky localization of each source detected by the full network; as a result we can legitimately expect successful EM follow-up campaigns, similar to that of GW170817. If so, much tighter constraints will straightforwardly be derived on H 0 as a simple example.

Future detectors

On a longer timescale, third generations of ground-based GW detectors are being proposed: the European Einstein Telescope (ET) [START_REF] Punturo | The Einstein Telescope: A Third-Generation Gravitational Wave Observatory[END_REF] and the American Cosmic Explorer (CE) [START_REF] Abbott | Exploring the Sensitivity of Next Generation Gravitational Wave Detectors[END_REF]. ET would be built underground, as KAGRA, to shield it from surface vibrations. Its arms are designed to be 10 km long in a triangular configuration which will host three Michelson-like interferometers allowing for independent measurements of the two polarizations [START_REF] Freise | Triple Michelson Interferometer for a Third-Generation Gravitational Wave Detector[END_REF]. CE would have even longer arms of 40 km but L-shaped and will not be underground due to its important arms length. On the one hand, ET and CE would detect the same type of currently observed sources but with much higher SNRs, hence allowing for a much better estimation of the parameters of the sources. On the other hand they will broaden the frequency range at lower frequencies down to ∼ 1 Hz, allowing for the detection of much more massive systems such as two IMBHs with a total mass up to ∼ 10 3 M . Finally these detectors will be sensitive enough to detect new sources of GWs different from compact binary systems, namely the core collapse of type II supernovae and also the stochastic background of GWs (SGWB).

Nonetheless, as ground-based detectors, ET and CE will still be limited at low frequencies by seismic and Newtonian noise. To probe GWs between ∼ 0.1 mHz and 1 Hz, the European Space Agency has approved the Laser Interferometer Space Antenna (LISA) project [138]. This spacebased interferometer will trail the Earth on its orbit around the sun 50 million km from it. The detector will consist of three satellites separated by ∼ 2.5 × 10 6 km in a triangular shape sending lasers beams to each other. Given its low frequency band, LISA will be able to detect, amongst other sources, the coalescence of supermassive BH binaries, extreme mass ratio inspirals where a stellar mass BH orbits a supermassive one but also white dwarf binaries. It will open a new window on the Universe by probing cosmology at much higher redshifts than current detectors and by measuring the SGWB. The launch is planned for the years 2034+.

Then we highlight that these new detectors open the possibility for multi-band observations where a source is first detected in the low frequencies by LISA before appearing in the frequency band of ground-based detectors. For such sources LISA will be able to warn its ground-based counterparts in advanced and the system will be observed on a much longer duration than a it would have been otherwise, allowing to better constrain the parameters of the source. We show on Fig. 4.5 the respective sensitivities of each generation of GW detectors.

A data analysis challenge

New experiments with better sensitivities and upgrades of current detectors are on their way, which implies higher detection rates and longer durations of signals to analyze. Indeed we quoted earlier the increased rates expected for O4, going up to 10 +52 -10 y -1 for BNSs which are already the longest duration signals, and for ET the detection rate is expected to be a few per minutes. While this means more opportunities for breakthrough discoveries thanks to many more GWs observations, it also appears as a continuous challenge for the data analysis community to come up with solutions able to treat the newly detected signals fast enough to cope with these increasing rates of detection and signal durations. In that regard, we will see how the Hamiltonian Monte Carlo appears as a promising algorithm to accelerate parameter estimation analysis of compact binary signals, and especially that of BNS signals.

Chapter 5

Gravitational wave parameter estimation using stochastic samplers

In chapter 3 we saw that a crucial task at the heart of GW data analysis is to infer the parameters of an observation, together with the uncertainties surrounding the measurement. We also explained how a Bayesian analysis could respond to this problem by estimating the posterior distribution probability of the astrophysical parameters given the signal detected. In this chapter we will describe how this task is achieved using specific algorithms called stochastic samplers. In the first section we explain why a naive grid-like approach would be computationally restrictive. Then we review the main features of Monte Carlo methods, allowing us to introduce the wide class of Markov Chain Monte Carlo (MCMC) algorithms, one of the most predominantly used family of stochastic samplers. Afterwards we finally introduce the Hamiltonian Monte Carlo (HMC) algorithm. We end this chapter with a brief review of the algorithms currently used by the LVC collaboration when performing Bayesian inference for GWs.

Estimating the posterior distribution

At any point in parameter space, the likelihood function can be computed from the data using Eq. (3.46). Multiplying the result by our prior knowledge and using Bayes theorem, Eq. (3.62), we are therefore able to estimate the posterior probability value anywhere in parameter space. However there exists no analytical solution for the integration of this D-dimensional function, leaving us with no other choice but to compute the posterior probability point after point. The question then arises as to what strategy to adopt in order to obtain a reliable estimate of the entire posterior distribution.

A first natural approach would be to set a D-dimensional grid over the prior range of parameters and compute the posterior at every point on the grid before performing a numerical integration. However it is easy to convince ourselves that this method is not computationally affordable as the number of dimension increases. With D = 9, as for the simplest model of a compact binary coalescence, and discretizing each dimension with a grid of 100 points, this very sparse grid already needs 100 9 = 10 18 evaluations of p (λ µ |s, M ). Even if one evaluation only took ∼ 10 -6 s (i.e. less than the CPU time of the print function in Python), it would still take 10 12 s ∼ 32 000 years, on one CPU, to finish the computation. Alternate methods have to be found in order to circumvent this curse of dimensionality.

Furthermore, one has to understand that the D-dimensional volume of parameters space contributing significantly to the integral, i.e. where the posterior is significantly different from zero, represents a tiny fraction of the initial D-dimensional prior volume for the parameters. Therefore a naive grid spanning the entire prior volume would be utterly inefficient as most of the computational time would be spent at points of almost null posterior probability value. The quite amazing achievement of stochastic samplers is to be able to find and explore efficiently the main modes of the posterior distribution, thus spending computational time where it matters most. While convergence is only guaranteed on an infinite timescale, they are generally able to provide a reliable estimate of the posterior distribution on acceptable timescales. Stochastic samplers belong to the wide class of Monte Carlo methods which we review below.

Monte Carlo methods

Monte Carlo methods comprise a wide class of techniques and algorithms aimed at solving problems with the help of random (i.e. stochastic) processes. A major application of these techniques is in the estimation of multidimensional integrals, especially those with irregular boundary conditions.

To illustrate the power of Monte Carlo methods, we investigate a way of empirically estimating the area of a circle, which in turns provides a numerical estimator for π. As represented on the left panel of Fig. 5.1 we draw a circle of generic radius r embedded in a square of side length 2r.

The ratio of the area of the circle, A c = πr 2 , with that of the square, A s = (2r) 2 , is thus ρ = π/4. Using random number generators we generate N = 400 independent samples uniformly drawn inside the square. At every draw, the probability for a sample X, of coordinates (x, y), to fall inside the circle is given by

P (X ∈ A c ) = 1 A s Ac dxdy = A c A s = ρ. (5.1)
It follows that the number N c of points falling inside the circle is proportional to the area of the circle, A c . Therefore N c /N is an approximation of ρ = π/4 and the statistical estimate π reads

π(N ) = 4 N c N ----→ N →∞ π, (5.2)
where convergence is assured by the law of large numbers, and the speed of convergence, √ N , given by the central limit theorem. Our Monte Carlo simulation finds N c = 318 directly leading to π(400) = 3.18 when we know that π ≈ 3.141592. On the right panel of Fig. 5.1 we show the convergence of the procedure as N increases.

Markov Chain Monte Carlo

A chained process with an invariant distribution

The idea of MCMC algorithms is to generate a set of points in parameter space one after the other, namely a chain of samples, where the transition from one point to the next is such that, if the chain is long enough, the samples will be distributed according to the posterior density we are looking for, as shown on Fig. 5.2. A powerful advantage of using MCMC algorithms is that even though the chain moves in D dimensions, the chain associated with each parameter is naturally marginalized over all other parameters. Integrating over these 1D distributions then allows us to define credible intervals, means and medians. Formally a Markov chain is a stochastic process X defined as:

X = {X t : t ∈ T } (5.3) X t : Ω → S, (5.4)
where t is a time index and each X t a random variable taking its values in a state space S. T is usually discrete and comes down to the natural numbers, however S can be discrete or continuous, making the possibility for different classes of chains. The chain is Markovian if at any stage of the process the value of the next sample does not depend on the past values of the chain but only on the present one. Mathematically in terms of transition probabilities it reads

P (X t+1 ∈ A|X 0 = x 0 , ..., X t = x t ) = P (X t+1 ∈ A|X t = x t ), (5.5)
for all measurable set A ⊂ S. If furthermore these probabilities are independent of time t, the chain is said to be homogeneous, which we should assume in the following. Hence an homogeneous chain will have a constant behaviour over time. We will see section 5.4 describing the Hamiltonian Monte Carlo algorithm that we sometimes have to break this important property when building our algorithm even though on the long run our chain remains homogeneous. The transition kernel K : S × S → R + 0 is the conditional probability density of X t+1 given X t = x t , thus yielding

P (X t+1 ∈ A|X t = x t ) = A K(x t , x t+1 )dx t+1 . (5.6)
It is a very powerful tool since it allows to express further transition probabilities conveniently, for instance with

P (X t+2 ∈ A|X t = x t ) = A S K(x t , x t+1 )K(x t+1 , x t+2 )dx t+1 dx t+2 . (5.7)
Hence if the first value of the chain: x 0 , is drawn from a probability density f µ we have

P (X 2 ∈ A) = A S S f µ (x 0 )K(x 0 , x 1 )K(x 1 , x 2 )dx 0 dx 1 dx 2 .
(5.8)

Building on Eq. (5.8), we define an invariant distribution µ, with density function f µ , of the Markov chain as

f µ (y) = S f µ (x)K(x, y)dx, (5.9)
for almost all y ∈ S. Nor its existence or its uniqueness are ensured. However if it exists and if x 0 is drawn from µ then Eq. (5.8) simplifies to

P (X 2 ∈ A) = A f µ (x)dx, (5.10)
which can be generalized by recurrence at any time t of the chain in

if x 0 ∼ µ then ∀t ∈ T, P (X t ∈ A) = A f µ (x)dx. (5.11)
This equation simply means that all the samples of the chain will be distributed according to the invariant distribution. We can thereby understand that the goal of an MCMC algorithm will be to create a set-up such that the target distribution (the posterior density in our case) is the invariant distribution of its kernel. However Eq. (5.11) holds if x 0 is drawn from the invariant distribution itself. Therefore two obstacles arise: how can we draw the first value of our chain from a probability density we aim at exploring ? How can we create a kernel with the posterior as invariant distribution ? Convergence to equilibrium will answer the first question while the detailed balance condition and its application with the Metropolis-Hastings algorithm will tackle the second.

The answer to the first question is quite simple: we cannot draw the first value of our chain from a probability distribution we do not know ! Hopefully the story does not end here. If our Markov chain satisfies a certain number of properties, its samples will converge, in the long run, to the invariant distribution. It means we can start the chain anywhere in parameter space as long as we wait long enough for it to converge. Formally, if X is an irreducible and aperiodic Markov chain with invariant distribution µ, then

P (X t ∈ A) t→+∞ ----→ A f µ (x)dx, (5.12)
for almost all A ⊂ S. The concept of irreducibility implies that all states of the chain can communicate in a finite amount of time when aperiodic means that all states have a non-zero probability of remaining at on the same state. Detailed definitions can be consulted in [START_REF] Cosma | Markov Chains and Monte Carlo Methods[END_REF]. Using Eq. (5.9) to create a transition kernel under which the target distribution is invariant would be a difficult task. Firstly it would require a knowledge of the posterior distribution over the entire state space S, knowledge we do not have; and secondly Eq. (5.9) involves a complicated summation over S.

Hopefully the detailed balance condition will simplifies things greatly. Let us state it first. A transition kernel K is in detailed balance with a distribution µ with density

f µ if for almost all x, y ∈ S f µ (x)K(x, y) = f µ (y)K(y, x). (5.13)
If such a condition is satisfied for the Markov chain then it implies that µ is its invariant distribution.

The Metropolis-Hastings algorithm

The Metropolis-Hastings algorithm was first introduced by Metropolis, Rosenbluth et al in 1953 [140] to investigate the equation of state of interacting molecules, the algorithm was then generalized by Hastings in [START_REF] Hastings | Monte Carlo Sampling Methods Using Markov Chains and Their Applications[END_REF] in 1970 and subsequently named the Metropolis-Hastings (MH) algorithm. It is now routinely used in MCMC algorithms to create a kernel of transition probabilities naturally in detailed balance with the target distribution of the chain. We describe here its layout together with insights on how it maintains detailed balance. To generate its chain, the algorithm uses one major function: the jump proposal Q(.|X t ) which is a probability density function of proposing any point in parameter space given the current state X t . It is up to the user to define the shape of Q(.|X t ). It can be as simple as a symmetric distribution (uniform or Gaussian centered on X t for instance) or it can be set to more elaborate probability densities, potentially asymmetric. In any case, proposing a point with a random draw leads to a random walk behaviour of the chain.

Once the jump proposal is set and starting from X 0 we iterate over fictitious time:

1. Draw X * ∼ Q(.|X t ). 2. Compute α(X * |X t ) = min 1, L(X * )π(X * )Q(X t |X * ) L(X t )π(X t )Q(X * |X t ) . (5.14) 3. With probability 1 α(X * |X t ) set X t+1 = X * otherwise set X t+1 = X t .
The fraction of the right term in Eq. (5.14) is called the Metropolis-Hastings ratio. As the evidence is only a constant, L(X * )π(X * )/L(X t )π(X t ) is equal to the ratio of the posterior probabilities between X * and X t which means that the posterior distribution is the target distribution of the process.

Let us give some insights about the reason for using such a ratio. L(X * )π(X * )/L(X t )π(X t ) favors transitions to points of higher posterior probabilities, but eventually allows for jumps to low posterior values. This makes sense since our process aims at creating a sample set distributed according to the posterior distribution, tails included. To understand the necessity to weight this ratio by the jump proposal, we can take the example of two regions of equal posterior probability with an asymmetric jump proposal between the two. Not including Q(X t |X * )/Q(X * |X t ) in the MH ratio would unfairly favor transitions from one region to the other and the chain would fail at producing samples distributed according to the posterior. These insights are the expression of detailed balance between the kernel and the posterior distribution. To understand on mathematical terms how this set-up maintains detailed balance, let us manipulate Eq. (5.14). Multiplying both sides by the denominator of the MH ratio yields

α(X * |X t ) L(X t )π(X t ) Q(X * |X t ) = min {L(X t )π(X t ) Q(X * |X t ), L(X * )π(X * ) Q(X t |X * )} . (5.15)
Since the right hand side of this equation is symmetric with respect to a t ←→ * swap, the left hand side can be equated to its image under this symmetry, giving

α(X * |X t ) L(X t )π(X t ) Q(X * |X t ) = α(X t |X * ) L(X * )π(X * ) Q(X t |X * ).
(5.16)

Now let us rewrite the same equation but swapping places between α and Lπ

L(X t )π(X t ) α(X * |X t ) Q(X * |X t ) K(Xt,X * ) = L(X * )π(X * ) α(X t |X * ) Q(X t |X * ) K(X * ,Xt)
.

(5.17)

We recognize the kernel transitions between X t and X * . Since X t+1 can either be set to X * or X t and since Eq. (5.17) is trivially satisfied in the rejection case, we can write the more general result

L(X t )π(X t ) K(X t , X t+1 ) = p(X t+1 ) K(X t+1 , X t ) (5.18)
proving that our Markov chain is in detailed balance with p(X) = L(X)π(X) and thus with the posterior distribution. As a consequence the latter is the invariant distribution of the chain and according to Eq. (5.12) its samples will be distributed according to the posterior if we wait long enough.

Diagnosing convergence

Knowing how long one has to wait to decide whether a chain has converged or not is a difficult problem. To begin wit,h we should distinguish two distinct meanings of the term "convergence". It is firstly used to indicate when the initial burn-in period (described below) is complete and we can say that the chain has converged to the main mode(s) of the posterior distribution. After this, the convergence theorem for MCMC algorithms guarantees convergence to the invariant distribution for an infinitely long chain, which we cannot produce in practice. Therefore, the question arises of after how many iterations does the chain provide a satisfactory estimation of the posterior distribution. In this respect, the chain has converged once the accuracy demanded, essentially measured by the effective sample size (ESS), is achieved. ) and plot the first 300 iterations of the chain marginalized in the first dimension. The chain needs ∼ 50 iterations to converge to the main mode of the distribution. When computing statistical quantities, the chain is burned-in by discarding these initial samples.

Initial burn-in part of the chain

If our starting point happens to be far away in parameter space from the main modes of the posterior distribution, it will take many iterations for the chain to find its way to these modes and stabilize in a regime where the stochastic process really produces samples drawn from the posterior distribution. We call this initial phase the burn-in of the chain. One way to check whether the chain has burned-in is to visually inspect its evolution. Fig. 5.3 presents an example of a burnin phase where the chain starts 20 standard deviations away from the main mode of the target distribution. On a numerical level, one can look for the latest big jump in posterior value and consider it the end of the burn-in. On the long run this first part will be small in comparison to the rest of the chain and convergence to equilibrium still applies, but necessitates a very long chain in return. Therefore, in order to get rid of this systematic error originating from an initialization bias, we discard samples from the burn-in phase whenever computing statistical quantities on the chain.

Auto-correlation and the effective sample size

Most often a MCMC algorithm produces correlated samples where the position X t+1 not only depends on the invariant distribution but also on X t . Considering the marginalized 1D chain X λi (t) over parameter λ i , the (normalized) auto-correlation function in this direction is estimated by [START_REF]Autocorrelation Analysis & Convergence -Emcee 3[END_REF] ρ λi (τ ) = c λi (τ )/c λi (0),

where

c λi (τ ) = 1 T -τ T -τ t=1 X λi (t) -X λi X λi (t + τ ) -X λi , (5.20)
with the mean of sample values for λ i . Referring to [START_REF] Cosma | Markov Chains and Monte Carlo Methods[END_REF][START_REF]Monte Carlo Methods in Statistical Mechanics: Foundations and New Algorithms[END_REF][START_REF]Autocorrelation Analysis & Convergence -Emcee 3[END_REF] we define the integrated autocorrelation length (ACL) as

X λi = 1 T T t=1 X λi (t) (5.21)
ρ(τ ) θ JN , L=22 ψ, L=233 D L , L=27 M, L=13 µ, L=13 δ, L=17 α, L=17 δt c , L=19
L λi = 1 + 2 +∞ τ =1 ρ λi (τ ). (5.22)
As D > 1, one ACL is derived per dimension and the auto-correlation of the entire chain is taken to be the maximum of all ACLs computed, noted L max . The latter can be understood as the number of steps that are needed before the chain "forgets" where it started [START_REF]Autocorrelation Analysis & Convergence -Emcee 3[END_REF]. Finally the ESS is the number T ESS of statistically independent samples (SIS) a chain of size T produces; it is given by

T ESS = T L max . (5.23)
We plot on Fig. 5.4 an example of auto-correlation functions ρ λi in each dimension of a 9D nonspinning GW parameter space, for a chain containing 10 5 correlated samples. To retrieve the set of effective samples, one only needs to thin the correlated chain by retaining every L max -th sample. In the case of Fig. 5.4, 10 5 correlated samples produce 429 SIS only since L max = 233. As explained in [START_REF]Monte Carlo Methods in Statistical Mechanics: Foundations and New Algorithms[END_REF], statistical errors on our final distribution are of order (L max /T ) 1/2 = (1/T ESS ) 1/2 . Hence to reach a 1% accuracy we need to set T ∼ 10 000L max , ie gather around 10 000 SIS. Therefore the ESS appears as a measure of how well we can estimate credible intervals. Furthermore it allows for a fair comparison between different samplers. Indeed depending on the algorithm used but also on the posterior itself, samplers can produce samples more or less rapidly but with a more or less important ACL. The bigger L max is, the more samples one has to gather before assessing convergence. In practice we set the number of SIS wished beforehand, then compute estimates of T ESS during the run and stop the chain once it has exceeded the threshold.

We should highlight here that in order to compute L λi , Eq. (5.22) implies that we should formally wait for an infinitely long chain. Obviously in practice the summation cannot go beyond τ = T but since L max is used to assess when to stop T , we run into a circular problem.

As a result we must pay attention that T is large enough that L max has reached a plateau in the summation. Once this plateau is reached and T gets larger, summing up until the end of the chain would be a bad idea since the auto-correlation function ρ gets very noisy at high lags τ , as can bee seen on Fig. 5.4. There is an automatic procedure which circumvents this behaviour, provided T 1 000L λi [START_REF]Monte Carlo Methods in Statistical Mechanics: Foundations and New Algorithms[END_REF]. It allows for a computation of L λi with a good level of confidence by stopping the summation at τ = M T , choosing the smallest value of M where M 5L λi (M ).

Optimal acceptance rate of a random walk MCMC

In the end, the performance of a sampler is well measured by considering the average time it needs to acquire one SIS. Therefore samplers are often optimized by minimizing this cost function. For MCMC algorithms, a way to optimize the procedure is to find a good trade off between increasing the acceptance rate and increasing the range of the proposal function Q, which appear as two competing goals. Indeed a low acceptance rate increases the correlation of the chain since for each jump proposal there is a high probability of the chain staying at the same point in parameter space.

One can improve the acceptance rate by reducing the range of Q, that is to say the typical distance between the current point in the chain and the one proposed, as it lowers the risk of rejection. However when doing so the chain moves very slowly in parameter space which in turn augments the correlation of the chain. A typical choice for Q is a symmetric Gaussian distribution, centered on the current point in the chain, with a given standard deviation vector σ D . It was shown in [START_REF] Roberts | Weak Convergence and Optimal Scaling of Random Walk Metropolis Algorithms[END_REF] that the optimal tuning for the proposal variance leads to an optimal acceptance rate of 23%. Therefore we see that even at its optimum value, a random walk MCMC will suffer from important correlations of its chain, and thus a long time to converge, since on average the chain does not move about 3 times out of 4.

Multi-modality

The uni-modal example shown in Fig. 5.2 describes an ideal situation of a well behaved posterior distribution consisting of a single mode. In GW data analysis we often face posteriors composed of multiple modes which represents a challenge for MCMC algorithms. While an infinite chain will eventually visit all the modes, a chain of finite length can get trapped in one of them an not explore the others as the finite number of proposals is unable to overcome the low probability plain separating the different peaks. If we are not aware in advance of the existence of multiple modes, there is little possibility of knowing whether the chains has fully explored its target distribution. On Fig. 5.5 we illustrate on the left panel a 2D bimodal distribution where a jump proposal function proposes updates relatively close to the current point of chain, allowing for a relatively high acceptance rate -necessary for the chain to move-but giving very little chance to visit the second mode since it is separated by a region of low probability. One could set the proposal with a typical jump distance equal to the distance between the two modes. Points in the second modes would then sometimes be proposed and accepted, however such a proposal function would result in a very low global acceptance rate, killing in its turn the efficiency of the algorithm. To overcome this problem, a popular approach is parallel tempering where the idea is to run multiple chains of different temperatures in parallel [START_REF] Earl | Parallel Tempering: Theory, Applications, and New Perspectives[END_REF]. The concept of temperature can easily be understood if we consider that the target distribution arises from a Boltzmann distribution of gas particles of energy E with a temperature at equilibrium2 T 0 = 1

p(λ µ ) = 1 Z e -E(λ µ ) T 0 , (5.24)
where Z is a constant that normalizes the distribution to one. Each point λ µ in parameter space, of posterior probability p(λ µ ), can equivalently be seen to carry an energy E(λ µ ) =ln [p(λ µ )]-ln(Z) at a temperature T 0 = 1 (in natural units). Regions of high probabilities corresponds to low energy values. However if the system is set to a hot state, regions of high energies, conversely low posterior probability, become accessible. In other words, increasing artificially the temperature flattens out the target distribution (while preserving its general shape) hence allowing for an easier switch between modes. We show this effect on Fig. 5.5. Then the strategy is to run several chains in parallel each with a different temperature. Note that only the coldest chain with T 0 = 1 really In both cases we show the first 500 iterations (red dots) of an MCMC chain starting from the same point (center of the highest mode) and using the same proposal function.

samples from the target distribution. Every now and then exchanges of states between adjacent temperatures are proposed allowing the coldest chain to benefit from the fast exploration of the hottest ones while keeping a reasonable acceptance rate. The downside is that the computational cost linearly grows with the number of temperatures used, M . However it turns out to be beneficial since it would take more than M times the length of the coldest chain to explore all the modes if it were to be run alone [START_REF] Earl | Parallel Tempering: Theory, Applications, and New Perspectives[END_REF].

The Hamiltonian Monte Carlo sampler

The Hamiltonian Monte Carlo (HMC), also known as a Hybrid Monte Carlo algorithm, was first introduced in 1987 by Duane et al [START_REF] Simon Duane | Hybrid Monte Carlo[END_REF] where they hybridized a MCMC algorithm, together with Hamiltonian dynamics, already used in deterministic molecular simulations, to study systems governed by quantum chromodynamics.

The HMC treats the inference problem as a "gravitational" problem by inverting the target distribution and treating it as a potential well. Using Hamiltonian trajectories the HMC uses the geometry of the inverse likelihood function to move between distant points while attaining a high acceptance rate. As a result, the algorithm avoids the usual random walk behaviour which causes a high auto-correlation of the chain, making it a much more efficient sampler. The cost for this is the introduction of hyper-parameters which need fine tuning, together with the necessity to evaluate the gradient of the target distribution many times for each proposal.

In this section, we shall first review Hamiltonian mechanics at the core of the algorithm and explain how Hamiltonian trajectories can be accurately simulated numerically using a symplectic integrator. We will then explain how to make the link between the fictitious Hamiltonian system and Bayesian inference, before finishing with an analysis of the advantages and disadvantages of the HMC algorithm.

dp µ (t)/dt + O(δ 2 ), (5.31)
giving

T δ (q µ , p µ ) =     q µ + δ ∂H ∂p µ p µ -δ ∂H ∂q µ     + O(δ 2 ).
(5.32)

The corresponding jacobian J δ is the 2D × 2D matrix

J δ =      I D + δ ∂ 2 H ∂q µ ∂p ν δ ∂ 2 H ∂p µ ∂p ν -δ ∂ 2 H ∂q µ ∂q ν I D -δ ∂ 2 H ∂p µ ∂q ν      + O(δ 2 ), (5.33)
where I D is the identity matrix in D dimensions. Computing the determinant we see that the terms at fist order in δ cancel out and we obtain det(J δ ) = 1 + O(δ 2 ).

(5.34)

Therefore the determinant of this infinitesimal transformation vanishes as O(δ 2 ) and not O(δ). It can be shown that, in the limit where δ → 0, this property leads to det(J) = 1 over an entire trajectory which in turn is equivalent to saying that Hamiltonian dynamics preserve phase-space volume [START_REF] Radford | MCMC Using Hamiltonian Dynamics[END_REF]. When it comes to using a Hamiltonian trajectory as a MCMC proposal function, this property is important as otherwise one would have to account for volume distortions to keep the propositions balanced.

Reversibility Hamilton's equations define a one-to-one mapping, T τ , between a phase-space state at time t and its image at time t + τ . The inverse map is simply T -τ as one can negate the time derivative in Eq. (5.25) and (5.26). In terms of an infinitesimal evolution of the system, one can easily check that T -δ [q µ (t + δ), p µ (t + δ)] = (q µ (t), p µ (t)). Interestingly the inverse mapping can also be obtained by evolving the system forward in time but with negated momenta since

T δ [q µ (t + δ), -p µ (t + δ)] =     q µ (t + δ) + δ ∂H ∂(-p µ ) -p µ (t + δ) -δ ∂H ∂q µ     + O(δ 2 ) = q µ (t) -p µ (t) . (5.35)
Reversibility will also be important as it will be used to show that an HMC update of the chain leaves the target distribution invariant.

We have shown analytically that Hamiltonian dynamics is reversible, conserves phase-space volume and the Hamiltonian itself. In practice however we have to solve Hamilton's equations using a numerical integrator which, by discretizing trajectories over a given number of steps, can only approximate the true trajectory.

Numerical solutions of Hamilton's equations

In order to solve Hamilton's equations numerically, a trajectory of fictitious length τ is discretized into l steps of size such that τ = l . is named the stepsize of the trajectory and while l refers strictly speaking to the number of steps, at fixed it is often referred to as the length of the trajectory.

A common symplectic integrator used for evolving Hamiltonian systems is the leapfrog method. Starting with a half-step update on momentum, it then computes a full step in position using the half-updated momentum value and then derives the final updated momentum by performing another half-step, i.e.

p µ (t + /2) = p µ (t) -2 ∂U ∂q µ q µ (t) , (5.36)
q µ (t + ) = q µ (t) + ∂K ∂p µ p µ (t+ /2) , (5.37)

p µ (t + ) = p µ (t + /2) - ∂U ∂q µ q µ (t+ ) . (5.38)
While not able to conserve the Hamiltonian perfectly, the leapfrog method has an error of O( 3 ) at each step of the trajectory, leading to an O( 2) global error at the end of the trajectory. This is important since an even order global error in assures reversibility of the method [START_REF] Radford | MCMC Using Hamiltonian Dynamics[END_REF].

Sampling from the posterior distribution using Hamiltonian dynamics

The canonical distribution

If we consider a generic Hamiltonian from Eq. (5.27) accounting for the total energy of a system, then, from a statistical mechanics point of view, it appears as an energy function giving rise to a canonical distribution over phase-space states with a probability density

P (q µ , p µ ) = 1 Z exp - H(q µ , p µ ) T , (5.39)
where Z is a normalizing constant and T is the temperature of the system which, without loss of generality, we take equal to unity. Therefore the canonical distribution can be rewritten as

P (q µ , p µ ) = 1 Z exp [-U(q µ )] exp [-K(p µ )] . (5.40)
We can see from this equation that P (q µ , p µ ) is separable in the variables (q µ , p µ ) which means that U(q µ ) and K(p µ ) define the canonical distributions for position and momentum respectively.

The HMC as a MCMC algorithm

We now have all the ingredients to create an MCMC algorithm whose transition kernel leaves the canonical distribution P (q µ , p µ ) invariant using Hamiltonian dynamics, allowing us to estimate the posterior distribution in the astrophysical parameters by marginalizing over the momenta. We will first detail the steps followed by the HMC and then we shall prove that these steps leave P (q µ , p µ ) invariant.

Starting from a point q µ i in parameter space and given some pre-determined scales s µ , we repeat the following steps to create a chain of samples {q µ i }: 1. Draw each of the D scaled momenta pµ i from ∼ N (0, 1). 2. Using the scaled leapfrog integrator from Eq. (5.46), evolve the trajectory for l steps to a point (q µ * , pµ * ), but negate the momenta such that the proposed point is

(q µ * , -p µ * ). 3. Set q µ i+1 = q µ * with probability α = min {1, exp [-H(q µ * , -p µ * ) + H(q µ i , pµ i )]} , (5.47)
otherwise leave q µ i+1 = q µ i . The first step clearly leaves the P (q µ , pµ ) invariant since the momenta are drawn from their true distribution. For the second and third step, one can rewrite the MH ratio as exp [-H(q µ * , -p µ * ) + H(q µ i , pµ i )] = P (q µ * , -p µ * ) P (q µ i , pµ i )

(5.48)

Eq. (5.14) indicates that the MH procedure will leave P (q µ , pµ ) invariant only if the jump proposal probability Q( * |i), referring here to the Hamiltonian trajectory of step 2 from (q µ i , pµ i ) to (q µ * , -p µ * ), is equal to its symmetric counterpart Q(i| * ). This is where reversibility and phase-space volume conservation of Hamiltonian dynamics integrated with the leapfrog method are important properties. Thanks to the negated momenta and to the reversibility property of our integrator we know that evolving another trajectory forward in time for l steps but starting from (q µ * , -p µ * ) leads to (q µ i , pµ i ) (after negation of the end momenta), which means that Q(i| * ) exists. Note that in practice this negation is not necessary since the kinetic energy is quadratic in pµ and we never compute Q(i| * ). Then given an infinitesimal volume δV i of a region in phase-space around (q µ i , pµ i ), the Hamiltonian trajectory from step 2 will transform it into a region of volume δV * around (q µ * , pµ * ) such that

δV i Q( * |i) = δV * Q(i| * ).
(5.49)

Phase-space volume conservation dictates δV i = δV * which in turn implies Q( * |i) = Q(i| * ). Thereby step 2 and 3 maintain the detailed balance condition ensured by the MH algorithm which finally proves that P (q µ , pµ ) is the invariant distribution of the kernel. We argued earlier that Hamiltonian dynamics conserve H along a trajectory. If we were able to preserve it exactly in our derivations, the MH ratio would always be equal to one, meaning that every proposed point in phase-space would be accepted and the MH step would be useless. In practice however we know that the leapfrog method introduces a numerical error along the trajectory, therefore the MH algorithm can be understood as a way to statistically cancel the bias introduced by these errors.

We emphasize here the importance of drawing new momenta in the first step of the HMC. Not only does it allow one to marginalize them out and recover the posterior distribution, but it also sends the chain on a path of new Hamiltonian value. Without these draws the chain would be confined on a surface of constant H defined by the initial position in phase-space meaning that the range of accessible potential energy levels, and thus posterior values, would be limited by H. In other words, the chain would not be irreducible and could never converge to equilibrium. To illustrate the effect of drawing new momenta, we show on Fig. 5.6 the first three Hamiltonian trajectories computed for a simple fiducial 1D harmonic oscillator of mass m = 1 where the Hamiltonian is the sum of two quadratic potential and kinetic energy terms given by

U(q) = 1 2 q 2 , (5.50)
K(p) = 1 2 p 2 m . (5.51)
One can clearly see on the right-panel of Fig. 5.6 the wide exploration of U allowed by this process. The first and main advantage of the HMC is its ability to avoid the random walk behaviour of classic MCMC samplers. It is able to do so because it takes advantage of the gradient information of the inverse posterior distribution when making a proposal in the form of a Hamiltonian trajectory. As a result distant points can be proposed while keeping a high acceptance rate since the Hamiltonian is essentially conserved along the trajectory. As a consequence, the HMC is able to produce chains of samples with a small ACL compared with a random walk MCMC, which is equivalent of saying that the chain will be much shorter to produce a given number of SIS required to recover the posterior distribution.

For the HMC, an optimal acceptance rate can be derived by optimizing the cost C (in terms of number of proposals) in obtaining an independent sample given the current position of the chain [START_REF] Radford | MCMC Using Hamiltonian Dynamics[END_REF]. Given the acceptance rate a, a sufficiently small step-size , and assuming high dimensionality D, the cost is given by C ∝ 1/ (a ) .

(5.52)

Minimising this cost, one finds an optimum acceptance rate for the HMC algorithm of a opt = 65%, much higher than the optimal 23% found for random walk MCMCs [START_REF] Roberts | Weak Convergence and Optimal Scaling of Random Walk Metropolis Algorithms[END_REF]. It was further demonstrated that this value is independent of the posterior distribution [START_REF] Beskos | Optimal Tuning of the Hybrid Monte Carlo Algorithm[END_REF]. In this work, it was found that the HMC will tend to benefit from a opt > 65% in cases where D -1/4 is not very small with respect to 1, as we regularly find in GW astronomy.

The second benefit of the HMC over random walk samplers comes from a better scaling with dimensionality. As D increases, longer chains are needed to produce a reliable estimate of the posterior distribution. However it was shown both theoretically in [START_REF] Radford | MCMC Using Hamiltonian Dynamics[END_REF] and empirically in [START_REF] Hajian | Efficient Cosmological Parameter Estimation with Hamiltonian Monte Carlo[END_REF] that the HMC is D times more efficient than a standard random walk MCMC, meaning that a HMC chain yielding the same performance as a random walk MCMC one will be about D times shorter.

Difficulties with the HMC

Unfortunately the HMC comes with a number of constraints which make its implementation more laborious than a simple MCMC and can even degrade its performance if not properly taken into account.

Firstly, the algorithm contains a number of free parameters, namely the stepsize , the length of trajectories l and the mass matrix M µν , that need to be fine tuned. The step-size should be small enough to conserve the Hamiltonian along a trajectory, but not so small that the computational cost becomes prohibitive. The number of leapfrog steps l should be large enough to allow the trajectory to move to distant parts of parameter space, but not so much that it results in making circular orbits in phase-space where the end point of the trajectory is very close to the starting one resulting in a chain performing a random walk.

We argued earlier that the mass matrix should be chosen in accordance with the scale of each parameter to allow for a wide exploration in each dimension. However the scales s µ of the posterior distribution are generally not known in advance. If a single scale is wrongly estimated, either too small or too large, then we end up with an algorithm that either has a poor exploration and high auto-correlation length, or one with a high rejection rate as the Hamiltonian is not being sufficiently conserved along trajectories.

To optimize the efficiency of a stochastic sampler, one may need to reparameterize the parameters of the problem, thus providing a geometry where the chain mixes better. For the HMC, this translates into defining functions f where, without loss of generality, we now set q µ = f (λ µ ), with f potentially different from the identity function in multiple directions. While this is common to most stochastic samplers, the HMC must account for it when deriving Hamiltonian trajectories meaning that the gradient terms of the posterior distribution in Eq. (5.46) must be re-written as:

∂ ln L f -1 (q µ ) π f -1 (q µ ) ∂q µ = ∂f -1 (q µ ) ∂q µ × ∂ ln [L(λ µ )π(λ µ )] ∂q µ . ( 5.53)
As will be demonstrated later in chapter 10, it can be that the gradient of f -1 is ill-defined in parameter space, which prevents the HMC from sampling the posterior distribution properly if an alternative form is not found. Last but not least, the HMC suffers from a high computational cost when generating trajectories if no closed-form solution for the gradient of the posterior exists. This single item is the primary reason which has prevented the algorithm from a wider use. In most practical cases, the analytical form of the target distribution is unknown and gradients must be derived numerically at each leapfrog step. Therefore if evaluating the posterior (and especially the likelihood) is computationally costly, the benefits brought by the HMC in terms of efficient sampling can rapidly be overtaken by the CPU time required to derive each trajectory.

We will tackle these issues in the next chapter.

Algorithms currently used by the LVC

Before moving to a description of the HMC algorithm as applied to GWs, it is a good time to highlight the algorithms currently used within the LVC for Bayesian inference. The LALInference software C library [START_REF] Veitch | Parameter Estimation for Compact Binaries with Ground-Based Gravitational-Wave Observations Using the LALInference Software Library[END_REF], which has successfully been used to analyse data from the three first observation runs, provides two stochastic samplers, LALInferenceMCMC and LALInferenceNest which are optimized to recover the posterior distribution of GW parameters.

LALInferenceMCMC performs a parallel tempered random walk MCMC. It uses a Gaussian proposal distribution, the widths of which are dynamically adjusted to target a 23% acceptance rate. On top of this, LALInferenceMCMC uses custom jump proposals enabling a faster exploration of isolated modes of the posterior distribution. The tempered chains are run in parallel to reduce the wall time of the run, and information swaps between adjacent chains are proposed every 100 samples.

LALInferenceNest implements a nested sampling algorithm, proposed by Skilling in 2006 [START_REF] Skilling | Nested Sampling for General Bayesian Computation[END_REF]. This population based algorithm adopts a different point of view from MCMC as the primary target is the Bayesian evidence, p(s|M ), appearing at the denominator of Eq. (3.62). To estimate p(s|M ), the algorithm evaluates a monotonically decreasing sequence of prior volumes defined by nested iso-likelihood contours. The process yields samples estimates of the evidence converging to the true value as the iso-likelihood contours get smaller. Once the algorithm has converged, posterior samples can be obtained as a by-product by re-sampling the chain with adequate weights.

Recently, the collaboration has decided to move towards a Python based library called Bilby [START_REF] Ashton | Bilby: A User-Friendly Bayesian Inference Library for Gravitational-Wave Astronomy[END_REF]. As the ultimate goal is to replace the LALInference software, the HMC algorithm outlined in this thesis has been developed within the Bilby framework to facilitate future integration with the package.

Chapter 6

The HMC in the context of gravitational waves

In this chapter, we begin by explaining how the free parameters of the HMC are fine tuned in the context of GWs. In a following section we detail our solution to circumvent the computational cost of numerical gradients of the log-likelihood, key to the success of our algorithm. At this point the algorithm described is essentially the one developed by Bouffanais et al [START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF] and constitutes the starting point of this thesis. Given that the algorithm was developed in the C language, and our goal is produce a Python version, we will refer to this particular version of the HMC as the C-code HMC for ease of differentiation. We continue afterwards by detailing the obstacles we faced when porting the C-code HMC to Bilby. Finally we end this chapter with a description of the numerous improvements we brought to the C-code version.

6.1 Tuning the HMC free parameters

The Mass matrix

The dynamical ranges of the gravitational wave parameters λ µ are extremely different. For example, the time at coalescence is usually measured with a precision on the order of O(10 -3 ) s, while the luminosity distance is generally constrained on the order of O(10 -10 3 ) Mpc ∼ O(10 23 -10 26 ) m. We explained in section 5.4.3.2 that a scaled version of the leapfrog algorithm can account for different dynamic ranges by appropriately choosing the mass matrix and setting m µ = (s µ ) -2 , where s µ is the typical dynamic scale of the corresponding direction.

As a good choice of mass matrix is essential for a successful HMC, it is important to find a way to acquire an a priori estimation of the scaling factors (scales) s µ . A good starting point is to invert the FIM and use the variance-covariance matrix for the source parameters, λ µ , to set the scales to the standard deviation predicted by the FIM, i.e. [START_REF] Porter | A Hamiltonian Monte Carlo Method for Bayesian Inference of Supermassive Black Hole Binaries[END_REF][START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF]

s µ = σ F IM µ = (Γ µµ ) -1/2 = (C µµ ) 1/2 = m -1/2 µ . (6.1)
If the scale of a bounded parameter is greater than its natural range, as can happen with the FIM predictions, we constrain the scales in the problem eigen-direction by setting it to half of the parameter prior range, corresponding to a 50% error-prediction.

Re-parametrization of the astrophysical parameters

Certain astrophysical parameters, such as the individual masses, are not a good choice of coordinates for Markov chains with acceptable mixing. In such cases, it has been demonstrated that better choices of coordinates exist, requiring a re-parametrization of the parameter set. Below, we will discuss our choice of coordinates.

Probably the most important choice of parameter coordinates involve the mass of the binary system. At the leading PN-order, the gravitational waveform is symmetric in component masses. Hence (m 1 , m 2 ) occupy a degenerate space with a 2-1 mapping to other mass combinations such as (M, µ). Since M appears at the dominant PN order in the waveform, it is a natural choice to sample in that parameter. As for the second mass parameter, several options are available: mass-ratio q, symmetric mass-ratio η or reduced-mass µ. We should note that there are issues with the first two possibilities: for an equal mass binary where q = 1 and η = 0.25, the HMC scales deduced from the FIM prediction is not reliable as it still assumes a Gaussian distribution around these values, whereas in reality, they are both astrophysically bounded at those values. It has been shown in previous studies that choosing µ produces well mixed chains [START_REF] Porter | Bayes : A Comparison of Parameter Estimation Techniques for Massive Black Hole Binaries to High Redshifts with eLISA[END_REF][START_REF] Porter | An Overview of LISA Data Analysis Algorithms[END_REF][START_REF] Cornish | The Search for Massive Black Hole Binaries with LISA[END_REF][START_REF] Cornish | Detecting Galactic Binaries with LISA[END_REF]. Therefore we choose (M, µ) for the mass parameter coordinates.

Next, the distribution of sources in the sky is generally assumed to be uniform, which translates into a uniform distribution for sin (δ) and not δ. Hence, if we were to sample in δ, we would need to include a prior ratio in the MH ratio to compensate for that choice and produce a chain that follows our prior knowledge. To avoid this we directly sample in sin (δ). Likewise for the inclination angle, which is assumed to be uniform in the cosine of the angle, leads us to sample directly in cos θ JN . Note that prior considerations on all other parameters will be tackled in more details in section 7.3.1.

As we explained in section 3.3.2, the FIM is often singular or ill-conditioned, which leads to numerical instabilities when inverting the matrix and untrustworthy predicted variances. As a consequence, we follow [START_REF] Cutler | Gravitational Waves from Mergin Compact Binaries: How Accurately Can One Extract the Binary's Parameters from the Inspiral Waveform?[END_REF][START_REF] Porter | Bayes : A Comparison of Parameter Estimation Techniques for Massive Black Hole Binaries to High Redshifts with eLISA[END_REF][START_REF] Cornish | The Search for Massive Black Hole Binaries with LISA[END_REF] by further using (ln M, ln µ, ln D L , ln t c ) as the coordinates of our sample space, since it was shown that this re-parametrization both reduces the dynamic range in parameter space and lowers the condition number of the FIM. This choice should then lead to a more accurate estimation of the scales needed for the HMC.

While this choice of coordinates should lead to a more numerically stable FIM, due to a lack of a closed form solution for the gradients of the waveform with respect to certain parameters, we need to estimate the FIM numerically, using a central difference method for the numerical derivatives. While it is possible to choose a common offset for each of the parameters, we found it does not work for the entire parameter set. One problem that required a specific solution was the numerical derivative for ln t c . As mentioned, the use of central differencing means that we will need to generate waveforms at some t + c and t - c to get the numerical gradient at t c , defined by

t ± c = e ln tc±∆ ln tc = t c e ±∆ ln tc ≈ t c ± t c ∆ ln t c + O(t c (∆ ln t c ) 2 ), (6.2)
where ∆ ln t c 1 is the offset used. To produce accurate numerical gradients, and remembering that the FIM can also be interpreted as the local curvature of the likelihood surface, t + ct - c ≈ 2t c ∆ ln t c + O(t c (∆ ln t c ) 2 ) must be (very) small with respect to the typical range of variation of ln L(t c ), which we said to be O(10 -3 ) s. Hence it implies that

∆ ln t c ≪ 10 -3 × t -1 c . (6.3)
Note that this constraint also applies when deriving the gradient of the log-likelihood for Hamiltonian trajectories. In general, the time of coalescence is commonly taken to be a GPS time, which is a number on the order of 10 9 s, and as a result of the previous inequality would require choosing an offset ∆ ln t c ≪ 10 -12 . To prevent numerical precision issues arising from such a small offset, it is much safer for this gradient to work with the duration to coalescence, δt c = t ct s , instead of the GPS-time t c , where t s is the start time of the analysis. The longest signal durations analyzed concern low mass binaries, typically BNSs which have durations of O( 102 ) s thus we are safe when using ∆ ln t c = 10 -7 ≪ 10 -5 . As t s remains constant throughout the algorithm, even though Hamiltonian trajectories will move in the ln(δt c ) direction, we can continuously map each point back to a unique GPS t c . These considerations allow us to define the final parameter space for the HMC as q µ = {cos θ JN , φ c , ψ, ln D L , ln M, ln µ, sin (δ) , α, ln(δt c )}. (6.4)

Stepsize of the leapfrog integrator

Following [START_REF] Radford | MCMC Using Hamiltonian Dynamics[END_REF][START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF], rather than trying to find an optimal static value for , the stepsize was drawn from the normal distribution ∼ N (5×10 -3 , 1.5×10 -3 ) ∈ [10 -3 , 10 -2 ]. It was found that drawing the stepsize from a normal distribution produced more statistically independent chains than those with a fixed value. This is due to the fact that trajectories with small values of will always be accepted, as their Hamiltonians will always be conserved. However, the end point of the trajectory may not be very far from the starting point in parameter space, so the exploration is local. On the other hand, trajectories with large have a higher probability of being rejected. But in those cases where they are accepted, the exploration is wider and the trajectory end points are more likely to be statistically independent of the starting point.

The trajectory length l

The trajectory length, l, is the final free parameter to be properly tuned. This is a difficult parameter to tune as, for a given value of , if the value of the trajectory length l is too small, the arc in phase space will be such that the start and end points of the trajectory will be so close together that the chain random walks through parameter space. If the value of l is too large, the trajectory generates a circular orbit in phase space, and once again the end point can be sufficiently close to the starting point that the chain is again a random walk. To avoid the situations described above and ensure a well mixing chain, and also taking into account the variable size of , the trajectory length was drawn from a uniform distribution.

Remapping parameters in their prior ranges

Out of simplicity, the C-code considered uniform priors for every q µ stated in Eq. (6.4). This way, the gradient of the log-prior in the scaled leapfrog and the prior ratios in the MH step could be ignored. More astrophysically motivated priors will be considered in chapter 10, but until then we simply equate the posterior distribution to the likelihood. However uniform prior boundaries still need to be accounted for. To do so, the C-code HMC checks at each step of a trajectory that the updated position q µ (after the full step of the scaled leapfrog, Eq. (5.46)) is inside the pre-defined range in all directions. If not the momentum in every concerned direction is negated, performing a bounce on the concerned boundaries. This allows for a natural remapping of the trajectory inside the prior ranges since momentum negation preserves the Hamiltonian and the time-reversibility of the chain.

Visualizing HMC trajectories

Now that we have described how the free parameters of the HMC should be tuned when dealing with gravitational waves signals, we will demonstrate what a Hamiltonian trajectory looks like in phase space for a non-spinning signal in a 9-dimensional parameter space. Not only do these visualisations demonstrate how the algorithm moves, but they will also turn out to be an excellent tool in understanding what is going wrong if the HMC fails to preserving the Hamiltonian and the proposed point is rejected.

In Fig. 6.1 we present one numerical trajectory in phase-space of length l = 200 and fixed stepsize = 5 × 10 -3 . We can see that the trajectory motion in a multi-dimensional space is far more complex that the simple arcs in the 1D harmonic oscillator, represented in Fig. 5.6. While some parameters do exhibit a quasi-periodic motion, some trajectories clearly trace loops in phase space. This motion is due to strong correlations between certain parameters. As the trajectory tries to move forward in one direction, it is pulled up and down the walls of a steep potential on either side, producing the highly oscillating trajectory in some parameters. While this phase-space motion might seem chaotic, in Fig. 6.2 we plot the time-evolution of the Hamiltonian H, potential energy U and kinetic energy K for the same trajectory. We can see that the potential and kinetic energies oscillate a lot, but compensate to produce a Hamiltonian almost constant all along the trajectory.

Circumventing the numerical gradient bottleneck

While the HMC algorithm is theoretically known to be more efficient than a standard MCMC algorithm, it is not as widely used as other stochastic samplers. The main reason for its lack of use is the fact that at each step along a trajectory, one has to calculate as many gradients of the log-likelihood as there are dimensions in the problem. In GW astronomy this is problematic because there is no closed form solution to the gradients of the log-likelihood, thus they have to be calculated numerically using either central differencing or forward differencing1

∂ ln L(q µ ) ∂q µ = ln L (h(q µ + ∆q µ )) -ln L (h(q µ -∆q µ )) 2∆q µ + O((∆q µ ) 2 ), (6.5)
∂ ln L(q µ ) ∂q µ = ln L (h(q µ + ∆q µ )) -ln L (h(q µ )) ∆q µ + O(∆q µ ), (6.6)
where ∆q µ is the offset step in the parameter value. Central differencing produces a more accurate estimate of the derivative as the error in the estimation goes as O((∆q µ ) 2 ). This contrast with an error estimate of O(∆q µ ) for forward differencing. However, while more accurate, in D dimensions, central differencing requires 2D waveform generations, i.e. at q µ ± ∆q µ , while forward differencing requires D + 1 waveforms, i.e. h(q µ ) plus the D waveforms at q µ + ∆q µ . As we are using matched filtering, previous tests [START_REF] Bouffanais | Bayesian Inference for Compact Binary Sources of Gravitational Waves[END_REF] on the HMC have shown that forward differencing is sufficient for the amplitude parameters {cos θ JN , ψ, ln D L , α, sin (δ)}, while central differencing is needed for parameters appearing directly in the phase of the waveform: {φ c , ln M, ln µ, ln δt c }. We therefore need to generate 14 waveforms per trajectory step to compute one full 9D gradient vector, leading to 2800 waveform generations over an entire trajectory of length l = 200. Details about the cost of generating ∂ µ ln L = ∂ ln L/∂q µ will be given in section 7.4.1, but we highlight that computing numerical gradients on ∼ 64 s of data sampled at 4096 Hz, using the IMRPhenomD approximant [START_REF] Husa | Frequency-Domain Gravitational Waves from Non-Precessing Black-Hole Binaries. I. New Numerical Waveforms and Anatomy of the Signal[END_REF][START_REF] Khan | Frequency-Domain Gravitational Waves from Non-Precessing Black-Hole Binaries. II. A Phenomenological Model for the Advanced Detector Era[END_REF] (one of the cheapest waveforms to generate) takes ∼ 500 ms on one Intel i5 CPU at 2.3 GHz. Hence, ∼ 100 s are necessary to derive a single trajectory with l = 200, meaning that the HMC would need weeks to months to produce the required number of statistically independent samples.

Approximating the gradients of the log-likelihood

In the non-spinning case, this numerical bottleneck was overcome by approximating the gradients of the log-likelihood. For this, the algorithm was split into three parts. Phase I is an information gathering phase: the chain is run for 1500 trajectories of length l = 200 where the positions in parameter space, together with their 9D gradients, visited by each accepted trajectory are recorded.

In Phase II we equate the numerical gradients from Phase I to the following cubic approximation [START_REF] Porter | A Hamiltonian Monte Carlo Method for Bayesian Inference of Supermassive Black Hole Binaries[END_REF] f

(q µ ) = a 0 + D i=1 a i q i + D j=1 D k=1 a jk q j q k + D l=1 D v=1 D w=1
a lvw q l q v q w (6.7)

where (a 0 , a i , a jk , a lvw ) are the cubic coefficients we want to derive. When D = 9, there are 1+D+D(D+1)/2+D(D+1)(D+2)/6 = 220 coefficients per gradient since a jk are the independent coefficients of a D × D symmetric matrix and a lvw those of a D × D × D symmetric tensor. Hence for each gradient we obtain a system of equations characterized by an n × 220 matrix where n ∼ 1 500 × 200 (a bit less since most but not all numerical trajectories are accepted). Due to its structure, a QR decomposition, which is both more stable and faster than an SVD decomposition, is used to invert this matrix [START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF]. Note that the inversion needs to be computed only once for all D gradients. It was shown in [START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF] that this cubic approximation broke down for the parameter sub-set {cos θ JN , ψ, ln D L }, when {cos θ JN , ψ} were multi-modal. To rectify the problem, a solution was found that uses a local linear approximation for each of these gradients, rederived at each leapfrog step by using only surrounding points to the current position q µ . To do so, and using ln D L as an example, the data from Phase I are ordered by ascending values of ln D L creating an ordered look-up table (OLUT) {q µ , (∂ µ ln L) num } ln D L . Then at each leapfrog step local points from the OLUT are selected via a two-step process. Firstly the n 1 = 2000 closest points in ln D L are selected symmetrically around ln D L . However, cos θ JN and ψ being generally multi-modal, this first pool might contain points which do not belong to the same mode as that of q µ . To discard those points, a scaled Euclidian distance on the 3D sub-space is then calculated, i.e.

||q µ k -q µ || 2 = (cos θ JN ) k -cos θ JN s cos θ JN 2 + ψ k -ψ s ψ 2 , (6.8)
and select the n 2 = 200 closest points in that respect. Equivalent expressions are used when deriving the local approximation to the gradients of cos θ JN and ψ, using the appropriate permutations.

Phase III then swaps out the numerical gradients with what we call the cubic-OLUTs fit approximation. At the start of the trajectory the algorithm proposes a new chain point by jumping from the true potential to a shadow potential which is an approximation to the real one from Phase I data. Then it evolves the trajectory along the shadow potential, and jumps back onto the real potential at the end of the trajectory to evaluate the Hamiltonian numerically. If the shadow potential is a good enough approximation to the real one, the Hamiltonian will generally be well conserved, thus the acceptance rate will remain high and the algorithm will converge rapidly.

Phase III analytical (ie cubic-OLUTs) trajectories were 90 times (with the code written in C) faster than numerical ones. This raw speed-up is traded for a loss in acceptance rate compared with Phase I but overall results reported in [START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF] show that the algorithm managed to reduce the run time from the estimated 33 days to ∼ 25 hours.

Dealing with unexplored areas

We shall highlight however that the cubic-OLUTs fit is heterogeneous, over regions of parameter space, in the accuracy of its prediction. The first reason is that Phase I cannot exhaustively explore the parameter space in only 1500 trajectories, which inevitably leads to unvisited regions of the parameter space where the future gradient fit is completely lacking information (this especially affects the OLUTs since they produce a local fit). As a result, it is common in Phase III to see the chain getting stuck in parts of parameter space where the cubic-OLUTs approximation fails at estimating sufficiently accurate gradient values and a long sequence of trajectories 2 get rejected before one is accepted "out of luck". This behaviour is very problematic for all stochastic samplers as the autocorrelation of the chain grows very rapidly when this happens, leading to a much longer run time for the algorithm. To circumvent this problem, each time a pre-defined number of analytical trajectories are successively rejected, numerical gradient trajectories are run until a proposed point is accepted, before switching back to approximate gradient trajectories, allowing the chain to move away from its blind spot. A threshold of 3 successively rejected trajectories was chosen, based on the assumption that a properly tuned HMC algorithm should have an acceptance rate of ∼ 70%. While this produced satisfying results, this parameter will be discussed and optimized later in this chapter. It was then understood that the main reason for = the failure of the cubic-OLUTs approximation were gradients with respect to {cos θ JN , ψ, ln D L } as the chain was visiting a region in parameter space the OLUTs had not been in Phase I. As full numerical gradient trajectories are expensive, it was found that running a hybrid trajectory, where one uses numerical gradients for the three troublesome parameters but keeps the cubic fit approximation for the others, would most often be sufficient to produce an accepted trajectory. To allow the cubic-OLUTs approximation to improve their predictions during Phase III, numerical gradients computed along hybrid and numerical trajectories are added to the OLUTs. Furthermore, every 10 5 trajectories, this data was also used to recalculate the coefficients in the cubic approximation. Thus, it is common to see the acceptance rate in Phase III improving as the number of trajectories increase.

1 500 numerical trajectories was found to be a suitable number to produce enough exploration and data points (∼ 3×10 5 ) allowing the cubic-OLUTs to perform well enough in Phase III generally speaking. To tackle (rare) cases where the cubic fit would miss data points from Phase I and lead to a poor acceptance rate a in Phase III, two thresholds were decided: if a < 65% (the theoretical optimal acceptance rate for an HMC) only hybrid trajectories would be run and if a < 50% only numerical trajectories. Again for each accepted trajectory, gradients and their positions would be recorded to update OLUTs immediately and update the cubic fit once the total data set has increased by 10%.

Detailed structure of the C-code algorithm

In this section, we outline the final version of the inherited C-code HMC. In the interest of demonstrating that the HMC works, we assume that algorithm has already burned-in, and we are now on the global peak of the posterior distribution. While the original version of the C-code HMC would stop after a predefined number of trajectories, compute the ACL in post-processing and deduce the ESS, it is more efficient to instead predefine the ESS that one desires for the analysis. While we know that in general 10 000 SISs are usually required for accurate statistical inference, in the interest of run-time, we will choose 5 000 SISs as our threshold for this thesis. We can justify this choice using the fact that obtaining a SIS essentially scales linearly with time. So, given 5 000 SISs, we can extrapolate to how long it would take to produce 10 000. We have therefore implemented this as the sole change to the original algorithm.

1. Pre-phase I : Compute the scales in every direction using the inverse of the FIM, s µ = Γ -1/2 µµ . Restrict the scales to half of the parameter prior range for naturally bounded parameters if s µ is greater than the range, and to 0.5 for ln D L . This corresponds to a maximum 50% error prediction in each parameter.

2. Phase I: run 1 500 numerical trajectories of fixed length l = 200 and with a stepsize ∼ N (5 × 10 -3 , 1.5 × 10 -3 ) ∈ [10 -3 , 10 -2 ]. For every accepted trajectory, record each visited position q µ and the D numerical gradients (∂ µ ln L) num at that point.

3. Phase II: using {q µ , (∂ µ ln L) num } derive the cubic gradient approximation coefficients for all parameters with unimodal distributions and create OLUTs for {cos θ JN , ψ, ln D L }.

4. Phase III: run analytical trajectories using the cubic-OLUTs approximation of the gradients. Keep the same stepsize as Phase I but draw the length from U(50, 150).

• Monitor the acceptance rate a:

-If a ≥ 65%: use analytical trajectories.

-If 50% ≤ a < 65%: use hybrid trajectories with l ∼ U(50, 100) and update OLUTs with data from accepted trajectories. -If a < 50%: use numerical trajectories with l ∼ U [START_REF] Buonanno | Signal Recycled Laser-Interferometer Gravitational-Wave Detectors as Optical Springs[END_REF][START_REF]GWTC-1: A Gravitational-Wave Transient Catalog of Compact Binary Mergers Observed by LIGO and Virgo during the First and Second Observing Runs[END_REF]. Record data to update cubic approximation coefficients.

• If 3 analytical trajectories are rejected in a row:

run one hybrid trajectory of smaller length l ∼ U(20, 100) and smaller stepsize = 2.5 × 10 -3 . If the trajectory is accepted, use the data to update the OLUTs. If not... -...run numerical trajectories of same length and stepsize until acceptance before switching back to analytical trajectories. Use the data to update both the OLUTs and the coefficients of the cubic approximation.

• Every 10 5 trajectories use data from accepted numerical trajectories to update the cubic fit.

5. Stopping condition: after 10 000 trajectories, compute the maximum integrated auto-correlation length, ACL max . Calculate 10 000/ACL max , giving the number of SISs gathered so far. Deduce the number of SISs missing to achieve the required ESS. Estimate the number of trajectories left to run n. Recompute ACL max after min(10 000, n) trajectories and repeat the operation until enough SISs have been accumulated, at which point the run is stopped.

With this further optimised version of the C-code HMC complete, the next step of the project was to port the algorithm to a new version compliant with Bilby and LALInference.

Chapter 7

Porting the HMC to Bilby While adapting our algorithm to make it available to Bilby [START_REF] Romero-Shaw | Bayesian Inference for Compact Binary Coalescences with BILBY: Validation and Application to the First LIGO-Virgo Gravitational-Wave Transient Catalogue[END_REF], we faced many unexpected issues which caused the HMC to fail. The first section describes the obstacles we faced relative to Phase I of the algorithm. Moving on to the integration of Phase II and III, new issues arose which are detailed in the second section. Once the HMC was finally working in its new framework, we brought several improvements which are outlined in the last section of this chapter.

Problems with Phase I

In order to make the HMC available to Bilby, the first task was to translate it from C to Python. For the sake of simplicity, the C-code HMC used its own implementation of the TaylorF2 [START_REF] Blanchet | Gravitational-Radiation Damping of Compact Binary Systems to Second Post-Newtonian Order[END_REF][START_REF] Blanchet | Gravitational-Wave Inspiral of Compact Binary Systems to 7/2 Post-Newtonian Order[END_REF] waveform approximant. In the interest of progress, we initially translated that model into Python and checked that both codes would generate the same waveform and compute the same log-likelihood for a given fiducial source. However, from the beginning, this module was meant to be replaced by a generic call from Bilby to the LALSimulation [START_REF][END_REF] package. This switch of module to generate waveforms turned out to be the origin of a number of problems which arose during the integration of the algorithm, a major one being a numerical flaw in the Bilby line of code computing the duration to coalescence in an interferometer.

Inaccurate computation of the duration to coalescence in Bilby

Replacing our own implementation of TaylorF2 , the acceptance rate in Phase I dropped to ∼ 20% as opposed to ∼ 95% for the C-code version. To understand what was going on we first tried to make sure that both implementations of the waveform generation were consistent. Unfortunately, this proved to be almost impossible as the two codes used many different conventions, for example:

• In order to compute the detector-frame waveforms for a given source, the C-code would use Handford as a reference point, by generating the waveform at this site first and then time-shifting and projecting it onto the two other detectors. On the other hand, Bilby and LALInference generate the source-frame waveform directly at the center of the Earth, before time-shifting and projecting it onto the interferometers. While these two methods are equivalent on the paper, they require a very different implementation code-wise, making each step of the waveform generation difficult to compare.

• The GMST was an input for the C-code, while computed on the fly given {α, δ, t c } in Bilby.

• Last but not least, the convention for the sign of the exponent when computing the discrete Fourier transform was different, with the C-code using a plus sign, while LALSimulation and Bilby follow the Numpy convention with a minus sign.

As a result we decided to pursue our investigations differently. We reduced the dimensionality of the problem by running the HMC on several subsets of parameter space, keeping other parameters constant. The idea being to gradually increase the dimensionality of the problem in an effort to identify problem parameters in the analysis. We saw, for example, that if q µ was restricted to {φ c , ln D L , ln M, ln µ, ln δt c }, numerical trajectories were almost always accepted, as expected. However, once any of the parameters {cos θ JN , ψ, sin (δ) , α} were introduced, we observed a drop the gradients of the log-likelihood with respect to α and sin (δ) displaying local instabilities several orders of magnitude larger than expected. This results, as shown in the bottom cell, in a large impulse in their respective momenta, and hence in the total kinetic energy. As this is not compensated for by the potential energy, the Hamiltonian is no longer conserved, and the trajectory is rejected.

in acceptance rate. While this drop was limited to ∼ 10% when introducing cos θ JN or ψ, as soon as either sin (δ) or α were included in q µ the acceptance rate dropped drastically by ∼ 80%. This seemed strange at first since these two parameters do not appear in the phase of the waveform, but only when projecting it onto the detector frame using the antenna patterns (F + , F × ) and then when time-shifting the waveform from geocenter to each interferometer. This meant that the issue was not caused by LALSimulation, but by the waveform projection used by Bilby. As trajectories are usually rejected when the Hamiltonian is not conserved along the path, to better understand what was happening, we plotted the gradients of the log-likelihood with respect to sin (δ) and α along each step of a trajectory as shown in Fig. 7.1. We can see that both gradients display a number of massive spikes along the trajectory where a smooth behaviour is expected. These instabilities in the gradients act like strong kicks, sending the trajectory away from its initial Hamiltonian path onto a higher energy level. As a result the Hamiltonian at the end of the trajectory is greater than that at the start by several orders of magnitude and the proposed point has effectively no chance of being accepted.

After we checked that Bilby and the original C-code were producing equivalent antenna patterns projections, it suggested that the probable culprit was the part of the code responsible for the time-shifting, which was one of the main differences between the two packages. Upon investigation, we confirmed that the spiked behaviour in the gradients was indicative of a numerical precision issue, and was indeed the cause of the problem.

Let us describe how the time-shift computation arises in Bilby. Once the source-frame polar-izations have been generated by LALSimulation, by convention at t c = 0, and projected onto a given detector using (F + , F × ), the waveform obtained must be time-shifted by the duration to coalescence in a given interferometer, denoted δt if o c . As the GW is characterized by a single time parameter, Bilby conveniently uses the time at coalescence measured by a detector placed at the center of the Earth as a reference time. From now on, t c will refer to this time. Not only is it detector independent, but it allows us to compute the waveform time delay between the center of the Earth and any detector1 , denoted δt geo-ifo , in a systematic way using: (i) the detector's coordinate on the surface, (ii) the GMST and (iii) the sky localization of the source. Therefore the total time-shift δt if o c is computed as

δt if o c = t c -t s + δt geo-ifo (α, δ, GM ST ), (7.1)
where, t s is the start time of the analysis, common to all three detectors. Note that δt c , defined in section 6.1.2 by δt c = t ct s , appears as the duration of the signal until coalescence as would be measured at the center of the Earth. However Bilby's implementation was coded as

δt if o c = t c + δt geo-ifo (α, δ, GM ST ) -t s , (7.2)
where the only difference between Eq. (7.1) and Eq. (7.2) is the order in which terms are added on the right hand side. While addition is commutative, the ordering of terms in an expression matters in Python. In the above equation, t c and t s are GPS times on the order of 10 9 s. On the other hand, the offset used when varying (α, δ) to compute their numerical gradients leads to variations in the time delay δt geo-ifo of order 10 -7 s. To store a double precision number in 64 bits requires a 52 bit mantissa [158]. Therefore, storing a number such as 10 9 ∼ 2 30 leads to a spacing precision of 2 (30-52) = 2.4 × 10 -7 . This meant that when Bilby calculated the quantity t c + δt geo-if o , it would round off the value of the addition and as a result would leave the value unchanged at times. This translated into a steppy, rather than smooth, evolution in the value of δt if o c as (α, δ) were changed, and consequently also in the value of the log-likelihood itself. This behaviour is demonstrated in Fig. 7.2 where we plot the time to coalescence in Handford as a function of α, using Eq. (7.2). The function is steppy with a height between each step precisely equal to 2.4 × 10 -7 . This behaviour leads to numerical derivatives that can be either zero or close to infinity, causing the Hamiltonian trajectories to diverge, and resulting in a very low acceptance rate.

A simple workaround for this issue was to change Eq. (7.2) for Eq. (7.1) which modified the order of computation. This way, δt c = t c -t s is computed first, producing a number on the order of 10 2 s and no rounding off error afterwards. We should emphasize that the simplicity of the equation and the associated line of code made it very hard to find when digging into the software library to try to understand what was damaging the gradients. As we expected the issue to be elsewhere in the code, it took us ∼ 3 months to finally bring this problem to light. Once the solution was implemented, the acceptance rate in Phase I went from ∼ 20% to ∼ 70%. This was clearly much better, but not quite at the ∼ 95% level expected.

Problems with re-mapping cos θ JN into its natural interval

After scrutinizing rejected trajectories using phase space plots in (q µ , p µ ), it became quite clear that a large number of rejections occurred when cos θ JN was about to step out of its [-1, +1] interval. In the C-code HMC, when this happened, the implemented solution was to manually remap cos θ JN into its natural range by subtracting 2 if cos θ JN > 1 and by adding 2 if cos θ JN < 1. Not only did it keep cos θ JN bounded, but it also provided a way for the algorithm to make modehop jump proposals going from the face-on mode where cos θ JN = 1 directly to the face-off mode where cos θ JN = -1, thus accelerating the exploration of the potentially bi-modal distribution.

However, when investigating the trajectory plots produced by our Python implementation, this re-mapping was clearly causing many of them to be rejected. As a consequence we decided to replace the re-mapping with a reflective boundary condition where we would reverse the momentum, p cos θ JN → -p cos θ JN whenever cos θ JN tried to go out of range. This new boundary condition worked well as trajectories approaching the ±1 boundaries were no longer rejected and the acceptance rate in Phase I went from ∼ 70% to ∼ 80%. We should highlight however that by doing so our algorithm lost its ability to visit easily the two face-on, face-off modes. The reason why the initial re-mapping did not work in the Python version remained a mystery for some time. It was only when solving problems in Phase III that we realised the issue arose from using our own version of the TaylorF2 waveform, and not the LALSimulation version. Since section 7.2.2 is devoted to this problem, we differ the explanation until then.

Zero padding issues

While ∼ 80% of numerical trajectories being accepted was better than before, we were still not quite at the ∼ 95% expected with our settings. Moreover some of the rejected trajectories were still displaying unexpected behaviour. Out the remaining ∼ 20% of rejected trajectories, a large number of them were showing occasional divergences in ∂ ln L/∂ ln µ, where this numerical gradient would blow up in a similar fashion as shown in Fig. 7.1 for ∂ ln L/∂α and ∂ ln L/∂ sin (δ). While this happened only a small number of times, maybe only two to three times in a 200 step trajectory, it resulted in trajectories where the Hamiltonian was not conserved. Scrutinizing what was happening at each peak, we understood that they originated from the zero-padding applied to each TaylorF2 waveform generated by LALSimulation.

The TaylorF2 waveform is an inspiral phase only model, based on a PN expansion in v/c. Assuming v/c 1, the expansion breaks down as the two bodies approach the non-linear regime close to merger. To terminate the waveform, LALSimulation uses the frequency of the Inner-most Stable Circular Orbit, f ISCO , given in Eq. (1.93), which is inversely proportional to the total mass of the system. The TaylorF2 phase is then computed up to this frequency and LALSimulation returns a waveform array padded with zeros between f ISCO and f max = f N yquist = f s /2, where f N yquist is the Nyquist frequency of the analysis, which is related to the sampling frequency f s . This array contains frequency bins separated by δf = 1/T , where T is the duration of the signal, meaning for example that a typical 64 s duration leads to δf = 1.5625 × 10 -2 Hz. Due to the discritization of the waveform array, it is highly unlikely that f ISCO will ever be represented by an integer frequency bin, therefore f ISCO is almost always located between two bins, f - bin < f ISCO < f + bin , where (f - bin , f + bin ) are the two closest integer frequency bins below and above the value of f ISCO in the array of frequencies. As a consequence, zero padding starts from f + bin which has a frequency value slightly greater than f ISCO . In the C-code HMC, to compute (∂ µ ln L) num (q µ ) we would calculate a single f ISCO (q µ ), and then pass it as an input to our version of the TaylorF2 to generate waveforms at q µ ± ∆q µ . On the other hand LALSimulation re-calculates f ISCO (q µ ± ∆q µ ) at each waveform call. Now when computing ∂ ln L/∂ ln µ using central differencing, we offset ln µ by ±10 -7 meaning the total mass and in its turn f ISCO are shifted by a small amount, typically 10 -4 Hz. Therefore it sometimes happens that the waveforms computed at ln µ ± 10 -7 produce two f ISCO located in-between two different frequency bins, which could not happen in our own version of TaylorF2 . As a result, one waveform is padded with zeros one bin earlier than its counterpart and this difference is enough to again produce a steppy log-likelihood, generating an erroneous exploding gradient value.

After correcting this issue, the acceptance increased to ∼ 90%. We should note that this issue is related to inspiral-only approximants in LALSimulation, such as TaylorF2 , and does not apply to the IMRPhenom family for instance, as they include the Inspiral, Merger and Ringdown and do not need to stop abruptly at f ISCO .

Optimized momentum inversion for boundary reflections

At this point, the acceptance rate in Phase I was much closer to our expectations. Nevertheless, by plotting the Hamiltonian along the path of some of the rejected trajectories we could see that this quantity would suffer from a slight bump in value (upwards or downwards) whenever a reflection on a parameter boundary was performed through inversion of the corresponding momentum. To check whether the trajectory should bounce on a boundary, we check at each step of the leapfrog algorithm that for each parameter, q µ (τ + µ ), defined in Eq. (5.46), is inside its range. If it is outside for one parameter, the C-code HMC was negating the half-step updated momentum: pµ (τ + µ /2) → -p µ (τ + µ /2) and add it to q µ (τ ). However we found that the Hamiltonian is more accurately conserved if the negation of the momentum is done at the first step of the leapfrog. This implies that we revert to the yet un-updated momentum, pµ (τ ) → -p µ (τ ), then recompute pµ (τ + µ /2) and finally perform the full step in position.

Although this behaviour was part of the inherited HMC code, the latter did not suffer much from it because it was only using reflections on {ln D L , ln M, ln µ}. As we explained earlier we now use reflective boundaries for cos θ JN and it is generally the parameter most subject to such situations because of its poor resolution by our detectors translating into a wide exploration of the inclination range.

Once this issue was corrected, the acceptance rate in Phase I increased to around 95% and all rejected trajectories scrutinized displayed a normal behaviour where the reason for rejection was due to the inability of the numerical integrator to perfectly conserve the Hamiltonian along a path. As a consequence we were finally able to move onto implementing Phases II and III hoping to face a simpler integration of the code.

Problems with Phase II and III

Unfortunately, once again, getting Phases II and III up and running did not turn out to be as easy as expected. After translating the original routines which derived the cubic fit coefficients, as well as those that created the OLUTs during Phase II into Python, the analytical trajectories during Phase III were mostly rejected, producing an acceptance rate of ∼ 10% during this phase when we were expecting ∼ 80%. It meant that for some reason the cubic-OLUTs approximations were not producing an accurate fit of the data gathered during Phase I. After investigation, it turned out that the problem was a difference of definition of the phase of coalescence, φ c , between the C-code and LALSimulation. We will detail below the cause of the problem, and the subsequent solution.

Probing the goodness of a fit

Our first idea was to compare the numerical and approximate gradients from Phases I and III, and test the goodness of fit during Phase II. To do this, we used the set of numerical gradients from Phase I, {(∂ µ ln L) i num }, and the approximate gradients based on the fits in Phase II, {(∂ µ ln L) i app }, to produce regression plots, along with the coefficient of determination, R 2 , defined as

R 2 = 1 - SS res SS tot = 1 - N i=1 (∂ µ ln L) i num -(∂ µ ln L) i app 2 N i=1 ((∂ µ ln L) i num -(∂ µ ln L) i num ) 2 . (7.3)
Here N is the number of data points, SS res is the residual sum of squares, SS tot is the total sum of squares, and

(∂ µ ln L) i num = 1 N i=N i=1 (∂ µ ln L) i num , (7.4)
is the mean. If the approximated data is equivalent to the numerical data then SS res = 0, R 2 = 1, and the data lies along the diagonal line (∂ µ ln L) num = (∂ µ ln L) app . By weighting the quadratic error with the variance of the data set we can fairly compare the goodness of the fit over the different gradients. A common way of interpreting the R 2 value is as a percentage. So, for example, R 2 = 0.70 indicates that 70% of the data fits the regression model. For our use cases, we find generally that a good value for the coefficient of determination satisfies R 2 > 0.90.

For this comparison, we ran Phase I for 1500 numerical trajectories of length l = 200. This run had an acceptance rate of 98.7% and produced 296 200 data points. We then ran Phase II to fit the coefficients of the cubic approximation and construct the OLUTs, and finally calculated the approximated gradients at each point in the Phase I data set.

In Fig. 7.3, we show the regression plots and their corresponding R 2 values for each of the nine gradients. We also include contours which encompass 90%, 99% and 99.9% of the data respectively, allowing the reader to visualize deviations from the diagonal. Except for the gradients with respect to cos θ JN and ln D L , where R 2 ≥ 0.93, the other gradient plots display a large dispersion in the data away from the diagonal, with values of R 2 ≤ 0.75, implying a failure of the approximate gradient methods in reproducing the Phase I numerical gradients. We note that the OLUT gradient approximations perform better than the cubic-fit approximation. even though it has some trouble fitting the gradient with respect to ψ (R 2 = 0.69). This is most likely due to the multi-modal nature of this parameter in the likelihood surface. The clear conclusion from this study was that the approximate gradients produced by the cubic-OLUTs method were incapable of conserving the Hamiltonian in Phase III, hence leading to most of the trajectories being rejected.

Poor performances of a fit on the data used to derive it might have different origins, such as

• The set of points to fit may not be big enough and the method needs more points. A classic example is that of a linear fit in N dimensions. It is defined by N + 1 coefficients and hence needs a minimum of N + 1 data points to solve a system of N + 1 linear equations which will allow for the derivation of each coefficient. Often, the collected data points are usually noisy, subject to fluctuations in the measurements. As a result it is usually necessary to increase the number of points used in order to decrease the statistical uncertainty. The cubic fit in 9 dimensions requires 227 coefficients for each gradient to be fitted. For the C-code HMC, running Phase I on an acceptable timescale was the primary goal. As a consequence, ∼ 300 000 data points was found to be the minimum number required to produce a good acceptance rate in Phase III.

• The set of points to fit might need to be cleaned or pre-processed. Polynomial fits for instance are known to behave badly when a few outliers are part of the training data; removing them might increase the overall accuracy.

• The approximation method might not be sophisticated enough to capture the complexity of the gradient function ∂ µ ln L(q µ ). If so, not much can be done except changing to another method. This is exactly what happened previously where the global cubic-fit approximation could not cope with bi-modalities in some of the parameter distributions, and was replaced with a local fit based the OLUTs.

To try and address the first two possibilities, we increased the Phase I data set to ∼ 500 000 points and then removed outliers, but no improvements to our results were seen. Even though in the end the third possibility turned out to be the reason for failure of Phase III, it seemed very unlikely at the time since the cubic-OLUTs method worked perfectly in the C-code HMC version. This suggested that the problem was likely to be related to differences arising from the integration of the algorithm into its new framework.

Different definitions for φ c between the C-code and LALSimulation

In this section we will explain how the surprising failure of the cubic-OLUTs to fit gradients of the log-likelihood in the Bilby implementation arose from two different definitions of the phase at Since we again suspected the change in the waveform generation module to be at the origin of the problem, we first decided to test different waveform approximants available in LALSimulation. Amongst them was IMRPhenomP [START_REF] Hannam | Simple Model of Complete Precessing Black-Hole-Binary Gravitational Waveforms[END_REF][START_REF] Chatziioannou | Constructing Gravitational Waves from Generic Spin-Precessing Compact Binary Inspirals[END_REF], a widely used precessing model which not only contains full spin effects, but also all three IMR phases of the coalescence. To keep the comparison simple, we kept spin parameters constant at zero such that the analysis remained 9-dimensional. This approximant also presents the advantage of having a reduced order quadrature (ROQ) basis [START_REF] Antil | Two-Step Greedy Algorithm for Reduced Order Quadratures[END_REF][START_REF] Canizares | Gravitational Wave Parameter Estimation with Compressed Likelihood Evaluations[END_REF][START_REF] Canizares | Accelerated Gravitational Wave Parameter Estimation with Reduced Order Modeling[END_REF] permitting an acceleration of the log-likelihood computation by several orders of magnitude, therefore reducing the run time of Phase I and of the different tests we were about to pursue. However, we immediately found that a run carried on a different BNS injection with IMRPhenomP-ROQ [START_REF] Smith | Fast and Accurate Inference on Gravitational Waves from Precessing Compact Binaries[END_REF] produced the same failure of the cubic-OLUTs to approximate gradients from Phase I.

So to solve this issue we used the same strategy that allowed us to gradually pin-point where and why Phase I was not working: we set some parameters to fixed values and ran Phase I and II on different sub-sets of the entire parameter space. It became clear that as soon as either φ new c or ψ were kept constant in the analysis the cubic-OLUTs method was able to fit correctly the data. Looking at corner plots of the data gathered during Phase I when including all nine parameters, φ new c and ψ have the peculiarity of being highly multi-modal and mutually correlated. This is shown on Fig. 7.4 where, projected on the {φ new c , ψ} plane, we plot the 296 200 positions gathered by numerical trajectories. We should highlight that this bi-modality in φ c was not observed in the C-code version of the HMC.

To understand this difference, we need to investigate how the phase at coalescence arises in the waveform equations. Following the literature [START_REF] Buonanno | Comparison of Post-Newtonian Templates for Compact Binary Inspiral Signals in Gravitational-Wave Detectors[END_REF], the C-code used the following formula to implement the TaylorF2 approximation of the waveform

hifo (f ) = AQ exp -i 2πf δt if o c -φ old c - π 4 + Φ 3.5 (m 1 , m 2 , f ) , (7.5)
where A is an amplitude factor directly proportional to M 5/6 f -7/6 /D L , Φ 3.5 is the 3.5PN expansion of the gravitational waveform phase and Q is given in Eq. (1.109). On the other hand, the LALSimulation implementation of TaylorF2 is consistent with Fourier transforming the detector-frame time domain waveform in Eq. (1.111) which yields

hifo (f ) = AQ exp -i 2πf δt if o c -φ new c - π 4 + ϕ(F + , F × , cos θ JN ) + Φ 3.5 (m 1 , m 2 , f ) , (7.6)
where ϕ(F + , F × , cos θ JN ) is given in Eq. (1.110).

Comparing Eq. ( 7.6) and Eq. ( 7.5) reveals how the codes used different definitions for the phase at coalescence which we can relate with the following equation

φ old c = φ new c -ϕ(F + , F × , cos θ JN ). (7.7)
As long as only one interferometer is involved in the estimation of the parameters, redefining φ c as φ old c with Eq. (7.7) only shifts its estimated value and has no further impact as it appears only as a constant of integration in this case. However when performing a coherent analysis over a network of detectors, each having different antenna pattern functions, it completely modifies the coherent phase-matches at each interferometer between the generated templates and the signals detected. Since the C-code HMC version was only tested on injections of fiducial GW generated with Eq. (7.5) and would generate templates for the phase-match with the same formula, its analysis completely missed that the coherent phase-match actually depends on (α, δ, ψ, cos θ JN ). As a result, correlations between these parameters and the phase at coalescence are different when considering φ old c or φ new c . In turn this impacts all of the phase dependent parameters, especially (δt c , M, µ). This difference in definition, and the fact that the original C-code HMC was never designed to cope with multi-modalities in φ c , explains why the cubic fit failed in approximating the gradients.

It also explains why the mode-hop scheme on inclination used previously was now causing numerical trajectories in Phase I to be rejected. When cos θ JN was equal to ±1, swapping for the other face-on/off mode by adding ∓2 has no impact on Eq. (7.5) since it only depends on cos 2 θ JN via Q. Hence the waveforms generated by the C-code HMC would be the same, meaning the log-likelihood and in turn the Hamiltonian would be conserved. However, when including the additional phase term, this action caused a modification of the phase which was sufficient enough to cause divergence in the Hamiltonian, and rejected trajectories.

With the origin of the failure of the cubic-OLUTs to fit the data now identified, we investigated if we could solve the problem by applying a phase marginalization.

Marginalizing over the phase at coalescence

While φ c appears in the phase of the waveform, it is an extrinsic parameter, and its value bears no information on the binary system in question. As a consequence, we can treat this parameter as a nuisance parameter in the Bayesian analysis, and hence marginalize when possible.

Fortunately, in certain cases, an analytical marginalization of φ c is possible. If we name q µ the set of all the astrophysical parameters except φ c , then the goal of our analysis becomes the estimation of the phase-marginalized posterior distribution p( q µ |s). This is related to the full posterior distribution via p(q µ |s) = p( q µ |s)p(φ c |s). Substituting this into Bayes theorem, Eq. (3.62) yields

p( q µ |s)p(φ c |s) = L(s|q µ )π(φ c )π( q µ ) p(s) . (7.8)
To marginalize over φ c , we integrate both sides between [0, 2π]

p( q µ |s) 2π 0 p(φ c |s)dφ c = 2π 0 L(s|q µ )π(φ c )dφ c π( q µ ) p(s) . (7.9)
The integral on the left side sums up to 1, by definition, meaning we can interpret the integral in the numerator as the marginalized likelihood L φc marg L φc marg (s| q µ ) = By plugging the previous equation into the likelihood formula from Eq. (3.46), and by using a uniform prior on φ c , which in practice is always the case, we arrive at the following expression for the marginalized log-likelihood [START_REF] Veitch | -v1: Analytic Marginalisation of Phase Parameter[END_REF][START_REF] Thrane | An Introduction to Bayesian Inference in Gravitational-Wave Astronomy: Parameter Estimation, Model Selection, and Hierarchical Models[END_REF] ln L φc marg (s| q µ ) = Ψ -

1 2 s|s - 1 2 h0 h0 + ln I 0 s h0 C , (7.12)
where Ψ is a normalizing constant, I 0 (x) is the modified Bessel function of the first kind and we use the complex version of the noise-weighted-inner-product, Eq. (3.31), to preserve phase information.

It is important to remember that Eq. ( 7.12) is valid as long as our primary assumption that the waveform is represented by the 22 mode in the spherical harmonic decomposition. This hypothesis is valid for approximants such as TaylorF2 [START_REF] Blanchet | Gravitational-Radiation Damping of Compact Binary Systems to Second Post-Newtonian Order[END_REF][START_REF] Blanchet | Gravitational-Wave Inspiral of Compact Binary Systems to 7/2 Post-Newtonian Order[END_REF], IMRPhenomD [START_REF] Husa | Frequency-Domain Gravitational Waves from Non-Precessing Black-Hole Binaries. I. New Numerical Waveforms and Anatomy of the Signal[END_REF][START_REF] Khan | Frequency-Domain Gravitational Waves from Non-Precessing Black-Hole Binaries. II. A Phenomenological Model for the Advanced Detector Era[END_REF] and IMRPhenomP [START_REF] Hannam | Simple Model of Complete Precessing Black-Hole-Binary Gravitational Waveforms[END_REF][START_REF] Chatziioannou | Constructing Gravitational Waves from Generic Spin-Precessing Compact Binary Inspirals[END_REF] which are widely used in the collaboration daily analysis, but it breaks down for waveforms making use of higher order modes. Using Bilby's implementation of Eq. ( 7.12) we re-ran Phase I with this new setting and using IMRPhenomP-ROQ [START_REF] Smith | Fast and Accurate Inference on Gravitational Waves from Precessing Compact Binaries[END_REF].

To our surprise, almost all numerical trajectories in Phase I were rejected. An analysis of trajectories showed that ∂ ln L φc marg /∂ ln D L was wrongly computed. The reason for this comes from an analytical trick we had been using from the beginning to compute gradients of the loglikelihood with respect to ln D L , without using numerical differencing, that was no longer valid. To explain this shortcut we used, we recall that the reduced log-likelihood, Eq. (3.48), is defined by ln L R = s|h -h|h /2. Taking its generic derivative gives

∂ ln L R ∂q µ = s ∂ h ∂q µ -h ∂ h ∂q µ . (7.13)
However with respect to luminosity distance, as

h ∝ 1/D L results in ∂ h/∂ ln D L = -h, this leads to ∂ ln L R ∂ ln D L = -s h + h h . (7.14)
This analytical expression allows us to economize one waveform generation, which forward differencing needs to approximate the gradient. It was hence used to save computational time during Phase I. However, now that we marginalize over phase at coalescence, we must take the gradient of ln L φc marg using Eq. (7.12). The modified Bessel function makes the previous equation inapplicable in that case. We corrected this error and computed ∂ ln L φc marg /∂ ln D L with forward differencing but still using the shortcut

h(D L + ∆D L ) = D L (D L + ∆D L ) h(D L ), (7.15)
avoiding the supplementary source-frame waveform generation and where ∆D L is the offset used for forward differencing.

A second adjustment needed to be applied to the FIM, Γ µν = ∂ µ h ∂ ν h , which we use to estimate the dynamic scales s µ at the start of the algorithm. When marginalizing over phase at coalescence, the FIM must be projected onto the sub-space excluding φ c . This projection can be justified geometrically [START_REF] Porter | Computational Resources to Filter Gravitational Wave Data with P-Approximant Templates[END_REF]. As we argued in section 3.3.2, the FIM is a local approximation of the metric on the D-dimensional manifold where templates h(q µ ) live, and defines the proper distance between two adjacent templates. The metric tensor must then be projected onto the new D -1 dimensional manifold such that the proper distance h(q µ + ∆q µ ) -h(q µ ) is also minimized. The projected FIM Γµν can be computed as [START_REF] Porter | Computational Resources to Filter Gravitational Wave Data with P-Approximant Templates[END_REF]

Γµν = Γ µν - Γ µφc Γ φcν Γ φcφc . (7.16)
Once these two adjustments identified and implemented, we successfully ran Phase I marginalizing over φ c and gathered 296 600 data points after 1 500 numerical trajectories. In Fig. 7.5 we provide the new regression plots for the 8 gradients of the log-likelihood and give their corresponding coefficient of determination. Contrary to Fig. 7.3, where φ c was not marginalized, all parameter gradients now have R2 values which are very close to unity, meaning that in this case, the cubic-OLUTs method is now able to correctly approximate the gradients of the log-likelihood. Assuming that we had correctly identified the problem, and found an adequate solution by maximizing over φ c , we ran Phase III for 100 000 trajectories. At the end of the run, we had an acceptance rate of 87.3%, which is reflective of what is be expected as an acceptance rate in Phase III (∼ 80%), according to the results in [START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF].

Marginalizing over the phase at coalescence is therefore a successful alternative which resolves the failure of the cubic approximation in dealing with multi-modal posterior distributions for φ c . This method is only applicable to the 22-mode of the waveform in its current form, and it is not clear how well it would work for waveforms with higher order modes. Other avenues, such as quartic and quintic gradient approximations, or radial basis functions, were investigated in [START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF] as replacements for the cubic fit approximation, but none of the methods were successful in addressing the multi-modality of the posterior distributions. This failure eventually lead to the solution of using OLUTs. A potential solution, if we were to carry out a analysis with higher-order modes, would be to move completely to using OLUTs. This may solve the problem for multi-modal parameters, and while faster than numerical gradients, would nonetheless result in a Phase III that is significantly slower than the cubic fit -OLUTs approximation.

First analysis of real data by the HMC

So far the HMC has only been tested on a fiducial signal injected into simulated Gaussian noise, whether it be the C-code version or the results presented above with the new integration scheme. Furthermore, the PSDs used were smooth analytical approximations to the real noise entering the detectors. Real PSDs are in fact complicated noisy curves, displaying for instance high peaks at particular frequencies as we saw on Fig. 3.1 2 . The performances and ability of the HMC to infer the parameters of a real GW signal was yet to be proved.

As a consequence, now that all phases of the algorithm were working, we decided to focus our analysis on real data. To do so, we used the highest SNR BNS signal detected so far, GW170817. For this we used the strain data [START_REF]GW170817 Data Release[END_REF] and PSDs [START_REF]Power Spectral Densities (PSD) Release for GWTC-1[END_REF] used for the GWTC-1 catalog [START_REF]GWTC-1: A Gravitational-Wave Transient Catalog of Compact Binary Mergers Observed by LIGO and Virgo during the First and Second Observing Runs[END_REF], which are publicly available on the GWOSC website [START_REF]Open Data from the First and Second Observing Runs of Advanced LIGO and Advanced Virgo[END_REF]. To prepare for the inclusion of aligned-spins in the algorithm, and to avoid any problems related with zero padding as described earlier, we decided to use the IMRPhenomD approximant instead of TaylorF2 , with the two spin components set to zero throughout the analysis. IMRPhenomD is a slightly more expensive approximant since it takes ∼ 12 ms to generate a 59 s long source frame waveform against ∼ 10 ms for TaylorF2 .

To prepare for a future comparison of our results with LALInference, we decided to also include astrophysical priors in the analysis of the HMC for the first time. Before continuing, we will first describe how prior knowledge has to be taken into consideration in our algorithm and then detail the results obtained on GW170817.

Including astrophysical priors

Priors in the HMC

As we mentioned in section 6.1.2 and 6.1.5, out of simplicity the C-code HMC considered uniform priors in all canonical parameters q µ , defined in Eq. (6.4), over a predefined range of allowed values. This way the gradient of the log-prior in the scaled leapfrog, Eq. (5.46), and prior ratios in the MH step, Eq. (5.14), could be ignored. This means that we were implicitly using, for example, uniform Regression plots comparing the approximate gradients, (∂ µ ln L) app , with the numerical gradients, (∂ µ ln L) num , using an identical data set of 296 600 points representing { q µ , (∂ µ ln L) num } used to derive the fit methods and gathered on injected data. The three contours encompass 90%, 99% and 99.9% of the data respectively. Gradients with respect to cos θ JN , ψ and ln D L are approximated with a local fit using Ordered Look-Up Tables (OLUTs), while all other gradients are approximated with a global cubic fit. All R 2 are very close to unity meaning the cubic-OLUTs method is able to correctly approximate the data, at least on the set of points used to derive the fit. priors in ln D L , ln M and ln µ while there is no astrophysical motivation to believe that D L , M and µ follow such a distribution in the universe. However, the analysis of GW170817 carried out by the LVC accounted for astrophysically motivated prior beliefs. For a direct comparison with published results, we now have to include them in the HMC.

Priors are usually dependent on the astrophysical parameters, i.e. π = π(λ µ ) . However, to optimize performance, the HMC defines a mapping between the λ µ and the canonical parameters q µ . Therefore Hamilton's equation relating the momentum's time derivative to the gradient of the potential energy, Eq. (5.26), is written as

dp µ dt = - ∂U ∂q µ = ∂ ln L(q µ ) ∂q µ + ∂ ln π(q µ ) ∂q µ , (7.17)
To relate the two prior functions π(λ µ ) and π(q µ ), we use a map between parameters, for example when going from D L to ln D L . Then using the change of variable formula we can write

π(q µ ) = π (λ µ (q µ )) |J f | -1 (q µ ), (7.18)
where J f is the determinant of the Jacobian of the map f . For ln D L , ln M, ln µ and ln δt c , the Jacobian is defined by

|J ln | -1 (λ µ ) = d ln λ µ dλ µ -1 = λ µ , (7.19)
while for cos θ JN we have

|J cos | -1 (θ JN ) = d cos θ JN dθ JN -1 = 1 sin(θ JN ) , (7.20)
and finally for sin(δ), we have

|J sin | -1 (δ) = d sin(δ) dδ -1 = 1 cos(δ) . ( 7

.21)

For the mass parameters, priors are usually defined on the component masses m 1 and m 2 . However, as we sample in the logarithm of chirp-mass and reduced-mass, these two transformations have to be properly accounted for. The change in variables is now two-dimensional and Eq. (7.18) is given by

π(ln M, ln µ) = π(m 1 (M, µ)) π(m 2 (M, µ)) J (m1,m2)→(ln M,ln µ) (M, µ) -1 , (7.22)
where J (m1,m2)→(ln M,ln µ) is the determinant of the Jacobian matrix defined for the transformation (m 1 , m 2 ) → (ln M, ln µ). As the right hand side is not separable, we cannot express the corresponding prior distributions on ln M and ln µ alone, as these two parameters are linked by a joint prior distribution. Using the chain rule, the previous Jacobian determinant can be expanded as

J (m1,m2)→(ln M,ln µ) = J (m1,m2)→(M,µ) J (M,µ)→(ln M,ln µ) . (7.23)
The inverse Jacobian for the logarithm function was derived in Eq. ( 7. [START_REF] Baumgarte | Numerical Relativity: Solving Einstein's Equations on the Computer[END_REF]), thus we get

J (m1,m2)→(ln M,ln µ) -1 = J (m1,m2)→(M,µ) -1 M µ, (7.24)
and finally we can write

π(ln M, ln µ) = π m1 (M, µ) π m2 (M, µ) J (m1,m2)→(M,µ) -1 M µ, (7.25)
where

J (m1,m2)→(M,µ) = 2 5 M m 1 -m 2 (m 1 + m 2 ) 2 . (7.26)
This result is derived in appendix A. We now have the full range of information needed to apply astrophysical priors to our analysis. is the GPS geocenter time of coalescence as reported by the detection pipeline, ie: 1187008882.43s and t s is the GPS start time of the analysis.

Current astrophysical priors used in Bayesian inference.

We follow LALInference's choices of priors on GW170817, reported in [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF] and detailed in Table 7.1. The justification for these choices are • (α, δ): the distribution of sources in the sky is assumed to be uniform. An infinitesimal patch on a sphere of radius r has an area dA = r 2 cos(δ)dα dδ. Then, to account for a prior probability of all patches containing the source of the signal proportional to their area, π α is taken uniform over [0, 2π] and π δ cosinusoidal over [-π/2, π/2]. Thus, combining Eq. ( 7.18) and ( 7.21), we see that π(δ) cancels with the jacobian meaning that π(sin (δ)) is uniform over [-1, 1]. Another way to derive this result is to note that dA = r 2 dα d (sin (δ)).

• θ JN : a similar argument for the inclination angle leads us to define a sinusoidal function for π(θ JN ); meaning from Eq. ( 7.18) and (7.20) that π(cos θ JN ) is uniform over [-1, 1].

• D L : the distribution of sources is assumed to be uniform in luminosity volume. An infinitesimal spherical shell between D L and D L + dD L has a volume dV = 4πD 2 L dD L . Then, to account for a prior probability of a shell containing the source proportional to their luminosity volume, π(D L ) is taken to be quadratic. As we shall see for GW170817, using a 10 -100 Mpc range widely encompasses the uncertainty in D L . At such distances, the redshift is small (z < 0.03) meaning the expansion of the universe has little influence on the GW. However for higher redshift detections it would be more accurate to consider a distribution of mergers uniform in comoving volume.

• m 1 and m 2 : we do not make any astrophysical assumptions regarding the prior values of the component masses, hence we use a non-informative uniform prior. The limits are chosen wide enough to encompass the range of allowed BNS masses, constrained by the different equations of state from nuclear physics between 0.5 -3M [START_REF] Özel | Masses, Radii, and the Equation of State of Neutron Stars[END_REF]. Nevertheless Eq. ( 7.25) and (7.26) indicate that the joint prior distribution on chirp-mass and reduced-mass diverges, due to the inverse jacobian, on the equal mass boundary defined by m 1 = m 2 or equivalently by η = m 1 m 2 /(m 1 + m 2 ) 2 = 0.25. In terms of the gradient of the log-prior, we derive in appendix A.2 their analytical formula for the two masses which read

∂ ln π(ln M, ln µ) ∂ ln M = 5 2 - 5 4 η (1/4 -η) , (7.27) ∂ ln π(ln M, ln µ) ∂ ln µ = - 1 2 + 5 4 η (1/4 -η) . (7.28)
When a Hamiltonian trajectory gets too close to the equal mass line, these two gradients diverge to infinities, inducing an important and sudden energy transfer to the momenta p ln M and p ln µ which results in an unstable trajectory prone to be rejected. To correct this effect we shifted the boundary on η from 0.25 to 0.2499. Trajectories were then bouncing before the gradients would blow up and the acceptance rate got back to its expected value.

• (ψ, δt c ): a non-informative uniform prior is used over a range of values sufficiently large to encompass all regions of parameter space where the chain could explore.

A first application of the HMC to real data

With astrophysical priors included in the HMC, we ran this new version of the algorithm on a stretch of 59 s of GW170817 data sampled at 4 096 Hz, which corresponds to a starting frequency for the analysis of 30 Hz. To avoid burn-in, the chain was again started at a point we knew to be close to the likelihood peak.

Overall the switch from simulated to real data did not impact the algorithm's performance. Phase I of the algorithm was run for 1 500 trajectories, which took 34.4h, with 99.7% of numerical trajectories accepted. As a consequence we gathered 299 000 data points to conduct the cubic fit and create the OLUTs in Phase II. This phase only took ∼ 2 min and the resulting regression plots were very similar to those from the run on fiducial data (Fig. 7.5) as can be seen in Fig. 7.6. Once again this means that the algorithm was responding well to the analysis of real data. We ran Phase III until at least 5 000 SISs were gathered using the settings described in section 6.3. The overall acceptance rate in that phase dropped to 89.4%, which was expected. In Fig. 7.7, we plot the auto-correlation function of the chain for each parameter and indicate in the legend their ACL. We should mention that a first run returned a very high ACL for ψ, i.e. ∼ 300, leading us to manually set its scaling factor to 1 (representing about a third of its prior range), from its original FIM estimated value of 0.17. This reduced the random-walk behaviour in the ψ dimension and the ACL to a value of 26, which is on the same level as that of the other parameters. As the chain (δt c ) with the longest auto-correlation length had an ACL = 65, a total of 345 057 trajectories had to be run in order to gather 5 308 SISs. Out of the 343 557 Phase III trajectories, 341 898 were analytical, 1 519 hybrid and 140 numerical; leading to a run time for Phase III of 20.3 h3 . Since almost all SIS are gathered during Phase III, it means the HMC is able to collect 1 SIS every 13.9 s once Phase III starts.

In Fig. 7.8, we plot the marginalized posterior distributions for each of the 8 astrophysical parameters together with their prior densities. To allow for a comparison with the published results for GW170817, we super-impose the marginalized posterior densities produced by the LVC [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF] obtained with the LALInferenceMCMC algorithm [START_REF] Veitch | Parameter Estimation for Compact Binaries with Ground-Based Gravitational-Wave Observations Using the LALInference Software Library[END_REF][START_REF][END_REF] and using the IMRPhenomD-NRTidal [START_REF] Dietrich | Closed-Form Tidal Approximants for Binary Neutron Star Gravitational Waveforms Constructed from High-Resolution Numerical Relativity Simulations[END_REF][START_REF] Dietrich | Improving the NRTidal Model for Binary Neutron Star Systems[END_REF][START_REF] Dietrich | Matter Imprints in Waveform Models for Neutron Star Binaries: Tidal and Self-Spin Effects[END_REF] waveform model 4 . This model integrates the effects of aligned-spins and tidal deformabilites in the waveform phase and are highly correlated to component masses (see Chapter 8 for more details about these parameters). We should highlight that the LVC analysis starts at 23 Hz, which results in 128 s of strain data analyzed, against 59 s in our case as we started from 30 Hz. Furthermore, the LVC analysis marginalizes over calibration uncertainties in the phase and amplitude measurement of the interferometers, which has not yet been implemented in the HMC. Note also that the LVC analysis produced 6 624 SISs 5 , against 5 308 for the HMC. Since at this point the settings of our analysis differ a lot from these of the LVC we do not expect the posterior distributions to match perfectly. A comparison with much closer settings will be performed in Chapter 10. In Table 7.2 we compare the 90% credible intervals centered on the median produced by LALInferenceMCMC and the HMC. Fig. 7.8 allows us to understand how much additional information has been brought by the Bayesian analysis with respect to our prior belief. The measurement of a parameter is all the more constrained by the observation that its prior density appears effectively flat and close to the x-axis over the range of gathered samples. In this case only ψ is weakly informed by the GW observation as its posterior is dominated by its prior distribution. Except for component masses, our results are generally consistent with these published in [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF] as shown by the overlap of the posterior distributions of the HMC and LALInferenceMCMC. The large discrepancy for (m 1 , m 2 ) is due to the fact we have not yet introduced aligned-spins and tidal deformabilities, which are highly correlated with the mass parameters.

To summarize the algorithm's performance at this point, the HMC needed 54.7 h to produce 5 308 SIS when analyzing 59 s of real GW170817 data, using the IMRPhenomD approximant in an 8-dimensional analysis where aligned-spins are kept constant at zero and phase at coalescence is marginalized over. This run time is already between one and two orders of magnitude better than usual run times needed by LALInference. We know from past analyses [START_REF] Veitch | Parameter Estimation for Compact Binaries with Ground-Based Gravitational-Wave Observations Using the LALInference Software Library[END_REF][START_REF] Christopher | Parameter Estimation for Binary Neutron-Star Coalescences with Realistic Noise during the Advanced LIGO Era[END_REF] that it takes several weeks to produce a comparable number of SISs for BNS signals. However, we felt that Regression plots comparing the approximate gradients, (∂ µ ln L) app , with the numerical gradients, (∂ µ ln L) num , using an identical data set of 299 000 points representing { q µ , (∂ µ ln L) num } used to derive the fit methods and gathered on real GW170817 data. The three contours encompass 90%, 99% and 99.9% of the data respectively. Gradients with respect to cos θ JN , ψ and ln D L are approximated with a local fit using Ordered Look-Up Tables (OLUTs), while all other gradients are approximated with a global cubic fit. All R 2 are very close to unity meaning the cubic-OLUTs method is able to correctly approximate the data, at least on the set of points used to derive the fit. there was still room for significant optimization and fine tuning of the algorithm.

Improvements to the algorithm

Optimizing numerical gradient computations

Numerical gradients are computed using either central or forward differencing, defined in Eq. (6.5) and (6.6), which require respectively two and one additional waveform generations. As we already explained, this requirement to generate a lot of waveforms at every step of a trajectory is the bottleneck of the HMC. While this issue is being dealt with globally thanks to fitting methods in Phases II and III, there is still a way to reduce the computational time spent on numerical gradients in Phase I. The general idea is that h(q µ ) and h(q µ ± ∆q µ ) are very similar waveforms since only 1 input parameter out of 8 changes. As a waveform is computed in several steps where only a subset of the parameters are inputs of a given step, it is possible to store in memory, i.e. cache, each step sub-result when first generating h(q µ ), and reuse these cached sub-results when computing h(q µ ± ∆q µ ). We will describe this optimization below.

Firstly we begin by generating the source frame polarizations where, by convention, LALSimulation sets t c = 0 yielding

hs (f ; λ µ , t c = 0) = h+ (f ; φ c , θ JN , D L , m 1 , m 2 , S 1 , S 2 , Λ 1 , Λ 2 ) h× (f ; φ c , θ JN , D L , m 1 , m 2 , S 1 , S 2 , Λ 1 , Λ 2 ), (7.29)
where S i denote the spin vectors, and in the case of neutron stars, Λ i define the tidal effect terms.

Secondly the two polarizations are projected onto each interferometer, using the antenna pattern functions we described in section 1.6.3.1, by Fourier transforming Eq. (1.106) 7.1) and the marginalized posterior densities produced by the HMC and LALInferenceMCMC in [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF] on GW170817. The parameter estimates quoted represent the median values (solid line), 5% lower limit and 95% upper limit credible intervals. The discrepancy in the component mass posteriors between the HMC and LALInferenceMCMC are predominantly due to differences in the starting frequency and the use of a non-spinning waveform model in our analysis. The scale used for prior densities is such that they integrate to one over their predefined support and for the marginalized posterior densities such that they integrate to one over the range defined by posterior samples. Finally we time-shift the waveform by the duration to coalescence in the interferometer using Eq. (7.1). Performing a time-shift in the Fourier domain translates into a phase-shift at each frequency bin. As a result the final projected waveform at each interferometer is given by

hifo (f ; λ µ , t c = 0) = F + (ψ, α, δ, GM ST ) h+ (f ; λ µ ) + F × (ψ, α, δ, GM ST ) h× (f ; λ µ ). ( 7
hifo (f ; λ µ ) = hifo (f ; λ µ , t c = 0)exp -i2πf δt if o c . (7.31)
In addition to generating waveforms, one numerical gradients requires the computation of 3 ( 2) noise-weighted-inner-product per interferometer for central (forward) differencing. In Table 7.3 we detail the time taken for a one-time generation of ln L and (∂ µ ln L) num using 59 s of data, sampled at 4096 Hz, and using the IMRPhenomD waveform approximant for the steps described above. We should highlight that Eq. (7.31) is split into two parts: the exponentiation of the frequency array exp(-i2πf δt if o c ) and the multiplication of this array with non-shifted waveform at each detector hifo (t c = 0). We see that the total time taken is about 405 ms which is in perfect agreement with an independent timing of (∂ µ ln L) num giving 407 ± 10.7 ms. From the table, we can see that the main costs are coming from the generation of the source frame waveform and the time shift array. We can directly compare this number to the run time of the algorithm. Phase I took 34.4 h for 1 500 trajectories, meaning that each trajectory took 82 s to generate on average. Considering that all computational costs of a trajectory are due to the generation of the numerical gradients of the log-likelihood, this infers a computation time for the 8 gradients of 82/200 = 412 ms (since our trajectories are 200 steps long) which is again in very good agreement with our previous analysis.

To reduce this computation time, we observed upon inspection of Eq. ( 7.29) that we can use the same hs for every gradient except those with respect to cos θ JN , ln D L , ln M and ln µ. We then saw that the projection of the source frame waveform onto each interferometer via Eq. (7.30) needs all parameters except t c , so even though we could have saved a bit of time on ∂ ln δtc ln L we did not implement a saving there. Finally the exponentiation in Eq. (7.31) is a function of t c , α and δ only, so the gradients with respect of all other parameters can use a pre-computed value of this exponential term.

In Table 7.4, we present the same analysis as before but with the optimized gradient computation using the scheme we just described. The predicted timing of the optimized computation of (∂ µ ln L) num is now reduced to 273 ms. Re-running Phase I with the new implementation reduced the run time from 34.4 h to 22.2 h, meaning that each numerical trajectory now takes 53 s instead of 82 s beforehand, confirming that one (∂ µ ln L) num takes around 266 ms to generate.

To conclude this section, our optimization allowed us to speed Phase I up by a factor of 1.5. We want to highlight that contrary to Phase III where we trade speed-up, using analytical trajectories, with accuracy on the gradients calculated, here the speed-up is 100% beneficial since gradients computed with the optimized version are exactly equal to their predecessors. We shall add that it also has a positive impact on Phase III since hybrid and numerical trajectories are run during this phase when too many analytical trajectories are rejected in a row, and these trajectories will require numerical gradient calculation. indicates the estimation comes from the 1 500 Phase I samples, hence used at the beginning of Phase III while σ samples 10 000 is a new estimation derived after 8 500 Phase III trajectories and used until the end of the run. The two last columns give the integrated auto-correlation length corresponding to each situation where the maximum value is bolded. ACL(σ F IM ψ ) is starred because the 26 value was obtained by manually increasing the scales derived from the FIM from 0.165 to 1. and an upper bounds for the cost of a HMC implementation, the authors relax the recommendation by targeting acceptance rates in the range 65% a 90%. However we believe this argument is not applicable in our case since the assumption that a = a( ) only does not hold any longer. In Phase III the error in the conservation of the Hamiltonian is highly dependent on the accuracy of the cubic-OLUTs fit. We can ultimately run the HMC for several stepsizes until 5 000 SIS are collected and look at which produces the optimal run. We will use this benchmark approach here, but note that the optimal stepsize derived for one peculiar analysis would not remain optimal for other signals where the accuracy of the cubic-OLUTs fit and the dimensionality D would be different. Hence, we would rather find a way of optimizing on the fly, during the analysis of a particular signal. To do so we note that contrary to the 65% theoretical optimum, the expression for the cost C ∝ 1/(a ) (given by Eq. (5.52)), still holds in our case which means that we may be able to optimize the cost over stepsize values. A remaining problem is we cannot theoretically derive , before starting Phase III, the acceptance rate related to a given stepsize, and given the yet unknown accuracy of the fit method which was just derived during Phase II.

σ F IM σ samples 1 500 σ samples 10 000 ACL(σ F IM ) ACL(σ samples ) cos θ JN 1.73 × 10 -1 1.68 × 10 -1 1.63 ×
Our idea was then to conduct a rapid benchmark during Phase II of the theoretical costs produced by different central stepsizes. For each considered value of , we run N analytical trajectories, measure the acceptance rate a N ( ) and compute the estimated cost C N ( ) ∼ 1/ (a N ( ) ). The stepsize producing the lowest cost can then be chosen to run Phase III entirely. To decide on how many trajectories N to run, we should aim for a large enough number in order to properly estimate the acceptance rate, but not so big that it impacts the overall run time. Looking at results from the run used in section 7.4.2, the acceptance rate stabilized between 87-90% after 400 Phase III trajectories. Given that one trajectory (analytical, hybrid or numerical) took on average 0.24 s to compute, setting N = 400 means the benchmark with = 5 × 10 -3 would require ∼ 100 s. This is completely acceptable given the total run time of our algorithm (even though we know there will be an increase in runtime for higher central stepsize values). Given that larger central stepsizes increase the probability of the analytical trajectories being rejected, they would naturally produce lower acceptance rates, leading to many more hybrid and numerical trajectories which take much longer to run. We first decided to deactivate the hybrid and numerical trajectories during the benchmark so that the total benchmark time would be around ∼ 10 min when testing 6 different stepsizes. However, as expected, the chain would sometimes get stuck for ∼ 30 consecutive trajectories before it managed to unstick itself without any hybrid or numerical help. Hence the resulting estimated acceptance rate after 400 analytical trajectories, a 400 , could be wrong by ∼ 10%. In the end, we found that keeping numerical and hybrid trajectories but incrementing by 1 the successive rejection threshold, n srt , for invoking them (set to 3 initially), each time is doubled was a good trade-off empirically. In this case, the acceptance predictions are more robust and the benchmarking lasted 15 min.

Since we suspected the initial stepsize value 0 = 0.005 was too conservative, we tested upper values by successively doubling the previous value until 5 = 2 The analytical trajectories are run for each stepsize, modifying only the successive rejection threshold n srt after which we trigger a hybrid trajectory. Costs are estimated after 400 trajectories using Eq. (5.52) and normalized with C400 = C 400 /C min 400 . If we demand a cost of C400 ≤ 2, we can see that there are three combinations of ( , n srt ) better than the base assumption of ( 0 , n srt ) = (0.005, 3).

as, due to the high number of rejected analytical trajectories (a 400 = 17%), and hence the large number of hybrid/numerical trajectories generated (24/10), it accounted for one third of the total benchmark duration. The results of the benchmark are given in Table 7.6 where we have computed the normalized estimated costs for each case, C400 = C min 400 a 400 ( ) -1 , where C min 400 is the minimum cost found after 400 trajectories, equal to 26 here. We can see that, if we enforce a criterion of C400 ≤ 2, we have three combinations of ( , n srt ) that are superior to the base choice of (0.005, 3), i.e. (0.04, 6), (0.08, 7) and (0.16, 8). The results also indicate that in order to achieve a minimum cost of C400 = 1, the optimal combination would be ( 4 , n srt ) = (0.08, 7), producing an estimated acceptance rate after 400 analytical trajectories of 48%. Given that the cost for 0 is 8.8 times that of 4 , we expect to have a maximum ACL about nine times smaller by using 4 instead of 0 , and hence a reduction from ACL max ( 0 ) = 59 to ∼ 7.

Validating the benchmark predictions

Taking the benchmark predictions from Table 7.6, we ran a full Phase III in each case. As we are now aiming for different central stepsize values which optimize the cost, and as a consequence, might produce lower acceptance rates, we need to review the acceptance thresholds below which we run only hybrid and numerical trajectories in Phase III. In the initial version of the algorithm, these values were set to 65% and 50% respectively. Sticking with these values would force the algorithm to run an unnecessarily high number of these trajectories, thus creating a computational bottleneck. To prevent this, we decided to adaptively set them to 0.75 a 400 and 0.50 a 400 respectively. As Phase I is independent of n srt , we report our results based on Phase III samples only in Table 7. [START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF].

The first thing we wanted to check was that 400 trajectories were sufficient for the benchmark. To do this, we first compare the acceptance rate and cost of the benchmark, (a 400 , C400 ), with the acceptance rate at the end of Phase III, a end , and the corresponding cost Cend = C min end a end ( ) -

We can see that while there are expected changes in acceptance rate due to the higher number of trajectories, they are not very different in either case for ≤ 0.04. Our choice of 400 trajectories is further supported by the similarities between C400 and Cend in each case. Looking at the cost functions both at the end of the benchmark and at the end of the run, we again see that the most efficient central stepsizes have the lowest acceptance rate, enforcing once again that acceptance rate is not a good metric for algorithmic performance.

In reality, while we try to optimize the speed of the algorithm in general, the real performance metric of our algorithm is the time to produce one SIS, denoted C P hIII tps in the table. We should first highlight here that the optimization of numerical gradients computation described in section 7.4.1 was used here because it reduces the influence of the number of hybrid and numerical trajectories on the total duration of Phase III. Hence the reader will notice that the time per SIS when = 0.005 has decreased from the 14.3 s/SIS reported earlier, to 12.9 s/SIS reported here. If we again demand Cend ≤ 2, we now see that we have reduced the number of possible combinations from three to two (in the longer run for 6 = 0.16, the trajectories were highly divergent, meaning that the Hamiltonian was not conserved, and so many trajectories were being rejected that the runtime became unacceptable). For the combinations ( 3 , 6) and ( 4 , 7), we have values of ( Cend , ACL max , C P hIII tps ) equal to (1.6, 6, 1.4 s/SIS) and (1.0, 7, 1.7 s/SIS) respectively. One thing that we noticed immediately in Table 7.7 was a discrepancy in the "optimal" combination of ( , n srt ). As with the benchmark, the combination (0.08, 7) again provided the lowest cost of 1. However, both the cost per SIS and the ACL max was higher than in the (0.04, 7.6. In the longer run, = 0.04 stands out as the optimal stepsize as it produces the minimum ACL max leading to only 1.4 s/SIS in Phase III. = 0.16 produced highly diverging trajectories which forced us to stop the run before the end of Phase III as the acceptance rate was too low and the runtime became unacceptable.

i.e. 1.7 s/SIS and 7 against 1.4 s/SIS and 6. This suggests that the optimal combination of ( , n srt ) was actually the (0.04, 6) case. Upon investigation, the reason why the cost analysis makes wrong predictions is because a key assumption behind Eq. (5.52) is 1. As a result of this hypothesis, the values of 0.08 and 0.16 were unfairly favored. To compensate for this, we propose the following ad-hoc cost computation

C adhoc ∝ 1/ a( - 8 2 ) . (7.34)
By substracting 2 to we disfavor stepsizes getting to big and the factor 8 was added such that the ad-hoc costs gives the correct ranking of stepsizes in our previous analysis, as shown in Table 7.7. This ad-hoc cost estimate protects us from computing undefined costs and now allows us to limit the benchmark to values up to 0.08.

Optimizing n srt

We remind the reader that, everything else kept constant, a smaller n srt should produce smaller ACLs at the cost of more hybrid and numerical trajectories, while a larger n srt will see less of these expensive trajectories while risking higher ACLs if the chain gets stuck for a long time. If we take the combination ( , n srt ) = (0.04, 6) from Table 7.7 as being "optimal", we recognise that while we essentially carried out a 1D optimization of , the value of n srt was achieved by simple incrementation. While a full 2D optimization is planned as a future work, here we then decided to carry out a similar 1D optimization, but this time in n srt . Keeping the central stepsize constant at = 0.04, we varied n srt in the range n srt ∈ [START_REF] Acernese | Advanced Virgo: A 2nd Generation Interferometric Gravitational Wave Detector[END_REF][START_REF] Buonanno | Comparison of Post-Newtonian Templates for Compact Binary Inspiral Signals in Gravitational-Wave Detectors[END_REF]. We present the results of the investigation in Table 7.8. In this table, we see that the final acceptance rate, the mean and maximum ACLs, the proportions P hyb and P num of hybrid and numerical trajectories, the time per trajectory and the time per SIS are generally insensitive to the value of n srt . While there are small differences in many of the values, the table suggests that benchmarking has a much greater effect on the performance of the algorithm.

As a consequence, for future runs we will keep incrementing n srt from 3 when doubling in the benchmark. Finally we highlight that the influence of n srt , and thus of (P hyb , P num ), on C P hIII tps depends on the waveform approximant and dimensionality of the problem considered as these factors control the computational cost of numerical gradients. If using more expensive models in higher dimensions, higher n srt values may be appropriate as, even though the ACL would increase, C P hIII tps will still benefit from running less (very) expensive hybrid and numerical trajectories.

Summary of improvements

We shall now summarize the new global performance of the HMC using the optimizations we have described in the previous sections. Given the large ACL produced by the non-optimized version of the algorithm, i.e. 65, the initial version of the code was designed such that ACL max would be estimated for the first time in Phase III after 50 000 trajectories so that the chain would be long enough for the estimation to be accurate. Running the new version of the code using the new optimized values ( , n srt ) = (0.04, 6), the HMC had already produced ∼ 8 000 SIS upon reaching Table 7.9: Performance of the HMC before and after optimization. The durations of Phase III have been rescaled for a run producing exactly 5 000 SIS in both cases. The two last columns give the time per SIS cost respectively in Phase III only and over the entire run time.

50 000 trajectories since ACL max was now 6. As a result we rescale both Phase III durations to their value if they had produced exactly 5 000 SIS, allowing for an apples-to-apples comparison between the two versions of the algorithm and which is summarized in Table 7.9. This comparison shows that the optimizations to the algorithm have reduced the total duration of the analysis from 53.7 h to 24.3 h. This runtime produces on the order of 5 000 SISs using 59 s of GW170817 data, sampled at 4096 Hz, using the IMRPhenomD approximant in an 8-dimensional analysis where aligned-spins are kept constant and phase at coalescence is marginalized over. This factor 2.2 speed-up essentially comes from our ability to reduce the auto-correlation of the chain during Phase III. In Fig. 7.9, we plot the original and optimized auto-correlation functions for easy comparison.

Reducing the total duration by ×2.2 is already quite satisfying, but the big achievement here is the fact we have managed to cut the duration of Phase III by ×10, producing an optimized cost of 1.4 s/SIS during Phase III versus 13.9 s/SIS in the un-optimized version of the code. In fact, Phase I is now the main bottleneck of our algorithm, but it is less of a problem for two reasons:

• The duration of Phase I is insensitive to the number of SIS required. Hence if some analysis requires 10 000 SISs instead of 5 000, the total runtime will increase by 1.9 h, i.e. 8% of the total duration.

• Phase I is only used to gather gradient data points for the fit in Phase II. As a consequence a future version of the HMC could parallelize this part of the algorithm and cut its duration by approximately the number of cores used. We unfortunately lacked of time to implement this feature.

To make sure that the numerous modifications we added to the HMC do not modify the GW inference, in Fig. 7.10 we plot the super-imposed posterior densities of the original HMC version and of LALInferenceMCMC (both already displayed on Fig. 7.8) with the new posterior density produced by the optimized version of the code. We also compare in Table 7.10 the median values and symmetric 90% credible intervals produced in each case. Every marginalized posterior distributions of the optimized version overlap almost perfectly with the original version which translates into equal estimation of the parameters in Table 7.10. As a consequence we can validate our new version of the algorithm.

ρ(τ ) θ JN , ACL=5 ψ, ACL=4 D L , ACL=6 M, ACL=2 µ, ACL=2 δ, ACL=2 α, ACL=3 δt c , ACL=2 θ JN , ACL=29 ψ, ACL=26 D L , ACL=34 M, ACL=37 µ, ACL=38 δ, ACL=64 α, ACL=62 δt c , ACL=65
Figure 7.9: The auto-correlation functions computed on the 48 500 Phase III trajectories obtained with the optimized version of the algorithm (solid). These curves can be directly compared with those produced by the original HMC from Fig. 7.7 (dashed). The integrated auto-correlation length (ACL) is indicated for each parameter in the legend. 7.1) and the marginalized posterior densities produced by the HMC in its original version, its optimized version and LALIn-ferenceMCMC in [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF] on GW170817. The parameter estimates quoted represent the median values (solid line), 5% lower limit and 95% upper limit credible intervals (dashed lines) produced by the optimized HMC. The differences in the settings used by the HMC and LALInferenceMCMC are described in the section 7.3.2. The scale used for prior densities is such that they integrate to one over their predefined support and for the marginalized posterior densities such that they integrate to one over the range defined by posterior samples.

Parameter LALInferenceMCMC HMC-original HMC-optimized θ JN 2.5 +0.4 -0.5

2.5 +0.4 -0.5

2.5 +0.4 -0.5 ψ 1.5 +1.5 -1.4

1.6 +1.5 -1.5

1.6 Now that we had a functioning algorithm using key modules from the collaboration, it was time to extend the HMC to spins and tidal deformabilities in order to prove its ability to sample from the full posterior distribution.

Chapter 8

Extending the HMC algorithm to spins and tidal parameters

The importance of spins effects

Up until now, we have been analyzing a signal without taking the effects of the spin components S 1 , S 2 into account, even though they can have a major influence on the gravitational wave profile produced by the binary system. The spin effects appear at the leading order in the 1.5PN expansion of the GW phase through a spin-orbit coupling and then at the 2PN order through a spin-spin coupling [START_REF] Theocharis | Spin-Induced Orbital Precession and Its Modulation of the Gravitational Waveforms from Merging Binaries[END_REF]. An arbitrary spin configuration will see S 1 , S 2 misaligned with the orbital angular momentum, L, leading to precession effects. Precession of a spinning body is the gradual change of direction of its rotational axis. In our case, both L and S i undergo precession. The vast majority of spin configurations will follow simple precession, as opposed to transitional precession which necessitates peculiar initial conditions and gives birth to much more complex dynamic of the binary system [START_REF] Theocharis | Spin-Induced Orbital Precession and Its Modulation of the Gravitational Waveforms from Merging Binaries[END_REF][START_REF] Schmidt | Towards Models of Gravitational Waveforms from Generic Binaries: A Simple Approximate Mapping between Precessing and Non-Precessing Inspiral Signals[END_REF]. We begin with a brief description of simple precession which we illustrate on Fig. 8.1. In this case L describes a cone around J = L + S 1 + S 2 , the total angular momentum, while S 1 + S 2 itself precesses on a cone around L. If the system was isolated, conservation of J would be preserved but GW emissions induce an angular-momentum loss. Nevertheless, GWs are emitted predominantly along L [START_REF] Schmidt | Tracking the Precession of Compact Binaries from Their Gravitational-Wave Signal[END_REF] and orthogonal emissions tend to average out due to the cone-like precession of L around J [START_REF] Hannam | Simple Model of Complete Precessing Black-Hole-Binary Gravitational Waveforms[END_REF][START_REF] Theocharis | Spin-Induced Orbital Precession and Its Modulation of the Gravitational Waveforms from Merging Binaries[END_REF]. Therefore, when dealing with simple precession, the direction of J remains approximately constant during the evolution of the binary and the angle θ JN it makes with the observer's line of sight is taken as constant. As the privileged direction of emission of GWs, along L, precesses, the amplitude of the signal detected by an observer along a fixed line of sight N will be modulated during the evolution of the binary, especially if N and J are not parallel. Since the instantaneous orbital plane precesses, the motion of the binary system can be drastically different from that of a non-spinning one, and a deeper analysis shows that not only the amplitude but the phase and polarization of the GW are also impacted [START_REF] Schmidt | Towards Models of Gravitational Waveforms from Generic Binaries: A Simple Approximate Mapping between Precessing and Non-Precessing Inspiral Signals[END_REF][START_REF] Theocharis | Spin-Induced Orbital Precession and Its Modulation of the Gravitational Waveforms from Merging Binaries[END_REF]. Lastly we point out that precession is most important when the spins of the components S i are orthogonal to the orbital angular momentum L and for high mass ratios m 1 /m 2 [START_REF] Schmidt | Tracking the Precession of Compact Binaries from Their Gravitational-Wave Signal[END_REF].

In the particular case where S 1 and S 2 are aligned with L there is no precession. Spins can then be entirely parametrized by their dimensionless projections onto L,

χ i = c S i • L Gm 2 i , (8.1)
with

χ i ∈ [-1, 1].
To capture the dominant spin effects on the waveform in the case of alignedspins, we introduce the effective spin parameter χ ef f . It is defined as a mass-weighted combination of (χ 1 , χ 2 ) by [START_REF] Damour | Coalescence of Two Spinning Black Holes: An Effective One-Body Approach[END_REF][START_REF] Ajith | Inspiral-Merger-Ringdown Waveforms for Black-Hole Binaries with Nonprecessing Spins[END_REF][START_REF] Santamaría | Matching Post-Newtonian and Numerical Relativity Waveforms: Systematic Errors and a New Phenomenological Model for Nonprecessing Black Hole Binaries[END_REF][START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF]]

χ ef f = m 1 χ 1 + m 2 χ 2 m 1 + m 2 . ( 8.2)
The dynamics of aligned-spinned system is much simpler than precessing systems, but spin effects remain important. In fact, it was shown in [START_REF] Ajith | Addressing the Spin Question in Gravitational-Wave Searches: Waveform Templates for Inspiralling Compact Binaries with Nonprecessing Spins[END_REF] that even in such cases and with moderate spin values, using non-spinning templates can cause significant mismatches with aligned-spinning templates in cases where m 1 m 2 .

To illustrate the importance of aligned-spins, we generate two GW170817-like waveforms in the Handford detector frame using the aligned-spin approximant IMRPhenomD [START_REF] Husa | Frequency-Domain Gravitational Waves from Non-Precessing Black-Hole Binaries. I. New Numerical Waveforms and Anatomy of the Signal[END_REF][START_REF] Khan | Frequency-Domain Gravitational Waves from Non-Precessing Black-Hole Binaries. II. A Phenomenological Model for the Advanced Detector Era[END_REF]. Both waveforms have been generated using exactly the same astrophysical parameters except for their spins where one has them set to zero while the other has χ 1 = χ 2 = 0.03. Then we match them at best by maximizing their normalized overlap over time and phase at coalescence. The best match M is defined for any two templates h1 and h2 as [START_REF] Owen | Search Templates for Gravitational Waves from Inspiraling Binaries: Choice of Template Spacing[END_REF][START_REF] Schmidt | Towards Models of Gravitational Waveforms from Generic Binaries: A Simple Approximate Mapping between Precessing and Non-Precessing Inspiral Signals[END_REF][START_REF] Ajith | Addressing the Spin Question in Gravitational-Wave Searches: Waveform Templates for Inspiralling Compact Binaries with Nonprecessing Spins[END_REF]]

M( h1 , h2 ) = max tc,φc h1 | h2 h1 | h1 h2 | h2 , (8.3)
where brackets refer to the noise-weighted inner product defined in Eq. (3.31) and we use here the PSD of GW170817 of the Handford detector reported in [START_REF]GWTC-1: A Gravitational-Wave Transient Catalog of Compact Binary Mergers Observed by LIGO and Virgo during the First and Second Observing Runs[END_REF]. We plot in Fig. 8.2 the last milliseconds of the resulting two waveforms. As can be seen on the figure, the presence of spins aligned with the orbital momentum of the binary delays the time of coalescence with respect to the non-spinning case, an effect known as the orbital hang up [START_REF] Campanelli | Spinning-Black-Hole Binaries: The Orbital Hang Up[END_REF]. Note that anti-aligned spins (χ 1 = χ 2 = -0.03 for instance) would have the opposite effect of accelerating the merger of the binary [START_REF] Campanelli | Spinning-Black-Hole Binaries: The Orbital Hang Up[END_REF]. Even without precession effects, and in the case of low spins, the proper orbital motion of the components is noticeably different which results in a best match of M = 0.75 when the threshold to consider a template faithful in matching the data for detection is 0.97 [START_REF] Owen | Search Templates for Gravitational Waves from Inspiraling Binaries: Choice of Template Spacing[END_REF][START_REF] Ajith | Addressing the Spin Question in Gravitational-Wave Searches: Waveform Templates for Inspiralling Compact Binaries with Nonprecessing Spins[END_REF]. Therefore in order to match best the signal detected, a non-spinning approximant would need to be generated with a whole different set of parameters to compensate for the absence of spin effects, thus introducing a bias in the analysis.

-0.04 -0.03 -0.02 -0.01 0.00

t (sec) -2 -1 0 1 2 h(t) ×10 -26 χ 1 = χ 2 = 0 χ 1 = χ 2 = 0.03 Figure 8
.2: Two GW170817-like time-domain waveforms strains projected onto the Handford detector using the aligned-spin IMRPhenomD approximant [START_REF] Husa | Frequency-Domain Gravitational Waves from Non-Precessing Black-Hole Binaries. I. New Numerical Waveforms and Anatomy of the Signal[END_REF][START_REF] Khan | Frequency-Domain Gravitational Waves from Non-Precessing Black-Hole Binaries. II. A Phenomenological Model for the Advanced Detector Era[END_REF]. The blue curve was generated with spins set to zero while the orange one with χ 1 = χ 2 = 0.03, all other parameters being otherwise equal except for t c and φ c which were maximized over to best match the two templates. The presence of aligned-spins delay the coalescence of the binary component as they stabilize the orbit [START_REF] Campanelli | Spinning-Black-Hole Binaries: The Orbital Hang Up[END_REF].

8.2 Extension of the HMC algorithm to aligned-spins

Motivation

As a next step beyond the non-spinning case, we decided to extend the HMC algorithm to alignedspin models. We made this choice due to the fact that precessing approximants, such as IMRPhenomP [START_REF] Hannam | Simple Model of Complete Precessing Black-Hole-Binary Gravitational Waveforms[END_REF][START_REF] Chatziioannou | Constructing Gravitational Waves from Generic Spin-Precessing Compact Binary Inspirals[END_REF], are much more expensive to generate than their non-precessing (i.e. aligned-spin) counterparts. For example, just considering the source frame waveform generation, this takes ∼ 40 ms using IMRPhenomP versus ∼ 12 ms for IMRPhenomD on 59 s of data sampled at 4096 Hz. Moreover, precession adds 6 parameters to the analysis versus 2 in the aligned-spins case, which increases even further the duration of the numerical gradients generations. We should point out that even though χ i can take values in the range [-1, 1] it is common to restrict this range for BNS systems. As pointed out in [START_REF] Ajith | Addressing the Spin Question in Gravitational-Wave Searches: Waveform Templates for Inspiralling Compact Binaries with Nonprecessing Spins[END_REF] most observed BNSs are weakly spinning. Indeed the fastest spinning neutron star has |χ| ≤ 0.4 [START_REF] Hessels | A Radio Pulsar Spinning at 716 Hz[END_REF] and the fastest remnant of a BNS merger was estimated in [START_REF] Stovall | PALFA Discovery of a Highly Relativistic Double Neutron Star Binary[END_REF] to have |χ| = 0.032. Taking this into account, and following the official LVC analysis for GW170817 [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF], we restrict the range of aligned-spins to the so called low-spin prior where χ ∈ [-0.05, 0.05]. The properties analysis of GW170817 [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF] points out that the upper limit on the magnitude does not significantly affect the results of parameter estimation on this signal.

Adjusting σ F IM for Phase I

The waveform approximant that we have been using previously, IMRPhenomD , already encodes the aligned spin behaviour which we had set to zero. Right after we increased the dimensionality of the problem by adding the two new spin parameters to our analysis, the acceptance rate in Phase I was much lower. A rapid investigation of some of the phase-space trajectories showed that the leapfrog discretizations in the masses and time of coalescence dimensions were diverging This was due to the fact that the new scales computed from the FIM with spins were orders of magnitude bigger for these parameters than before. This can be understood by the fact that spins are highly correlated with masses and time of coalescence, thus the FIM was closer to singular than usual, leading to very significant numerical errors once inverted. To circumvent this problem, we came

σ F IM σ F IM no spins σ F IM f inal cos θ JN 1.73 × 10 -1 1.73 × 10 -1 1.73 × 10 -1 ψ 1.66 × 10 -1 1.65 × 10 -1 1.65 × 10 -1 ln D L 3.74 × 10 -1 3.73 × 10 -1 3.73 × 10 -1 ln M
1.12 × 10 -3 4.70 × 10 -5 4.70 × 10 -5 ln µ 2.50 × 10 -1 1.62 × 10 -3 1.62 × 10 -3 sin (δ) 2.87 × 10 -2 2.87 × 10 -2 2.87 × 10 -2 α 2.00 × 10 -2 2.00 × 10 -2 2.00 × 10 -2 ln δt c 5.30 × 10 -5 6.71 × 10 -6 6.71 × 10 -6 χ 1 5.62 --5.00 × 10 -2 χ 2 8.61 --5.00 × 10 -2

Table 8.1: The two first columns compare scales computed from the FIM with and without aligned spin components χ i . In the first case, due to spin correlations with ln M, ln µ and ln δt c , the scales for these parameters are between one and two orders of magnitude bigger than expected, and lead to an unacceptable number of rejected trajectories in phase I. In the second column, we see more reasonable values for these parameter scales. The third column indicates the final scales retained to run Phase I.

up with a workaround for estimating the scales: we first calculate and invert the full 10D FIM. We then take the 10D FIM, delete all columns and rows associated with (χ 1 , χ 2 ), and then invert this 8D matrix. After this, each parameter is assigned the most conservative (i.e. smallest) scale of the two. We detail in Table 8.1 the scale estimations corresponding to this procedure. For bounded parameters we continue to limit the maximum value of their scale to half the dynamical range. Thus, for the two spin parameters, their final value was reduced to 5.00 × 10 -2 , corresponding to a 50% error prediction in the low spin prior case. While not entirely mathematically consistent, this procedure produces initial scales that are sufficient for getting the chain exploring parameter space. After this fix, the acceptance rate at the end of Phase I was 98.2% and we moved onto the inclusion of tidal effects.

Including astrophysical priors for aligned-spins

Prior considered

Still following LALInference's choices of priors on GW170817 [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF], we consider a low spin prior on (χ 1 , χ 2 ) by imposing χ max = 0.05 which is a sensible assumptions for galactic BNS as we explained in section 8.2.1. By default the priors of χ 1 and χ 2 could be set uniform over [-χ max , χ max ] but if one wants to make a comparisons with precessing approximants, which LALInference does, it is necessary to consider a uniform prior on the spin magnitude S i before marginalizing out the other degrees of freedom. Doing so yields the so called zprior, defined for instance in Eq. (A.7) of [START_REF] Lange | Rapid and Accurate Parameter Inference for Coalescing, Precessing Compact Binaries[END_REF] by

π zprior (χ i ) = -1 2χ max ln χ i χ max , (8.4)
and which we plot on Fig. 8.3.

Divergence of the gradient of the log-zprior

Once we had introduced the zprior for aligned-spins, we were surprised to see that the acceptance rate on numerical trajectories in Phase I dropped to ∼ 55%. Upon investigation, this was due to three divergences induced by the gradient of the log-prior. Taking the derivative of the logarithm of Eq. (8.4) yields ∂ ln π zprior (χ i )

∂χ i = 1 χ i ln |χ i /χ max | . (8.5)
This equation presents three singularities: two at χ i = ±χ max = ±0.05, and one at χ i = 0. We resolve the boundary divergences by setting a reflective boundary for the HMC trajectories at χ RB = ±0.99 χ max = ±0.0495. Contrary to the shift of the equal mass line we described earlier, this setting does not introduce any bias in our results. The divergence at zero is more complicated to handle since a bounce would prevent the chain from crossing the χ i = 0 line and constrain exploration to one half of parameter space. We therefore implement a smooth transition around zero by replacing Eq. (8.5) with a sinusoidal extrapolation function. This allows us to use an effective gradient defined by

∂ ln π(χ i ) ∂χ i ef f =    [χ i ln |χ i /χ max |] -1 , if χ low < |χ i | < χ max A sin π 2 χi 0.9χ low , if |χ i | ≤ χ low . (8.6)
χ low must be chosen close enough to 0 such that if a trajectory ends at a point where |χ i | < χ low , it will still have a good chance of being accepted even though the Hamiltonian was not properly conserved on the last steps of the trajectory. However it should not be so close to 0 that the transition across χ i = 0, where the gradient changes direction rapidly, is to steep and destabilizes the trajectory. We found empirically that setting χ low = 0.001 works well. The factor 0.9 allows for a smooth transition when aligned-spins go from |χ i | > χ low to 0.9 χ low < |χ i | ≤ χ low . Indeed at that point the effective gradient gets on the sinusoidal branch while keeping the same sign of its own gradient before reaching its maximum absolute value, A, and then transitioning. Naturally A is set such that the effective gradient is continuous at χ low which translates into

A = χ low ln χ low χ max sin π 2 1 0.9 -1 (8.7)
and numerically reads A 260. In Fig. 8.4 we compare the true and effective gradients of the zprior, demonstrating the interpolation across the singularity at χ i = 0. Using this effective gradient allowed us to recover the original acceptance rate.

Importance of tidal effects

Even though NSs are very stiff and compact objects, they can get deformed if subject to an intense gravitational field, with a propensity to deform which depend on the governing EoS of NS. During the inspiral of a BNS system, each gravitational gradient induced by a component will tidally deform the other, even though this effect becomes significant at small separations only [START_REF] Wade | Systematic and Statistical Errors in a Bayesian Approach to the Estimation of the Neutron-Star Equation of State Using Advanced Gravitational Wave Detectors[END_REF]. In turn these deformations will produce a back reaction on the space-time metric hence modifying the orbital decay of the binary which behaviour will be imprinted in the GW signal produced. Therefore it is possible to model and thereby measure tidal effects when observing of a GW signal. Such a measure can, if not exclude, disfavour some EoSs not in agreement with the results obtained.

For spinning NSs, matter effects enter the waveform phase computation at the 2PN order through the spin-induced quadrupole moment. However due to the presence of many other terms at this PN order, this effect is expected to be degenerate with the measure of mass ratio and spins. The precessing approximant IMRPhenomP-NRTidal [START_REF] Dietrich | Closed-Form Tidal Approximants for Binary Neutron Star Gravitational Waveforms Constructed from High-Resolution Numerical Relativity Simulations[END_REF][START_REF] Dietrich | Improving the NRTidal Model for Binary Neutron Star Systems[END_REF] encodes this effect, but not the aligned-spin model IMRPhenomD-NRTidal [START_REF] Dietrich | Closed-Form Tidal Approximants for Binary Neutron Star Gravitational Waveforms Constructed from High-Resolution Numerical Relativity Simulations[END_REF][START_REF] Dietrich | Improving the NRTidal Model for Binary Neutron Star Systems[END_REF][START_REF] Dietrich | Matter Imprints in Waveform Models for Neutron Star Binaries: Tidal and Self-Spin Effects[END_REF]] which we will be using. Nevertheless, the analysis of GW170817 indicates that this discrepancy between the two models did not noticeably affect the results for the tidal estimation. In fact, tidal effects can be best measured due to the next higher orders where they appear, i.e. at 5 and 6PN, through terms which are independent of spins and are thus applicable for non-spinning NSs as well. The inclusion of tidal effects in the phase of the waveform is usually parametrized by dimensionless tidal deformability parameters, defined for each component i by

Λ i = 2 3 k 2 c 2 G R i m i 5 , (8.8)
where k 2 is the dimensionless l = 2 Love number and R i the radius of the NS. Therefore, given an EoS model relating R i to m i , we can compute the radii (R 1 , R 2 ) corresponding to each (m 1 , m 2 ) sample gathered during the sampling process thus leading to the corresponding EoS-predicted tides {Λ 1 , Λ 2 }. This way we can draw where each EoS stands on the Λ 1 -Λ 2 plane and view whether it agrees with the marginalized posterior distribution of the tidal deformabilities coming purely from the GW data. This analysis was carried out on GW170817 and illustrated by a plot which we report on Fig. 8.5. It enabled to strongly disfavour EoSs lying outside the 90% credible region of the tidal deformation measurement of the detected signal. Other BNS signals observed during O3, such as GW190425 [START_REF]Observation of a Compact Binary Coalescence with Total Mass $\sim 3.4 M_{\odot}[END_REF], had a lower SNR than GW170817 which unfortunately did not allow to constrain further the EoS. Finally we introduce Λ and δ Λ which are two mass-weighted combinations of (Λ 1 , Λ 2 ) [START_REF] Wade | Systematic and Statistical Errors in a Bayesian Approach to the Estimation of the Neutron-Star Equation of State Using Advanced Gravitational Wave Detectors[END_REF], defined by [START_REF] Wade | Systematic and Statistical Errors in a Bayesian Approach to the Estimation of the Neutron-Star Equation of State Using Advanced Gravitational Wave Detectors[END_REF][START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF]

Λ = 8 13 1 + 7η -31η 2 (Λ 1 + Λ 2 ) + 1 -4η 1 + 9η -11η 2 (Λ 1 -Λ 2 ) , (8.9)
and by We are mostly interested in Λ as it represents the leading contribution to the GW phase evolution which appears at the 5PN order. As (Λ 1 , Λ 2 ) are highly correlated, parameter inference was found to work better when parametrizing the tidal effects with Λ and δ Λ [START_REF] Wade | Systematic and Statistical Errors in a Bayesian Approach to the Estimation of the Neutron-Star Equation of State Using Advanced Gravitational Wave Detectors[END_REF].

δ Λ = 1 2 1 -

Extension to tides

As mentioned before, we use the aligned spin IMRPhenomD-NRTidal [START_REF] Dietrich | Closed-Form Tidal Approximants for Binary Neutron Star Gravitational Waveforms Constructed from High-Resolution Numerical Relativity Simulations[END_REF][START_REF] Dietrich | Improving the NRTidal Model for Binary Neutron Star Systems[END_REF] approximant which encodes tidal effects at the 5 and 6PN orders, but not the spin-induced effect at 2PN. By introducing the tidal parameters (Λ 1 , Λ 2 ), we now increase the dimensionality of the analysis to 12. Compared to spin and precession effects, tides have little effect on the GW signal as their influence is only significant in the last stages of the coalescence when the two bodies are close together. In Fig. 8.6 we plot the same spinning waveform as that in Fig. 8.2, with its tidally corrected counterpart super-imposed on top after maximization of the overlap over t c and φ c . We see that contrary to Fig. 8.2, the two waveforms only start to deviate noticeably from each other at the last few orbits. The best match between these two templates is 0.996, confirming that tides have a much smaller impact on the gravitational wave profile than spin does.

For our analysis, we followed the LVC analysis and constrained tides to the boundaries 0 ≤ Λ i ≤ 5000 [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF]. and by using a non-informative uniform prior over this range. Similarly, we do not assume any correlations between Λ 1 and Λ 2 , whereas if we believe that two NSs have the same EoS, comparable masses should produce comparable tidal deformabilities [START_REF]Measurements of Neutron Star Radii and Equation of State[END_REF]. Our first step again was to calculate the scales coming from the FIM. In this case, we found that ) whether computed with or without including spins in the FIM as shown in Table 8.2. However, contrary to the spinning case, this did not influence the size of the other scales. As a result we simply followed our existing rule by reducing both of the tidal scales to half their prior range, i.e. 2500.

σ F IM σ F IM no spins σ F IM f inal cos θ JN 1.73 × 10 -1 1.
With these settings the acceptance rate in Phase I was ∼ 95% using central differencing for aligned-spin and tides (after ∼ 100 trajectories). However, before moving onto Phase II, we decided to verify whether forward differencing might be sufficient for these new parameters and allow us to economise on waveform generations.

Central vs forward difference for numerical gradients on aligned-spins and tides

Since tides enter in the GW phase computation at the 5PN order (excluding the spin-induced term) versus 1.5PN for spins, we can legitimately expect a lesser influence of their gradients on the global Hamiltonian trajectory. As a consequence we tested three possibilities: (i) central differencing for spins and tides, which we denote (central-central ) (ii) central differencing for spins and forward differencing for tides (central-forward ) or (iii) forward differencing for all (forward-forward ). To accelerate the analysis, we decided to pursue our tests on a signal starting from 40 Hz instead of the 30 Hz used previously, reducing the total duration of the signal to 29 s from 59 s .

Comparing results from Phase I

There are several indicators we can compare to check whether forward differencing is sufficient or not. The acceptance rate in Phase I is key since a big drop when switching to forward differencing will directly prove that this method produces gradients not sufficiently accurate for the Hamiltonian to be conserved. Thus, we ran Phase I for 1 500 trajectories and compared the acceptance rates in all three cases. We found acceptance rates of 92.3%, 93.1% and 92.7% respectively. All three acceptance rates are very close, even though we would have expected central-central to do better than the two other cases. However the fact that forward differencing on spins and tides produces the same acceptance rate as central differencing for both is not sufficient to state that we can prefer it over central differencing.

Comparing results from Phase II

The ability of the cubic-OLUTs method to correctly fit data from Phase I depends on the faithfulness of the data to the real posterior distribution. Hence we shall produce regression plots to compare the accuracy of the cubic-OLUTs in each case. Contrary to the previous chapter where we produced those plots on the Phase I data set, we produce them here on a validation data set not used to derive the cubic-OLUTs. We are indeed mostly interested in the performance of our analytical method on data it has never seen before as it is indicative of its ability to generalize its predictions and perform well during Phase III.

To produce this validation set, we run Phase I, plus an extra 1 500 numerical trajectories in the central-central case and keep the accepted trajectories part of the last 1 500 as validation only. The predictive performance of each of the three cubic-OLUTs fit, derived on Phase I data using central and/or forward difference, is then tested on gradients from the validation set where we compute the coefficients of determination for all gradients. The R 2 results presented in Table 8.3 show that the spin gradients are insensitive to the type of differencing used. Hence any of the three methods seems to work for the spin parameters. However, none of the methods were successful in reproducing the tidal gradients in the validation set. We conclude that the coefficients of determination are not informative enough for us to decide on which method to choose and forces us to compare results from a full Phase III run.

Comparing results from Phase III

In order to make an apples-to-apples comparison, we benchmarked ( , n srt ) in the central-central case and used these values throughout. This ensured that any differences in the results were coming from the differencing method only. Phase III was run until we obtained at least 5 000 SIS. The results for these runs are reported in Table 8. [START_REF] Acernese | Advanced Virgo: A 2nd Generation Interferometric Gravitational Wave Detector[END_REF]. We can see that the results are very similar in all cases. The large ACL max in each case suggests that the chains were getting stuck in parameter space more frequently than before. As a consequence, it was very hard to decide, even at the end of the run, which differencing method should be preferred. However, given that we would like the algorithm to be as generic as possible, and given that other source types could produce high spins, in the end we believe that using central differing for aligned-spin gradients and forward differencing for tidal gradients is a good choice for the algorithm.

Timing analysis of (∂ µ ln L) num with IMRPhenomD-NRTidal

Now that we have decided on which numerical method to use for the new parameters, we can update the timing analysis of the computation of (∂ µ ln L) num . Going back to 59 s of analyzed signal, the source frame generation of the waveform with IMRPhenomD-NRTidal is about twice as expensive as it was for IMRPhenomD , i.e. 25.4 ms versus 11.7 ms. Table 8.3 reports a similar timing analysis to what was done in chapter 6 where spins and tides were not included. We trajectories for each case. In the end, as it produced equivalent results, we kept 400 as a base number.

Results of the benchmark are given in Table 8.6. Similarly to Table 7.6, the last stepsize value tested, = 0.08, produced to many analytical trajectories where the Hamiltonian was not conserved and which were then rejected. Thus, the benchmark for this case was too slow to converge and we stopped it after 170 trajectories. The optimal values predicted by the cost C400 are ( , n srt ) = (0.02, 5), giving a factor of 2.6 difference with the original (0.005, 3) setting. However, we see that ( , n srt ) = (0.04, 6) is predicted to be almost as optimal with a cost of C400 = 1.1. Once again, the ad-hoc cost augments the discrepancy between the two combinations as it penalizes higher stepsizes, thus giving a preference for the smaller stepsize. As the factor 8 introduced in the expression for C adhoc , Eq. 7.34, was calibrated on a non-spinning and non-tidal analysis, we repeat the validation procedure of the benchmark to confirm whether or not this equation holds.

Validating the benchmark with spins and tides

To validate the benchmark, we did not conduct full Phase III runs, i.e. until 5 000 SISs were acquired. Given the linearity of the scaling to acquire a SIS, we ran a number of tests to choose a number of trajectories that was large enough to have confidence in the results, but small enough to allow us to cut the cost of each Phase III validation run. In all cases, results for the ACL max had converged after 25 000 trajectories. As a consequence, our validation tests were run using this number of trajectories in Phase III. Results are reported in Table 8.7.

The first thing to note in Table 8.7 is that the acceptance rate for ( , n srt ) = (0.04, 6) increased from 19% in the benchmark to 30% in the longer run. Upon inspection, we observed that the acceptance rate for this case only began to converge after 5 000 trajectories. This is explained by the fact that the Phase III chain for this case got stuck almost immediately in a part of parameter space where the cubic-OLUTs method failed to predict accurate gradients, thus resulting into an acceptance rate after 400 trajectories of only 19% and hence the discrepancy between C adhoc 400 and C adhoc end .

The second thing to notice is that the ad-hoc cost equation remains valid even when spins and tides are included. While the ad-hoc cost allows us to definitively exclude certain combinations, we can see that for some combinations, the predicted ad-hoc cost is essentially indentical. This highlights that we cannot use the ad-hoc cost as a metric on its own. While the combinations ( , n srt ) = (0.02, 5) and (0.04, 6) have ad-hoc costs of 1. It is interesting to see that while numerical trajectories only represent 2.0% of the 75 000 trajectories, they account for 50% of the total run time (13.7 h out of 27.3 h). To try an further reduce the number of numerical and hybrid trajectories generated, a full 2D optimization over and n srt is planned for a future work.

Marginal posterior distributions

In Fig. 8.8 we plot for each parameter the marginal posterior distributions resulting from this 12D analysis, as well as the astrophysical priors used and the posterior distributions produced by LALInferenceMCMC in [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF], and whose settings were described in 7.3.2. Firstly we note that aligned-spins are poorly constrained by our GW measurement since their marginal posterior distribution is dominated by their astrophysical prior. Even though tidal deformabilities do not follow the uniform prior, they remain weakly constrained since their marginal posterior distribution spans a large part of the [0, 5000] range considered. Then, compared with the 8D analysis in Fig. 7.8, we see that the inclusion of aligned-spins and tides has an important effect on the inference of the component masses as their estimated values are shifted from (m 1 , m 2 ) = (1.74 +0.03 -0.03 , 1.1 +0.02 -0.02 ) M to (m 1 , m 2 ) = (1.49 +0. 14 -0.08 , 1.27 +0.07 -0.10 ) M and now agree much better with the analysis from the LVC. Likewise, the estimation of t c has shifted from 1187008882.4303 +0.0008 -0.0007 to 1187008882.4317 +0.0013 -0.0011 . This is to be expected due to the correlation between (m i , χ i , Λ i , t c ), all appearing in the phase of the GW waveform. Therefore the important uncertainty on aligned-spins and tides induces wider credible intervals for (m 1 , m 2 , t c ) and shifts the central value. On the other hand, the discrepancies between the estimated values of (θ JN , ψ, D L , α, δ) when comparing the 8D and 12D analysis are not statistically significant as these parameters essentially appear in the amplitude of the GW waveform and as such are not impacted by the inclusion of spins and tidal deformabilities. The 90% credible intervals centered on the median values produced by LALInferenceMCMC and the HMC are compared in Table 8.9.

Summary

Table 8.10 sums up the performance of the HMC on this 12D analysis which includes aligned-spins and tides and compares them with the 8D analysis. 7.1) and the marginalized posterior densities produced by the HMC (5 000 SISs) and LALInferenceMCMC (6 622 SISs) in [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF] on GW170817, using the IMRPhenomD-NRTidal waveform model. The parameter estimates quoted represent the median values (solid line), 5% lower limit and 95% upper limit credible intervals (dashed lines) produced by the HMC. Discrepancies in the posterior distributions could be explained by the fact that, contrary to the HMC analysis, the LALInferenceMCMC analysis used 128 s of GW170817 data (against 59 s for the HMC) and marginalized over calibration uncertainties. The scale used for prior densities is such that they integrate to one over their predefined support and for the marginalized posterior densities such that they integrate to one over the range defined by posterior samples. Due to the higher dimensionality of the problem, and the fact that numerical gradients of the log-likelihood need to be generated in four extra dimensions, Phase I is approximately twice as long as before. Phase II is approximately four times longer and can be explained by the fact that the benchmarking takes longer due to the more expensive waveforms, and the fact that the cubic fit now requires the calculation of 455 coefficients per dimension in 12D as opposed to the 165 coefficients in 8D. The increase in the Phase III run time is due to a number of different effects: as the acceptance rate is lower, the chain takes longer to converge to the target density. We can see that there is a factor of 2.5 difference in ACL max going from 6 in 8D, to 15 in 12D. This means that we need 2.5 times as many trajectories to acquire the necessary 5 000 SISs.

Finally there is the fact that we are using a more expensive waveform model. Not only does it play a major effect when we calculate gradients of the log-likelihood for hybrid / numerical trajectories, but it also has a important impact on the time taken for analytical trajectories as the Hamiltonian calculation at the end of each trajectory is now also slower.

In Fig. 8.9, we plot the new auto-correlation curves for each parameter. While taking longer to run, we again see that the chain is very efficient, producing ACL ∈ [9,[START_REF] Blanchet | Gravitational Radiation from Post-Newtonian Sources and Inspiralling Compact Binaries[END_REF].

In this chapter, we have shown that we can run the HMC algorithm on real GW170817 data, including spins and tides, in around 3 days on a single CPU. Given that we think it is possible to parallelize Phase I, we believe that a further factor of 2 acceleration is possible. While the possibility of carrying out Bayesian inference on a BNS system in ∼ 2 days is already an achievement, we know that the cubic-OLUTs method is not the optimal solution. If any of the phase parameters were to become multi-modal, the approximation would break down and another solution would

ρ(τ ) θ JN , ACL=13 ψ, ACL=12 D L , ACL=15 M, ACL=15 µ, ACL=15 δ, ACL=9 α, ACL=10 δt c , ACL=13 χ 1 , ACL=12 χ 2 , ACL=9 Λ 1 , ACL=15 Λ 2 , ACL=14 Figure 8
.9: Auto-correlation functions computed on 75 000 Phase III trajectories of a run which used the cubic-OLUTs method in a 12D analysis with aligned-spins and tides and marginalizing over phase. The integrated ACL of each parameter is indicated in the caption. The maximum being 15, the run produced exactly 5 000 SIS.

be necessary. This would result in an algorithm that is unacceptably slow. For this reason, we decided to look for a more efficient way of approximating the gradients in Phase III.

Chapter 9

Building DeepHMC

In the previous chapter we saw that the cubic-OLUTs approximation to the gradients of the loglikelihood began to break down once spins and tides were included. While acceptable results could still be obtained with this method, it required an increase in the runtime of the algorithm. Given the fact that GW170817 has a uni-modal posterior distribution in all parameters, and that the cubic-OLUTs approximation failed to perform as expected, this suggested that further problems would arise in the case of multi-modal distributions. We therefore decided to replace this approximation method with something more sophisticated. In this chapter we will describe how we successfully replaced the cubic-OLUTs method with a Deep Neural Network (DNN) algorithm. Firstly we will give a broad overview of the reasons which lead us to test this family of algorithms. Then we will explain what a DNN is, and detail the procedure used to fine tune it. The next section will focus on the concrete implementation of a DNN for the case of GW170817 and on how it can be trained to produce accurate predictions of the log-likelihood gradients. We will continue with a presentation of the results of this new method on Phase II and III before detailing the new structure of our algorithm as a whole which we now name DeepHMC.

Machine learning algorithms

Motivation

To replace the current approximation method, we are looking for a technique which is agnostic of the shape of posterior and combines accuracy with speed of prediction. In several fields, machine learning algorithms have demonstrated the ability, if tuned appropriately, to approximate very diverse, complex and highly multidimensional functions. They aim at learning from a series of data samples, named the training set, patterns or relationships in order to make accurate predictions of properties on new samples they have never seen before. In supervised learning, the correspondence between each sample and its known property is available to the algorithm in the training set, while unsupervised learning aims at discovering key properties governing the data unknown to the user by itself. Machine learning algorithms can be applied to solve different types of problems among which classification and regression are most common (more details can be found in [START_REF] Pedregosa | Scikit-Learn: Machine Learning in Python[END_REF][START_REF] Géron | Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow[END_REF])

• Classification is the identification of which category an object belongs to, typically labelling photos of animals with the correct species (eg dog, cat etc), hence the parameter space of properties (the output parameter space) is discrete, consisting in the different labels of interests.

• Regression algorithms on the other hand try to predict a continuous-valued attribute associated with an object, as for instance the atmospheric CO 2 concentration in future years coming given samples of past measurements [187]. Hence the output parameter space is continuous.

With regard to this definition, our use of the cubic-OLUTs falls into the category of a supervised machine learning algorithm performing a regression task: given the Phase I training set where mapping between an input position in parameter space q µ and its corresponding gradient vector (∂ µ ln L) num , continuous in all dimensions, is given; the method learns the relationships between them (with the prior knowledge that is it of a cubic nature or locally linear for OLUTs) and is able to make accurate predictions on new positions in Phase III. Using existing algorithms, or building them from scratch is not an easy piece of work, but the increasing demand for these algorithms has lead to the development of packages, such as scikit-learn [START_REF] Pedregosa | Scikit-Learn: Machine Learning in Python[END_REF] and Keras [START_REF] Chollet | [END_REF], greatly facilitating their implementations. Upon investigation, it seemed that replacing the cubic-OLUTs approximation with a machine learning algorithm was very promising.

Which algorithm to use?

Over the past decade, the application of machine learning in the research and development of new algorithms has expanded exponentially. Hence, there now exists a wide variety of solutions, making it difficult to choose the best method for a particular problem. For example, Scikit-learn permits the implementation of many regression algorithms, i.e. polynomial regression, stochastic gradient descent, nearest neighbors, gaussian processes, Random Forests or neural network models etc.

Initially, when we were struggling to make Phase II and III work, and before we understood that φ c was the culprit and could be marginalized over, we tried to replace the cubic-OLUTs with three different algorithms: nearest neighbours, Random Forests and DNNs. For this, we used the KNeighborsRegressor and RandomForestRegressor implementations in scikit-learn and the Keras platform for neural networks respectively . KNeighborsRegressor selects K samples in the training set which are closest in distance to the new point and predicts the new log-likelihood gradient vector based on the mean of the neighbors [189]. Random Forests is a decision tree based algorithm, as such it learns from the training data by creating simple if-then-else decision rules which are then used to make predictions [190]. DNNs try to recognize patterns in a data set using a generic scheme which stacks several layers of simulated neural connections; their detailed description will be given afterwards. Even though none of our tests managed to overcome the multimodality generated by φ c , KNeighborsRegressor and RandomForestRegressor produced slightly better coefficients of determination, R 2 , in their regression plots than the cubic fit approximation shown in Fig. 7.3. Our implementations were probably not fully optimized since these algorithms require some additional fine tuning, and once we found that marginalizing over phase at coalescence solved our problem, we kept the cubic-OLUTs method. We believe it would still be interesting to investigate further the abilities of KNeighborsRegressor and RandomForestRegressor to learn from Phase I and predict the gradients of the log-likelihood.

As mentioned, we also implemented DNNs to try to overcome the φ c issue, using the Keras library. At the time, we used one DNN per gradient as an approximation, leading to 9 DNNs to replace the cubic-OLUTs. A lack of time to fine tune the networks lead to poor results. At a later stage, we revisited the problem, but this time using a single DNN as a replacement for the cubic-OLUTs approximation. This time we were successful, and decided to pursue this method further.

Description of a Deep Neural Network

Structure of a Deep Neural Network

To produce predictions on data, neural networks rely on a generic scheme where layers of multiple (potentially non-linear) functions are stacked together. Hence, instead of trying to a priori model some complicated non-linear correlations in the data, as the cubic fit is trying to do for instance, these networks are able to automatically recognize automatically complex and hidden patterns in the data. For GW astronomy it makes them good candidates for modelling complex likelihood functions and potentially highly multi-modal distributions. The main downside, as always, is the necessity to fine tune the network to one's use case.

Our goal here is to now use a DNN to predict gradients of the log-likelihood, (∂ µ ln L) DN N , given a new position in parameter space q µ . The DNN consists in an directed graph organized in layers of neurons, where each edge of the graph carries a weight w and each neuron a bias b for inactivity. The weight defines the strength of the connection between two neurons, and the bias is a constant value inherent to every neuron which will be added to the input its receives from other neurons. We use fully-connected (or dense) layers, meaning that a neuron is connected to every other neuron in the preceding and successive layer. Each neuron of the network carries a numerical value called an activation value. Upon receiving q µ in the D neurons of the input layer, we equate the position values to the activations of the input neurons. Then the information is propagated deeper by computing the activations values of neurons in the following layer from a linear combination of the preceding activations of neurons they are linked to, weighted by the strengths of the connections. On top of this, at each layer we define an activation function σ l which allows us to introduce non-linearity in the network. σ l is applied to the linear combination of weights and activation values thus allowing for the information to be propagated non-linearly if σ l is different from a linear function. Using non-linear activation functions is very important if we hope for the DNN to approximate a non-linear multi-dimensional function such as ∂ µ ln L(q µ ), otherwise the DNN will be equivalent to a simple linear function, no matter the number of layers used [START_REF] Géron | Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow[END_REF], and fail at predicting gradients of the log-likelihood.. In the end we can write the activation of the j th neuron in layer l, a l j , as

ω 3 32 ∂ q 1 ln ℒ ∂ q 2 ln ℒ b 2 1 b 2 2 b 2 3 b 3 1 b 3 2 σ 2 σ 3
a l j = σ l   N (l-1) i=1 w l ij * a l-1 i + b l j   , (9.1)
where N (l -1) is the number of neurons in layer l -1. The output (∂ µ ln L) DN N are the activations carried by the D neurons in the final layer. To illustrate the previous equation, in Fig. 9.1 we present a representation of a very simple DNN where D = 2, and which contains only one hidden layer of 3 neurons, giving a total of 3 layers considering the input and output layer. The weights and biases involved in the same activation computation of Eq. (9.1) are given the same colour. We can already see that even with such a simple architecture and only 2 dimensions in parameter space, the DNN has 17 weights and biases that need to be fine tuned. Adding an additional hidden layer of 3 neurons would bring that total to 29. As a comparison, the cubic fit with D = 2 would have required 10 coefficients per dimension, hence a total of 20 coefficients.

Fine tuning a given DNN

Fine tuning the weights and biases is done through an iterative training procedure on the training set {q µ , (∂ µ ln L) num } P haseI , which is split into batches of equal batchsize, picked randomly but left disjoint such that every example is used and used once. Starting from an initial state of weights and biases, drawn from a normal kernel initializer, N (0, 1), we use a mean squared error loss function (MSE loss) between the predicted and numerical gradients to measure how incorrect the tuning is on the batch considered [START_REF] Géron | Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow[END_REF], i.e.

M SE (∂ µ ln L) num , (∂ µ ln L) DN N N = 1 N D N -1 i=0 D-1 µ=0 (∂ µ ln L) i num -(∂ µ ln L) i DN N 2 , (9.2)
where N is the batchsize. By computing the gradient of the loss function with respect to every weight and bias we can update them in their inverse gradient direction with a learning rate step which controls the size of the step taken between old and new values. This operation is repeated until every batch is treated which completes an epoch. This process is repeated for several epochs which allows the network to see the training examples in a different order. These iterations perform a mini-batch gradient descent [START_REF] Géron | Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow[END_REF] in the hope to find, if not a global, a local minimum of the loss function hoped to also minimize the loss on unseen data. The final state of the network corresponds in our case to the values of weights and biases derived at the last epoch.

If one dimension has a variance orders of magnitude larger than others it will dominate the loss function and prevent the network from learning in other dimensions. To avoid this possibility we standardize the training set by centering distributions in each dimension of q µ and (∂ µ ln L) num around zero and by scaling them to unit variance. This procedure is common to most machine learning estimator and we use scikit-learn's StandardScaler() [START_REF] Pedregosa | Scikit-Learn: Machine Learning in Python[END_REF] for this purpose. Note that the MSE from Eq.(9.2) is evaluated on the standardized gradients. Therefore at the very beginning of the training process, when weights and biases are randomly drawn from N (0, 1), the initial MSE derived on the first batch will be of order 1.

At each epoch, the error loss is computed on the entire training set, as well as on a validation set of the same size, generating the learning history of the network (see section 9.4 for training results). The validation set is not used to update the weights as we are mostly interested in testing the DNN's performance on this data as it reveals the network's ability to generalize its predictions to yet unseen positions in parameter space. Failure to do so, while having good results on the training set, is usually indicative of two symptoms: the network might be overfitting the training data and/or the two sets are unrepresentative of each other meaning their statistical characteristics differ too much [START_REF] Géron | Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow[END_REF].

Implementation of the DNN

We use the Keras library [START_REF] Chollet | [END_REF] to build and train our DNN. Keras is a widely used deep learning API running on top of the machine learning platform TensorFlow [191,[START_REF] Abadi | TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems[END_REF]. The Sequential() model allows us to stack Dense layers, i.e. layers where neurons are fully connected to every neuron in the layer preceding and succeeding its own. The stochastic gradient descent is implemented with the Adam optimizer [START_REF] Diederik | Adam: A Method for Stochastic Optimization[END_REF] with the learning rate left to its default value of 0.001.

As we just saw, a given DNN is defined by a number of hyper-parameters: the number of layers, number of neurons per layer, activation functions, kernel initializer, loss function, learning rate and gradient descent compiler. As we explained the input and output layer must contain D neurons each, meaning they scale linearly with dimension. The higher the dimensionality of the posterior distribution, the more difficult it should be for a given network to fit the data. As a consequence, we decided to parametrize the size of each internal layer such that it scales linearly with D. For the activation function of hidden layers we started with the popular Rectified Linear Unit (ReLU) function: for a given input x it returns max(x, 0). Contrary to the sigmoid function 1 used for a long time because it roughly approximates the activation functions of biological neuron, ReLU proved to behave much better. It indeed improves the learning capabilities of the network (see [START_REF] Géron | Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow[END_REF][START_REF] Glorot | Understanding the Difficulty of Training Deep Feedforward Neural Networks[END_REF] for details) and accelerates the training procedure since its gradient is very cheap to compute. The activation function of the output layer should be kept linear though, such that, contrary to using ReLU, gradients of the log-likelihood can take values which are not bounded by 0. Nevertheless other activation functions have been shown to outperform the ReLU in some (if not most) cases such as the leaky ReLU [START_REF] Xu | Empirical Evaluation of Rectified Activations in Convolutional Network[END_REF], the exponential linear unit (ELU) [196] or the scaled exponential linear unit (SELU) [START_REF] Klambauer | Self-Normalizing Neural Networks[END_REF]. As we lacked of time to pursue our investigations in every possible direction and since ReLU was showing good performances in our use case we decided to leave the study of these activation functions to a future work. We shall consider that a DNN architecture performs well if the coefficients of determination it produces are comparable to those produced by the cubic-OLUTs method. To conduct our tests, we use the same training and validation set, each containing 289 100 data points, that were used in the previous chapter and where the regression plots for the cubic-OLUTs are displayed on Fig. 8.7. In Table 9.1 we report the R 2 found for four different architectures of the DNN together with these produced previously by the cubic-OLUTs. The first architecture, named DNN-1, is composed of three internal layers containing D neurons each. While DNN-1 has a very simple structure, it produces promising results with R 2 closer to one than those achieved by the OLUTs on (∂ cos θ JN ln L, ∂ ψ ln L, ∂ ln D L ln L). However it is less accurate at predicting gradients for all the other parameters compared with the cubic fit. By expanding the number of neurons in the second and third internal layers to respectively 100D and 10D neurons, DNN-2 now outperforms the cubic-OLUTs for every parameter. Our third manual test, DNN-3, simply replaced the ReLU activation function of the first input layer of DNN-2 by the linear function. As shown on Table 9.1, this modification slightly improved the R 2 for every parameter. After suspecting some overfitting in our model, we built DNN-4 by adding a Dropout layer with a 25% rate between the large second layer and the third layer. During the training process, it will randomly deactivate at each update 25% of neurons from the preceding layer and it was shown to mitigate overfitting [START_REF] Srivastava | Dropout: A Simple Way to Prevent Neural Networks from Overfitting[END_REF]. It indeed brought the validation errors closer to the training errors, consistent with the fact that Table 9.1 shows a slight improvement in the coefficients of determination, and adding the Dropout layer did not impact the training duration of the network. Note that, out of simplicity, the batchsize used when training the DNNs for these tests was set to 1425. The reason for this choice was that an early test showed that this value produced equivalent performance to that with 32, while the training of the network was more rapid. No training of the above described DNNs indeed lasted more than 10 min using 60 epochs.

These manual tests successively improved the architecture of the DNN but were quite time consuming to set-up and we were far from exploring the full space of possible architectures. As a result we decided to optimize the number of neurons per layer using the RandomSearch2 algorithm proposed by Keras. Now while considering these tests, it should be noted that the complexity of our network was also limited by two factors. Firstly the training time, induced primarily by the number of connections in the network and the complexity of activation functions, should not become a new bottleneck for the algorithm. In our case it means we want to keep it below ∼ 1h which represents about 10% of the current duration of Phase III using cubic-OLUTs. Secondly, the more neurons in the network, the more time it takes to make a new prediction once trained. This parameter is usually of no importance in DNN applications because predictions are computed in parallel on large batches of data. However, in our case we inherently need to predict gradient values sequentially along Hamiltonian trajectories, meaning the complexity of the network could slow down Phase III if too many neurons are used. With this in mind, and given that the previously tested number of neurons for the three layers made one prediction about as fast as the cubic-OLUT method, we did not allow the layer sizes to vary too widely in RandomSearch: the sizes of the two small layers could only take one of the three values (1D, 5D, 10D), while the size of the large layer was allowed one of the three setting (50D, 100D, 200D). To reduce the size of the search parameter space, we also fixed the activation functions to these found previously, i.e. linear, ReLU and ReLU for respectively the first, second and third hidden layers. Given these settings, RandomSearch randomly picks several possible DNN architectures amongst the allowed layer sizes, trains each of them for a given number of epochs and returns the DNN with the lowest error on our validation set. In our case, after several hours of training and testing different architecture, the best one came out as (10D, 100D , 10D). Note that in this process, we fixed the position of the large layer to second place in order to accelerate the search. Nonetheless a quick test showed that placing it at the third position maintained the same predictive performance, while accelerating the training from 14 min to 10 min. This happens as the large layer gets connected to a layer of smaller size (the output layer with D neurons) resulting into fewer weights in the overall network. As this layer was followed by the dropout layer, we moved both of them to third and fourth position in the graph.

The resulting DNN is described in Fig. 9.2 where the number of neurons and the activation function is given for each layer. Note that we did not vary all hyper-parameters at the same time and the learning rate was always left to its default value of 0.001. This means there is room for some more optimization, but at some point we decided to stick with the previously described architecture as it displayed a good performance for our particular case.

Training the network

We present here results on the same training and validation sets, each containing 289 100 data points, that were used in the previous chapter. Now that the architecture of the network is fixed, we can fine tune the number of epochs and the batchsize. As we explained previously, the batchsize controls how many updates (in the inverse error gradient direction) of the weights and biases will be performed during one epoch. The bigger the batchsize, the more samples will be used to estimate the error gradient, hence the more likely it will be that the update will improve the network's performance. The downside of this is that less updates can be performed over one epoch, or, equivalently, more epochs will have to be performed for a fixed number of updates. On the other hand with smaller batchsizes, the error is estimated on fewer samples, hence the error gradient is highly dependent on the batch which was randomly selected from the training set, and might not point toward a global minimum of the error function. The advantage of this though is the ability to perform many more updates, leading to a gradient descent with a more stochastic behaviour than that for bigger batchsizes. Different studies (see [START_REF] Masters | Revisiting Small Batch Training for Deep Neural Networks[END_REF] and references therein) suggest that small batchsizes, typically between 4 and 128 , allow for a better gradient descent and a better generalization of the DNN predictions. Note that a batch gradient descent corresponds to the case when the entire training set is used to compute the loss function while a stochastic gradient descent uses a single instance for each update (i.e. batch-size of 1) [START_REF] Géron | Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow[END_REF].

We now present a complete test of 12 different batchsize values ranging from 16 to 32768 (2 4 to 2 15 ) by successively multiplying it by 2. For these tests the number of epochs is constant and set to 60 which, as we shall see, leaves enough epochs to compare the different gradient descents. We point out that the smaller the batchsize, the longer the epoch in CPU time, since more updates of weights and biases are performed. We plot in Fig. 9.3 the learning histories for the 12 different batchsizes.

For the learning history on the training set, we see that in every case, the network steadily improves its predictive accuracy as indicated by the smooth and monotonic decrease of the curves. Nonetheless we observe that increasing the batchsize induces a slower learning of the DNN per epoch, but not necessarily slower in wall time since epochs last between 10 s and 70 s depending on the batchsize. So even if a large batchsize induces a learning curve decreasing less rapidly per epoch than a smaller batchsize, it can still appear as a better choice since each epochs is faster to compute. The influence of the batchsize on the validation set learning history is more complicated. Small batchsizes from 16 to 128 quickly reach a low error loss meaning the network has good generalization abilities. Intermediate values, between 256 and 2048, have a much more noisy behaviour where the validation history curve increases and seems unable to converge to a minimum. Higher values, between 4096 and 32768, produce monotonically decreasing curves resembling their training counterpart, except for 8192 where a point of inflection around epoch 20 9.2: We compare the average time each method takes to predict one vector of 12 gradients of the log-likelihood. The number quoted for numerical gradients was measured using 59 s of data sampled at 4096 Hz and using the IMRPhenomD-NRTidal approximant.

occurs and from which starts an increase in the error loss. These high batchsize values converge to higher minima than that of the small batchsizes indicating poorer generalization performances. At this point we are unable to explain the reasons for the poorer performances of the four intermediate batchsizes, i.e. (256, 512, 1024, 2048).

In the end, a batchsize of 128 seems to be the optimal choice as it produces a gradient descent as good as that of a batchsize of 32 while requiring less weights and biases updates (60 epochs lasts 21 min with a batchsize of 32 versus 12 min with a batchsize of 128). 9.5 Comparing the DNN gradient approximation with the cubic-OLUTs method

DNN gradient approximation

In Fig. 9.4 we present regression plots of the network on the same validation set that was used in the previous chapter for the cubic-OLUTs. We see that for each parameter, the R 2 values from the DNN are closer to unity than for that of the cubic-OLUTs approximation. This demonstrates that the DNN is better at predicting accurate gradient values on new data. This is especially remarkable for the three troublesome parameters where OLUTs where used previously: for cos θ JN and ln D L we find R 2 of 0.89 and 0.95 respectively for the DNN, versus -8.03 and -2.36 with the OLUTs. For ψ, the network still has difficulty in capturing the multi-modality of the posterior distribution, as we can see from the value R 2 (ψ) = 0.12. However, this is still much better than the OLUTs value, R 2 (ψ) = -61.64. For the cubic fit approximation, we previously achieved values of between 0.65 ≤ R 2 ≤ 0.98, where the values of R 2 = 0.65 corresponded to the approximation of the gradient with respect to the tidal parameters. We now see that the R 2 values coming from the DNN lie between 0.95 ≤ R 2 ≤ 0.99, where again the gradients with respect to the tidal parameters now have values of R 2 = 0.95. Not only is the DNN more accurate in its predictions, but as we show in Table 9.2, it is 2.6 times faster than the cubic-OLUTs method, achieving one (∂ µ ln L) DN N prediction every 0.54 ms. Assuming 59 s of data sampled at 4096 Hz with the IMRPhenomD-NRTidal waveform approximant, we measure 561 ms to compute the 12 numerical gradients. This means that the analytical gradients computed with the DNN approximation are ∼ 1 000 times faster than numerical differencing gradients. We remind the reader that this number would be even bigger in case of longer durations, and more complicated waveform approximants since the cost for numerical gradients would grow rapidly, but would remain constant for the analytical gradients. For the algorithm as a whole, in these cases we would see a slow down in Phase I, while Phase II and III would be much less impacted. Finally, since the end goal is to parallelize Phase I, we can expect our algorithm to be even more competitive on longer durations and with more advanced approximants.

Results from Phase II and III

In Phase II, the training process for the DNN takes 12 min. This is twice the time it took for the derivation of cubic coefficients and the creation of OLUTs. However, as the gradients coming from the DNN are faster, the benchmark now only takes 15 min as opposed to 39 min before. Given the reduced number of hybrid/numerical trajectories that were needed, it is also clear that the DNN gradients are also more accurate. In Table 9.3, we give the details of the stepsize benchmark carried. In this case, the optimal predicted stepsize is = 0.04. In total, Phase II lasted 27 min and we started Phase III with benchmarked values of ( , n srt ) = (0.04, 6). Given the improved performance of the DNN approximation over the cubic-OLUTs approximation, Phase III converged to 5 000 SISs after 55 000 trajectories. In Fig. 9.5 we plot the marginal posterior distributions for each parameter produced by the DNN super-imposed with these produced by the cubic-OLUTs and LALInferenceMCMC (already displayed in Fig. 8

+1420

-598

+1434

-600

Table 9.4: Comparison of the symmetric 90% credible intervals around the median derived from the posterior distributions produced by the HMC using either the cubic-OLUTs method or the DNN and LALInferenceMCMC based respectively on 5 000 and 6 622 SISs. The analysis used the IMRPhenomD-NRTidal waveform model, as well as 128 s and 59 s of data for the HMC and LALInferenceMCMC respectively.

At the end of the run, the acceptance rate was 42% and the ACL max was reduced from 15 to 11. In Table 9.5 we present a breakdown of the total duration of Phase III over the different types of trajectories and the additional training of the DNN carried out after the accumulation of every 50 numerical trajectories. Compared with Table 8.8, we see that the proportion of hybrid (numerical) trajectories has decreased from 3.7% (2.0%) to 2.6% (1.1%). In total, Phase III now lasts ∼ 12 h Finally, in Table 9.6 we present a comparison between the DNN and cubic-OLUTs based algorithms. While Phase I takes the same amount of time, we see that the runtimes for Phases II and III are halved. This results in a reduction of the total runtime from 75 hours to 60 hours. While the acceptance rates are almost equal, we also see that the ACL max has been reduced from 15 to 11, meaning that the time per SIS in Phase III has also been reduced from 19.7 s/SIS to 8.9 s/SIS. It is clear from these results that the DNN approximation for the gradients of the log-likelihood is superior to the cubic-OLUTs approximation.

Final structure of the algorithm

In this last section, we detail the final structure of the algorithm which includes the DNN and all modifications compared with the original C-code HMC.

1. Pre-phase I: compute the scales in every direction using the inverse of the FIM, i.e. s µ = Γ -1/2

µµ . Repeat the operation with a FIM from which columns and lines relative to spin components have been removed and for each non-spinning parameter keep the smallest scale of the two. Restrict the scales to half of the parameter prior range for naturally bounded parameters if s µ is greater than the prior range, and to 0.5 for ln D L . This corresponds to a maximum 50% error prediction in each parameter.

2. Phase I: run 1 500 numerical trajectories of fixed length l = 200 and with a stepsize ∼ N (5 × 10 -3 , 1.5 × 10 -3 ) ∈ [10 -3 , 10 -2 ]. For every accepted trajectory, record each visited position q µ and the D numerical gradients (∂ µ ln L) num at that point.

Phase II:

• Train the DNN for 60 epochs on {q µ , (∂ µ ln L) num } with a batchsize set to 128.

• Recompute the scales using the covariance matrix of the chain points from Phase I, i.e.

σ samples µ = C samples µµ 1/2 .
• Tune the stepsize: test four different central values from which to draw , i.e. = (0.005, 0.01, 0.02, 0.04), each with an incremented value of the successive rejection threshold, n srt , from 3 to 6, by running analytical trajectories with DNN approximated gradients for 400 trajectories. Record the acceptance rate a 400 ( , n srt ) and pick ( , n srt ) producing the smallest ad-hoc cost given by C adhoc = 1/ a 400 ( -8 2 ) .

• Remove Phase I samples from the chain. 4. Phase III: run analytical trajectories using the DNN approximation of the gradients, drawing the stepsize from the above derived central value and drawing the length from U(50, 150).

• Monitor the acceptance rate a and after 400 trajectories:

-If a 0.75 a 400 : use analytical trajectories.

-If 0.50 a 400 a < 0.75 a 400 : use hybrid trajectories with l ∼ U(50, 100).

-If a 0.50 a 400 : use numerical trajectories with l ∼ U [START_REF] Buonanno | Signal Recycled Laser-Interferometer Gravitational-Wave Detectors as Optical Springs[END_REF][START_REF]GWTC-1: A Gravitational-Wave Transient Catalog of Compact Binary Mergers Observed by LIGO and Virgo during the First and Second Observing Runs[END_REF]. Record data for a future update of the DNN.

• If n srt analytical trajectories are rejected in a row:

-Run one hybrid trajectory of smaller length l ∼ U(20, 100) and halved stepsize value. If the trajectory is rejected... For each version of the HMC, we report the cost per SIS (left y-axis) and the corresponding run time to gather 5 000 SISs (right y-axis), both computed for Phase III only and over all phases (Total). We remind that all SISs are gathered during Phase III. The Original cubic-OLUTs HMC is presented in section 6.3, its optimized version detailed in section 7.4 and DeepHMC was presented in this chapter. In each case, results have been obtained on 59 s of GW170817 real data while marginalizing over φ c , in either 12D when aligned-spins and tides were included in the analysis or 8D otherwise.

-...run numerical trajectories of same length and stepsize until acceptance before switching back to analytical trajectories. Record {q µ , (∂ µ ln L) num } computed during the accepted numerical trajectory and re-train the DNN every 50 numerical trajectories. • Every 10 000 trajectories, recompute the scales using the covariance matrix of the new chain points from Phase III. Stop doing so if the new update does not modify any scale by more than 10%.

5. Stopping condition: after 5 000 trajectories, compute the maximum integrated auto-correlation length, ACL max . Calculate 5 000/ACL max , giving the number of SISs gathered so far. Deduce the number of SISs missing to achieve the required ESS. Estimate the number of trajectories left to run n. Recompute ACL max after min(5 000, n) trajectories and repeat the operation until enough SISs have been have been accumulated, at which point the run is stopped.

We should point out that out of all the runs we conducted since implementing the tuning of the stepsize in Phase II, none of them saw its acceptance rate during Phase III fall below 75% of a 400 .

In Fig. 9.6 we summarise the performance improvements brought to the HMC algorithm as we evolved it from its original version with cubic-OLUTs in 8D to DeepHMC in 12D. Thanks to the many enhancements we brought, DeepHMC can run a 12D analysis essentially as fast as the original HMC in 8D when considering all phases but it is 1.6 times faster in Phase III, where all SISs are gathered.

To conclude, we see that we have been able to successfully implement a DNN as a replacement of the older fitting method which combined a cubic fit and OLUTs. The DNN introduces new hyper-parameters which need to be fine tuned, but once this task is solved, it appears to be a more universal approximation method. Thus not only is it able to better capture the complexity of the log-likelihood surface, but it also makes predictions 2.6 times faster than the cubic-OLUTs, resulting into a factor ∼ 2 speed-up in Phase III. We note however that proving once and for all the superiority of the DNN requires testing its abilities on other signals than GW170817, as was done for the cubic-OLUTs [START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF]. For now, now that we have a working and optimized HMC algorithm to estimate the parameters of a GW signal, we move onto a comparison of results with other algorithms used by the LVC to analyze GW170817.

Chapter 10

Comparison of DeepHMC with LALInferenceMCMC

The LVC uses two algorithms within the LALInference package [START_REF] Veitch | Parameter Estimation for Compact Binaries with Ground-Based Gravitational-Wave Observations Using the LALInference Software Library[END_REF][START_REF][END_REF]: a MCMC algorithm and a nested sampling algorithm. In this work, we decided to compare DeepHMC with LAL-InferenceMCMC. The quality of an algorithm can be measured by two quantities: speed and robustness. In order to measure the performance of DeepHMC, we decided to make a full comparison with the publicly available results for GW170817 produced by the LVC [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF]. However, while a robustness test between posteriors produced by DeepHMC and LALInferenceMCMC were possible, a runtime test was not. As LALInferenceMCMC uses a number of parallel chains, it uses an MPI application which makes measuring and recording the CPU time difficult. Therefore, in order to measure the runtime performance of DeepHMC, we decided to run both DeepHMC and LALInferenceMCMC on the same machine, using as many common settings for both samplers as possible, as well as some particular settings for LALInferenceMCMC, with the goal of acquiring 5 000 SISs. In this chapter, we begin with the runtime test. We first define the common settings to both samplers, as well as particular settings that were needed for LAL-InferenceMCMC, and conclude with a presentation of the runtimes. We then move onto the robustness test by comparing the posterior distributions produced by DeepHMC with the public GW170817 distributions produced using LALInferenceMCMC.

10.1 Runtime test on GW170817 using DeepHMC and LAL-InferenceMCMC In our previous analyses, we used 59 s of GWOSC data. This was due to the fact that we were using a low frequency cutoff of f low = 30 Hz, which when considering the component masses of GW170817, and using a 3.5PN approximation to calculate the duration necessary for the binary to evolve from f low to coalescence of the two body, predicts a coalescence time of 57 s. Given that, by convention, 2 s is added in order to cover the merger and ringdown part of the signal, we thus arrive at a total duration of T = 59 s. However, LALInferenceMCMC requires a segment duration which is a power of 2 long to simplify any fast Fourier transform operations which might have to be performed on the time domain data. Therefore by setting f low = 30 Hz the total duration considered by LALInferenceMCMC is 64 s. To make an apples-to-apples comparison, we thus extended the analysis duration for DeepHMC to 64 s as well.

The data files used, downloaded from the GWOSC website, correspond to the cleaned version of the strain where a glitch in the Livingston detector was removed [START_REF]GW170817 Data Release[END_REF] and down-sampled at 4 096 Hz, implying a Nyquist frequency for the analysis of 2 048 Hz. The PSDs used are the same as those which were used in the GWTC-1 catalog [START_REF]GWTC-1: A Gravitational-Wave Transient Catalog of Compact Binary Mergers Observed by LIGO and Virgo during the First and Second Observing Runs[END_REF], which are shown on Fig. 3.1 and are publicly available [START_REF]Power Spectral Densities (PSD) Release for GWTC-1[END_REF].

We use the IMRPhenomD-NRTidal approximant [START_REF] Dietrich | Closed-Form Tidal Approximants for Binary Neutron Star Gravitational Waveforms Constructed from High-Resolution Numerical Relativity Simulations[END_REF][START_REF] Dietrich | Improving the NRTidal Model for Binary Neutron Star Systems[END_REF] to generate waveform templates, hence considering aligned-spins and tidal deformations. The "reference" frequency used by LAL- 210.695175639 -Table 10.1: Values of the starting point of our HMC chain in the IMRPhenomD-NRTidal analysis of GW170817. These values were taken from the maximum likelihood point of a previous run from the LVC collaboration which used IMRPhenomD-NRTidal as well [START_REF]LVC Early IMRPhenomD-NRTidal Run on GW[END_REF]. Using a point already in the main mode of the posterior distribution avoids the burn-in part of the chain.

Simulation when generating waveforms to evolve the spin components is set to 20 Hz. In both cases, we marginalize over the phase at coalescence, thus conducting a 12D analysis. Both analysis use exactly the same prior distributions and boundaries which are described in Table 7.1 for (θ JN , ψ, D L , m 1 , m 2 , α, δ, δt c ). A low spin prior between [-0.05, 0.05] using the zprior function (see section 8.2.3) is considered for aligned-spins and a uniform prior over [0, 5000] is used for tides. To convert between detector and source frame quantities, we use the flat ΛCDM cosmological model defined in [START_REF][END_REF] and implemented by the Astropy library 1 [START_REF]The Astropy Project: Building an Inclusive[END_REF].

Each interferometer presents uncertainties in the calibration of its phase and amplitude measurement of the strain. A complete GW analysis should marginalize over this uncertainties using calibration envelopes files linked to the time of detection. However, in order to accelerate both analyses, and since we only aim at comparing the two samplers, we did not marginalize over calibration uncertainties in both cases. The starting point of both analysis in parameter space was set to the same values of parameters, given in Table 10.1. This point corresponds to a matched-filter SNR of 31.37, thus avoiding any burn-in part of the chains. We halted both runs when a threshold of 5 000 SISs were acquired.

Particular settings for LALInferenceMCMC

LALInferenceMCMC is an advanced MCMC algorithm and provides many options to modify its default settings, which can have an large impact on the performance of the algorithm. In particular, and as mentioned in Chapter 5, LALInferenceMCMC implements a parallel tempered MCMC. Therefore the number of tempered chains is a key parameter, which we decided to set to 8, following the setting used by the LVC for the run which produced inference results on GW170817 using the IMRPhenomD-NRTidal approximant [START_REF]LALInference Configuration File for PhenomDNRT Low-Spin Analysis of GW[END_REF]. We also turned on the option which adapts spacing between temperatures such that it produces a uniform swap acceptance. The lowest and highest temperatures are left to their default value of respectively 1 and 50, and we note that an nondefault option 2 which stops temperature swapping after 10 6 iterations was used by mistake. Upon investigation [204], this choice is expected to have minimal effects on the run performance.

A complete description for the settings used, as well as the full command line to run LALIn-ferenceMCMC, can be found in Appendix B.

A first comparison between DeepHMC and LALInferenceMCMC

A first inspection of results between the two samplers showed that the marginal posterior distributions for (m 1 , m 2 ) produced by DeepHMC did not have enough support close to the equal mass line. After some analysis, we realized that our decision to shift the reflective boundary from η = 0.25 to η = 0.2499 in order to prevent the mass log-prior gradients, (∂ ln M ln π, ∂ ln µ ln π), from 1 See the built-in cosmology astropy.cosmology.Planck15. 2 The --tempKill option in the command line. diverging (see section 7.3.1.2) was problematic. A value of η = 0.2499 only allows for configurations where m 2 0.96 m 1 at most. To fix this issue we decided to keep the bounce at η = 0.25 while capping both gradient absolute values to their evaluation at η = 0.2499. Hence when a trajectory goes beyond η = 0.2499, the Hamiltonian is not properly conserved by this setting but the mass parameters are given enough momenta to explore regions where 0.2499 ≤ η ≤ 0.25 and keep a non negligible probability of being accepted.

Using this new setting, we re-ran the DeepHMC. After 1 500 numerical trajectories in Phase I, the acceptance rate was 93.7%, producing 281 200 data points. The Phase I runtime increased from 46.6 h to 53.5 h as numerical gradients are now computed on 64 s of data instead of 59 s. Using the data from Phase I, we first benchmarked ( , n srt ). We present the results of the benchmark in Table 10.2. Using the ad-hoc cost, and a requirement of having an acceptance rate greater than 40%, the optimal values from the benchmark were ( , n srt ) = (0.02, 5).

At the end of Phase III, the acceptance rate was 56%, which is consistent with the benchmark prediction of 58% after 400 trajectories. With ACL max = 14, Phase III produced 5 000 SIS after 70 012 trajectories which took a total of 13.0 h. This works out as a cost per SIS of C P hIII tps = 9.4 s/SIS. In Table 10.3 we present a breakdown of how the runtime duration now spreads over the different types of trajectories and additional trainings of the DNN carried (out every 50 numerical trajectories).

Runtime performance comparison

To compare the CPU performance of both algorithms, we ran both LALInferenceMCMC and DeepHMC on the same MacBook Pro containing a quad-core Intel i5-7360U CPU at 2.3 GHz. As LALInferenceMCMC is able to parallelize its computations on the available cores, we thereby measured the total run time (or wall time) as well as the CPU time. The CPU time measured for the LALInferenceMCMC run was 3.3 times the wall time of the run, meaning that, on average, LALInferenceMCMC was able to spread its computation on 3.3 cores. On the other hand DeepHMC benefits from no parallelization at the moment except during the ∼ 12 min during which the DNN is being trained where 2.5 cores are being used on average. Since runs last on the orders of days, we approximate its CPU time with the wall time.

Unfortunately we cannot plot the ACL for LALInferenceMCMC since the chain is thinned internally every 2 000 samples to save memory. This means that in order to produce the chain of 50 076 correlated samples, which we thinned again to 5 000 SIS, LALInferenceMCMC performed ∼ 10 8 iterations on its lower temperature chain. Similarly, we do not have access to the average acceptance rate for this run. For reference, we plot in Fig. 10.1 the auto-correlation functions over the chain of 70 012 correlated samples produced by DeepHMC and which show a maximum ACL of 14; the acceptance rate at the end of Phase III was 56.4%.

While not the goal of this test, we compared the posterior distributions between DeepHMC and LALInferenceMCMC at the end of the run. When investigating the LALInferenceMCMC posterior distributions, we saw that the algorithm had not fully converge to the true posterior distribution. We know from published results (see figure 11 of [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF]) that the distribution for Λ was bimodal. However, our LALInferenceMCMC run only produced a unimodal posterior distribution for this parameter. In contrast, the DeepHMC algorithm produced the expected bimodality in Λ. This can be seen in In Table 10.4 we detail the performance comparison between the two algorithms. As expected, the random walk implemented in LALInferenceMCMC requires a lot more time to gather SIS than the HMC does. Our LALInferenceMCMC run took 66.4 days to produce a set of samples which, as we explained, had not fully converged in the Λ dimension. This wall time converts to 220.2 CPU days. The durations of each DeepHMC phase are reported in Table 10.4. In total, DeepHMC converged in 67.1 h, i.e. 2.8 CPU days. This means that our algorithm currently offers a speedup factor of ∼ 80. We consider this result as a lower limit for this analysis since LALInferenceMCMC would in fact have required more time to fully converge to the true posterior distribution. Furthermore, we remind the reader that if more SISs are needed to produce the posteriors, e.g. 10 000, we can expect the speed-up to rise to ∼ 150 since LALInferenceMCMC run time grows approximately linearly with the effective sample size while only Phase III is impacted for DeepHMC, going from 13.0 h to an expected ∼ 26 h for 10 000 SIS.

Comparison of posterior distributions with LALInfer-enceMCMC published results

To produce a robustness test for DeepHMC, we compare the posterior distributions with published results from the LVC using the IMRPhenomD-NRTidal waveform model 3 [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF] and which was also carried out with LALInferenceMCMC. Before making the comparison, we remind the reader of two major differences between the two analyses. Firstly, the LVC analysis began from 23 Hz, which results in 128 s of strain data, whereas the DeepHMC analysis began at 30 Hz, which produces 64 s of data. Lack of time unfortunately prevented us from running DeepHMC from 23 Hz to compare apples with apples. This analysis is currently ongoing and the results will appear in an article highlighting the main results of this thesis. Secondly, the LVC analysis marginalizes over calibration uncertainties in the phase and amplitude measurement of the interferometers. This is, as of yet, not implemented in the DeepHMC. Given these caveats, we compare the posterior distributions produced by DeepHMC and LALInferenceMCMC in Figs. 10.2 to 10.6. For each parameter, we present the marginalized posterior distributions, the median values (solid line) and the symmetric 90% credible intervals (dashed lines). As we are taking LALInferenceMCMC as our point of reference, only numbers from this run are quoted at the top of each plot. We compare these values with their DeepHMC counterparts in Table 10.5. The 2D joint posterior display the 50%, 90% and 99% credible regions over the two parameters considered 4 .

Starting with tidal parameters, we see in Fig. 10.2 that the two modes in Λ explored by each algorithm overlap very well, leading to an almost identical median estimate ( Λ = 370 +484 -247

for LALInferenceMCMC against Λ = 377 +517 -234 for DeepHMC). We can also see a very large overlap in posterior distributions for the individual tidal parameters (Λ 1 , Λ 2 ).

Moving onto Fig. 10.3, we plot the posterior distributions for the source frame individual masses and chirp-mass, as well as the mass ratio. In general, there is very good agreement between the two algorithms. Nevertheless we note a discrepancy close to the equal mass line where LALIn-ferenceMCMC has more support than DeepHMC in this region. This discrepancy could come from a number of sources. One possibility is that the discrepancy comes from the different low frequency cut-offs used by each analysis. Our re-run of DeepHMC from 23 Hz will shortly answer this question. Another possibility is that we saw in section 10.1.3 that DeepHMC had difficulty in sampling close to the equal mass line due to divergences in the log-prior gradients. While we treated this by capping the gradients to their value at η = 0.2499, it could also be that, even though the chain is now able to explore regions up to η = 0.25, this solution of capping gradients would still not resolve entirely the problem and result in a lack of support next to the equal mass line. This is a matter for future exploration.

In Figs. 10.4 and Fig. 10.5, we see very good agreement for (θ JN , ψ, D L ) and (α, δ, t c ). Finally, in Fig. 10.6, we plot the posterior distributions for the spin parameters (χ 1 , χ 2 , χ ef f ). While there is a small discrepancy in the posterior distributions for χ ef f , we see an almost perfect alignment

+3

-5

Table 10.5: Comparison of the symmetric 90% credible intervals around the median derived from the posterior distributions produced by DeepHMC and LALInferenceMCMC containing respectively 5 000 and 6 622 SISs. The complete description of the settings of the analysis is given in section 10.1.

for the individual spin parameters.

As a conclusion, we have successfully compared DeepHMC and LALInferenceMCMC to reproduce the 12D posterior distributions for GW170817 with an aligned-spin model, which includes tidal deformabilities. DeepHMC produces 5 000 SIS in only 2.8 days using a single CPU which translates into a CPU time speedup of a least 80 with respect to LALInferenceMCMC for a 64 s long signal. To confirm the robustness of DeepHMC, a future work is planned to run the algorithm on 128 s of data instead of 64 s by decreasing the low frequency cut-off from 30 Hz to 23 Hz and confront the new posterior distribution to the published one by the LVC.

Chapter 11

Future perspectives for DeepHMC

In this chapter we review several perspectives for an evolution of DeepHMC which could be the heart of a future work. Most of them are, if not necessary, of primary importance for the algorithm to be fully operational and broadly used by the GW community.

Treating the burn-in of the chain

In general, runs from the collaboration are started at a point where parameters values correspond to the waveform template that triggered the detection during the search process. In most cases this point does not belong to the main mode of the posterior distribution and the beginning of the chain must be burnt-in until it properly samples from the posterior distribution. In our studies, the HMC chain has always been started at a point in parameter space known to belong to the main mode of the posterior distribution, thereby avoiding any burn-in.

Ability to sample the inclination bimodality

As we explained in chapter 7, in order for the HMC to work in its new framework we had to deactivate the mode-hop scheme in cos θ JN which allowed the chain to visit the two face on/off modes. This did not prevent DeepHMC to produce good results on GW170817 though since this signal has the peculiarity to present only one mode in this dimension. Nevertheless it is common for GW signals to be bi-modal in cos θ JN . Therefore it is necessary to run DeepHMC on such signals and test its ability to visit the two modes. If Hamiltonian trajectories end up trapped in a single mode for too long, then it would be necessary to implement a scheme where custom mode-hop jumps are proposed now and then to accelerate the mixing of the chain.

Including precessing spins

In this thesis, we have successfully demonstrated the ability of DeepHMC to include aligned-spins in its analysis. However, when mis-aligned, precession of the spins usually changes the motion of the binary system quite significantly and thus modifies the phase of the resulting GW (cf chapter 8). It is clear that the next step for DeepHMC is to be run with a precessing waveform model to prove its ability to sample from the full posterior distribution.

Parallelizing Phase I

As we explained several times throughout this manuscript, the main purpose of Phase I is to gather data points in parameter space, allowing for an accurate training of the cubic-OLUTs or DNN approximations of the log-likelihood gradients in Phase II. As such there is no need for the chain to be run sequentially and this phase may be parallelized at will. In the future, we would like to use more physically realistic waveforms for our analysis. In general, waveform models with higher order effects, such as precession or eccentricity, will be more expensive to generate. In this case, an unparallelized Phase I will become a restrictive bottleneck to using DeepHMC. In this regard, parallelizing Phase I appears crucial in practical terms, even though the algorithm can be run without this option, to make DeepHMC operational on acceptable timescales.

In depth validation of DeepHMC

So far, DeepHMC has only been tested on a single event: GW170817. As the C-code HMC was successfully validated on a set of 10 injected BNS signals [START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF], we can assume (or at least hope) that DeepHMC will demonstrate good performance on high SNR BNS signals, with the caveat that it can handle the bi-modality in θ JN . Nevertheless, a deeper validation of the algorithm is necessary for DeepHMC to be officially used by the collaboration on the same grounds as LALInferenceMCMC or LALInferenceNest for instance. In this case, a wider exploration of the BNS parameter space is needed, as well as an extension to testing other source types such as NSBHs and BBHs. In the near future, we plan to run on the 50 detections appearing in the GWTC-1 and GWTC-2 catalogs as well as pursue an injection study to validate the ability of the algorithm to recover the true parameters within statistical uncertainties.

Accelerating the sampling with EOB waveforms models

EOB waveform models [START_REF] Buonanno | Effective One-Body Approach to General Relativistic Two-Body Dynamics[END_REF][START_REF] Buonanno | Transition from Inspiral to Plunge in Binary Black Hole Coalescences[END_REF] are physically well motivated but remain slower to generate, even with ROM techniques [START_REF] Pürrer | Frequency Domain Reduced Order Models for Gravitational Waves from Aligned-Spin Compact Binaries[END_REF][START_REF] Pürrer | Frequency Domain Reduced Order Model of Aligned-Spin Effective-One-Body Waveforms with Generic Mass Ratios and Spins[END_REF], than their counterpart from the Phenom family: ∼ 30% slower reported on the NRTidal models in [START_REF] Dietrich | Improving the NRTidal Model for Binary Neutron Star Systems[END_REF]. By using a Phenom model to generate the Hamiltonian trajectories, but reverting back to the EOB waveform when evaluating the Hamiltonians in the MH ratio, we could cleverly speedup the inference of parameters from EOB models and make it essentially as fast as an algorithm that exclusively uses the Phenom family.

Conclusion

The work of this thesis has centered on the development of a HMC algorithm to accelerate the inference of parameters defining a GW signal. Starting from a C-code version of the algorithm, which had been demonstrated to speed-up the inference of fiducial BNS signals with a simple TaylorF2 model, the initial aim was to port the HMC to a new Python based framework and extend its use cases as much as possible.

Therefore we started by porting the algorithm to Bilby. We faced numerous difficulties during this process which highlighted important discrepancies between the two frameworks. First an inaccurate computation of the duration to coalescence in Bilby delayed the integration of Phase I for several months. Once this issue was fixed, we then needed to deactivate the previously used mode-hop scheme for cos θ JN and deal with zero padding issues for Phase I to work properly. Then we were surprised to see that the cubic-OLUTs method was failing to produce an accurate fit of numerical gradients while this ability had been demonstrated previously in the C-code version. By probing the goodness of our fit, both visually and numerically, we managed to find that the problem originated from two different definitions of the phase at coalescence between the C-code and LALSimulation. As the new definition completely changed the structure of the data set that needed to be fitted, we found a solution to this problem by marginalizing over φ c . With the HMC finally operational in its new framework, we included astrophysical parameters in our analysis and then performed its first analysis of real data using GW170817 as a test case. Finally, we incorporated several important optimizations of the algorithm to accelerate its sampling capabilities. After reducing the computational cost of numerical gradients, replacing the FIM-derived scales by an estimation of the covariance matrix using Phase I samples and optimizing the leapfrog stepsize, the HMC was able to produce 5 000 SIS in ∼ 24 h for an 8D analysis, using the IMRPhenomD model over 59 s of data, needing only 1.4 s on average in Phase III to acquire a new SIS.

As a second step for this work, we extended the algorithm to the analysis of aligned-spins and tidal deformabilities, as these parameters are crucial to accurately model the dynamics of the binary system. This effort firstly required an adjustment to the estimation of the FIM derived scales in Phase I. Secondly, we solved divergences appearing in the aligned-spin log-prior gradient, in particular thanks to the introduction of an effective gradient. Finally we determined which numerical derivative method, central or forward differencing, was suited for the numerical gradients with respect to each new parameter. As the dimensionality increased to 12 and the waveform model used, IMRPhenomD-NRTidal , was computationally more expensive, the HMC converged after about three days to produce the same ESS and took 19.7 s/SIS in Phase III.

Although these results were obtained with the cubic-OLUTs method, we knew it was not yet an optimal solution; in addition it was failing to fit the log-likelihood gradient with respect to tides accurately. As a result, we replaced this approximation with a machine learning algorithm hoping to find a more universal fitting function. Our tests settled on a single DNN we would train in Phase II on data gathered during Phase I. To obtain good gradient approximations, a careful fine tuning of the network's hyper-parameters was necessary. We converged on a DNN composed of three internal layers, composed of (120, 120, 1200) neurons respectively. W then optimized the batchsize used during the training process and found that 128 samples per batch produced optimal results. A direct comparison of the DNN against the cubic-OLUTs on the same data set demonstrated that the network had a much better ability to fit the gradients of the log-likelihood, even for gradients with respect to (cos θ JN , ψ, ln D L ) where OLUTs were previously necessary as they usually cause problem to the cubic fit. Not only did we develop a more accurate approximation method, but we also found it to be 2.6 times faster at making gradient predictions than the cubic-OLUTs. Altogether our DNN allowed to cut the cost for SIS by 2, achieving 8.9 s/SIS in Phase III.

To measure the performance of DeepHMC with respect to that of LALInferenceMCMC, we ran both algorithms on 64 s of GW170817 data with identical analysis settings. Our strategy to use a HMC based algorithm and subsequent efforts to optimize it resulted in a speed-up factor of at least 80 in CPU time as 5 000 SIS were produced in only 2.8 CPU days for DeepHMC against 220 for LALInferenceMCMC which ended its run before converging to the full posterior distribution. We highlight that increasing the ESS to the commonly used value of 10 000 SIS would result in a speed-up of ∼ 150. Then we tested our algorithm's robustness by confronting both visually on numerically the posterior distribution it produces with the published one by the LVC in [START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF] using the IMRPhenomD-NRTidal waveform model. Apart from some minor discrepancies and a point of attention about the ability of DeepHMC to sample close to the equal mass line, all of which could be explained by the different segment lengths analyzed by DeepHMC and LALInferenceMCMC, we find that within statistical uncertainties DeepHMC produces the same posterior distribution as LALInferenceMCMC.

We believe these achievements should foster a global effort to pursue the integration of DeepHMC as a standard sampler for the LVK collaboration. While the work presented here represents a major step towards this purpose, there remain some non-negligible efforts to be made for DeepHMC to become fully operational: Phase I desperately needs parallelization, the algorithm needs further optimization to account for bimodal distributions, at present it does not contain marginalization over calibration errors, work is needed to extend the dimensionality of the algorithm to account for effects such as precession, eccentricity etc, and a broader validation campaign on a large set of GW signals together with an injection study will have to be pursued to fully validate the robustness of the algorihtm.

To conclude we demonstrated that using optimized Hamiltonian trajectories to propose new points in phase-space enables DeepHMC to drastically reduce the CPU time of GW parameter inference compared with current algorithms. Not only did we show that DeepHMC is a promising solution to respond to the increasing rates of detections and segment durations, but it also leaves doors open to further enhancements making it a potentially powerful tool to face upcoming observation runs.

Figure 1 . 3 :

 13 Figure 1.3: Illustration of two massive orbiting bodies bounded by their mutual gravitational attraction in a circular orbit (illustration taken from [8]).

x 1 1 =

 1 r cos(ωt), (1.63) x 2 1 = r sin(ωt), (1.64) x 1 2 = -r cos(ωt), (1.65) x 2 2 = -r sin(ωt).

Figure 1 . 4 :

 14 Figure 1.4: Ground-based GW detector network. In red are detectors currently making observations, LIGO India is still under construction and GEO is operating but has a sensitivity generally too low to participate to coherent detections, hence we denote it in blue. Map created with Google My Maps.

Figure 1 . 5 :

 15 Figure 1.5: Simplified diagram of a LIGO detector. Except for the four components closest to the beam splitter, used to enhance the detector's measurement abilities, this simplified setup is that of a Michelson's interferometer. Figure taken from [49].

Figure 1 . 6 :

 16 Figure 1.6: Link between the mirrors displacement sensitivity of the AdV (top panel) and aLIGO (bottom panel) detectors and different sources of noise which are explained in the accompanying text, section 1.6.2.2. Top panel figure taken from [4] and bottom one from [51], corresponding to the sensitivity of the detectors in 2015. The strain amplitude on the top panel corresponds to the mirror displacement divided by the AdV arm length, ie 3 km.

Figure 1 . 7 :

 17 Figure 1.7: Representation of the minimum set of 9 parameters λ µ defining the GW emitted by a binary system. (α, δ) are the right-ascension and declination angles, ψ is the polarization angle, D L the luminosity distance to the source, (t c , φ c ) the time and phase at coalescence, (m 1 , m 2 ) the primary and secondary masses of the components where by convention we consider m 1 > m 2 and ι is the inclination angle between N , the line of sight from the observer to the source, and L, the Newtonian orbital angular momentum of the binary.

Figure 2 . 1 :

 21 Figure 2.1: Hertzsprung-Russell diagram. The position of a star in the diagram provides information about its present stage and its mass. Figure taken from [71].

  Figure 2.1: Hertzsprung-Russell diagram. The position of a star in the diagram provides information about its present stage and its mass. Figure taken from [71].

Figure 2 . 2 :

 22 Figure 2.2: Simplified evolutionary steps of a star depending on its initial mass M . The top branch corresponds to low mass stars for which 0.3 M M 8 M and the bottom branch to high mass stars where M 8 M .

Figure 2 . 3 :

 23 Figure 2.3: Evolutionary scenario for formation of neutron stars or black holes in close binaries [68].T is the typical time scale of an evolutionary stage, N is the estimated number of objects in the given evolutionary stage in the galactic disk. SN, ECSN stand respectively for supernovae and electron-capture supernovae. OB refers to the spectral type of the stars and implicitly means that these stars are in their early life with an initial mass M > 2 M even though we only consider here cases where M 8 M .

  )

Figure 3 . 1 :

 31 Figure3.1: Comparison of the characteristic strain for GW170817 and of the amplitude spectral densities (ASD) A n (f ) for each detector at the time of GW170817. | hc (f )| is common to all three interferometers as we neglected the antenna pattern functions influence. The data for the ASD was derived from GWTC-1[START_REF]GWTC-1: A Gravitational-Wave Transient Catalog of Compact Binary Mergers Observed by LIGO and Virgo during the First and Second Observing Runs[END_REF].

Figure 3 . 2 :

 32 Figure3.2: Illustration of the matched-filter analysis on a high amplitude BBH GW signal, GW150914, in the Handford detector. A template h(t) from the bank is correlated with the strain signal s(t) detected (bottom panel ). When the phases do not match ( green), the corresponding matched-filter SNR ρ mf is low (top panel ). However, when the phases match (orange), we see a significant peak in the SNR time series, yielding the time of detection. Signals in the bottom panel have been windowed, whitened and band-passed, in accordance with the data analysis scheme used by the collaboration and described in[START_REF]A Guide to LIGO-Virgo Detector Noise and Extraction of Transient Gravitational-Wave Signals[END_REF]. The whitening procedure is responsible for the peculiar unit in noise-standard-deviation σ. This figure has been produced from a largely adapted version of the tutorial in[104] and using open data from the interferometers available on the GWOSC website [105].

Figure 3 . 3 :

 33 Figure 3.3: Equivalent of Fig.3.2 (see corresponding caption) but for a typical BNS system, here GW170817 in the Livingston detector. Even though the signal is more deeply buried in noise than GW150914, GW170817 has a higher matched-filter SNR than GW150914 as the entire signal stretches over ∼ 57 s vs ∼ 0.2 s allowing to accumulate a lot more phase-matching. Only the last 0.2 s are plotted here.

Figure 4 . 1 :

 41 Figure 4.1: Time domain GW strains detected by LIGO Handford (top) and LIGO Livingston (bottom) and reconstructed waveforms of GW150914, whitened by the noise PSD. The whitening procedure is responsible for the peculiar unit in noise-standard-deviation σ noise on the ordinate axis on the right; and on the left axis are normalized to preserve the strain amplitude at 200 Hz. Times are shown relative to the time of coalescence at the center of the earth, i.e. September 14, 2015 at 09:50:45 UTC. The width of waveform templates plotted corresponds to the 90% credible regions.The light blue curve combines results from the IMRPhenomP[START_REF] Hannam | Simple Model of Complete Precessing Black-Hole-Binary Gravitational Waveforms[END_REF][START_REF] Chatziioannou | Constructing Gravitational Waves from Generic Spin-Precessing Compact Binary Inspirals[END_REF] and SEOBNR[START_REF] Buonanno | Effective One-Body Approach to General Relativistic Two-Body Dynamics[END_REF][START_REF] Buonanno | Transition from Inspiral to Plunge in Binary Black Hole Coalescences[END_REF][START_REF] Buonanno | Effective-One-Body Waveforms Calibrated to Numerical Relativity Simulations: Coalescence of Non-Spinning, Equal-Mass Black Holes[END_REF] templates while the dark blue was obtained with a wavelet method agnostic to the morphology of the waveform. See[START_REF] Abbott | Properties of the Binary Black Hole Merger GW150914[END_REF] for further details.

Figure 4 . 2 :

 42 Figure 4.2: 90% credible regions of masses and spins of all the GW events detected during O1 and O2. Left panel : Source frame component masses m 1 and m 2 where by convention m 1 > m 2 . Lines of constant mass ratio q are indicated. Right panel : Final mass M f and spin magnitude a f of the remnant BHs. Figure taken from [100].

Figure 4 . 5 :

 45 Figure 4.5: Strain sensitivity curves for second/third generation (2G/3G) GW detectors and LISA. The strain amplitude of GW150914 is represented for comparison as well as the expected background of massive BBH and galactic white-dwarfs binaries. Figure taken from [120].

Figure 5 . 1 :

 51 Figure 5.1: Left panel : A Monte Carlo simulation to estimate π. N = 400 points are uniformly drawn inside the square and with 318 being inside the circle (represented by blue dots) leading to an estimation π(400) = 3.18. Right panel : Convergence of the estimator π(N ) with increasing N . In red we represent the true value for π and in dashed blue the theoretical speed of convergence of the standard deviation, 1/ √ N , around the mean.

Figure 5 . 2 :

 52 Figure 5.2: In both panels, we represent in blue a generic 2D Gaussian distribution illustrating a potential posterior distribution the MCMC algorithm aims at recovering. Left panel : The exploration of the posterior distribution after only four iterations. Right panel : after 50 000 iterations we thinned the chain to 500 samples (red dots) which are distributed according to the posterior.

1 Figure 5 . 3 :

 153 Figure 5.3: Using the same target 2D Gaussian distribution represented on Fig. 5.2, we start the chain 20 standard deviations away from the peak located at (λ 1 , λ 2 ) = (4, 5) and plot the first 300 iterations of the chain marginalized in the first dimension. The chain needs ∼ 50 iterations to converge to the main mode of the distribution. When computing statistical quantities, the chain is burned-in by discarding these initial samples.

Figure 5 . 4 :

 54 Figure 5.4: Auto-correlation functions for each dimension of a GW MCMC run which gathered 10 5 correlated samples. The corresponding integrated auto-correlation length is indicated for each parameter. The slowly vanishing curve for ψ indicates an important correlation in this direction which results in a very high L max = L(ψ) = 233. Thus only 10 5 /233 = 429 SIS have been gathered for this run leading to a poor estimation of the credible intervals.

45 T = 4 Figure 5 . 5 :

 45455 Figure 5.5: The left plot gives an example of a bimodal distribution where the chain gets trapped in one of the two modes because of the important low probability gap separating them. The right plot shows the effect of tempering the distribution with a fiducial temperature equal to 4, translating in a doubling of the standard deviation parameter for the two normal distributions. Both peaks are hence flattened allowing for the hot chain to explore the two modes more easily and avoid being stuck. In both cases we show the first 500 iterations (red dots) of an MCMC chain starting from the same point (center of the highest mode) and using the same proposal function.

Figure 5 . 6 :

 56 Figure 5.6: Effect of drawing new momenta at the beginning of each Hamiltonian trajectory. Three consecutive trajectories of length 11 are plotted in phase-space on the left-panel while the evolution of their energy components are successively displayed on the right-panel. In this example the two proposed points have been accepted.

Figure 6 . 1 :Figure 6 . 2 :

 6162 Figure 6.1: Phase-space plot of a numerical trajectory of length l = 200, with a stepsize = 5×10 -3(beginning at the green dot and ending at the red dot) for a non-spinning 9D GW signal.

4 KFigure 7 . 1 :

 471 Figure 7.1: Evolution of a numerical trajectory of 200 leapfrog steps. The top two cells represent the gradients of the log-likelihood with respect to α and sin (δ) displaying local instabilities several orders of magnitude larger than expected. This results, as shown in the bottom cell, in a large impulse in their respective momenta, and hence in the total kinetic energy. As this is not compensated for by the potential energy, the Hamiltonian is no longer conserved, and the trajectory is rejected.

Figure 7 . 2 :

 72 Figure 7.2: Plot of variations in time to coalescence versus right ascension for a BNS signal at the Hanford detector, using two variations in the ordering of the time to coalescence equation. The blue curve corresponds to the original Bilby implementation, while the orange curve corresponds with the re-arranged equation. As can be seen, the stepped behaviour in the original implementation can lead to near-infinite gradients at the edges of each step, and near-zero gradients on the plateaus.

Figure 7 . 3 :

 73 Figure 7.3: Regression plots comparing the approximate and numerical gradients, (∂ µ ln L) app and (∂ µ ln L) num , based on the same data set of 296 200 {q µ , (∂ µ ln L) num } points used to derive the fit methods. The three contours encompass 90%, 99% and 99.9% of the data. Gradients with respect to cos θ JN , ψ and ln D L are approximated with a local fit using Ordered Look-Up Tables (OLUTs), while all other gradients are approximated with a global cubic fit. The R 2 values suggest that the approximate gradient methods only worked for gradients with respect to cos θ JN and ln D L , indicating a failure of the method in general.

Figure 7 . 4 :

 74 Figure 7.4: 2D marginal distribution in the (φ new c , ψ) plane using the 296 200 positions points gathered from a Phase I run with 1 500 numerical trajectories of length 200, using the LALSimulation version of the TaylorF2 waveform.

2π 0 L

 0 (s|q µ )π(φ c )dφ c . (7.10) Then if we assume that the gravitational wave only consists of the l = |m| = 2 spherical harmonic modes, the waveform at any φ c can be written as h(φ c ) = h(φ c = 0) e iφc = h0 e iφc .(7.11)

  Figure 7.5:Regression plots comparing the approximate gradients, (∂ µ ln L) app , with the numerical gradients, (∂ µ ln L) num , using an identical data set of 296 600 points representing { q µ , (∂ µ ln L) num } used to derive the fit methods and gathered on injected data. The three contours encompass 90%, 99% and 99.9% of the data respectively. Gradients with respect to cos θ JN , ψ and ln D L are approximated with a local fit using Ordered Look-Up Tables (OLUTs), while all other gradients are approximated with a global cubic fit. All R 2 are very close to unity meaning the cubic-OLUTs method is able to correctly approximate the data, at least on the set of points used to derive the fit.

  Figure 7.6:Regression plots comparing the approximate gradients, (∂ µ ln L) app , with the numerical gradients, (∂ µ ln L) num , using an identical data set of 299 000 points representing { q µ , (∂ µ ln L) num } used to derive the fit methods and gathered on real GW170817 data. The three contours encompass 90%, 99% and 99.9% of the data respectively. Gradients with respect to cos θ JN , ψ and ln D L are approximated with a local fit using Ordered Look-Up Tables (OLUTs), while all other gradients are approximated with a global cubic fit. All R 2 are very close to unity meaning the cubic-OLUTs method is able to correctly approximate the data, at least on the set of points used to derive the fit.

Figure 7 . 7 :

 77 Figure 7.7: HMC autocorrelation functions computed on the 345 057 samples produced by analysing 59 s of real data for GW170817 using a non-spinning IMRPhenomD waveform model. The integrated auto-correlation length (ACL) for each parameter is given in the legend. The longest ACL has a value of 65, meaning that the data set produces 5 308 SISs.

Figure 7 . 8 :

 78 Figure 7.8: Comparison of the prior densities (as described in Table7.1) and the marginalized posterior densities produced by the HMC and LALInferenceMCMC in[START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF] on GW170817. The parameter estimates quoted represent the median values (solid line), 5% lower limit and 95% upper limit credible intervals. The discrepancy in the component mass posteriors between the HMC and LALInferenceMCMC are predominantly due to differences in the starting frequency and the use of a non-spinning waveform model in our analysis. The scale used for prior densities is such that they integrate to one over their predefined support and for the marginalized posterior densities such that they integrate to one over the range defined by posterior samples.

Figure 7 . 10 :

 710 Figure 7.10: Comparison of the prior densities (as described in Table7.1) and the marginalized posterior densities produced by the HMC in its original version, its optimized version and LALIn-ferenceMCMC in[START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF] on GW170817. The parameter estimates quoted represent the median values (solid line), 5% lower limit and 95% upper limit credible intervals (dashed lines) produced by the optimized HMC. The differences in the settings used by the HMC and LALInferenceMCMC are described in the section 7.3.2. The scale used for prior densities is such that they integrate to one over their predefined support and for the marginalized posterior densities such that they integrate to one over the range defined by posterior samples.

Figure 8 . 1 :

 81 Figure 8.1: Source frame of a binary following simple precession: the total angular momentum J = L + S 1 + S 2 remains approximately constant during the inspiral while the orbital angular momentum L describes a cone around it. N is the line of sight of the observer.

Figure 8 . 3 :

 83 Figure 8.3: Shape of the zprior used in our analysis for aligned-spin parameters and defined in Eq.(8.4). χ max is set to 0.05 in accordance with usual settings when considering the low spin prior case for BNS systems.

Figure 8 . 4 :

 84 Figure 8.4: A comparison between the true (dashed yellow lines) and effective (solid blue line) gradients of the log-zprior. The effective gradient interpolates across the divergence at χ i = 0 and smoothly connects the two regions of spin-space.

Figure 8 . 5 :Figure 8 . 6 :

 8586 Figure 8.5: GW170817 marginalized posterior distribution for the tidal parameters in the low-spin prior case. The analysis was carried out for four different approximants which corresponding 50% (dashed) and 90% (solid) credible regions are denoted with different colors, the blue shading being representative of IMRPhenomP-NRTidal only. Some EoSs, computed from the mass samples of the IMRPhenomP-NRTidal analysis, are represented in solid black lines and end at the Λ 1 = Λ 2 line. The three EoS outside the 90% credible region are strongly disfavoured by this GW measurement. Figure taken from [117].

Numerical

  ∂ ln L/∂ln(δt c )

Figure 8 . 8 :

 88 Figure 8.8: Comparison of the prior densities (as described in Table7.1) and the marginalized posterior densities produced by the HMC (5 000 SISs) and LALInferenceMCMC (6 622 SISs) in[START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF] on GW170817, using the IMRPhenomD-NRTidal waveform model. The parameter estimates quoted represent the median values (solid line), 5% lower limit and 95% upper limit credible intervals (dashed lines) produced by the HMC. Discrepancies in the posterior distributions could be explained by the fact that, contrary to the HMC analysis, the LALInferenceMCMC analysis used 128 s of GW170817 data (against 59 s for the HMC) and marginalized over calibration uncertainties. The scale used for prior densities is such that they integrate to one over their predefined support and for the marginalized posterior densities such that they integrate to one over the range defined by posterior samples.

Figure 9 . 1 :

 91 Figure 9.1: A simple three-layer DNN used to approximate gradients of the log-likelihood for a dimensionality of D = 2. The neurons of the input layer are assigned the position values, and neurons of the output layer contain the DNN approximation of the gradients (∂ µ ln L) DN N . The latter are computed from the activation values a 2i stored in the 3 neurons of the hidden layer using Eq. (9.1).The similar coloured weights and biases are involved in the same activation computation.

Figure 9 . 2 :

 92 Figure 9.2: Sketch representation of the architecture of the DNN implemented. Each layer is fully connected to its neighbours and the number of neurons is stated together with the activation function used. During training the dropout layer deactivates randomly at each update 25% of the connections from the layer preceding it which prevents overfitting the data.

Figure 9 . 3 :

 93 Figure 9.3: Influence of the batchsize on the learning behaviour of the network on a training set (top panel) and on a validation set (bottom panel) of equal size 289 100. The mean squared error (MSE) loss between (∂ µ ln L) num and (∂ µ ln L) DN N is computed at the end of each epoch. While increasing the batchsize degrades the accuracy on the training set monotonously, the influence on the validation set is worse for central batchsize values than for the larger ones. In the end a batchsize of 128 produces an equivalently good training as 32 for instance while reducing the training time.

  L/∂ ln(δt c )) num

Figure 9 . 4 :

 94 Figure 9.4: Comparison of the DNN's predicted values of the gradients of the log-likelihood, (∂ µ ln L) DN N , with the numerical gradients, (∂ µ ln L) num , on the same validation set used for Fig. 8.7, using the IMRPhenomD-NRTidal approximant.

Figure 9 . 6 :

 96 Figure 9.6: Evolution of the performance of our HMC algorithm during its development. For each version of the HMC, we report the cost per SIS (left y-axis) and the corresponding run time to gather 5 000 SISs (right y-axis), both computed for Phase III only and over all phases (Total). We remind that all SISs are gathered during Phase III. The Original cubic-OLUTs HMC is presented in section 6.3, its optimized version detailed in section 7.4 and DeepHMC was presented in this chapter. In each case, results have been obtained on 59 s of GW170817 real data while marginalizing over φ c , in either 12D when aligned-spins and tides were included in the analysis or 8D otherwise.

10. 1 . 1

 11 Common settings to DeepHMC and LALInferenceMCMC

Figure 10 . 1 :

 101 Figure 10.1: Auto-correlation functions of the chain produced by DeepHMC on 64 s of GW170817 data. M det and µ det refer to detector frame chirp and reduced masses.

  Fig. C.1 of Appendix C, where we super-impose the posterior distributions produced by DeepHMC and LALInferenceMCMC for the tidal parameters. For reference the posterior distributions for the other parameters are also compared in Figs. C.2 to C.5.

Figure 10 . 3 : 17 Figure 10 . 4 :Figure 10 . 6 :

 10317104106 Figure 10.3: Corner plot comparing the 1D marginalized and 2D joint posterior distributions produced by DeepHMC and by published results by the LVC in [117] using LALInferenceM-CMC, on GW170817 (see complete description of the analysis for DeepHMC in section 10.1 and differences with the published results settings in section 10.2). Conventions are the same as in Fig. 10.2.

Figure C. 5 :

 5 Figure C.5: Corner plot comparing the 1D marginalized and 2D joint posterior distributions produced by DeepHMC and LALInferenceMCMC, composed of 5 000 SIS each, on 64 s of GW170817 data (see complete description of the analysis in section 10.1). Conventions are the same as in Fig. C.1.

  .48) Contrary to Eq.(3.41) where | .|. C | is used to maximize automatically the SNR over the phase at coalescence; templates are generated at a given φ c when performning parameter inference (unless φ c is being marginalized over, see section 7.2.3 for more details). Thus the matched-filter SNR is simply defined by

  δt c,H = (t c + δt geo-if o )t s δt c,H = (t ct s ) + δt geo-if o

		7.4	×10 -6 +5.693417×10 1
		7.2
	c,H (sec)	7.0
	δt	6.8
		6.6
		0.50 6.4	0.75	1.00	1.25	1.50 α (rad)	1.75	2.00	2.25	×10 -4 +3.446 2.50

  Parameter λ µ Shape of prior π λ µ

			Limits	Units
	θ JN	Sinusoidal	0-π	rad
	ψ	Uniform	0-π	rad
	D L	Quadratic	10-100	Mpc
	m 1	Uniform	0.5-7.7	M
	m 2	Uniform	0.5-7.7	M
	δ α	Cosinusoidal Uniform	-π/2-π/2 0-2π	rad rad
	δt c	Uniform	δt det c ± 0.1	s
	Table 7.1: Priors used for the analysis of GW170817. δt det c	= t det c	-t s where t det c

  .[START_REF] Pürrer | Frequency Domain Reduced Order Models for Gravitational Waves from Aligned-Spin Compact Binaries[END_REF]

		HMC				Prior				LALInferenceMCMC
			2.5 +0.4 -0.5					1.6 +1.5 -1.5				38 +8 -16
		2.1	2.4	2.7	3.0	0.8		1.6	2.4	16	24	32	40	48
		θ JN (rad)					ψ (rad)			D L (Mpc)
								1.74 +0.03 -0.03			1.101 +0.019 -0.016
					1.4	1.5	1.6	1.7	1.8	1.12	1.20	1.28	1.36
							m 1 (M )			m 2 (M )
		-0.36 +0.06 -0.06					3.42 +0.04 -0.04			1187008882.4303 +0.0008 -0.0007
	-0.6	-0.5	-0.4 δ (rad)	-0.3	-0.2	3.35	3.40	3.45 α (rad)	3.50		0.5	2.0 ×10 -3 +1.1870088824×10 9 3.5 t c (s)

Table 7 .

 7 2: A comparison of the median and symmetric 90% credible intervals derived from the HMC, based on 5000 SISs, using a non-spinning IMRPhenomD waveform model, as well as a starting frequency of 30 Hz, against the public GW170817 parameter values produced using LALInfer-enceMCMC. We note that the public release values were derived using a different waveform model, with the analysis beginning at 23 Hz.

	Parameter LALInferenceMCMC	HMC
	θ JN	2.5 +0.4 -0.5	2.5 +0.4 -0.5
	ψ	1.5 +1.5 -1.4	1.6 +1.5 -1.5
	D L	38 +8 -17	38 +8 -16
	m 1	1.49 +0.16 -0.10	1.74 +0.03 -0.03
	m 2	1.28 +0.09 -0.12	1.101 +0.019 -0.016
	δ α	-0.37 +0.07 -0.07 3.43 +0.04 -0.04	-0.06 -0.36 +0.06 3.42 +0.04 -0.04
	t c	1187008882.4312 +0.0012 -0.0010	1187008882.4303 +0.0008 -0.0007

Table 7 .

 7 10 -1 29 49 ψ 1.65 × 10 -1 9.57 × 10 -1 9.33 × 10 -1 26 * 37 ln D L 3.73 × 10 -1 2.36 × 10 -1 2.26 × 10 -1 34 59 ln M4.70 × 10 -5 5.27 × 10 -5 5.06 × 10 -5 5: Comparison of the dynamic scaling factors, or scales, derived from the Fisher Information Matrix (FIM) at the beginning of the algorithm with their new estimation from the covariance matrix of samples gathered. For the latter case, σ samples

	37	31

Table 7 .

 7 6: Phase II benchmark results of several central stepsize values.

		0.005 0.01 0.02 0.04 0.08 0.16
	n srt	3	4	5	6	7	8
	a 400	87% 78% 76% 66% 48% 17%
	C 400 C400	230 8.8	128 5.0	66 2.5	38 1.5	26 1.0	37 1.5

5 0 = 0.16. We stop at this value

Table 7 .

 7 [START_REF] Akutsu | Overview of KAGRA: Calibration, Detector Characterization, Physical Environmental Monitors, and the Geophysics Interferometer[END_REF]) case, 7: Phase III results for each ( , n srt ) combination used in the benchmark of Table

			0.005	0.01	0.02	0.04	0.08	0.16
	n srt		3	4	5	6	7	8
	a end		88.2% 83.5% 77.3% 68.8% 55.7%	*
	Cend		10.1	5.3	2.9	1.6	1.0	*
	ACL max	59	17	9	6	7	*
	C P hIII tps	( s/SIS)	12.9	3.4	1.9	1.4	1.7	*
	Cadhoc 400		4.3	2.5	1.4	1.0	1.3	*

Table 7 .

 7 8: Impact of varying the successive rejection threshold n srt on the global performance in Phase III. In each row we state the final acceptance rate, the maximum auto-correlation length, the mean of the 8 ACL which is indicative of the evolution of the auto-correlation, the proportions of hybrid and numerical trajectories generated in Phase III, the average time to compute one trajectory and finally the time per SIS cost in Phase III.HMC version Phase I Phase II Phase III Total ACL max

	n srt		4	5	6	7	8	9	10	11	12
	a end		70.5% 69.3% 68.4% 68.4% 67.5% 67.3% 67.3% 67.3% 66.4%
	ACL max	6	6	6	6	6	6	6	7		7
	ACL mean	3.1	3.1	3.3	3.3	3.6	3.3	3.8	3.8	4
	P hyb		1.42% 0.71% 0.54% 0.37% 0.31% 0.23% 0.19% 0.16% 0.14%
	P num		0.34% 0.16% 0.16% 0.10% 0.10% 0.06% 0.05% 0.03% 0.03%
	time/traj (s)	0.302	0.240	0.234	0.213	0.206	0.194	0.191	0.185	0.186
	C P hIII tps	( s/SIS)	1.82	1.43	1.38	1.28	1.23	1.16	1.15	1.30	1.30
									C P hIII tps	Ctps
									(s/SIS)	(s/SIS)
	Original	34.4 h	2 min	19.3 h 53.7 h		65	13.9	38.5
	Optimized	22.2 h	12 min	1.9 h 24.3 h		6	1.4	17.5

Table 7 .

 7 10: Comparison of the symmetric 90% credible intervals around the median derived from the posterior distributions produced by the HMC in its original version, in its optimized version and LALInferenceMCMC containing respectively 5 000, 5 000 and 6 622 SISs.

	+1.5
	-1.4

Table 8 .

 8 73 × 10 -1 1.73 × 10 -1 ψ 1.66 × 10 -1 1.65 × 10 -1 1.65 × 10 -1 ln D L 3.74 × 10 -1 3.74 × 10 -1 3.74 × 10 -1 ln M 4.97 × 10 -4 6.01 × 10 -5 6.01 × 10 -5 ln µ 1.07 × 10 -1 2.45 × 10 -3 2.45 × 10 -3 sin (δ) 2.87 × 10 -2 2.87 × 10 -2 2.87 × 10 -2 α 2.00 × 10 -2 2.00 × 10 -2 2.00 × 10 -2 ln δt c 4.61 × 10 -5 7.98 × 10 -6 7.98 × 10 -6 2: As for Table 8.1, the two first columns compare scales computed from the FIM with and without aligned spin components χ i , but when tides are added to the analysis this time. The third column indicates the final scales retained to run Phase I.

			χ 1 χ 2 Λ 1 Λ 2	3.34 5.41 4.42 × 10 6 1.80 × 10 7	----4.42 × 10 6 1.79 × 10 7	5.00 × 10 -2 5.00 × 10 -2 2.50 × 10 3 2.50 × 10 3
	the scales predicted by the FIM were orders of magnitude larger than their natural range, i.e
	(σ F IM Λ1	, σ F IM Λ2	) = (4.4 × 10 6 , 1.8 × 10 7

Table 8 .

 8 3: Comparison of the coefficients of determination, R 2 , for three runs using either central/forward differencing on spins and tides when computing numerical gradients. The R 2 values are computed on the same validation set of 274 200 samples, where gradients with respect to spins and tides used central differencing. The R 2 values for cos θ JN , ψ and ln D L were computed with OLUTs and the cubic fit was used for the other parameters. The signal analyzed corresponds to 29 s of GW170817 data using the IMRPhenomD-NRTidal approximant.

	Gradient	Central-central Central-forward Forward-forward
	R 2 (∂ χ1 ln L) R 2 (∂ χ2 ln L) R 2 (∂ Λ1 ln L) R 2 (∂ Λ2 ln L)	0.98 0.98 0.48 0.51	0.99 0.97 0.59 0.59	0.98 0.97 0.40 0.42
		Central-central Central-forward Forward-forward
	a P hIII	38.5%	36.7%	37.9%
	ACL max	25	21	28
	ACL mean	16.3	16.4	18.3
	C tps ( s/SIS)	6.66	5.76	7.35

Table 8 .

 8 4: Comparison of Phase III of the three runs using either central/forward differencing on spins and tides when computing numerical gradients. The signal analyzed corresponds to 29 s of GW170817 using the IMRPhenomD-NRTidal approximant.

Table 8 .

 8 Figure 8.7: Comparison of predicted values of the gradients with the numerical ones on a validation set, {q µ , (∂ µ ln L) num }, containing as many points as that used to derived the cubic-OLUTs fit: 289 100 . The three contours encompass respectively 90%, 99% and 99.9% of the data. 6: Same analysis as carried out in Table7.6 but with spins and tides included. = 0.08 produced diverging trajectories resulting in a very poor acceptance rate of 3% after 170 of them, thus we manually stopped it before it would converge as an excessive number of hybrid and numerical trajectories were being run.

	OLUTs						Cubic fit
	L/∂Λ 1	0.08	R 2 = 0.65	L/∂Λ 2	0.04	R 2 = 0.65
	Predicted ∂ ln	-0.08 0.00		Predicted ∂ ln	-0.04 0.00
							-0.04	0.00	0.04
				1			Numerical ∂ ln L/∂Λ 2

Table 8 .

 8 7: Phase III results after 25 000 trajectories for each ( , n srt ) combination used in the benchmark of Table8.6. values of 0.02 and 0.04 both produce a minimum ACL max of 16, but = 0.02 stands out as the optimal choice since the time per SIS in Phase III is only C P hIII

	tps	= 23

Table 8 .

 8 1 and 1.0 respectively, we can see that the 8: Breakdown of the total duration of Phase III over the different types of trajectories and the re-derivation of the cubic coefficients carried out after the accumulation of 50 numerical trajectories. The second column indicates the proportions of each trajectory type and the number of times the cubic coefficient were re-derived.first combination has a lower cost per SIS at 23 s as opposed to 31 s, as well as a higher acceptance rate of 43%. Taking all of these factors into consideration, it suggests that ( , n srt ) = (0.02, 5) are the optimal values from the benchmark.Consistent with results from Table8.7, Phase III took 75 000 trajectories to produce exactly 5 000 SIS. The acceptance rate at the end of the run was 46%, with ACL max = 15. We should point out that in the previous version of the code, we updated the cubic approximation coefficients every 10 5 trajectories. However, now that the algorithm is more efficient, we never actually run long enough for the update to take place. As a consequence, we now update the cubic fit coefficients after every 50 numerical trajectories. As before, we update the OLUTs every time we run a hybrid/numerical trajectory. As Phase III lasted 27.3 h, the global performance translates into a time per SIS of C P hIII tps = 19.7 s/SIS. In Table8.8 we report how the total duration of Phase III is spread over the different types of trajectories and the new schedule for the re-derivation of cubic coefficients.

	Phase III operation	Proportion / Number Duration
	Analytical trajectory	94.3%	4.1 h
	Hybrid trajectory	3.7%	5.5 h
	Numerical trajectory	2.0%	13.7 h
	New cubic fit	27	4.0 h
	8.6.4 Phase III results
	8.6.4.1 Performance analysis

Table 8 .

 8 9: Comparison of the symmetric 90% credible intervals around the median derived from the posterior distributions produced by the HMC and LALInferenceMCMC based respectively on 5 000 and 6 622 SISs. The analysis used the IMRPhenomD-NRTidal waveform model, as well as 128 s and 59 s of data respectively.

	Parameter LALInferenceMCMC		HMC
	θ JN			2.5 +0.4 -0.5		2.6 +0.4 -0.5
	ψ			1.5 +1.5 -1.4		1.6 +1.4 -1.4
	D L			38 +8 -17		38 +8 -14
	m 1			1.49 +0.16 -0.10		1.49 +0.14 -0.08
	m 2			1.28 +0.09 -0.12		1.27 +0.07 -0.10
	δ α			-0.37 +0.07 -0.07 3.43 +0.04 -0.04		-0.06 -0.37 +0.06 3.43 +0.03 -0.03
	t c	1187008882.4312 +0.0012 -0.0010	1187008882.4316 +0.0013 -0.0011
	χ 1			0.002 +0.027 -0.018		0.010 +0.026 -0.019
	χ 2			0.001 +0.027 -0.020		0.008 +0.028 -0.021
	Λ 1			247 +730 -226		364 +902 -328
	Λ 2			401 +1104 -363		665 +1420 -598
	D Approximant	PhI	PhII PhIII Total Acc ACL max	C P hIII tps (s/SIS)	Ctps (s/SIS)
	8 IMRPhD	22.2 h 12 min	1.9 h 24.3 h 68%	6	1.4	17.5
	12 IMRPhD-NRTidal 46.6 h 45 min 27.3 h 74.6 h 44%	15	19.7	53.7

Table 8 .

 8 10: Performance of the HMC before and after including aligned-spins and tides in the analysis. In both cases Phase I (PhI) consists of 1 500 numerical trajectories of length 200. Durations of Phase III have been rescaled for a run producing exactly 5000 SIS in both cases. The acceptance rate reported, Acc, is that of Phase III only. The two last columns give the time per SIS cost respectively in Phase III only and over the entire run time.

Table 9 .

 9 1: Comparison of the coefficients of determination, R 2 , relative to the fit produced by the cubic-OLUTs and several DNN architectures when predicting gradients of the log-likelihood with respect to parameters listed in the first column on the same validation set used in Fig. 8.7. DNN-1 is composed of three internal layers containing each D neurons and using the ReLU activation function. DNN-2 and DNN-3 expand the second and third layer of DNN-1 to respectively 100D and 10D neurons keeping the same activation functions except for the first layer of DNN-3 which uses the linear function. DNN-4 adds a Dropout layer to the structure of DNN-3 between the second and third layer.

	which was

Table 9 .

 9 3: Same benchmark of the stepsize as carried out in Table8.6 but using the DNN instead of the cubic-OLUTs method. distributions from the DNN and cubic-OLUTs of the HMC overlap almost perfectly which validates the robustness of the DNN approximation of the log-likelihood gradients. For reference we report in Table9.4 the 90% credible intervals centered on the median for each case.

	.8). The

Table 9 .

 9 5: Breakdown of the total duration of Phase III over the different types of trajectories and the new trainings of the DNN carried out after the accumulation of 50 numerical trajectories. The second column indicates the proportions of each trajectory type and the number of times the DNN was re-trained.

		Cubic-OLUTs					DNN				LALInferenceMCMC
				2.5 +0.4 -0.5					1.6 +1.5 -1.4					38 +8 -14
		2.1		2.4	2.7	3.0		0.8	1.6	2.4		16	24		32	40	48
			θ JN (rad)					ψ (rad)					D L (Mpc)
				1.50 +0.14 -0.08					1.26 +0.07 -0.10					-0.36 +0.06 -0.06
	1.4	1.5	1.6 1 (M ) m det	1.7	1.8	1.12	1.20 m det 2 (M )	1.28	1.36	-0.6	-0.5	-0.4 δ (rad)	-0.3	-0.2
				3.43 +0.04 -0.03				1187008882.4316 +0.0013 -0.0011				0.011 +0.026 -0.019
	3.35	3.40	3.45 α (rad)		3.50		0.5	2.0 t c (s) ×10 -3 +1.1870088824×10 9 3.5	-0.04	-0.02	0.00 χ 1	0.02	0.04
			0.009 +0.027 -0.020					378 +865 -338					674 +1434 -600
	-0.04	-0.02		0.00 χ 2	0.02	0.04		800	1600 Λ 1	2400	3200		1000	2000	Λ 2	3000	4000
	Figure 9.5: Comparison of the marginalized posterior densities produced by the HMC (5 000
	SISs) using either the cubic-OLUTs or DNN approximation of the log-likelihood gradients in

Phase III, and with LALInferenceMCMC (6 622 SISs) in

[START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF]

on GW170817, using the IMRPhenomD-NRTidal waveform model. The parameter estimates quoted represent the median values (solid line), 5% lower limit and 95% upper limit credible intervals (dashed lines) produced by the HMC with the DNN. Discrepancies in the posterior distributions between the HMC and LALInferenceMCMC could be explained by the fact that, contrary to the HMC analysis, LAL-InferenceMCMC used 128 s of GW170817 data (against 59 s for the HMC) and marginalized over calibration uncertainties.

Table 9 .

 9 6: Performances comparison of the algorithm when replacing the cubic-OLUTs fitting method by the DNN. The latter being more accurate in its gradients prediction, the acceptance rate in Phase III is sensibly higher which decreases the auto-correlation of the chain (ACL max ) and therefore the total runtime. Durations of Phase III have been rescaled for a run producing exactly 5000 SIS in both cases. The two last columns report the time per SIS cost, respectively in Phase III only and over the entire run time. The signal analyzed consists of 59 s of GW170817 real data sampled at 4096 Hz.

  Parameter λ µ Starting value of the chain Units

	θ JN	2.04318308535 rad
	ψ	1.61012417485 rad
	D L	21.1702759705 Mpc
	m 1	1.72592086595 M
	m 2	1.10730509114 M
	δ α	-0.408084 rad 3.44616 rad
	t c	1187008882.43 s
	χ 1	0.027842426346 -
	χ 2	0.027826246618 -
	Λ 1	130.651548464 -
	Λ 2

Table 10 .

 10 Table10.2: Same benchmark of the stepsize as carried out in Table8.6 but using 64 s of signal instead of 59 s and capping the log-prior gradients for (ln M, ln µ) at their value at η = 0.2499 instead of using this limit as a bouncing boundary for trajectories. 3: Breakdown of the total duration of Phase III, based on 64 s of data, over the different types of trajectories and additional trainings of the DNN carried out after the accumulation of 50 numerical trajectories. The second column indicates the proportions of each trajectory type and the number of times the DNN was re-trained.

		0.005 0.01 0.02 0.04
	n srt	3	4	5	6
	a 400 C400	65% 71% 58% 33% 4.0 1.9 1.1 1.0
	Cadhoc 400	3.1	1.5	1.0	1.1
	Phase III operation	Proportion / Number Duration
	Analytical trajectory			97.3%	2.5 h
	Hybrid trajectory				1.8%	2.5 h
	Numerical trajectory			0.9%	6.7 h
	New DNN training				7	1.3 h

  Table10.4: Comparison of the performances of DeepHMC with LALInferenceMCMC on 64 s of GW170817 real data sampled at 4096 Hz with the IMRPhenomD-NRTidal approximant to produce 5 000 SIS. The complete description of the settings of the analysis is given in section 10.1.

	Sampler	Nb CPUs		Wall time	CPU time
	LALInference -MCMC	3.3		66.4 d		220.2 d
				2.8 d
	DeepHMC	1	Phase I Phase II	Phase III	2.8 d
			53.5 h	0.6 h Analytical 2.5 h	Hybrid 2.5 h	Numerical 6.7 h	DNN fit 1.3 h

  TableC.1: Comparison of the symmetric 90% credible intervals around the median derived from the posterior distributions produced respectively by DeepHMC and LALInferenceMCMC containing 5 000 SIS each. The complete description of the settings of the analysis is given in section 10.1.

			1.6 +1.4 -1.5
	D L	39 +8 -14	39 +7 -15
	z	0.0087 +0.0017 -0.0032	0.0087 +0.0016 -0.0033
	m 1	1.47 +0.15 -0.09	1.49 +0.15 -0.10
	m 2	1.27 +0.08 -0.11	1.25 +0.09 -0.11
	M q	1.187 +0.004 -0.002 0.87 +0.12 -0.15	1.187 +0.004 -0.002 0.84 +0.12 -0.14
	δ α	-0.37 +0.06 -0.06 3.43 +0.04 -0.04	-0.06 -0.36 +0.06 3.42 +0.03 -0.03
	t c	1187008882.4312 +0.0012 -0.0010	1187008882.4311 +0.0012 -0.0010
	χ 1	0.003 +0.028 -0.017	0.004 +0.027 -0.018
	χ 2	0.002 +0.028 -0.020	0.003 +0.028 -0.020
	χ ef f	0.004 +0.015 -0.010	0.005 +0.015 -0.010
	Λ 1	485 +2096 -444	255 +739 -230
	Λ 2	930 +2347 -852	446 +1190 -399
	Λ	762 +1495 -543	377 +517 -234
	δ Λ	28 +416 -502	4 +221 -200
	ρ mf	32.47 +0.09 -0.16	32.28 +0.09 -0.14
	ln(L R )	522 +3 -5	520 +3 -5

I ought to mention that, once or twice, I was right.

Okay one or two but that only goes in the footnote.

France and Italy indeed started the project but were joined later in their efforts by the Netherlands, Poland, Hungary and Spain.

We already use this notation as a reference to the luminosity distance which will be the standard distance measurement to the source using GWs.

In units of length it would read r ISCO = 6Gm/c 2 .

From several minutes to hours to generate a typical BNS waveform[START_REF] Pürrer | Frequency Domain Reduced Order Models for Gravitational Waves from Aligned-Spin Compact Binaries[END_REF][START_REF] Bohé | An Improved Effective-One-Body Model of Spinning, Nonprecessing Binary Black Holes for the Era of Gravitational-Wave Astrophysics with Advanced Detectors[END_REF]. As a result, reduced order modeling (ROM) techniques have been developed to speed-up the computation by factors up to several thousands[START_REF] Pürrer | Frequency Domain Reduced Order Models for Gravitational Waves from Aligned-Spin Compact Binaries[END_REF][START_REF] Pürrer | Frequency Domain Reduced Order Model of Aligned-Spin Effective-One-Body Waveforms with Generic Mass Ratios and Spins[END_REF] making these waveforms adequate for parameter inference purposes.

See further references for individual waveform models: IMRPhenomB[START_REF] Ajith | Inspiral-Merger-Ringdown Waveforms for Black-Hole Binaries with Nonprecessing Spins[END_REF], IMRPhenomC[START_REF] Santamaría | Matching Post-Newtonian and Numerical Relativity Waveforms: Systematic Errors and a New Phenomenological Model for Nonprecessing Black Hole Binaries[END_REF], IMRPhenomD[START_REF] Husa | Frequency-Domain Gravitational Waves from Non-Precessing Black-Hole Binaries. I. New Numerical Waveforms and Anatomy of the Signal[END_REF][START_REF] Khan | Frequency-Domain Gravitational Waves from Non-Precessing Black-Hole Binaries. II. A Phenomenological Model for the Advanced Detector Era[END_REF], IMRPhenomP[START_REF] Hannam | Simple Model of Complete Precessing Black-Hole-Binary Gravitational Waveforms[END_REF][START_REF] Chatziioannou | Constructing Gravitational Waves from Generic Spin-Precessing Compact Binary Inspirals[END_REF], IMRPhenomHM[START_REF] London | First Higher-Multipole Model of Gravitational Waves from Spinning and Coalescing Black-Hole Binaries[END_REF], IMRPhenomX[START_REF] Geraint Pratten | Setting the Cornerstone for the IMRPhenomX Family of Models for Gravitational Waves from Compact Binaries: The Dominant Harmonic for Non-Precessing Quasi-Circular Black Holes[END_REF].

F = π √ r 1 r 2 /(1r 1 r 2 )where (r 1 , r 2 ) are the coefficients of reflections of the two mirrors of the cavity[9].

Also named angular pattern or beam pattern functions.

Note there is a typo in the definition of the wave-frame in[START_REF] Nishizawa | Probing Non-Tensorial Polarizations of Stochastic Gravitational-Wave Backgrounds with Ground-Based Laser Interferometers[END_REF].

The detailed mechanisms behind these emissions are still uncertain.

We note here that the singularity at r = R Sch is only an apparent singularity due to the coordinate system chosen but not a physical one since one can choose another coordinate system (e.g. Eddington-Finkelstein) where the metric is well defined at r = R Sch . On the contrary the singularity at r = 0 is a physical one since the Ricci tensor is not defined there.

A Kerr BH can in fact only approach extremality since |a| = 1 is an unstable state of the horizon[START_REF] Aretakis | Horizon Instability of Extremal Black Holes[END_REF].

Where r I SCO is defined here in length units as opposed to natural units in Eq.(1.92)

Only non-isolated binaries could have a non negligible eccentricity[START_REF] Blanchet | Gravitational Radiation from Post-Newtonian Sources and Inspiralling Compact Binaries[END_REF].

We use the same definition of the characteristic strain as that implicitly defined in Eq. (26) of[START_REF] Cutler | Gravitational Waves from Mergin Compact Binaries: How Accurately Can One Extract the Binary's Parameters from the Inspiral Waveform?[END_REF], but different from the definition used in[START_REF] Moore | Gravitational-Wave Sensitivity Curves[END_REF].

Interestingly the signal in Virgo had a low amplitude which constrained the sky position to Virgo's blind spots with respect to its antenna pattern.

A neutrino follow-up was also part of the campaign but was unsuccessful in finding any associated counterpart.

The NSBH rate was not updated due to uncertain nature of GW190814 and of the low significance of the other NSBH candidate GW190426_152155

In practice when implementing the algorithm, we first compute the Metropolis-Hastings ratio, then we generate a uniform random number u ∈ [0, 1] and accept X * if u α, reject it otherwise.

We use natural units for the Boltzmann constant giving k B = 1.

Backward is also possible but it yields the same performances as forward. We only use it at the boundaries of parameter space where h(q µ + ∆q µ ) would not be defined.

Between O(10) and O(10

) depending on the accuracy of fit.

δt geo-ifo is positive if the GW passes through the Earth center before the interferometer and negative otherwise.

Fig.

3.1 displays the ASD which is simply the square root of the PSD.

It is interesting to note how these 20.3 h are spread over: 16.1 h on analytical, 3.3 h on hybrid and 0.9 h on numerical trajectories, that is to say respectively 79.3%, 16.3% and

4.4% of the run time when each trajectory type represents in number respectively 99.52%, 0.44% and 0.04% of trajectories.[START_REF] Acernese | Advanced Virgo: A 2nd Generation Interferometric Gravitational Wave Detector[END_REF] While, as members of the LVC, we had access to the IMRPhenomD-NRTidal samples produced and used in[START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF], unfortunately this sample set has not been made public yet.[START_REF] Aasi | Advanced LIGO[END_REF] For plotting purposes we decided to remove two samples, at index 5 347 and 5 348, to only keep 6 622 SISs because these two points appeared at very odd positions in parameter space with M 0.04.

The sigmoid is define by f (x) = 1/(1 + e -x ).

RandomSearch is available on tensorflow 2.0+ while version 1.13 was used to run the DNN. This is because version 2.0 requires a hardware architecture unavailable on our machine to run optimally.

While, as members of the LVC, we had access to the IMRPhenomD-NRTidal samples produced and used in[START_REF]Properties of the Binary Neutron Star Merger GW170817[END_REF], unfortunately this sample set has not been made public yet.

The 90% credible region for a 2D joint posterior does not produce the same bounds given by the two respective 1D 90% credible interval of the parameters considered, see[START_REF]A Note about Sigmas -Corner[END_REF].

Commit reported is: (CLEAN 37caf89936b637993c30b3076fe4b853311873ee)

Commit reported is: (CLEAN cc76ded3b81c7b44559ae02b79b15ad74ae8622c)

Acknowledgements

Hamiltonian dynamics

Hamilton's equations are a reformulation of Newton's law describing classical mechanics. A system is described, in a particular frame of reference, by a set of canonical coordinates in phase-space (q µ , p µ ) where q µ are the generalized position coordinates and p µ their conjugate momenta. Then the time evolution of the system is defined by Hamilton's equations dq µ dt = ∂H ∂p µ , (5.25)

where H(q µ , p µ ) is the Hamiltonian.

Conservation of the Hamiltonian For a closed system, H is the sum of a potential energy U(q µ ) with a kinetic energy K(p µ ), H(q µ , p µ ) = U(q µ ) + K(p µ ), (5.27) and therefore corresponds to the total energy of the system. In this case, conservation of energy follows from the conservation of the Hamiltonian which can be demonstrated using Hamilton's equations:

= 0.

(5. [START_REF] Pürrer | Frequency Domain Reduced Order Models for Gravitational Waves from Aligned-Spin Compact Binaries[END_REF] This property is key to the effectiveness of the HMC as a MCMC algorithm. As we will see later, the acceptance probability will be directly linked to the conversation of H over a trajectory.

Conservation of phase-space volume Another important property which we will use later is the conservation of phase-space volume. To show this, we will use the fact that a transformation preserves volume if the determinant of its jacobian is equal to one. If we consider an infinitesimal evolution of the system after a very small duration δ T δ : q µ (t)

We define the kinetic energy as

where M µν is a positive definite mass matrix left to definition. It is common to make the components of p µ independent of each other by specifying a diagonal mass matrix where we note m µ = M µµ . Thus the kinetic energy can be rewritten as

(5.42)

Therefore the corresponding distribution of momenta is a multi-variate Gaussian with zero mean and standard deviation √ m µ in each direction allowing us to rewrite the canonical distribution over phase-space as P (q µ , p µ ) ∝ exp [-U(q µ )] N (0, m µ ).

(5.43)

By drawing momentum variable from their true distribution, p µ ∼ N (0, m µ ), we can essentially ignore them such that phase-space samples will naturally provide a sample set for the position variables q µ asymptotically coming from the distribution exp[-U(q µ )] [START_REF] Radford | MCMC Using Hamiltonian Dynamics[END_REF]. Since our target distribution is the posterior distribution for our model parameters, we equate the position variables to the GW astrophysical parameters: q µ = λ µ and set the potential energy as

Thereby the canonical distribution over phase-space can finally be expressed as

(5.45)

Taking dynamical scales into account with a scaled leapfrog integrator

The leapfrog equations (5.36) to (5.38) are constrained by a constant stepsize and have been shown [START_REF] Porter | A Hamiltonian Monte Carlo Method for Bayesian Inference of Supermassive Black Hole Binaries[END_REF] to not produce chains with acceptable mixing. In fact, when parameters vary on different dynamic scales, becomes constrained by the parameter with the smallest eigen-direction since it must be very small with respect to that particular length-scale. This results in a highly conserved evolution of Hamilton's equations, giving a very high acceptance rate, but the chain would in turn explore dimensions whose dynamical ranges are orders of magnitude greater very poorly, leading to an algorithm that would essentially random walk through the global parameter space.

To take different dynamical scales into account when deriving Hamiltonian trajectories, we set each mass as m µ = (s µ ) -2 where s µ is the typical dynamic scale of the corresponding direction (cf section 6.1.1 for details about the tuning of the mass matrix). Therefore the bigger the dynamic scale of a parameter is, the smaller the mass gets which allows for less inertia and thus a wider exploration in this dimension. After multiplying Eq. (5.36) and (5.38) with s µ , we define the scaled momenta pµ = s µ p µ and scaled stepsizes µ = s µ leading to the scaled leapfrog equations [START_REF] Radford | MCMC Using Hamiltonian Dynamics[END_REF]

)

.

Without loss of generality, the scaled momenta are now all drawn from N (0, 1). Note that as we are using scaled leapfrog equations, the state space parameters no longer follow Hamiltonian trajectories at constant times. However this will not matter as a MH ratio will be computed at the end of the trajectory.

Operation

Derivative method we list the number of operations required to generate the log-likelihood, plus the 8 gradients of the log-likelihood in a single step of the leapfrog evolution. Here, columns three to seven represent the source frame waveform, the waveform projected onto each detector with t c = 0, the time shift at each detector, the time shifted waveform at each detector, and the noise weighted inner product respectively. In each column, n if o is the number of detectors used in the analysis. The second last line gives the time per single calculation of each operation, while in the last line we calculate a total time of 405ms for the generation of the log-likelihood and its 8 gradients, as well as a breakdown of the total cost to detail where the main contributions are coming from.

Optimizing the dynamical scales for Phase III

The dynamical scale of each parameter is derived at the beginning of the algorithm using the FIM as described in equation (6.1). The inverse of the FIM is a local approximation of the covariance matrix of the parameters q µ under several assumptions stated in section 6.1.1 which we know to be at best approximately true in our case. The FIM remains our best way to estimate scaling factors at the beginning of the algorithm and proved to produce satisfying results. Nevertheless scales have a major influence on the auto-correlation length of each parameter and hence on the total number of trajectories that need to be run in Phase III. As proof we remind the reader that we had to manually increase σ ψ from 0.17 to 1 in order to decrease its ACL from ∼ 300 to 26. While this peculiar setting on σ ψ could be hard-coded in the algorithm since we know from past parameter estimation results that ψ generally displays a multi-modal posterior distribution covering its entire [0, π] range, scales sub-estimations by the FIM on other parameters can hardly be foreseen.

It turns out that there is a simple way to get a better approximation of the scales during the runtime of the algorithm. The idea is simply to estimate the covariance matrix of the parameters from the covariance matrix of samples gathered by the chain. Even though Phase I is fundamentally meant to gather data points and later derive the cubic-OLUTs fit in Phase II, its trajectories still follow a Markov Chain. It means that the ∼ 1 500 samples accumulated at the end of the phase have a covariance matrix which approximates the real covariance matrix of the posterior distribution. As a result we decided to replace the FIM estimated scales: σ F IM µ , by scales estimated from the covariance matrix of samples gathered so far. If X n µ = q 0 µ , ..., q n µ is the (n, D) matrix containing the n samples of the chain and we note q µ = 1/nΣ i q i µ the vector of length D containing the means in each dimension, then the estimated (D, D) covariance matrix from the samples is:

and we set

This new estimation is done for the first time at the very beginning of Phase III. Then during the run we recompute the predicted scales every 10 000 samples gathered and stop doing so when no scale is modified by more than 10% of its previous value. We re-ran Phase III using this setting and the acceptance rate stayed almost constant going from 89.4% with the FIM scales to 88.2% with the new scales. We show in Table 7.5 the differences between scales estimated from the FIM and their counterparts estimated during Phase III. We see that, except for ln D L , the new scales are equal to or greater than the FIM scales, within the same order of magnitude. This leads to a less accurate discretization of trajectories which explains the small drop in acceptance rate. However the benefit was important for two reasons. Firstly we avoid the ad-hoc setting for this parameter that we had to introduce earlier to reduce its ACL. Secondly even though the acceptance rate decreased a little bit, the maximum ACL was reduced from 65 to 59 as is shown in Table 7.5. As a consequence, only 295 017 trajectories were needed to be run in Phase III to obtain exactly 5 000 SIS. Nonetheless it took 19.7h to finish Phase III, meaning the time needed to collect 1 SIS did not improve.

The explanation for this is in the fact that more hybrid and numerical trajectories had to be run with the new scales. In fact, the hybrid and numerical trajectories represented 0.44% and 0.04% respectively of the total number of Phase III trajectories before, against 0.59% and 0.06% now, ie a ∼ 34 -50% increase. This can possibly be explained by the fact that, a small drop in acceptance rate, indicative of more occasions where three trajectories are rejected in a row triggers a hybrid trajectory, and then a numerical trajectory if the hybrid trajectory is rejected. However a 1% difference in acceptance rate should account for an increase in the proportions of the same order of magnitude, which is not the case. These numbers mean that the run using the new scales spent more time in areas of parameter space where the cubic-OLUTs fit was inaccurate, which up to this point we could only attribute to the statistical uncertainty inherent to any Markovian process.

Optimizing the stepsize

Benchmarking different values of

We explained in section 5.4.4.1 that the theoretical optimal acceptance rate for a generic HMC algorithm is a opt = 65%, depending on an optimal choice of stepsize . The study in [START_REF] Bouffanais | Bayesian Inference for Binary Neutron Star Inspirals Using a Hamiltonian Monte Carlo Algorithm[END_REF] showed that using a normal distribution of stepsizes centered around = 5 × 10 -3 lead to satisfactory results, but we note here that acceptance rates reported were quite high with respect to a opt , i.e. between 76.2% and 89.5% in Phase III for 10 different fiducial BNS signals. Initially we used this scheme for , but given the high acceptance rate, it indicated that we might be using a conservative and sub-optimal value for .

Several options exist for finding a more "optimal" central value of the stepsize. One could think of testing different values of to see which one produces an acceptance rate closest to 65%, as suggested in [START_REF] Beskos | Optimal Tuning of the Hybrid Monte Carlo Algorithm[END_REF]. Other possibilities were suggested in [START_REF] Betancourt | Optimizing The Integrator Step Size for Hamiltonian Monte Carlo[END_REF] where, by deriving analytical lower

Application of the HMC to an aligned-spin analysis with tidal effects

Using central differencing for ∂ χi ln L and forward differencing for ∂ Λi ln L, we ran the algorithm on 59 s of data. As expected Phase I lasted 46.6 h, with an acceptance rate of 96.4%.

Prediction performances of the cubic-OLUTs

The cubic fit coefficients and the OLUTs were derived in 6 min. In Fig. 8.7 we provide regression plots based on 289100 data points coming from Phase I. We see that in the case of the cubic fit, we obtain R 2 > 0.9 for all parameter gradients, except for the tidal parameters where R 2 = 0.65.

While it is clear that the cubic fit is not working for the tidal parameters, an encouraging result is that the R 2 values for the spins and tides are consistent with those presented in Table 8.3 which corresponded to the run from 40 Hz. While it might look like there is a problem with the OLUT approximations, given the negative R 2 for each parameter, this is simply due to a lack of fitting points in the validation set. This is not a problem as these gradients refine themselves throughout the run.

Benchmarking of ( , n srt ) taking spins and tides into account

In this case, benchmarking the values of ( , n srt ) took 39 min, while it had only taken 12 min when spins and tides had not been included. This increased duration is firstly due to the fact that hybrid and numerical trajectories which were needed to free the chains are now much more expensive. The second reason is that given the higher dimensionality, the acceptance rates are also now lower than in Table 7.6, but, as n srt values were kept the same, more hybrid and numerical trajectories were run. Finally, as we are now working in 12D, it was uncertain that 400 trajectories would be sufficient to obtain good estimates for the benchmark, so we extended the benchmark to 600

Appendix A

Priors on ln M and ln µ

Let us remind the formula defining the chirp-mass and reduced-mass from the component masses; they are defined by

As the jacobian matrix when going from coordinates (m 1 , m 2 ) → (M, µ) reads

, (A.4) its determinant: J (m1,m2)→(M,µ) can be developped as

Then, using the above definitions for (M, µ), we derive

where (i, j) is either (1, 2) or (2, 1). On a side note, one can check that the above equations are consistent with J (M,q)→(m1,m2) = m 2 1 /M as stated in Eq. ( 21) of [START_REF] Veitch | Parameter Estimation for Compact Binaries with Ground-Based Gravitational-Wave Observations Using the LALInference Software Library[END_REF]. Finally substituting these expressions in Eq. (A.5) yields

A.2 Log-prior gradients with respect to ln M and ln µ

To derive the gradient of ln π (ln M, ln µ) with respect to ln M and ln µ let us first introduce the inverse jacobian determinant J = J (m1,m2)→(M,µ) -1 allowing us to rewrite Eq. (7.25) as

Therefore, general case the log-prior gradients read

Then we use uniform priors on component masses which, in practice, is almost always the case considered and leads to null derivative of their logarithm. To derive the gradients of ln J , we will first show that J is a function of the symmetric mass ratio η = (m 1 m 2 )/(m 1 + m 2 ) 2 only. From Eq. (A.9) we can express J as

where m is the total mass, and using

we rewrite the determinant as

Eq. (A.1) allows to express the total mass as

which, injected into Eq. (A.15) yields

one finally gets the following expression of the determinant as a function of the symmetric mass ratio

As a result the derivative of its logarithm reads

and since from Eq. (A.18) we directly have ∂ ln η/∂ ln M = -5/2 and ∂ ln η/∂ ln µ = 5/2, the chain rule allows to write

which yield the analytical expression for the log-prior gradients in the case of uniform priors on component masses

Appendix B

LALInferenceMCMC settings for runtime comparison

We report here the full command line we used to run LALInferenceMCMC from 30 Each .gwf file corresponds to the cleaned version of the strain data where a glitch in the Livingston detector was subtracted. They can be downloaded from the GWOSC website [START_REF]Open Data from the First and Second Observing Runs of Advanced LIGO and Advanced Virgo[END_REF] on the event page related to GW170817 [START_REF]GW170817 Data Release[END_REF].

The three PSD files were manually created from the single PSD file published with the GWTC1 catalog [START_REF]GWTC-1: A Gravitational-Wave Transient Catalog of Compact Binary Mergers Observed by LIGO and Virgo during the First and Second Observing Runs[END_REF] and are publicly available [START_REF]Power Spectral Densities (PSD) Release for GWTC-1[END_REF].

Appendix C

Posterior distribution comparison between DeepHMC and LALInferenceMCMC from 30 Hz

We present here a comparison between the posterior distributions of DeepHMC and the LAL-InferenceMCMC run which was carried out on the same machine, using the same low frequency cut-off of 30 Hz and which settings are described in section 10. C.1 the median values and 90% credible intervals. While the agreement is very good in general, it is hard to draw any conclusion from them since we know that LALInferenceMCMC has not converged to the true posterior distribution. Therefore we keep the comparison with published samples from the LVC carried out in section 10.2 as the point of reference for the robustness test of DeepHMC.