 Dobro. So, welcome to the next talk of this session. It will be about Python in gravitational wave research communities. And ladies and gentlemen, please welcome our speaker, Elena Kvoko. Thanks. Good morning, everybody. Thanks to be here for my talk of Python in gravitational wave communities. Before starting, something about me. I am a physicist working as a data scientist at European Gravitational Observatory in Italy. I'm a member of LIGO Virgo Collaboration. And I'm also the scientific coordinator of the European Project Graviton, which has the aim to train 14 PhD students in Europe. I am also a machine learning passionate, so during my free time I participated in cargo competition. And I am also a science outreach passionate. This is me while dancing with Michael League during and after each event at Virgo site. Why gravitational waves? You have heard that this year we gave the announcement of the first detection of gravitational waves. A new era has just started. In September we made the first detection of gravitational waves. In December we made the second detection of gravitational waves. So I'm here to try to explain why gravitational waves in this event wasn't so important. Spoiler alert. Sorry, but this is a spoiler of the keynote talk of tomorrow Michael League James that is here. Some warnings about my talk. In 14-5 minutes I will try to explain everything on gravitational waves. It will be almost impossible. So if you have a question, I am here during these days and also today. This talk is meant for beginners, but I can avoid to introduce technical details while explaining everything. Why here at EuroPython? Because we used also Python to achieve these results. In every day working activity in our labs we use Python. In control room doing senior processing, controlling our system. I will try to while explaining what are gravitational waves, how we detected them. I will try to point to all the Python usage we made in Virgo and LIGO. And for sure it is not an exhaust list of the Python usage. So let's start. What is the challenge, first of all? What are the gravitational waves and how we discovered them? So in 1915, this guy that might be you know, Albert Einstein, introduced the theory of general relativity. He said important things. He said that the geometry of a spacetime is linked to the content of a mass and energy of a spacetime. So there is this strict relation that is expressed in this beautiful formula that links the geometry to the mass, in some way mass energy. So just a little joke if you want to play with me. So I need some volunteer. Don't be afraid. You have only to keep in your head the spacetime. Please come here. So come. I have the spacetime. So. Please. Come on, I need the other one. So keep it as flat as possible. This is the spacetime in some ways you can think. And in the absence of any mass, it is flat. But if you have a very massive body that is in the spacetime, it became scar. This is what Einstein said. If there is a present of a massive body in the spacetime, it curves the spacetime there. But I will try this experiment. If there are also mass that moves in your flat spacetime, you can see that maybe you not. They can see. But there are little little that are created in the spacetime that moves in the spacetime itself. These are the gravitational waves. Thanks. And that's what we are trying for many years to detect. The research of gravitational wave detection started many years ago. Einstein wrote this article in just 100 years ago. The problem of the gravitational waves is that they produce a very tiny effect in the spacetime. So the challenge is to detect this small effect. But as said effect, the fact that they interact so little with the mass can help us in understanding much more about the universe itself. Because they can bring information that otherwise we cannot access. So since they are so small, so tiny, we should think to astrophysical phenomena. So that massive body that I showed you should be very, very big. So we should think to star, very massive star. I showed you the main source of gravitational waves that we expect from. There are the rotating neutron star, the so-called pulsar, that while rotating around its asymmetrically around axis can produce gravitational waves. There is the violent phenomena that are called the supernova when there is an implosion of a big star. And during this phenomena it can produce very intensive gravitational waves. Then there are the event that we detected that is the black hole colliding, the collision binary, and I will concentrate my talk around this phenomenon. And then we talk also to the existence of a gravitational wave background, the one that is remnant from the Big Bang. So this is a simulation of the phenomena that we detected. These are two black holes that rotating one around the other. And while they rotate, they become closer and closer because they are losing energy. And at some point the gravitational attraction is so intense that they collide. And that was the event that we detected in September. So why we were so confident that the gravitational wave exists because we are looking for them for many years. Because in 1993 these two guys won the Nobel Prize because they proved in indirect waves the existence of gravitational waves. They observed for many years to a binary system, the energy loss by this binary system and estimate the quantity of energy that can be lost as gravitational waves. And these red points are the measure they made while the blue lines is the prediction. And as you can see the fit is almost perfect. So we know they exist and we try to detect them. I will skip the first experiment and we will concentrate over the recent experiment. How we can detect them? We can use the effect that they made on a free mass that they can eat while they pass through. So this is a simulation, obviously. And while a gravitational wave eats somebody, it can stretch in one direction and elongate in another direction. This is a schematic effect on a tennis ball. So we think to some test mass put around a circle while they are invested by this gravitational wave, it can start oscillating. And we can detect this small difference in length above the length itself. And this is what we call the strain of gravitational waves. The problem of this strain is that it is very, very small. It is the order of 10 to minus 31 and let you understand which are the dimensions we are talking about. If the diameter of a human hair is 10 to minus 55 meters, the diameter of an atom is 10 to minus 10 meters, the one of the nucleus is 10 to minus 14 meters, the diameter of a proton is 10 to minus 15 meters. We are trying to detect a small displacement that is 1,000 of the dimension of the diameter of a proton. So this was our challenge. And now, in which tool we used to detect this small displacement, we used a module interferometer. We think to this schematic position of some test mass and we try to detect this small displacement using this oscillation of the test mass and take advantage of the phenomena of the interference of the laser. I will explain better using a video that one of our colleagues produced. This is a laser that was sent through a splitter. So the first mirror that it covers is the device, the laser in two directions, the one that are the two perpendicular arms of our interferometers. This laser go back and forward. While the gravitational waves hit the interferometer, it starts moving the two test mass. So we can see light here, or don't see, following the movement of this mass. This was the idea. We can detect this small movement by looking at the light that appeared at the end of this interferometer. But this is a schematic view. Now we add an extra mirror in both beams in this configuration. Sorry. The experiment is much more complicated than the one that I showed. Obviously to have better and better sensitivity, we want that this laser make many parts in what we call cavity. So the light becomes more intense. The part that the laser made is longer. So the sensitivity at the detection bench will be higher. Then there are further mirrors that are part of the optical setup that pass to clean as much as possible the laser itself to make higher the power inside the interferometer. More or less this is how it works. But this is the ideal world. The real world is that we have a noise that is much more higher than what we are looking for. We know that many other things can move this mirror that are not gravitational waves but are seismic noise, that are thermal noise, that are due also to the hair that the laser can meet during its travel. So we should take care of reducing as much as possible the noise. We can do this from an experimental point of view while projecting our detector or when we analyze our data. So I will show how we do this. The first accuracy that the first care that we put in reducing the noise was to reduce as much as possible the seismic noise. As you see our heart is continuously moving so all these optics were shaken by the seismic noise and we want that the mirror should be kept at rest as much as possible. So we use this instrument that we call super attenator. The mirror is hanged to this chain and all the optics in Virgo, but also in LIGO detector are suspended in such a way that it can be considered in the same place as much as possible. So we know that what we see is not seismic noise, at least at some frequency. One more thing that we made is to put all the optics in under vacuum because we want that the laser go through the cleanest possible path. So all the optics were covered, put in a tank that this is the real, this is the tube, the Virgo tube and we have one in Europe, one of the biggest vacuum experiment, under vacuum experiment, much more than the set. The other thing that we have cured is the thermal noise. We know that all the components, all the optical components can cause thermal noise because the molecular that composes our component can move due to the temperature and this can cause thermal noise. So we take care of this building mirror, very special mirror. These are an example of the advanced Virgo mirror. These are made of a particular material, these are silica material. They are very heavy and very big because they have to be eaten by the laser many times. And with this we tried to keep under control the thermal noise. This I will show now how it looks like in reality Virgo. This is a video made by my colleague with a drone. This is a Virgo, this is in Italy. This is closer to Kashina. This is what we call the male building. All the optics, all the injection laser is here. These are the two arms of the teleformator, the three kilometer arms. At the end of this tube you find the two end mirror and the laser go through this tube, go back and forward and then recombine in the central building. So let's come to the main topic of this talk. It is python in gravitational wave communities. Why I am here talking of python? Because as I said we used python in many, many fields of our research. As I said the Virgo and LIGO are very complex instruments. This is a schematic view of the optical scheme that I showed before. The two end mirror, the input mirror, the injection laser. As I said there are to control a lot of noise that can make worse our sensitivity. At the end we came out with what we call a sensitivity curve. So we know how much we are sensitive to gravitational waves by looking at this curve. If we want to detect an event, this should be in some way higher than our noise. So we can do prediction, estimation of our noise and see how much we are sensitive. One of the tools that we use for example is the simulation. We have some optical simulation to know how the optics behaves. This is what is written in python. This is python. I put everywhere the link that you can go there and have a look at. This is the first schedule python. As I said we want to control as much as possible everything in our interferometer. So the mirror we have to keep the interferometer locked at this working point. So we don't use only what we call passive control of our optics, but also active control. So there are many things that are used in control room that are based on python. In this is a short list of what we use in VILGO. We started also to write a documentation of all these packages. Many of these are used daily in our control room. So there are automations of the locking procedure that were done using python. But now came to data analysis. How we can extract a signal from our noise. This is the point. We build an instrument. We know that we can detect gravitational waves using this instrument. But how we can make this? What is a first of all gravitational detection? We have noise. We have astrophysical signal. We know that this signal that are time-serious we have hidden a signal. And that is much more smaller than the noise cell. We can extract this. The astrophysical source that I showed at the beginning produced a different signal. The rotating neutral star produced what we call continuous waves. These are periodic signal. These are present continuously in our data with a given frequency. So this signal should be there for all the run that we made in data. This signal is there continuously. While there are other signals that we call transient signals. There are very short transient signals that are due to the supernova events. We have a lot of release of energy in very, very short times. They are the millisecond. Then there are the collision binaries that are always transient because they start with this rotation one around the other and then collide. So this can last from some millisecond to some second. It depends on the mass of the phenomena. And then we have what we call broadband signal that can be due to the stochastic background. This is simply a noise in some way that should be different of some way below our signal. So it is very difficult, our noise, sorry. So it is very difficult to detect. In the ideal world we have noise and signal that are summoned. And in the ideal world our noise is good. It's nice. It's a Gaussian and it's a stationary. In this ideal world exists an optimal filter to detect the signal. So a bit of formula. Obviously I won't go through this formula. But the idea is that with this characteristic we know what will be the best way to extract the signal. So if this is the data that came out from our instrument that we have the noise and the hypothetical signal we try to match our data with a template. We, for example, we are talking of collection binaries. We know theoretically how it could be this signal. The way formula that is signal itself. So we try to match a template with our data weighted by the power spectral density, by the noise. This is a formula that is derived in a perfect way from mathematics. What we can do. So if we have a signal template and we do this method we can find and say that we found a signal if this quantity is above a threshold. Maybe it's clear with this simulation. This is the signal that is hidden in the noise. This is our template. This is moving along the data. While it encountered the real signal and it matched the exact waveform we can see this peak. We detect a signal. So if the match is perfect or almost perfect we know that we have a trigger in some way in our data. And also this pipeline in some way was written in Python. This is PyCBC. This is a representation of our LIGO colleague and all this code is in GitHub so you can go there and have a look at the code itself. So the idea of this mechanism to detect the signal is to build a template bank. So we know what is the waveform that we are looking for but we don't know the parameters of this waveform. We are linked to the mass of the binaries to the position, to the fact that the star may be spinning. So we have a very large parameter space that we have to span to find the exact template of our phenomena. So we can in some way simulate the signal to produce this template. And also this was done using Python in some way in a C library that we are embedding in Python this is called PyLal and we simulate the waveform using this library. We estimate this important quantity that is the signal to mass ratio for some of you that are doing signal processing know what it is. It is an estimate of how your signal is higher than with respect to your noise. You know how intense is your signal give in some way this quantity that is the amplitude of the signal self-awaited by the north spectral density. Why I introduce this? Because when we build our template bank we say, OK, we build a template bank taking account the fact that we don't want to lose much more than 3% of its signal to mass ratio. So, for example, for the detection of the event in September we end up with 250,000 waveforms. So you can imagine how many times this measured filter was done to produce the real signal. And this is the parameter space that we can span using this number of waveforms. So till now we will talk about the signal the instrument and the way in which we can extract the signal in the real world. But the tecton noise is not so ideal as we want. It is no stationary that means that it is not the same while passing the time. So after some minutes it can change. It is not Gaussian so it is distribution of this data not perfect Gaussian distribution and can be contaminated by the presence of many spurious events. There are many things that can mimic in some way gravitational waves because, as I said, a supernova could produce a gravitational wave we don't know exactly the waveform so it's simply a glitch that we can see in our data. So we should take care of clinics as much as possible our noise before they try to detect something inside it. There are many packages that rely also on Python which we use to do this procedure. GWP, GWP software, the chart, pylile and pinup there are algorithms that we use to clean the data. And this is important because what I show is the example in which we know the waveform, but what happens if the noise is not as ideal as we want if we don't know anything of the signal itself. So we should use what we call trigger generator that are generic so we look for transient signal in our data that simply find excess of signal in the data and it can be due to different source of noise or of signal. By the way, the first pipeline that triggered the signal in September was one of these generic tools this is called the Quarant Wave Bars and it is based on a wave letter the composition of the data and this is how it looks like that signal. So these different pipeline for noise characterization because we use this pipeline so generic one just to find the different glitch that are in our data this is what is called a glitch gram so the number, the glitch that are present in our data so many of these you can think of our signal but obviously they are noise and we should identify each of them to be sure that our signal was not one of these. We are a network we are a LIGO instrument to detect the signal but we are a network there are the two LIGO in USA, Virgo in Italy in Germany there is Kagra that is almost operating there was approved LIGO India in the next year but why we are a network because the gravitational wave detector are not as the standard telescope you cannot point your detector in some direction of the space to look for some signal if you want to know to the source position of your event you need to do the triangulation of the results so you can consider where the interferometer are the traveling time that the gravitational waves were detected in the different detector in this way you can in some way have information of the position of the source this was in some way the error of the position in the sky for the event with detector and to do this kind of localizac on the sky we use always Python some way here are some link where you can find this notebook and the tutorial to apply this estimation of the position why we are network because as much more detector are much more is will be the precision of the estimation of the position of the source so when also we go this big area can become this small area in the sky that's why it is important to be a network so come to the event the gravitational wave have be detected for many years it seems almost impossible for people that are working in this field and I am sure that many of us when have the alert no one believe that was a real event because we were very surprised by the fact that it was so beautiful as I will show you it is almost perfect to the prediction so we have this guest star of 14 September 14 December during the first scientific run of LIGO there was another event that were detected always back call colliding this is the event in three minutes after the data acquisition we have the alert there was an e-mail that go around and say there is a strange event in our data please have a look and let us give the announcement in February so these are the wave form of the two of the event seen in the two different detector in Hanford and Libiston this is how to look like in time domain the line continuous line that is superimposite is the prediction the template that much so as you can see is almost perfect and I want to show you this is the famous chirp sound you know if you can hear and now there is no sound wait we call this kind of senior chirp just for this sound that you can hear because there is this frequency that produce this beautiful sound for our the one that we detected in December was a bit different always two black holes but with a smaller mass so it was detected directly by a pipeline that is based on metric filtering and the wave form is always the same this frequency that change in time with this big peak at the end of the phenomena so this is our few numbers about the detection so the first event has a very big signal to noise ratio that was why it was so evident in our data the second ever has a little smaller signal to noise ratio these are the distance so 1.3 billion of light years and 1.44 billion light years and the solar mass so you can see are different for the one that are very very big so these are very compact black hole 36 and 29 for the second event 14 and 7 there was also another event that were considered candidate event during October but the statistics was not so good to make us claim another detection so coming to my personal experience working in this field I am a signal processing researcher so I am that analyst and I work as mainly for noise characterization and I am one of the person to clean the data before the detection in Virgo we developed this library that is a noise analysis package it is a C++ library that we are embedding in Python using Swig and now we have this find up generic noise analysis toolkit I developed this event trigger generator that was based on the wavelet that was used just to detect the noise and in the last period also trying to using machine learning tool to classify the noise signal this is the environment in which we work using Python Cycatelina, Cypina, Py you know all of this just to show what we did these are the typical output of our detector so these are the data house came out from the detector these are the same data of the cleaning the whitening and you can see that there are these two peaks here that in time frequency appear in this way so the idea is to have a look to this kind of waveform classify the signal the noise signal in some way and we did this using machine learning technique that separated the signal in different class just trying to fit in different way the waveform of the signal so in the app I said that we can have a look to the data there are LIGO produced this LIGO open sun center you can go there, this is the link there is you can download the LIGO data you can play with this LIGO data there are beautiful tutorial now there are two beautiful tutorial because they did the same with the second event where there are some signal processing technique well described there and you can play see how it works maybe we can try now I prepared a short version of this so hoping it works I downloaded the data on myepc so you can recognize there many of the Python package that maybe all of you use and plus some signal library of SIP that were used to prepare filter the data were preparing the format hdf while in Virgo and LIGO we use different format to save the data that are what we call frame data I've been time and you can also load the simulation waveform that was simulated you can have a look at the data this is how it looks like your data these are the some second of the data around the event so in this data the two detector to refer the detector is somewhere within the event so you can see that it is impossible to to identify some events here but if you use some signal processing technique for example the so called the whitening which is the whitening these are the power spectra density of the data that is similar to the sensitivity curve that I showed at the beginning we call this noise so our noise is not flat it's full of features, full of lines that are due to many source of noise can be due to the 60 hertz power in Virgo and the 50 hertz power in Virgo because in Italy there are many lines that are due to the thermal noise the movement of the wire that are suspend the mirror so some of these lines are well identified but if we estimate this power spectra density and apply the whitening that is the inverse procedure of this power spectra density we divide in some way the data by this quantity just do and then plot the whitening data this is our event so just simply whitening your data without doing strange things you can identify your event these are the two strains different detector and in black there is the simulated mached waveform so the same if you look at in the time frequency domain sorry, I don't know how many of you know these terms these are outlooks like the time frequency plot the signal was there but you cannot see without do anything to your data but if you apply again the whitening and you produce the same plot here it is your signal so I don't know if it is so evident also for you but yellow this is the so called chirp in your data so I am almost done the data are now also on Kaggle I don't know if some of you play on this platform so there is some portion of this data there are some script that you can use directly there without downloading the data if you want to create your Python script or in the script language that you prefer you can play there and that's it two we might have time for just one question one short question before lunch we have one basically the question is gravitational wave on a physical level that's it gravitational wave at the physical level sorry gravitational wave at the physical level at the physical level ok I don't know if you missed the first part of the talk I show what are gravitational waves it is a very small oscillation of the space time so your space time in some ways moving while I also now I am producing gravitational waves because I am mass I am moving while I am moving I am not symmetric because you need also that your mass are symmetric while moving and this can perturb your space time it's any more flat but produce this small oscillation on your space time self through all the space time that can reach the earth or your self ok I have one question very quick is it true that the first event was detected when they were basically still testing the this is true so it was not operation it was operation it was during what we call engineering runs before the starting of scientific runs there is a period of some days before that we used to test that everything is working so we have quite data but we official are not in science mode what we call science mode but it was during everything was running as it was in science run because the pipeline were under test and we saw this so basically you are expecting to see the first event in one year probably and you get it before you start and to be honest we expected that with the LIGO sensitivity it was probably to be detected in the event this year but not as fast as we did it was real and expected for us ok, thank you very much again thanks