Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
256 commits
Select commit Hold shift + click to select a range
53da4ee
Added s2 terms, fixing tij terms
CarterDW Dec 15, 2023
811e1d4
Multiplied gb2 and s2 terms by 2
CarterDW Dec 15, 2023
32dd2de
Fixing TijSij Cross Correlation
CarterDW Mar 1, 2024
c9bd07a
Still fixing tijsij
CarterDW Mar 14, 2024
ad6861a
Updated factors of 2 to reflect appropriate values
CarterDW Apr 30, 2024
dc0010c
Changed structure of tijsij calculation
CarterDW May 6, 2024
0ba548f
Fixed S2F2 term
CarterDW Aug 6, 2024
5cd7a93
Moved galaxy bias x tij terms into a seperate function
CarterDW Aug 6, 2024
4b95d10
Seperating out tij terms from gb2 terms
CarterDW Aug 6, 2024
ee52d2b
Updated naming convention for tij terms, seperated out tij and gb2 terms
CarterDW Oct 29, 2024
0b35fae
updated naming convention for galaxy bias terms
CarterDW Oct 29, 2024
2da24e8
Continuing seperation of tij and galaxy bias
CarterDW Nov 12, 2024
a56cf47
Renamed tij files to align with function, fully seperated galaxy bias…
CarterDW Nov 12, 2024
915d0bf
Still updating ctbias
CarterDW Nov 12, 2024
34efd06
Edited naming convention for nlxia tij terms
CarterDW Nov 21, 2024
6870e06
updating naming convention for s2 terms
CarterDW Jan 2, 2025
e9f30aa
merged ct
vschac Jan 21, 2025
590785c
fixed merge
vschac Jan 21, 2025
21d7b5a
fixed indent error
vschac Jan 21, 2025
53672ab
fixed test file
vschac Jan 27, 2025
af0273a
added gb and tij methods
vschac Jan 28, 2025
ad24972
added profiler
vschac Jan 29, 2025
42f3e69
added tests template
vschac Jan 29, 2025
2f54f5b
updated print statements
vschac Jan 31, 2025
4b1f0a3
removed unused import scipy trapz
Feb 3, 2025
6eb52ab
Delete build/lib/fastpt directory
vschac Feb 3, 2025
ca6d0e3
changed spaces to tabs
Feb 4, 2025
98ebc1b
added build/
Feb 4, 2025
ce956c6
start benchmarking
Feb 4, 2025
153a83f
removed unused imports
Feb 4, 2025
63fb8b2
set up init tests
Feb 5, 2025
36d87cd
updated setup stuff
Feb 5, 2025
bc178ec
removed duplicated functions
Feb 6, 2025
f0ed982
implemented benchmarking for most terms
Feb 6, 2025
77974a7
transposed benchmark data
Feb 7, 2025
81fb87e
code cleanup
Feb 7, 2025
4eb1b60
edit sig4 in this file
Feb 7, 2025
b659d45
init tests pass
Feb 7, 2025
7496857
dd name change
Feb 10, 2025
10ba604
added der term
Feb 10, 2025
b0de915
benchmarking tests
Feb 10, 2025
f3eb3b0
moved benchmark tests
Feb 10, 2025
6e7adc0
parameter validation tests
Feb 10, 2025
aac1c2f
made validator a decorator
Feb 10, 2025
5ef5608
all tests pass
Feb 11, 2025
ae8faba
todo list refactor
Feb 11, 2025
1b9195c
moved heavier imports where necessary
Feb 11, 2025
20bdcd6
cleanups
Feb 12, 2025
29b9e3c
moved heavier imports where necessary
Feb 11, 2025
a9a1afc
cleanups
Feb 12, 2025
768ccbf
profiling for long functions
Feb 12, 2025
5fecab5
tij todo bug fix
Feb 12, 2025
0906186
to-do init test
Feb 12, 2025
a07ca34
todo init test
Feb 12, 2025
475b9dd
identified long running functions
Feb 12, 2025
e6da3ab
faster factorial method
Feb 13, 2025
12c2157
added ci
Feb 13, 2025
87dbb97
update workflow
Feb 13, 2025
add7ecc
pytest runs from FAST-PT dir
Feb 13, 2025
1b620e1
example refactor
Feb 13, 2025
35a13d8
bug fixes in example refactor
Feb 18, 2025
c033e95
positional args fix
Feb 18, 2025
bfebedf
positional args fix
Feb 18, 2025
3c593bd
change yml py version
Feb 18, 2025
eac8933
resolve merge
Feb 18, 2025
ef8ff10
forgot quotes
Feb 18, 2025
392e20c
tracer cache example
Feb 18, 2025
3ec8aca
todo list overhaul
Feb 19, 2025
5025f36
same length P and k check
Feb 19, 2025
55ecb36
cleanups
Feb 19, 2025
2f235fe
deprecation warning
Feb 20, 2025
8c7eec2
deprecation warning
Feb 20, 2025
5714c43
removed param validation (only for handler)
Feb 20, 2025
4535620
began handler implementation
Feb 20, 2025
ad0a9b4
handler tests pass
Feb 21, 2025
b0b23d7
clear and update default params
Feb 21, 2025
af5ba1f
update fpt instance
Feb 21, 2025
0e1b302
max cache entries
Feb 21, 2025
38a8269
added handler to init imports
Feb 21, 2025
b755acc
params validated with function
Feb 21, 2025
10745de
debugging to IA_ct benchmark
Feb 21, 2025
3578635
switched ci to mac
Feb 21, 2025
6b89eb6
added handler demo
Feb 24, 2025
59dc698
updated profiler
Feb 24, 2025
2636c6c
added total time
Feb 24, 2025
6ed4bfc
apply extrap function
Feb 24, 2025
351fb94
one loop abstraction
Feb 24, 2025
1c3c87c
IA compute JK functions
Feb 24, 2025
4dd97b1
new timed results
Feb 24, 2025
403a86a
renamed time files
Feb 24, 2025
7241290
c terms cache
Feb 24, 2025
54b56ed
time name changes
Feb 24, 2025
8e0bc1f
removed comments
Feb 25, 2025
b5fb41b
k orig name mangled
Feb 26, 2025
21c842d
show cache info
Feb 26, 2025
5cb8d19
get terms start
Feb 26, 2025
eb292e7
n_pad warn and name mangle k's
Feb 27, 2025
6f3a1f5
k names
vschac Feb 27, 2025
6e48174
merged
vschac Feb 27, 2025
fd05a5d
test commit
vschac Feb 27, 2025
15361e0
start terms breakdown
vschac Feb 27, 2025
8daab2b
made cache optional
vschac Feb 27, 2025
8939e5f
abstracting computing terms
vschac Feb 27, 2025
cdf095a
get method functioning
vschac Feb 28, 2025
ebae31b
all terms get test
vschac Feb 28, 2025
b443e6f
get tests pass
vschac Mar 3, 2025
52fd846
IA_ct breakdown
vschac Mar 5, 2025
b5f180b
one loop terms breakdown
vschac Mar 10, 2025
de819fa
new time file for get terms functionality
vschac Mar 10, 2025
083ecd1
cache manager
vschac Mar 10, 2025
2058dbc
timed json rename
vschac Mar 10, 2025
229a55e
cache tests
vschac Mar 11, 2025
cf27dc7
cache tests
vschac Mar 11, 2025
003fec9
fpt.cache is public
vschac Mar 11, 2025
ac96b67
cache manager print
vschac Mar 11, 2025
3bcdea3
start cache speed up
vschac Mar 12, 2025
0252ae8
resolve div branches
vschac Mar 12, 2025
7a79245
fix merge
vschac Mar 12, 2025
0870abc
fast cache manager
vschac Mar 12, 2025
9c2fafb
fast hashing
vschac Mar 13, 2025
f3c011e
unused imports
vschac Mar 14, 2025
e6f8b08
OV test bug fix
vschac Mar 14, 2025
f2f0e48
removed todo list in init
vschac Mar 14, 2025
dc5b7da
save output in handler
vschac Mar 14, 2025
e620725
bulk add
vschac Mar 14, 2025
57c2145
different save paths
vschac Mar 17, 2025
5e5696b
load method
vschac Mar 17, 2025
093e59f
bulk run verbose
vschac Mar 17, 2025
9ff550c
start readthedocs
vschac Mar 17, 2025
20d93ab
private get methods
vschac Mar 17, 2025
209ae4b
rtd's for handler
vschac Mar 17, 2025
aba75e8
more rtd stuff
vschac Mar 17, 2025
9e34f89
plot functions
vschac Mar 18, 2025
e1e9b9e
more rtd
vschac Mar 18, 2025
22d0de1
added requirements
vschac Mar 18, 2025
be580b1
flip flag
vschac Mar 19, 2025
bc667bc
n_pad error fix
vschac Mar 19, 2025
0ae93e6
bulk timing files
vschac Mar 19, 2025
998d6e5
save and load params method
vschac Mar 20, 2025
148ec18
get tracer method
vschac Mar 20, 2025
0ac5a0a
rtd for get tracer
vschac Mar 20, 2025
254301d
begin cython
vschac Mar 21, 2025
40be01b
Pympler size in stats
vschac Mar 25, 2025
3e07643
clean memory comments for later
vschac Mar 25, 2025
7b5bc1b
cythonized fpt (almost)
vschac Mar 25, 2025
87766cc
compiler error resolved
vschac Mar 26, 2025
f4c1462
cython stopping point
vschac Mar 26, 2025
c8eddeb
ctbias terms seperated
vschac Mar 26, 2025
a8bb6b9
up to date with working branch
vschac Mar 27, 2025
1b90714
better time with cache dump
vschac Mar 27, 2025
fa3b441
removed timing lines
vschac Mar 28, 2025
9c0b707
memoized init params
vschac Mar 28, 2025
5fae6f1
generate power spectra
vschac Mar 28, 2025
1941ae4
removed comments
vschac Mar 28, 2025
1c461b6
up to date with working
vschac Mar 28, 2025
8fbc0b6
polishing
vschac Mar 28, 2025
5e61a3c
handler bug fixes
vschac Mar 28, 2025
455453e
handler bug fixes
vschac Mar 28, 2025
eec3845
removed cython
vschac Mar 31, 2025
7dc455a
deleted cython test
vschac Apr 3, 2025
f2d0279
removed cython
vschac Apr 10, 2025
eb444a7
begin camb pk generation
vschac Apr 10, 2025
5f08725
generate multiple p
vschac Apr 10, 2025
ba8de51
P_1loop and Ps get functions
vschac Apr 15, 2025
857187b
update qkstrt
vschac Apr 22, 2025
02b9785
removed forced fpt instance
vschac Apr 21, 2025
23bb757
updated benchmarks for 1loop error
vschac Apr 21, 2025
70a84db
timer and 1loop func
vschac Apr 22, 2025
1d8bd2e
removed comments
vschac Mar 28, 2025
cd951b9
begin camb pk generation
vschac Apr 10, 2025
a8ac9cb
generate multiple p
vschac Apr 10, 2025
cfecdb0
started pk tests
vschac Apr 11, 2025
165cf30
P_1loop and Ps get functions
vschac Apr 15, 2025
1318730
update qkstrt
vschac Apr 22, 2025
18072ac
updated branch
vschac Apr 22, 2025
6524256
fast hash in convolution
vschac Apr 22, 2025
48e6e62
no rebase
vschac Apr 22, 2025
b221752
cleanups
vschac Apr 23, 2025
f65d0e3
merged with working branch
vschac Apr 23, 2025
08b6154
comments for term name changes
vschac Apr 24, 2025
669582a
new camb generation method
vschac Apr 24, 2025
ee9f6dd
gen pk methods done, camb/class still unequal
vschac Apr 25, 2025
e4fd8cd
renamed terms
vschac Apr 25, 2025
5529c65
rtd additions/changes
vschac Apr 28, 2025
aa11941
Merge branch 'working-branch' into beta-fpt
vschac Apr 28, 2025
3e3361f
updated version
vschac Apr 28, 2025
1f9e1cd
removed unecessary files
vschac Apr 28, 2025
e34c322
updated IRES bmark
vschac Apr 28, 2025
36fbd3a
files re-org
vschac Apr 29, 2025
2e4f340
commented out pk equality tests
vschac Apr 29, 2025
b3d65cb
generate pk params fix
vschac Apr 29, 2025
4442c29
k_h ctrl f fix
vschac Apr 29, 2025
f891392
handler rtd update
vschac Apr 29, 2025
116dd2f
clean comments
vschac Apr 29, 2025
f168b21
changelog add
vschac Apr 29, 2025
4068c37
merged pk gen methods
vschac May 1, 2025
63c41c3
polishes
vschac May 1, 2025
242d4cc
files restructure
vschac May 1, 2025
1d3be3a
as ns bug fix
vschac May 2, 2025
23e0664
rtd build debug
vschac May 2, 2025
2478847
requirements.txt update
vschac May 2, 2025
ff01268
cache manager import fix
vschac May 2, 2025
a251d42
merged pk precision
vschac May 7, 2025
fc63b0f
rtd example update
vschac May 9, 2025
ace2e7a
Update requirements.txt
vschac May 9, 2025
794ec92
merged in power spectra changes
vschac May 13, 2025
d6de8b9
remove rtd link
vschac May 30, 2025
241ea09
remove rtd link
vschac May 30, 2025
18fdaac
add rtd link
vschac May 30, 2025
c571042
update readme
vschac May 30, 2025
2ed7006
cache bust read me
vschac Jun 2, 2025
35674ca
same as before
vschac Jun 2, 2025
6939e42
Update README.md
vschac Jun 2, 2025
bf1425a
Update README.md
vschac Jun 2, 2025
deb8fc4
Update README.md
vschac Jun 2, 2025
786a967
sphinx stuff
vschac Jun 2, 2025
1b21f2e
rtd reqs
vschac Jun 2, 2025
f32a91a
Update README.md
vschac Jun 2, 2025
43fce77
cleanups and examples
vschac Jun 2, 2025
d3c9a6d
fixed gma funcs cache
vschac Jun 2, 2025
081f713
cleanups n reorg
vschac Jun 3, 2025
2ca5542
Update README.md
vschac Jun 3, 2025
505ebb1
remove self.sig4
vschac Jun 4, 2025
81d8ef7
removed main if
vschac Jun 4, 2025
079e444
hello fastpt example
vschac Jun 4, 2025
3b86256
default param warning in diff params
vschac Jun 4, 2025
d978f03
examples and reorg
vschac Jun 4, 2025
a61aa93
Update FASTPT.py docstring for the s2 tt and ta terms
jablazek Jun 4, 2025
56c63e2
ignored ex outputs
vschac Jun 5, 2025
55fe928
updated docs
vschac Jun 5, 2025
de31994
cleaned examples
vschac Jun 9, 2025
8c4e6e1
added warnings
vschac Jun 9, 2025
37d94a4
removed handler cache
vschac Jun 9, 2025
c01d0fe
docs updates
vschac Jun 9, 2025
cd3ca74
unbolded first line fpt docstring
vschac Jun 9, 2025
00d6c0b
diff method indexing update
vschac Jun 9, 2025
3461de2
docs and examples updates
vschac Jun 10, 2025
03d23ad
moved lower funcs down
vschac Jun 10, 2025
7d5aa06
removed sub inits
vschac Jun 10, 2025
ce83b1c
fixed gamma funcs cache
vschac Jun 10, 2025
ed6f9bd
cache rtd info
vschac Jun 10, 2025
01d77bd
polishes
vschac Jun 12, 2025
270c715
rtd wordings
vschac Jun 12, 2025
a39f133
resolved merge
vschac Jun 12, 2025
2ebf9d5
updated versions
vschac Jun 13, 2025
5f786bd
Update FASTPT.py
jablazek Jun 13, 2025
2cf88f2
docstring updates
vschac Jun 13, 2025
0b9c5d2
rebuilt docs
vschac Jun 13, 2025
284daef
updated save in example
vschac Jun 13, 2025
a31bc33
Update ci.yml
vschac Jun 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: FAST-PT CI

