Stochastic first-passage time (FPT) simulations using importance sampling
Project description
What is PyFPT?
PyFPT is Python/Cython package to run first-passage time (FPT) simulations using importance sampling.
This package will let you numerically investigate the tail of the probability density for first passage times for a general 1D Langevin equation.
The tail of the probability density is investigated using the method of importance sampling, where a bias increases the probability of large FPTs, resulting in a sample distribution, which are then weighted to reproduce the rare events of the target distribution. This allows very rare events (normally need supercomputers) to be simulate efficiently with just your laptop!
Note, it was originally developed to find number of e-folds for a potential in slow-roll stochastic inflation inflation. As such, analytical functionality is also included for this particular problem in the analytics module.
Documentation
You can find the latest documentation on PyFPT's ReadTheDocs page.
Requirements
Operating System
As PyFPT uses Cython to optimise the stochastic simulations, a C-compilier is required for installation. Therefore, PyFPT does not currently run (future releases hope to address this issue) on Windows directly. Windows uses can either install PyFPT on a virtual machine or use a cloud-based service such as SciServer.
Mac and Linux user should be able to directly install PyFPT, as these operating systems have a C-compiler.
Packages
The following packages are required to run PyFPT
Many of which are included in common Python distributions like Anaconda. You can check which packages you already have installed with pip list
.
Getting Started
User Guide
The documentation contains a user guide, whose code you can run yourself as interactive Jupyter notebook by downloading them.
Installation
The package can be installed by using the following command
pip install PyFPT
in the command line wherever you have Python installed.
You can also clone the PyFPT repository
git clone https://github.com/Jacks0nJ/PyFPT.git
to work on it locally. This would require compiling the Cython code (the .pyx
files) locally as well.
Example Results
The PyFPT package can be used to investigate far into the tail of the probability density (down to 10^-34 and beyond!)
Or even deviations from Gaussianity!
In the above images `N' is the first-passage time in stochastic inflation.
See the user guides for details on how you can make these figures yourself!
Roadmap
- Simulate first-passage times of slow-roll inflation
- Use importance sampling to investigate rare realisations.
- Make general, for any 1D Langevin equation
- Add multi-dimensionality
- Add the acceleration of the field
- Add more sophisticated noise models
See the open issues for a full list of known issues.
Contributing
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
And we will review your request!
Bugs
This is the initial release of PyFPT, so it is expected there will be some minor bugs. Feel free to either report by raising an Issue on Github, emailing joseph.jackson@port.ac.uk or fork the repository with your fix.
Your feedback is very much appreciated!
License
Distributed under an Apache-2.0 License. See LICENSE.txt
for more information.
Contact
Joe Jackson - joseph.jackson@port.ac.uk
Project Link: https://github.com/Jacks0nJ/PyFPT
Acknowledgments
We would like the following contributors to PyFPT, be it through physical understanding of first-passage time processes or help developing the package
The Physics
- David Wands
- Vincent Vennin
- Kazuya Koyama
- Hooshyar Assadullahi
Package Development
- Coleman Krawczyk
- Ian Harry
Logo
- Will Jackson
Resources
The following resoucres were instrumental in developing the project into a package usable by the community:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for PyFPT-1.0.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74f91ad030c10c8f6a5728fefe078f9289eac518f71f205a565d0424ba6aaf16 |
|
MD5 | 1bb7bb237389d91988e7a78cfbc38ee5 |
|
BLAKE2b-256 | dafb597e3a2a35797ae11466dcb03b2655175d15dd2e97499f3bc03374aef257 |