From 07a51158b53c618b8c6c8604541a0e7819ef28a6 Mon Sep 17 00:00:00 2001 From: jaimerz Date: Fri, 13 Oct 2023 11:33:59 +0100 Subject: [PATCH] upd tutorial --- Tutorial/Tutorial.ipynb | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/Tutorial/Tutorial.ipynb b/Tutorial/Tutorial.ipynb index 6ee677a..60287b2 100755 --- a/Tutorial/Tutorial.ipynb +++ b/Tutorial/Tutorial.ipynb @@ -56,7 +56,7 @@ "id": "ff368c1c", "metadata": {}, "source": [ - "Computing the matter power spectrum is just as easy. However, the computation is subject to a series of options that the user can alter. By default $\\texttt{Cosmology}$ will use the E\\&H formula to find the primordial matter power spectrum and it will not apply non-linear corrections. These settings can be changed by specifying the keyword arguments $\\texttt{tk\\_mode}$ and $\\texttt{pk\\_mode}$ which control the used transfer function and whether non-linear corrections are applied to the power spectrum respectively. In terms transfer function $\\texttt{LimberJack}$ offers two possibilities $\\texttt{tk\\_mode}$ = $\\texttt{EisHu}$ (default) / $\\texttt{EmuPk}$ which correspond to using the Eisenstein and Hu formula, $\\texttt{EmuPk}$ or $\\texttt{Bolt.jl}$ to find the primordial matter power spectrum respectively. Similarly, $\\texttt{pk\\_mode}$ = $\\texttt{linear}$ / $\\texttt{Halofit}$ which determines whether or not non-linear corrections are applied using $\\texttt{Halofit}$. $\\texttt{LimberJack.jl}$ offers two distinct public functions to evaluate either the linear or non-linear matter power spectrum regardless of the choice in $\\texttt{pk\\_mode}$. However, if $\\texttt{pk\\_mode}$ = $\\texttt{linear}$ the two functions will return the linear matter power spectrum." + "Computing the matter power spectrum is just as easy. However, the computation is subject to a series of options that the user can alter. By default $\\texttt{Cosmology}$ will use the E\\&H formula to find the matter power spectrum and it will not apply non-linear corrections. These settings can be changed by specifying the keyword arguments $\\texttt{tk\\_mode}$ and $\\texttt{pk\\_mode}$ which control the used transfer function and whether non-linear corrections are applied to the power spectrum respectively. In terms transfer function $\\texttt{LimberJack}$ offers two possibilities $\\texttt{tk\\_mode}$ = $\\texttt{EisHu}$ (default) / $\\texttt{EmuPk}$ which correspond to using the Eisenstein and Hu formula or $\\texttt{:EmuPk}$. Similarly, $\\texttt{pk\\_mode}$ = $\\texttt{:linear}$ / $\\texttt{:Halofit}$ which determines whether or not non-linear corrections are applied using $\\texttt{Halofit}$. $\\texttt{LimberJack.jl}$ offers two distinct public functions to evaluate either the linear or non-linear matter power spectrum regardless of the choice in $\\texttt{pk\\_mode}$. However, if $\\texttt{pk\\_mode}$ = $\\texttt{:linear}$ the two functions will return the linear matter power spectrum." ] }, { @@ -69,32 +69,26 @@ "cosmo_lin_EisHu = Cosmology(Omega_m=0.25, Omega_b=0.03,\n", " h=0.70, ns=1.0,\n", " sigma_8=0.78,\n", - " tk\\_mode=\"EisHu\",\n", - " pk\\_mode=\"linear\") \n", + " tk\\_mode=:EisHu,\n", + " pk\\_mode=:linear) \n", " \n", "cosmo_nonlin_EisHu = Cosmology(Omega_m=0.25, Omega_b=0.03,\n", " h=0.70, ns=1.0,\n", " sigma_8=0.78,\n", - " tk\\_mode=\"EisHu\",\n", - " pk\\_mode=\"Halofit\") \n", + " tk\\_mode=:EisHu,\n", + " pk\\_mode=:Halofit) \n", "\n", "cosmo_nonlin_emupk = Cosmology(Omega_m=0.25, Omega_b=0.03,\n", " h=0.70, ns=1.0,\n", " sigma_8=0.78,\n", - " tk\\_mode=\"emupk\",\n", - " pk\\_mode=\"Halofit\")\n", + " tk\\_mode=:EmuPk,\n", + " pk\\_mode=:Halofit)\n", "\n", - "cosmo_nonlin_bolt = Cosmology(Omega_m=0.25, Omega_b=0.03,\n", - " h=0.70, ns=1.0,\n", - " sigma_8=0.78,\n", - " tk\\_mode=\"Bolt\",\n", - " pk\\_mode=\"Halofit\") \n", "zs = [0.1, 0.3, 0.5]\n", "ks = [100, 300, 1000]\n", "lin_eh_Pks = lin_Pk(cosmo_lin_EisHu, ks, zs) = nonlin_Pk(cosmo_lin_EisHu, ks, zs)\n", "nonlin_eh_Pks = nonlin_Pk(cosmo_nonlin_EisHu, ks, zs)\n", - "nonlin_emupk_Pks = nonlin_Pk(cosmo_nonlin_emupk, ks, zs)\n", - "nonlin_bolt_Pks = nonlin_Pk(cosmo_nonlin_bolt, ks, zs)" + "nonlin_emupk_Pks = nonlin_Pk(cosmo_nonlin_emupk, ks, zs)" ] }, { @@ -190,10 +184,10 @@ "@model function model(data;\n", " meta=meta, \n", " files=files)\n", - " |$\\Omega_m$| ~ Uniform(0.2, 0.6)\n", - " |$\\Omega_b$| ~ Uniform(0.028, 0.065)\n", + " Ωm ~ Uniform(0.2, 0.6)\n", + " Ωb ~ Uniform(0.028, 0.065)\n", " h ~ TruncatedNormal(0.72, 0.05, 0.64, 0.82)\n", - " |$\\sigma_8$| ~ Uniform(0.4, 1.2)\n", + " σ8 ~ Uniform(0.4, 1.2)\n", " ns ~ Uniform(0.84, 1.1)\n", "\n", " DESgc__0_b ~ Uniform(0.8, 3.0)\n", @@ -238,10 +232,9 @@ " \"A_IA\" => A_IA,\n", " \"alpha_IA\" => alpha_IA,)\n", "\n", - " cosmology = Cosmology(|$\\Omega_m$|=|$\\Omega_m$|, |$\\Omega_b$|=|$\\Omega_b$|,\n", - " h=h, ns=ns, |$\\sigma_8$|=|$\\sigma_8$|,\n", - " tk\\_mode=\"EisHu\",\n", - " pk\\_mode=\"Halofit\")\n", + " cosmology = Cosmology(Ωm= Ωm, Ωb=Ωb, h=h, ns=ns, σ8=σ8,\n", + " tk_mode=:EisHu,\n", + " pk_mode=:Halofit)\n", "\n", " theory = Theory(cosmology, meta, files; Nuisances=nuisances)\n", " data ~ MvNormal(theory, cov)\n",