neost package

Subpackages

Submodules

neost.Likelihood module

class neost.Likelihood.Likelihood(prior, likelihood_functions, likelihood_params, chirp_masses)[source]

Bases: object

array_to_scalar(var)[source]
call(pr)[source]
loglike_prior(pr)[source]

neost.Prior module

class neost.Prior.Prior(EOS, variable_params, static_params, chirp_masses)[source]

Bases: object

inverse_sample(hypercube)[source]

neost.Star module

class neost.Star.Star(epscent, epscent_dm=0.0, enthalpy=False)[source]

Bases: object

Instances of this class represent a model neutron star.

property Mbaryonic

Get the gravitational mass of baryonic component.

property Mdm

Get the total gravitational dark matter mass.

property Mdmcore

Get the dark matter mass within the baryonic radius.

property Mdmhalo

Get the dark matter mass outside the baryonic radius.

property Mrot

Get the gravitational mass.

property Rdm

Get the total dark matter radius.

property Rdm_core

Get the dark matter core radius.

property Rdm_halo

Get the dark matter halo radius.

property Req

Get the equatorial radius.

plot_structure()[source]

Plot the internal mass and pressure structure of the star.

solve_structure(eps, pres, eps_dm=None, pres_dm=None, dm_halo=False, two_fluid_tidal=False, atol=1e-06, rtol=0.0001, hmax=1000.0, step=0.46)[source]

Solve the relativistic structure equations to build a model star.

Args:
param eos (object):

The interpolated EoS object, which inputs a density and outputs a pressure, both in geometrized units.

param Pmin (float):

The pressure at the surface of the star, or the minimum pressure for which the EoS is defined. Should be given in geometrized units.

param atol (float):

The absolute tolerance for the ODE solver.

param rtol (float):

The relative tolerance for the ODE solver.

param hmax (float):

The maximum step size allowed for the ODE solver, given in centimetres.

param step (float):

The resolution of the ODE solver, should be between ~0.2 and ~0.5.

neost.PosteriorAnalysis module

neost.PosteriorAnalysis.calc_bands(x, y)[source]
neost.PosteriorAnalysis.compute_auxiliary_data(root_name, EOS, variable_params, static_params, chirp_masses, dm=False)[source]

Function to compute the posterior auxiliary data used to generate standard NEoST plots, such as, the pressures, (if dm = True) the baryonic pressure, mass-radius posteriors, and p-eps posteriors.

Parameters

root_name: str

Name of the inference run to refer back to. Used to get the Multinest outputs.

EOS: obj

equation of state object initialized in the inference script, i.e., the parameters that are sampled during inferencing.

variable_params: dict

Variable parameters in the inference script.

static_params: dict

Static parameters in the inference script, i.e., the parameters that are held static during inference sampling.

chirp_masses: list

List determining if GW data is included. If None, just MR only.

dm: bool

If True, ADM is included when computing the table data.

neost.PosteriorAnalysis.compute_prior_auxiliary_data(root_name, EOS, variable_params, static_params, dm=False)[source]

Function to compute the prior auxiliary data used to generate standard NEoST plots, such as, the pressures, (if dm = True) the baryonic pressure, and mass-radius priors

Parameters

root_name: str

Name of the inference run to refer back to. Used to get the Multinest outputs.

EOS: obj

equation of state object initialized in the inference script, i.e., the parameters that are sampled during inferencing.

variable_params: dict

Variable parameters in the inference script.

static_params: dict

Static parameters in the inference script, i.e., the parameters that are held static during inference sampling.

dm: bool

If True, ADM is included when computing the table data.

neost.PosteriorAnalysis.compute_table_data(root_name, EOS, variable_params, static_params, dm=False)[source]

Function to compute the table data in Raaijmakers et al. 2021 & Rutherford et al. 2024. In particular: M_TOV, R_TOV, eps_cent_TOV, rho_cent_TOV, P_cent_TOV, R_1.4, eps_cent_1.4, rho_cent_1.4, P_cent_1.4, R_2.0, eps_cent_2.0, rho_cent_2.0, P_cent_2.0. With v2.0.0, the user has the choice to include ADM or not.

Parameters

root_name: str

Name of the inference run to refer back to. Used to get the Multinest outputs.

EOS: obj

equation of state object initialized in the inference script, i.e., the parameters that are sampled during inferencing.

variable_params: dict

Variable parameters in the inference script.

static_params: dict

Static parameters in the inference script, i.e., the parameters that are held static during inference sampling.

dm: bool

