-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcosmology_functions.py
More file actions
53 lines (34 loc) · 1.22 KB
/
cosmology_functions.py
File metadata and controls
53 lines (34 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Math imports
#
# Copyright (c) 2025 Adrian Thompson via MIT License
from .constants import *
import numpy as np
from numpy import sqrt, log, exp, log10, power, sin, cos, tan, heaviside
from scipy.optimize import fsolve, fmin, minimize, shgo, brute
from scipy.signal import argrelmin
from scipy.integrate import quad
#import mpmath as mp
#mp.prec = 10
#mp.dps = 10
import cosmoTransitions as cosmo
from cosmoTransitions.tunneling1D import SingleFieldInstanton, PotentialError
import pkg_resources
###### assumes rad domination
def temp_to_time(T, gstar=GSTAR_SM):
return sqrt(90/8/pi**3/gstar_sm(T)) * M_PL / T**2
def time_to_temp(t, gstar=GSTAR_SM):
return sqrt(sqrt(90/pi**3/gstar/8) * M_PL / t)
def hubble2_rad(T, gstar=GSTAR_SM):
return 8*pi*pi**2 * gstar * T**4 / 90 / M_PL**2
def a_ratio_rad(ti, tj):
# returns the ratio a(tj) / a(ti)
return power(tj/ti, 1/2)
def scale_factor_int2_rad(ti, t):
return power(2*ti - 2*sqrt(ti*t), 2)
# General
gstar_dat_path = pkg_resources.resource_filename(__name__, "data/gstar_sm.txt")
gstar_data = np.genfromtxt(gstar_dat_path)
def gstar_sm(T):
return np.interp(T, gstar_data[:,0], gstar_data[:,1], left=GSTAR_SM_LE, right=GSTAR_SM)
def a_ratio(ti, tj):
pass