GithubHelp home page GithubHelp logo

potatoasad / kerrquasinormalmodes.jl Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 591 KB

A Package to Compute mode functions for Kerr Black Hole Quasinormal modes, as well as their frequencies, seperation constants and more. Additionally provides an interface for cheap differentiation of such modes.

License: MIT License

Julia 100.00%
blackholes quasinormal-modes eigenvalues schwarzschild kerr

kerrquasinormalmodes.jl's Introduction

KerrQuasinormalModes

This is a package that not only computes Quasinormal Modes for Kerr Black holes, but focuses on an easy to use (yet performant) interface for working with the Quasinormal Mode Functions. These functions are basically solutions to the Tuekolsky Equations for different s,l,m,n and a values. We implement the Cook-Zalutskiy solver to compute the quasinormal mode frequency and also the radial expansion coefficients, as well as the spectral coefficients in the angular sector.

Usage

Start off by defining a ModeSequence: this defines a particular mode without reference to a particular $a$ value. Then you can get the QNM wavefunction corresponding to any particular $a$ value. (In this case $a=0.8$)

Ω = ModeSequence(s=-2,l=2,m=2,n=0) # Pick a mode
ψ = Ω(0.8) # Get the QNM mode function at a = 0.8

Mode Values

Values for the Quasinormal Mode Quantities

ψ.ω # = 0.5860169749084593 - 0.0756295523345646im
ψ.Alm # = 2.5852939720024275 + 0.20529748567633602im

Wavefunction Evaluation

QNM Wavefunction values in Boyer Lingquist Coordinates

ψ(r) # Returns the value of the radial wavefuntion at r
ψ(r,cos(θ)) # Returns the value of the full wavefunction at r=r, cos(θ)=cos(θ), ϕ=0 and t=0
ψ(r,cos(θ),ϕ) # Returns the value of the full wavefunction at r=r, cos(θ)=cos(θ), ϕ=ϕ and t=0
ψ(r,cos(θ),ϕ,t) # Returns the value of the full wavefunction at r=r, cos(θ)=cos(θ), ϕ=ϕ and t=t

Radial & Spin Weighted Harmonic Wavefunctions

ψ.R # Returns the Radial Wavefunction
ψ.R(2.2) # Value of the Radial Wavefunction @ r = 2.2
ψ.R.r₊, ψ.R.r₋  # Radial coordinate of Outer and Inner Horizons
ψ.S # Returns the Spin-Weighted Spheroidal Harmonic Wavefunction
ψ.S(0.7) # Value of the Spin-Weighted Spheroidal Harmonic @ cos(θ) = 0.7
ψ.S(0.7, π/2) # Value of the Spin-Weighted Spheroidal Harmonic @ cos(θ) = 0.7 & ϕ = π/2
ψ.S.Cllʼ # Returns the vector of Spherical-Spheroidal mixing coefficients

Performant Linear Symbolics of QNM Wavefunctions

One can also take Derivatives and Linear Combinations of these modes to emulate the action of differential operators on these functions in a simple way that doesn't come with the slow-down of a general symbolic system. It allows:

  • Derivatives of any mode with respect to any of the Boyer Lingquist coordinates ∂r,∂θ,∂ϕ,∂t
    • Use ∂r,∂θ,∂ϕ,∂t to create a new Heun-like function. This new function is also very performant during evaluation.
  • Linear Combinations of any mode or it's derivative: (∂r(Ψ) + m*Ψ -∂θ(∂θ(Ψ)) )
  • Doing something like ψnew = ∂r(Ψ) + m*Ψ -∂θ(∂θ(Ψ)) is a completely valid operation, and evaluating it as if it was a mode function, like ψnew(0.6,0.4), will be performant.

An example:

julia> ψnew = ∂r(Ψ) + 3*Ψ  -∂θ(∂θ(Ψ)) # Completely valid expression that is saved as a Linear Combination of Heun-Like functions as shown below
(-1.0 - 0.0im)₋₂Ψ₂₂₀ +
(-1.224744871391589 - 0.0im)₀Ψ₂₂₀ +
(0.2293785997558912 + 1.7983211937744943im)₋₂Ψ₂₂₀ +
(-1.4014125495728098 + 1.352937910894635im)₋₂Ψ₂₂₀ +
(4.075629552334565 + 0.5860169749084593im)₋₂Ψ₂₂₀

julia> ψnew(2.5,0.7)  # Evaluating this new variable is a completely valid and performant operation
0.5945305105574497 + 0.6407097912091125im

Animated Plot of Radial Modes

RadialModePlot

kerrquasinormalmodes.jl's People

Contributors

potatoasad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

kerrquasinormalmodes.jl's Issues

Using generated functions for computing the spin weighted spheroidal harmonics

At the moment there is this large and clanky method for precomputing the factorial expressions inside the SpinWeightedSphericalHarmonic functions.

I used Mathematica to precompute expressions for spin weighted spherical harmonics:
s = -2 to +2 , l = 0 to 20 , m = all

They are all saved in a csv, and then a huge ~500 expression if-else statement is constructed.

This goes into the body of the SpinWeightedSphericalHarmonicCalculation function.

I want to look into the possibility of having a @generated function unroll all the loops and pre-compute the relevant binomial expressions at compile time.

So we will have some expression like:

@generated function::SpinWeightedSpheroidal{s,l,m})()
    # function body that generates the needed expression
end

This would imply that we would make SpinWeightedSpheroidal a parametric type with s,l,m as parameters as well.

Why is this needed?

Derivatives of a Spin Weighted Spheroidal Harmonic ψₛ our expansion can be written as a sum over ψₛ₊₁ and ψₛ₋₁ , and so if we only pre-compute uptil s=2, and take it's first derivative or second derivative (which we often may have to do), we would be using unoptimized code which will spend more time computing binomial expressions of s,l and m than anything else.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.