-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
086cb71
commit 6078a42
Showing
3 changed files
with
124 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# How Does Powerbox Work?" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"It may be useful to understand the workings of powerbox to some extent -- either to diagnose performance issues or to understand its behaviour in certain contexts.\n", | ||
"\n", | ||
"The basic algorithm (for a Gaussian field) is the following:\n", | ||
"\n", | ||
"1. Given a box length $L$ (parameter ``boxlength``) and number of cells along a side, $N$ (parameter ``N``), as well as Fourier convention parameters $(a,b)$, determine wavenumbers along a side of the box: $k = 2\\pi j/(bL)$, for $j\\in (-N/2,..., N/2)$.\n", | ||
"2. From these wavenumbers along each side, determine the *magnitude* of the wavenumbers at every point of the $d$-dimensional box, $k_j= \\sqrt{\\sum_{i=1}^d k_{i,j}^2}$.\n", | ||
"3. Create an array, $G_j$, which assigns a complex number to each grid point. The complex number will have magnitude drawn from a standard normal, and phase distributed evenly on $(0,2\\pi)$.\n", | ||
"4. Determine $\\delta_{k,j} = G_j \\sqrt{P(k_j)}$.\n", | ||
"5. Determine $\\delta_x = V \\mathcal{F}^{-1}(\\delta_k)$, with $V = \\prod_{i=1}^{d} L_i$." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"For a Log-Normal field, the steps are slightly more complex, and involve determining the power spectrum that *would be* required on a Gaussian field to yield the same power spectrum for a log-normal field. The details of this approach can be found in [Coles and Jones (1991)](http://adsabs.harvard.edu/abs/1991MNRAS.248....1C) or [Beutler et al. (2011)](https://academic.oup.com/mnras/article/416/4/3017/976636)." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"One characteristic of this algorithm is that it contains *no information* below the resolution scale $L/N$. Thus, a good rule-of-thumb is to choose $N$ large enough to ensure that the smallest scale of interest is covered by a factor of 1.5, i.e., if the smallest length-scale of interest is $s$, then use $N = 1.5 L/s$.\n", | ||
"\n", | ||
"The range of $k$ used with this choice of $N$ also depends on the Fourier Convention used. For the default convention of $b=1$, the smallest scales are equivalent to $k = \\pi N/L$." | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python [conda env:powerbox]", | ||
"language": "python", | ||
"name": "conda-env-powerbox-py" | ||
}, | ||
"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.6.5" | ||
}, | ||
"latex_envs": { | ||
"LaTeX_envs_menu_present": true, | ||
"autoclose": false, | ||
"autocomplete": true, | ||
"bibliofile": "biblio.bib", | ||
"cite_by": "apalike", | ||
"current_citInitial": 1, | ||
"eqLabelWithNumbers": true, | ||
"eqNumInitial": 1, | ||
"hotkeys": { | ||
"equation": "Ctrl-E", | ||
"itemize": "Ctrl-I" | ||
}, | ||
"labels_anchors": false, | ||
"latex_user_defs": false, | ||
"report_style_numbering": false, | ||
"user_envs_cfg": false | ||
}, | ||
"toc": { | ||
"base_numbering": 1, | ||
"nav_menu": {}, | ||
"number_sections": true, | ||
"sideBar": true, | ||
"skip_h1_title": false, | ||
"title_cell": "Table of Contents", | ||
"title_sidebar": "Contents", | ||
"toc_cell": false, | ||
"toc_position": {}, | ||
"toc_section_display": true, | ||
"toc_window_display": false | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters