{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "65c59396",
   "metadata": {},
   "source": [
    "Tristan Hoellinger<br/>\n",
    "Institut d'Astrophysique de Paris</br>\n",
    "tristan.hoellinger@iap.fr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "5b0cf9e5",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "eae75fe1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Min k (1D): 0.025 h/Mpc\n",
      "Min k: 0.014 h/Mpc\n",
      "Nyquist ('particles grid'): 3.14 h/Mpc\n",
      "Nyquist (density grid): 6.28 h/Mpc\n",
      "Nyquist (PM grid): 6.28 h/Mpc\n",
      "Particle wavenumber: 104.72 h/Mpc\n",
      "Split wavenumber: 10.05 h/Mpc\n",
      "Short-range reach: 2.23 h/Mpc\n"
     ]
    }
   ],
   "source": [
    "L = 256\n",
    "N = 512\n",
    "Np = 256\n",
    "Npm = 512\n",
    "min_k_1D = 2 * np.pi / L\n",
    "min_k = 2 * np.pi / L / np.sqrt(3)\n",
    "nyquist = np.pi * N / L\n",
    "nyquist_PM = np.pi * Npm / L\n",
    "nyquist_particles = np.pi * Np / L\n",
    "epsilon = 0.03 * L / Np\n",
    "particle_length = 2*epsilon\n",
    "xs = 1.25 * L / Npm\n",
    "xr = 4.5 * xs\n",
    "particle_wavenumber = 2*np.pi / particle_length\n",
    "xs_inv = 2*np.pi / xs\n",
    "xr_inv = 2*np.pi / xr\n",
    "print(f\"Min k (1D): {min_k_1D:.3f} h/Mpc\")\n",
    "print(f\"Min k: {min_k:.3f} h/Mpc\")\n",
    "print(f\"Nyquist ('particles grid'): {nyquist_particles:.2f} h/Mpc\")\n",
    "print(f\"Nyquist (density grid): {nyquist:.2f} h/Mpc\")\n",
    "print(f\"Nyquist (PM grid): {nyquist_PM:.2f} h/Mpc\")\n",
    "print(f\"Particle wavenumber: {particle_wavenumber:.2f} h/Mpc\")\n",
    "print(f\"Split wavenumber: {xs_inv:.2f} h/Mpc\")\n",
    "print(f\"Short-range reach: {xr_inv:.2f} h/Mpc\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "16e60561",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "p3m",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
