GithubHelp home page GithubHelp logo

rjrosati / inflation.jl Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 1.0 1.27 MB

A Julia package for numerical evaluation of cosmic inflation models. Perturbations are solved for with the transport method. Supports an arbitrary number of fields, arbitrary field space metric, and arbitrary initial conditions.

License: MIT License

Julia 100.00%
physics cosmology julia differential-equations

inflation.jl's Introduction

Inflation.jl

Build Status codecov DOI

A Julia package for numerical evaluation of cosmic inflation models. Perturbations are evolved with the transport method. It supports symbolic calculation of the equations of motion, and remains efficient at a high number of fields, even with non-canonical kinetic terms. If you use this in a publication, please cite via the Zenodo link.

Inflation.jlautomatically applies the horizon-crossing approximation, if the potential is detected to be sum-separable. Support is planned for automatic application of other approximations when they are valid as well.

Watch the talk given about this package at JuliaCon 2020: https://www.youtube.com/watch?v=gvUZiPPB3nI

logo

Installation

For now, Inflation.jl is an unregistered Julia package. It can be installed with

julia> import Pkg

julia> Pkg.add("https://github.com/rjrosati/Inflation.jl")

an example

using Inflation
using SymPy

# this is a quadratic inflation model with 10 fields and randomly selected masses

# set the field space dimension
d = 10

# set the model parameters, and their values
params = [symbols("m$i") for i in 1:d]
pvalues = rand(d)*1e-9

function G(Phi,p)
    d = length(Phi)
    g = Matrix{eltype(Phi)}(I,d,d)
    return g
end

function V(Phi,p)
    m = p
    return sum([ m[i]*Phi[i]^2)/2 for i in 1:d])
end

# set the initial conditions
Pi0 = zeros(d) # zero initial velocity

# pick a position randomly over the sphere, with radius to give ~N0 e-folds
N0 = 100
Phi0 = randn(d)
Phi0 ./= norm(Phi0)
Phi0 .*= sqrt(4*N0)

# symbolically construct the equations of motion
# because this potential is sum-separable, the horizon-crossing approximation will automatically be calculated
funcs = inflation_setup(d,V,G,params)

# solve the background equations of motion
sol = background_evolve(Phi0,Pi0,pvalues,funcs,verbose=true)

# solve the 2-pt correlation function equations of motion
# by default, use 7 k-values centered at a pivot scale of 0.002 Mpc^-1
tsol = transport_perturbations(sol,pvalues,funcs,verbose=true)

println(tsol)

see the examples directory for more complicated potentials and metrics, how to scan parameter space, evaluate several simulations in parallel, output and analyze data.

At the moment, Inflation.jl can only solve the 2-pt correlation function equations of motion. Solving for higher-point correlation functions is possible with PyTransport/CppTransport.

inflation.jl's People

Contributors

rjrosati avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

githimanshuc

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.