If True ADM is included when computing the table data.

neost.PosteriorAnalysis.cornerplot(root_name, variable_params, dm=False)[source]
neost.PosteriorAnalysis.eos_posterior_plot(root_name, variable_params, prior_contours=None, dm=False)[source]

Function to plot the p-eps posteriors.

Parameters

root_name: str

Name of the inference run to refer back to. Used to get the Multinest outputs.

variable_params: dict

Variable parameters in the inference script.

prior_contours: bool

If True, include the prior contours

dm: bool

If True, ADM is included in the p-eps posteriors. Otherwise, the baryonic only p-eps is used.

neost.PosteriorAnalysis.get_quantiles(array, quantiles=[0.025, 0.5, 0.975])[source]
neost.PosteriorAnalysis.m1(mc, m2)[source]
neost.PosteriorAnalysis.mass_radius_posterior_plot(root_name)[source]
neost.PosteriorAnalysis.mass_radius_prior_predictive_plot(root_name, variable_params, label_name='updated prior')[source]

neost.tovsolvers.TOVh module

neost.tovsolvers.TOVh.h_initial_condition(central_h, central_P, central_e, central_Gamma)
neost.tovsolvers.TOVh.solveTOVh(rhocent, eos_eps, eos_pres, atol=1e-06, rtol=1e-05, hmax=1000.0, step=0.46)

neost.tovsolvers.TOVr module

neost.tovsolvers.TOVr.initial_conditions(rhocent, pcent, adindcent=2.0)

Set the initial conditions for solving the structure equations.

Args:

eos (object): An object that takes energy density as input and outputs pressure, both in geometrized units. w0 (float): The initial value of the rotational drag. Not known a priori, but can be calculated after the TOV equations are solved. j0 (float): The initial value of j. Not known a priori, but can be calculated after the TOV equations are solved. static (bool): Calculate initial conditions for a static star (True) or a rotating star (False).

Returns:

tuple: tuple containing:

  • dr (float): The initial stepsize in cm.

  • intial (array): A np array storing the initial conditions.

neost.tovsolvers.TOVr.solveTOVr(rhocent, eos_eps, eos_pres, atol, rtol, hmax, step)

neost.tovsolvers.TOVdm module

neost.tovsolvers.TOVdm.initial_conditions(rhobcent, rhodmcent, pbcent, pdmcent)

Set the initial conditions for solving the structure equations.

Args:

rhobcent (double): baryonic central density in geometrized units. rhodmcent (double): ADM central density in geometrized units. pbcent (double): baryonic central pressure in geometrized units. pdmcent (double): ADM central pressure in geometrized units.

Returns:

tuple: tuple containing:

  • dr (float): The initial stepsize in cm.

  • intial (array): A np array storing the initial conditions.

neost.tovsolvers.TOVdm.solveTOVdm(rhobcent, rhodmcent, eos_epsb, eos_presb, eos_epsdm, eos_presdm, dm_halo, two_fluid_tidal, atol, rtol, hmax, step)

neost.tovsolvers.TidalDef module

neost.tovsolvers.TidalDef.EofP(P, epsgrid, presgrid)[source]
neost.tovsolvers.TidalDef.PofE(E, epsgrid, presgrid)[source]
neost.tovsolvers.TidalDef.solveTidal(Array, dm_halo)[source]

Function that solves the two-fluid tidal deformability equations.

Parameters

Array: array

Output array that has the full TOVdm.pyx solver’s radial, mass and pressure distributions of baryonic matter and ADM, respectively. The units are geometrized.

dm_halo: bool

If True, ADM halos will be considered in the two-fluid tidal deformability calculation.

Methods

dp_deps(eps,deps,epsgrid,presgrid)

Numerical derivative calculator of the derivative of pressure w.r.t energy density

dalpha_dr(r)

The dalpha_dr term in the TOV equations, which is related to the g_tt component of the spherically symmetric static metric.

g_rr(r)

g_rr component of the spherically symmetric static metric.

dy_dr(r,y)

yR = y(R) is related to the quadrupolar perturbed metric function and is obtained as a solution to the differential equation dy_dr

tidal_deformability(y2, Mns, Rns)

Two-fluid deformability calculation function.

neost.utils module

neost.utils.m1_from_mc_m2(mc, m2)[source]
neost.utils.m1_m2_from_mc_q(chirp, q)[source]
neost.utils.tidaltilde(m1, m2, l1, l2)[source]

Module contents

NEoST: Open-source code for equation of state inference via nested sampling.