on:
push:
branches:
- beta-fpt
pull_request:
branches:
- beta-fpt
workflow_dispatch:

jobs:
test:
runs-on: macos-latest

strategy:
matrix:
python-version: ["3.13", "3.11"]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest

- name: Run unit/benchmark tests
run: pytest tests/ --disable-warnings
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
examples/*.pdf
examples/*.npy
examples/output/*
examples/outputs/*
*.pyc
build/
plot_test_outputs/
fastpt/core/outputs/
15 changes: 15 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.8"

python:
install:
- method: pip
path: .
- requirements: docs/requirements.txt

sphinx:
configuration: docs/conf.py
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# FAST-PT

[![Documentation Status](https://readthedocs.org/projects/fast-pt/badge/?version=latest)](https://fast-pt.readthedocs.io/en/latest/?badge=latest)
[![arXiv:1603.04826](https://img.shields.io/badge/arXiv-1603.04826-b31b1b.svg)](https://arxiv.org/abs/1603.04826)
[![arXiv:1609.05978](https://img.shields.io/badge/arXiv-1609.05978-b31b1b.svg)](https://arxiv.org/abs/1609.05978)
[![arXiv:1708.09247](https://img.shields.io/badge/arXiv-1708.09247-b31b1b.svg)](https://arxiv.org/abs/1708.09247)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

FAST-PT is a code to calculate quantities in cosmological perturbation theory
at 1-loop (including, e.g., corrections to the matter power spectrum). The code
utilizes Fourier methods combined with analytic expressions to reduce the
Expand All @@ -22,17 +28,17 @@ Full installation with examples:
* Make sure you have current version of numpy, scipy, and matplotlib
* download the latest FAST-PT release (or clone the repo)
* install the repo: `python -m pip install .`
* run the example: `cd examples && python fastpt_example.py`
* run the most recent example: `cd examples && python3 hello_fastpt.py`
* hopefully you get a plot!

See the [user manual](docs/usr_manual.pdf) for more details.
* for a more in-depth example of new features: `cd examples && python3 v4_example.py`
* for older examples see the 'examples' folder

Our papers (JCAP 2016, 9, 15; arXiv:1603.04826) and (JCAP 2017, 2, 30; arXiv:1609.05978)
describe the FAST-PT algorithm and implementation. Please cite these papers
when using FAST-PT in your research. For the intrinsic alignment
implementation, cite arXiv:1708.09247.
implementation, cite PRD 100, 103506 (arXiv:1708.09247).

FAST-PT is under continued development and should be considered research in
progress. FAST-PT is open source and distributed with the
[MIT license](https://opensource.org/licenses/mit). If you have comments,
questions, or feedback, please file an [issue](https://github.com/JoeMcEwen/FAST-PT/issues).
questions, or feedback, please file an [issue](https://github.com/jablazek/FAST-PT/issues).
Binary file added dist/fast_pt-4.0.0b1-py3-none-any.whl
Binary file not shown.
Binary file added dist/fast_pt-4.0.0b1.tar.gz
Binary file not shown.
Binary file added docs/.DS_Store
Binary file not shown.
Binary file added docs/_build/.DS_Store
Binary file not shown.
Binary file added docs/_build/doctrees/api.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/changelog.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file added docs/_build/doctrees/examples.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/installation.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/quickstart.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/theory.doctree
Binary file not shown.
Binary file added docs/_build/html/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 43eb43198a4eba09a90caefeb185ff84
tags: 645f666f9bcd5a90fca523b33c5a78b7
4 changes: 4 additions & 0 deletions docs/_build/html/.buildinfo.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: b2cf89ef06e9ad64bee162009c2d4eca
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added docs/_build/html/.doctrees/api.doctree
Binary file not shown.
Binary file added docs/_build/html/.doctrees/changelog.doctree
Binary file not shown.
Binary file added docs/_build/html/.doctrees/environment.pickle
Binary file not shown.
Binary file added docs/_build/html/.doctrees/examples.doctree
Binary file not shown.
Binary file added docs/_build/html/.doctrees/index.doctree
Binary file not shown.
Binary file added docs/_build/html/.doctrees/installation.doctree
Binary file not shown.
Binary file added docs/_build/html/.doctrees/quickstart.doctree
Binary file not shown.
Binary file added docs/_build/html/.doctrees/theory.doctree
Binary file not shown.
Binary file not shown.
1,805 changes: 1,805 additions & 0 deletions docs/_build/html/_modules/fastpt/FASTPT.html

Large diffs are not rendered by default.

1,807 changes: 1,807 additions & 0 deletions docs/_build/html/_modules/fastpt/FPTHandler.html

Large diffs are not rendered by default.

1,777 changes: 1,777 additions & 0 deletions docs/_build/html/_modules/fastpt/core/FASTPT.html

Large diffs are not rendered by default.

1,722 changes: 1,722 additions & 0 deletions docs/_build/html/_modules/fastpt/core/FPTHandler.html

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions docs/_build/html/_modules/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@


<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &mdash; FAST-PT 4.0.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />


<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=3304f9e4"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
</head>

<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >



<a href="../index.html" class="icon icon-home">
FAST-PT
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quickstart.html">Quick Start Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api.html">API Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../examples.html">Examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="../theory.html">Theory</a></li>
<li class="toctree-l1"><a class="reference internal" href="../changelog.html">Changelog / Migration Guide</a></li>
</ul>

</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">FAST-PT</a>
</nav>

<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Overview: module code</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>All modules for which code is available</h1>
<ul><li><a href="fastpt/core/FASTPT.html">fastpt.core.FASTPT</a></li>
<li><a href="fastpt/core/FPTHandler.html">fastpt.core.FPTHandler</a></li>
</ul>

</div>
</div>
<footer>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2016-2025, FAST-PT developers.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.


</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
16 changes: 16 additions & 0 deletions docs/_build/html/_sources/api.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _api:

API Reference
=============

FASTPT Class
------------

.. autoclass:: fastpt.FASTPT
:members:

FPTHandler Class
----------------

.. autoclass:: fastpt.FPTHandler
:members:
64 changes: 64 additions & 0 deletions docs/_build/html/_sources/changelog.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.. _changelog:

Changelog / Migration Guide
===========================

This document details the changes between the original FAST-PT implementation and the current version.

For previous versions' changes, see the :download:`complete changelog history </usr_manual.pdf>`.

NOTE: FAST-PT 4.0 is completely backwards compatible with FAST-PT 3.0. However, adjustments to your code may be required to take advantage of the new features and performance improvements.

Major Changes
-------------

* Caching: FAST-PT now caches individual terms and intermediate calculations to speed up computation.
* FPTHandler: The handler class has been introduced to improve the the user's ability to manage FAST-PT and provide many new convenience features that compliment the FAST-PT class. NOTE: the FPTHandler class is not a replacement for the FAST-PT class, but rather a wrapper that provides additional functionality. It is not necessary for computation.
* To_do list: The to_do list is no longer needed to initialize FAST-PT. The terms will now be calculated as needed and stored as a property of the FAST-PT class.


Minor Changes
-------------

* Simple flag: A new "simple" kwarg has been added to FAST-PT which will instead initialize an instance of FAST-PT simple.
* Private k: The input k is now "private" after initialization via Python's name mangling. This means that the user cannot change the value of k after initialization but can still access the value of k.
* Gamma functions cache: A separate (and simpler) caching system has been implemented to cache gamma functions and save time on the calculation of the X terms.
* Parameter validation: The parameters P, P_window, and C_window are now validated at every function call to ensure that they have the proper traits needed for the calculation. This is done to prevent errors from propagating through the code and causing issues later on.
* N_pad default: If no n_pad is provided during initialization, the default value is now set to 0.5 * len(k).
* Nu deprecation: The nu parameter is now deprecated as it is no longer needed for initialization. It will default to -2 unless a different nu value is needed in which case it will be calculated internally.
* One_loop_dd return: One_loop_dd will only return P_1loop, Ps. Previously returned the dd_bias terms as well however this was contingent on the to_do list which is being deprecated.
* Cleft_QR: The Cleft_QR function has been removed due to missing internal functions.


Performance Improvements
------------------------

The improvement in performance of FAST-PT is going to varry largely with your use case. However, about half of the calculation done for most terms was redundant granting a two times speedup do to the new caching system.
FAST-PT also now calculates terms in a modular format. This means that the user can now choose to calculate only the terms they need, rather than all of the terms grouped into one FAST-PT function.
This is done by using the FPTHandler class and the get method, or by calling compute_term with the necessary parameters for each term.
This will greatly improve the performance of each FAST-PT function if your use case only requires a select few terms.


Description of Caching System
-----------------------------

Caching in Fast-PT is done via a CacheManager_ object that is initialized with the FAST-PT class. This cache tracks various different "layers" of the calculation of Fast-PT terms. These layers include:

* Individual Power Spectra: Fast-PT functions return a tuple of multiple power spectra, each of which is cached individually.
* Jk Scalar and Tensor Calculations: Most Fast-PT terms require the calculation of the Jk scalar or tensor functions. Some terms have identical parameters that are passed to these functions, so they are cached individually as well.
* Fourier Coefficients: Fourier coefficients of the user provided power spectra are cached and then used in the Jk functions.
* Convolutions: This is the convolution of the power spectrum fourier coefficients and the relevant k grid quantities (X terms). The convolution function is called with fourier coefficients and k grid quantities, which are dependent on the user provided k and P and cached individually.

There is also a separate form of caching used for the k grid quantities (X terms) and the gamma functions used to calculate them. The gamma functions are cached outside the Fast-PT object as they will not be frequently changed, while the k grid quantities are cached as properties of the Fast-PT object and can be accessed via `fastpt_instance.X_IA_A` for example.
In total, there are three forms of caching used in Fast-PT 4.0, two of which are stored within the object. The gamma functions cache will persist as long as the program runs.

This multi-tiered caching system allows Fast-PT to avoid redundant calculations both on individual power spectra terms and the intermediate calculations that are needed to compute them.
To avoid the cache from growing too large, a "dump_cache" flag is provided in initialization that, when True, will clear the cache when a new power spectra is inputted by the user. The user is also able to specify (during Fast-PT initialization) a maximum cache size in mb. This will evict cached items randomly (in linear time) to avoid slowing down the total computation time. However, the cache size limit is meant as a safeguard and should not be treated as a form of memory management for the program.

.. _CacheManager: https://github.com/jablazek/FAST-PT/tree/master/fastpt/core/CacheManager.py


Additional Notes
------------------

* The 1loop term (one_loop_dd[0]) currently does not pass np.allclose due to numerical noise when compared with FAST-PT 3 when a C_window of 0.63 or less is provided. This only occurs at the very low k end and is negligible. This issue is currently being investigated and will be fixed in a future release.
64 changes: 64 additions & 0 deletions docs/_build/html/_sources/examples.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.. _examples:

Examples
=======

More examples can be found `here <https://github.com/jablazek/FAST-PT/tree/master/examples>`_.

One-loop Matter Power Spectrum
----------------------------

.. code-block:: python

from fastpt import FASTPT
import numpy as np
import matplotlib.pyplot as plt

# Load data
data = np.loadtxt('Pk_test.dat')
k = data[:, 0]
P = data[:, 1]

# Initialize FASTPT
fpt = FASTPT(k, low_extrap=-5, high_extrap=3, n_pad=int(0.5*len(k)))

# Calculate corrections
P_1loop, P_components = fpt.one_loop_dd(P, C_window=0.75)

# Plot
plt.figure(figsize=(10, 7))
plt.loglog(k, P, label='Linear P(k)')
plt.loglog(k, P_1loop, label='1-loop P(k)')
plt.xlabel('k [h/Mpc]')
plt.ylabel('P(k) [(Mpc/h)³]')
plt.legend()
plt.tight_layout()
plt.show()

Using the FPTHandler
-----------------

.. code-block:: python

import numpy as np
from fastpt import FASTPT, FPTHandler

# Initialize with default parameters
k_values = np.logspace(-3, 1, 1000)

fastpt_instance = FASTPT(k_values)
handler = FPTHandler(fastpt_instance, P_window=np.array([0.2, 0.2]), C_window=0.75)

# Generate and store a power spectrum
P = handler.generate_power_spectra()
handler.update_default_params(P=P)

# Get the 1-loop power spectrum, using the default parameters
result = handler.get("P_1loop")

#Plot the results
handler.plot(data=result)

# Save the results and your parameters
handler.save_output(result, "one_loop_dd")
handler.save_params("params.npz")
26 changes: 26 additions & 0 deletions docs/_build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. FAST-PT documentation master file

FAST-PT Documentation
====================

FAST-PT is a code to calculate quantities in cosmological perturbation theory at 1-loop (including, e.g., corrections to the matter power spectrum). The code utilizes Fourier methods combined with analytic expressions to reduce the computation time to scale as N log N, where N is the number of grid points in the input linear power spectrum.

FASTPT is a numerical algorithm to calculate 1-loop contributions to the matter power spectrum and other integrals of a similar type. The method is presented in papers arXiv:1603.04826 and arXiv:1609.05978. Please cite these papers if you are using FASTPT in your research.

.. toctree::
:maxdepth: 2
:caption: Contents:

installation
quickstart
api
examples
theory
changelog

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Loading
Loading