https://github.com/jmsull/gzpt
Hybrid Perturbation Theory + Halo Model 2-point statistics
https://github.com/jmsull/gzpt
Last synced: about 1 month ago
JSON representation
Hybrid Perturbation Theory + Halo Model 2-point statistics
- Host: GitHub
- URL: https://github.com/jmsull/gzpt
- Owner: jmsull
- License: mit
- Created: 2020-07-17T19:20:37.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-19T06:02:20.000Z (about 2 years ago)
- Last Synced: 2025-02-13T14:44:25.522Z (3 months ago)
- Language: Python
- Size: 1.16 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.com/jmsull/gzpt)
[](https://pypi.python.org/pypi/gzpt/)# gzpt
Hybrid Perturbation Theory + Halo Model 2-point statisticsgzpt provides a simple implementation of the analytic expressions used in [Sullivan, Seljak \& Singh (2021)](https://arxiv.org/pdf/2104.10676.pdf)
## Installation
Using pip:
```
pip install gzpt
```## Dependencies:
- numpy, scipy
- pyfftw## Simple Example
```python
from gzpt import hzpt,matter,tracers
import numpy as np# Provide a linear theory power spectrum at some z and instantiate hzpt model
klin,plin = np.loadtxt('./tests/test_plin_cc_z0.55.txt',unpack=True)
model = hzpt(klin,plin)#set up correlator objects for matter, tracer cross and auto, nmax is inferred from size of parameters
A0,R,R1h,R1sq,R12 = 350.,26.,5.,20.,2.
nbar,b1,Rexc = 1e-3, 2., 2.
mm = matter.Correlator([A0,R,R1h,R1sq,R12],model)
tm = tracers.CrossCorrelator([b1,A0,R,R1h,R1sq,R12],model)
tt = tracers.AutoCorrelator([nbar,b1,A0,R,R1h],model,params_exc=[Rexc]) #use one exclusion parameterkk = np.logspace(-3,np.log10(2),1000)
rr = np.logspace(0,2,1000)#get some matter correlators
Pmm = mm.Power()(kk)
Ximm,Ximm_grad = mm.Xi(wantGrad=True)(rr) #get the grad if you want it```
A more involved example is provided in docs/first_example.ipynbThe Zel'dovich correlator code is based on code of Stephen Chen (https://github.com/sfschen/velocileptors) and Chirag Modi (https://github.com/modichirag/CLEFT), which is in turn built upon Yin Li's mcfit package (https://github.com/eelregit/mcfit) and Martin White's CLEFT code (https://github.com/martinjameswhite/CLEFT_GSM).
Disclaimer that the organization of the code could be greatly improved!