Skip to content

Gravitational Wave Analysis using Auto Differentiation with JAX

License

Notifications You must be signed in to change notification settings

WDoyle123/GravAD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

GravAD

Gravitational Wave Analysis using Auto Differentiation with JAX

Report Bug · Request Feature

forthebadge


Table of Contents


Info

GravAD offers a cutting-edge approach to gravitational wave detection, leveraging Automatic Differentiation (AD), JAX, and Ripple for template generation via IMRPhenomD. GravAD quickly pinpoints potential gravitational wave events in detector data by optimising the matched filtering process. Despite using fewer templates and significantly reducing computational time, it achieves nearly equivalent results to the established LIGO pipelines. This efficiency positions GravAD as an ideal preliminary tool in gravitational wave research, quickly sifting through data to highlight promising candidates for detailed analysis. GravAD also serves as an additional validator to existing search pipelines, fortifying their credibility.

Features

  • Dynamic Template Generation
  • Optimised for GPUs
  • Graphs and Results
  • Works using real LIGO data
  • Works with simulated signals

Installation

Prerequisites

This software requires Python 3.11.3 or newer, and has dependencies that can be installed via pip. You can view the full list of dependencies in the requirements.txt file. Note, this requirements.txt is for the CPU version of JAX. For GPU version of JAX please install separately following their guides.

Installation via GitHub

  1. Clone the GravAD repository to your local machine:
git clone https://github.com/WDoyle123/GravAD.git
  1. Navigate to the cloned repository:
cd GravAD

3, Install the required packages:

pip install -r requirements.txt

Usage

Once you have installed all the prerequisites and set up GravAD, you can start using it for gravitational wave analysis.

Simply run python main.py.

Here is a simple example of how you might use GravAD:

Changing the constants

Navigate to the constants.py file. You can alter the detection frequencies, number of iteration GravAD runs for (how many templates), aswell as adjusting the simulated annealing optimisation.

# Constants
SAMPLING_RATE = 2048
LOW_FREQ_CUTOFF = 20.
HIGH_FREQ_CUTOFF = 1000.
MAX_ITERS = 100
TEMPERATURE = 1 # Initial Temperature
ADV_TEMPERATURE = 2 # Advanced Temperature
ANNEALING_RATE = 0.99
LRU = 1.5 # Learning Rate Upper
LRL = 5.5 # Learning Rate Lower
SEED = 1

You can alter which signals you want to detect and from which detector.

STRAINS = ['H1', 'L1']
EVENTS = ["GW150914", "GW151012", "GW151226", "GW170104", "GW170608", "GW170729", "GW170809",
"GW170814", "GW170817", "GW170818", "GW170823"]

Adjusting the Optimisers

in GravAD.py, navigate to:

def get_optimal_mass(init_mass1, init_mass2, freqs, params, data, psd, delta_f, signal_type, optimiser='sgd_adam'):

From here you can select the optimiser from.

Currently available optimisers:

sgd - Stochastic Gradient Descent

sgd_sa - Stochastic Gradient Descent + Simulated Annealing

sgd_p - Stochastic Gradient Descent + Momentum

sgd_sa_p - Stochastic Gradient Descent + Simulated Annealing + Momentum

sgd_sa_adam - Stochastic Gradient Descent + Simulated Annealing + Adam

sgd_adam - Stochastic Gradient Descent + Adam

Real and Simulated Signals

In the main function in main.py you will find:

    # Analyse real signals
    if True:
        real_signals()
        plotter(pattern_real, folder_results_real, folder_max_snr_real)
    
    # Analyse simulated signals (WIP)
    if False:
        simulated_signals()
        plotter(pattern_simu, folder_results_sim, folder_max_snr_sim)

Simply change the True or False to enable real or simulated signals.

Screenshots

App Screenshot App Screenshot App Screenshot

Check out graphs for more!

Authors

Citing

If you use GravAD in your work, please cite our paper:

@article{Doyle_2023,
  author={Doyle, William},
  title={Searching For Black Holes Using Auto Differentiation},
  url={https://ipipublishing.org/index.php/emjsr/article/view/10},
  DOI={10.59973/emjsr.10},
  journal={Emerging Minds Journal for Student Research},
  volume={1},
  year={2023},
  month={Jul.},
  pages={17–38}
}

Acknowledgements

We would like to acknowledge the use of ripple for template generation in this project.

About

Gravitational Wave Analysis using Auto Differentiation with JAX

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages