├── PyTransport
├── __init__.py
├── PyTrans
│ ├── __init__.py
│ ├── setup.cfg
│ ├── .spyderworkspace
│ ├── lib
│ │ └── python
│ │ │ ├── PyTransDQuad.so
│ │ │ ├── PyTransDQuadNC.so
│ │ │ ├── PyTransDQuad-1.0.egg-info
│ │ │ └── PyTransDQuadNC-1.0.egg-info
│ └── moduleSetup.py
├── setup.cfg
├── PyTransSetup.pyc
├── PyTransScripts.pyc
├── CppTrans
│ ├── stepper
│ │ ├── gnu_lgpl.webarchive
│ │ ├── Note.txt
│ │ └── rkf45.hpp
│ ├── fieldmetricProto.h
│ ├── potentialProto.h
│ ├── potential.h
│ └── fieldmetric.h
└── __pycache__
│ ├── PyTransSetup.cpython-35.pyc
│ └── PyTransScripts.cpython-35.pyc
├── Docs
├── Pz.png
├── ns.png
├── BiEq.png
├── DQ1.png
├── DQ2.png
├── DQ3.png
├── DQ4.png
├── DQ5.png
├── NCsetup.png
├── Shot1.png
├── Shot1b.png
├── Shot2.png
├── Shot2d.png
├── Shot3.png
├── Shot3b.png
├── Shot3c.png
├── Shot4.png
├── Shot4b.png
├── Shot5.png
├── Shot5b.png
├── Shot6.png
├── Shot6b.png
├── Shot7.png
├── Shot7b.png
├── Shot8.png
├── Shot8b.png
├── shot1c2.png
├── shot2b.png
├── alpBetEq3.png
├── alpbetMay.png
├── PyTransLogo.pdf
├── UserGuide2.pdf
├── UserGuide2.synctex.gz
└── UserGuide2.out
├── Examples
├── Curve
│ ├── BiEq.png
│ ├── MpiRun.py
│ ├── curveSetup.py
│ ├── EqBi.py
│ └── MpiEqBi.py
├── CurveNC
│ ├── BiEq.png
│ ├── polarBackground.png
│ ├── CartesianBackground.png
│ ├── twopointevolutionNC.png
│ ├── fieldfieldcorrelation_kExit10efolds.png
│ └── CurveSetup.py
├── DoubleQuad
│ ├── Pz.png
│ ├── ns.png
│ ├── BiEq.png
│ ├── DQ1.png
│ ├── DQ2.png
│ ├── DQ3.png
│ ├── DQ4.png
│ ├── DQ5.png
│ ├── DBiCon2.png
│ ├── times2.png
│ ├── data
│ │ ├── alp.npy
│ │ ├── bet.npy
│ │ ├── alBetBi.npy
│ │ ├── alBetPz1.npy
│ │ ├── alBetPz2.npy
│ │ ├── alBetPz3.npy
│ │ ├── timesSq1.dat
│ │ ├── timesSq2.dat
│ │ └── timesSq1 (David Mulryne's conflicted copy 2016-11-25).dat
│ ├── plots
│ │ ├── DQ1.png
│ │ ├── DQ2.png
│ │ ├── DQ3.png
│ │ ├── DQ4.png
│ │ ├── DQ5.png
│ │ ├── BiEq.png
│ │ ├── DQ1 (David Mulryne's conflicted copy 2016-11-25).png
│ │ ├── DQ2 (David Mulryne's conflicted copy 2016-11-25).png
│ │ ├── DQ3 (David Mulryne's conflicted copy 2016-11-25).png
│ │ ├── DQ4 (David Mulryne's conflicted copy 2016-11-25).png
│ │ └── DQ5 (David Mulryne's conflicted copy 2016-11-25).png
│ ├── MpiRun.py
│ ├── UserGuidePlots
│ │ ├── Pz.png
│ │ ├── ns.png
│ │ ├── BiEq.png
│ │ ├── DQ1.png
│ │ ├── DQ2.png
│ │ ├── DQ3.png
│ │ ├── DQ4.png
│ │ ├── DQ5.png
│ │ ├── fnlEq.png
│ │ ├── alpBetEq2.png
│ │ ├── alpBetEq3.png
│ │ ├── alpbetMay.png
│ │ ├── data
│ │ │ ├── alp.npy
│ │ │ ├── bet.npy
│ │ │ ├── alBetBi.npy
│ │ │ ├── alBetPz1.npy
│ │ │ ├── alBetPz2.npy
│ │ │ ├── alBetPz3.npy
│ │ │ └── EqBi.dat
│ │ ├── PyTransLogo.pdf
│ │ ├── DQ1 (David Mulryne's conflicted copy 2016-11-25).png
│ │ ├── DQ2 (David Mulryne's conflicted copy 2016-11-25).png
│ │ ├── DQ3 (David Mulryne's conflicted copy 2016-11-25).png
│ │ ├── DQ4 (David Mulryne's conflicted copy 2016-11-25).png
│ │ ├── DQ5 (David Mulryne's conflicted copy 2016-11-25).png
│ │ └── Note.txt
│ ├── PaperPerformanceDataPlots
│ │ ├── fig12a.png
│ │ ├── fig12b.png
│ │ ├── fig12c.png
│ │ ├── fig12d.png
│ │ ├── fig13a.png
│ │ ├── fig13b.png
│ │ ├── fig13c.png
│ │ ├── fig13d.png
│ │ ├── times1.png
│ │ ├── times2.png
│ │ ├── times3.png
│ │ ├── times4.png
│ │ ├── DBiCon1.png
│ │ ├── DBiCon2.png
│ │ ├── DBiCon3.png
│ │ ├── DBiCon4.png
│ │ ├── Note.txt
│ │ ├── data
│ │ │ ├── timesEq1.dat
│ │ │ ├── timesEq2.dat
│ │ │ ├── timesSq1.dat
│ │ │ ├── timesSq2.dat
│ │ │ └── timesEq2 (David Mulryne's conflicted copy 2016-11-25).dat
│ │ └── timing.py
│ ├── DQuadSetup.py
│ ├── Plots.py
│ ├── MpiAlpBetBi.py
│ ├── MpiEqBi.py
│ ├── timing.py
│ └── powerSpectrum.py
├── QuartAx
│ ├── DQ1.png
│ ├── DQ2.png
│ ├── DQ3.png
│ ├── DQ4.png
│ ├── DQ5.png
│ ├── movie
│ │ └── out.mp4
│ ├── paper
│ │ ├── fig5a.png
│ │ ├── fig5b.png
│ │ ├── fig5c.png
│ │ ├── fig5d.png
│ │ ├── fig5e.png
│ │ ├── fig5f.png
│ │ ├── fig6a.png
│ │ ├── fig6b.png
│ │ ├── fig6c.png
│ │ ├── fig6d.png
│ │ ├── fig6e.png
│ │ ├── fig6f.png
│ │ ├── fig7a.png
│ │ ├── fig7b.png
│ │ ├── fig7c.png
│ │ ├── fig7d.png
│ │ ├── Note.txt
│ │ └── Plots.py
│ ├── MpiRun.py
│ ├── AxionQurtSetup.py
│ ├── alpbetMpi.py
│ ├── movie.py
│ └── Plots.py
├── QuartAxNC
│ ├── DQ2.png
│ ├── DQ3.png
│ ├── DQ4.png
│ ├── DQ5.png
│ ├── PzEvo.png
│ ├── FnlEvo.png
│ ├── BackEvolution2ax.png
│ ├── QuatAxNCsetup.py
│ └── BackgroundEvolution.py
├── LH
│ ├── paper
│ │ ├── fig11a.png
│ │ ├── fig11b.png
│ │ ├── fig11c.png
│ │ ├── fig11d.png
│ │ └── Note.txt
│ ├── Slow turn example
│ │ ├── LH1.png
│ │ ├── LH2.png
│ │ ├── LH3.png
│ │ └── LH4.png
│ ├── MpiRun.py
│ ├── LangHeavySetup.py
│ ├── EqSpecMpi.py
│ └── SpectraExample.py
├── DoubleQuadNC
│ ├── DQ1.png
│ ├── DQ2.png
│ ├── DQ3.png
│ ├── DQ4.png
│ ├── DQ5.png
│ └── DQuadNCSetup.py
├── SingleField
│ ├── data
│ │ ├── alp.npy
│ │ ├── bet.npy
│ │ ├── alBetBi.npy
│ │ ├── alBetPz1.npy
│ │ ├── alBetPz2.npy
│ │ ├── alBetPz3.npy
│ │ ├── alpBetFnl2.png
│ │ ├── alpbetFnlMay.png
│ │ └── eqDataT.dat
│ ├── Paper
│ │ ├── fig8a.png
│ │ ├── fig8b.png
│ │ ├── fig8c.png
│ │ ├── fig8d.png
│ │ ├── fig9a.png
│ │ ├── fig9b.png
│ │ ├── fig9c.png
│ │ ├── fig9d.png
│ │ ├── alpBetDBi1.png
│ │ ├── alpBetFnl1.png
│ │ ├── paperData
│ │ │ ├── alp.npy
│ │ │ ├── bet.npy
│ │ │ ├── alBetBi.npy
│ │ │ ├── alBetPz1.npy
│ │ │ ├── alBetPz2.npy
│ │ │ └── alBetPz3.npy
│ │ └── Note.txt
│ ├── old
│ │ ├── alpBetEq2.png
│ │ ├── alpBetEq3.png
│ │ ├── alpbetMay.png
│ │ └── PaperData
│ │ │ ├── alp.npy
│ │ │ ├── bet.npy
│ │ │ ├── alBetBi.npy
│ │ │ ├── alBetPz1.npy
│ │ │ ├── alBetPz2.npy
│ │ │ └── alBetPz3.npy
│ ├── MpiRun.py
│ ├── StepPotSetup.py
│ ├── MpiAlpBetBi.py
│ ├── Plots.py
│ ├── MpiEqBi.py
│ └── SpectraExample.py
└── PseudoScalar
│ ├── alpBetEq2.png
│ ├── alpBetEq3.png
│ ├── data
│ ├── alp.npy
│ ├── bet.npy
│ ├── alBetBi.npy
│ ├── alBetPz1.npy
│ ├── alBetPz2.npy
│ └── alBetPz3.npy
│ ├── FnlEvolution.png
│ ├── PzEvolution.png
│ ├── AlphaEvolution.png
│ ├── MpiRun.py
│ ├── SigmaEvolution.png
│ ├── BackgroudEvolution.png
│ ├── ThreepointEvolution.png
│ ├── PseudoSetup.py
│ ├── Plots.py
│ └── MpiAlpBetBi.py
├── paper
├── JOSS_summary.pdf
├── PyTransLogo-1.png
└── paper.md
├── AutoTest
├── ReadMe.md
├── TestSetup.py
└── Testrun.py
└── README.md
/PyTransport/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PyTransport/PyTrans/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PyTransport/setup.cfg:
--------------------------------------------------------------------------------
1 | [install]
2 | prefix=
3 |
--------------------------------------------------------------------------------
/PyTransport/PyTrans/setup.cfg:
--------------------------------------------------------------------------------
1 | [install]
2 | prefix=
3 |
--------------------------------------------------------------------------------
/Docs/Pz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Pz.png
--------------------------------------------------------------------------------
/Docs/ns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/ns.png
--------------------------------------------------------------------------------
/Docs/BiEq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/BiEq.png
--------------------------------------------------------------------------------
/Docs/DQ1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/DQ1.png
--------------------------------------------------------------------------------
/Docs/DQ2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/DQ2.png
--------------------------------------------------------------------------------
/Docs/DQ3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/DQ3.png
--------------------------------------------------------------------------------
/Docs/DQ4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/DQ4.png
--------------------------------------------------------------------------------
/Docs/DQ5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/DQ5.png
--------------------------------------------------------------------------------
/Docs/NCsetup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/NCsetup.png
--------------------------------------------------------------------------------
/Docs/Shot1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot1.png
--------------------------------------------------------------------------------
/Docs/Shot1b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot1b.png
--------------------------------------------------------------------------------
/Docs/Shot2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot2.png
--------------------------------------------------------------------------------
/Docs/Shot2d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot2d.png
--------------------------------------------------------------------------------
/Docs/Shot3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot3.png
--------------------------------------------------------------------------------
/Docs/Shot3b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot3b.png
--------------------------------------------------------------------------------
/Docs/Shot3c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot3c.png
--------------------------------------------------------------------------------
/Docs/Shot4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot4.png
--------------------------------------------------------------------------------
/Docs/Shot4b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot4b.png
--------------------------------------------------------------------------------
/Docs/Shot5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot5.png
--------------------------------------------------------------------------------
/Docs/Shot5b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot5b.png
--------------------------------------------------------------------------------
/Docs/Shot6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot6.png
--------------------------------------------------------------------------------
/Docs/Shot6b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot6b.png
--------------------------------------------------------------------------------
/Docs/Shot7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot7.png
--------------------------------------------------------------------------------
/Docs/Shot7b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot7b.png
--------------------------------------------------------------------------------
/Docs/Shot8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot8.png
--------------------------------------------------------------------------------
/Docs/Shot8b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/Shot8b.png
--------------------------------------------------------------------------------
/Docs/shot1c2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/shot1c2.png
--------------------------------------------------------------------------------
/Docs/shot2b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/shot2b.png
--------------------------------------------------------------------------------
/Docs/alpBetEq3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/alpBetEq3.png
--------------------------------------------------------------------------------
/Docs/alpbetMay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/alpbetMay.png
--------------------------------------------------------------------------------
/Docs/PyTransLogo.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/PyTransLogo.pdf
--------------------------------------------------------------------------------
/Docs/UserGuide2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/UserGuide2.pdf
--------------------------------------------------------------------------------
/Examples/Curve/BiEq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/Curve/BiEq.png
--------------------------------------------------------------------------------
/paper/JOSS_summary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/paper/JOSS_summary.pdf
--------------------------------------------------------------------------------
/paper/PyTransLogo-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/paper/PyTransLogo-1.png
--------------------------------------------------------------------------------
/Docs/UserGuide2.synctex.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Docs/UserGuide2.synctex.gz
--------------------------------------------------------------------------------
/Examples/CurveNC/BiEq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/CurveNC/BiEq.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/Pz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/Pz.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/ns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/ns.png
--------------------------------------------------------------------------------
/Examples/QuartAx/DQ1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/DQ1.png
--------------------------------------------------------------------------------
/Examples/QuartAx/DQ2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/DQ2.png
--------------------------------------------------------------------------------
/Examples/QuartAx/DQ3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/DQ3.png
--------------------------------------------------------------------------------
/Examples/QuartAx/DQ4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/DQ4.png
--------------------------------------------------------------------------------
/Examples/QuartAx/DQ5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/DQ5.png
--------------------------------------------------------------------------------
/Examples/QuartAxNC/DQ2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAxNC/DQ2.png
--------------------------------------------------------------------------------
/Examples/QuartAxNC/DQ3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAxNC/DQ3.png
--------------------------------------------------------------------------------
/Examples/QuartAxNC/DQ4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAxNC/DQ4.png
--------------------------------------------------------------------------------
/Examples/QuartAxNC/DQ5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAxNC/DQ5.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/BiEq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/BiEq.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/DQ1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/DQ1.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/DQ2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/DQ2.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/DQ3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/DQ3.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/DQ4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/DQ4.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/DQ5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/DQ5.png
--------------------------------------------------------------------------------
/Examples/LH/paper/fig11a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/LH/paper/fig11a.png
--------------------------------------------------------------------------------
/Examples/LH/paper/fig11b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/LH/paper/fig11b.png
--------------------------------------------------------------------------------
/Examples/LH/paper/fig11c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/LH/paper/fig11c.png
--------------------------------------------------------------------------------
/Examples/LH/paper/fig11d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/LH/paper/fig11d.png
--------------------------------------------------------------------------------
/Examples/QuartAxNC/PzEvo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAxNC/PzEvo.png
--------------------------------------------------------------------------------
/PyTransport/PyTransSetup.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/PyTransport/PyTransSetup.pyc
--------------------------------------------------------------------------------
/Examples/DoubleQuad/DBiCon2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/DBiCon2.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/times2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/times2.png
--------------------------------------------------------------------------------
/Examples/DoubleQuadNC/DQ1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuadNC/DQ1.png
--------------------------------------------------------------------------------
/Examples/DoubleQuadNC/DQ2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuadNC/DQ2.png
--------------------------------------------------------------------------------
/Examples/DoubleQuadNC/DQ3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuadNC/DQ3.png
--------------------------------------------------------------------------------
/Examples/DoubleQuadNC/DQ4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuadNC/DQ4.png
--------------------------------------------------------------------------------
/Examples/DoubleQuadNC/DQ5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuadNC/DQ5.png
--------------------------------------------------------------------------------
/Examples/QuartAx/movie/out.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/movie/out.mp4
--------------------------------------------------------------------------------
/Examples/QuartAxNC/FnlEvo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAxNC/FnlEvo.png
--------------------------------------------------------------------------------
/PyTransport/PyTransScripts.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/PyTransport/PyTransScripts.pyc
--------------------------------------------------------------------------------
/Examples/DoubleQuad/data/alp.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/data/alp.npy
--------------------------------------------------------------------------------
/Examples/DoubleQuad/data/bet.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/data/bet.npy
--------------------------------------------------------------------------------
/Examples/DoubleQuad/plots/DQ1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/plots/DQ1.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/plots/DQ2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/plots/DQ2.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/plots/DQ3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/plots/DQ3.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/plots/DQ4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/plots/DQ4.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/plots/DQ5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/plots/DQ5.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig5a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig5a.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig5b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig5b.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig5c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig5c.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig5d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig5d.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig5e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig5e.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig5f.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig5f.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig6a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig6a.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig6b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig6b.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig6c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig6c.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig6d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig6d.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig6e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig6e.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig6f.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig6f.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig7a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig7a.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig7b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig7b.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig7c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig7c.png
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/fig7d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAx/paper/fig7d.png
--------------------------------------------------------------------------------
/Examples/SingleField/data/alp.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/data/alp.npy
--------------------------------------------------------------------------------
/Examples/SingleField/data/bet.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/data/bet.npy
--------------------------------------------------------------------------------
/Examples/Curve/MpiRun.py:
--------------------------------------------------------------------------------
1 | import subprocess
2 | subprocess.Popen(['mpiexec', '-n', '10', 'python', 'MpiEqBi.py'])
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Examples/CurveNC/polarBackground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/CurveNC/polarBackground.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/data/alBetBi.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/data/alBetBi.npy
--------------------------------------------------------------------------------
/Examples/DoubleQuad/plots/BiEq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/plots/BiEq.png
--------------------------------------------------------------------------------
/Examples/PseudoScalar/alpBetEq2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/alpBetEq2.png
--------------------------------------------------------------------------------
/Examples/PseudoScalar/alpBetEq3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/alpBetEq3.png
--------------------------------------------------------------------------------
/Examples/PseudoScalar/data/alp.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/data/alp.npy
--------------------------------------------------------------------------------
/Examples/PseudoScalar/data/bet.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/data/bet.npy
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/fig8a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/fig8a.png
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/fig8b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/fig8b.png
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/fig8c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/fig8c.png
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/fig8d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/fig8d.png
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/fig9a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/fig9a.png
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/fig9b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/fig9b.png
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/fig9c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/fig9c.png
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/fig9d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/fig9d.png
--------------------------------------------------------------------------------
/PyTransport/PyTrans/.spyderworkspace:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/PyTransport/PyTrans/.spyderworkspace
--------------------------------------------------------------------------------
/Examples/DoubleQuad/MpiRun.py:
--------------------------------------------------------------------------------
1 | import subprocess
2 | subprocess.Popen(['mpiexec', '-n', '10', 'python', 'MpiEqBi.py'])
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/data/alBetPz1.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/data/alBetPz1.npy
--------------------------------------------------------------------------------
/Examples/DoubleQuad/data/alBetPz2.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/data/alBetPz2.npy
--------------------------------------------------------------------------------
/Examples/DoubleQuad/data/alBetPz3.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/data/alBetPz3.npy
--------------------------------------------------------------------------------
/Examples/LH/Slow turn example/LH1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/LH/Slow turn example/LH1.png
--------------------------------------------------------------------------------
/Examples/LH/Slow turn example/LH2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/LH/Slow turn example/LH2.png
--------------------------------------------------------------------------------
/Examples/LH/Slow turn example/LH3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/LH/Slow turn example/LH3.png
--------------------------------------------------------------------------------
/Examples/LH/Slow turn example/LH4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/LH/Slow turn example/LH4.png
--------------------------------------------------------------------------------
/Examples/PseudoScalar/FnlEvolution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/FnlEvolution.png
--------------------------------------------------------------------------------
/Examples/PseudoScalar/PzEvolution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/PzEvolution.png
--------------------------------------------------------------------------------
/Examples/PseudoScalar/data/alBetBi.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/data/alBetBi.npy
--------------------------------------------------------------------------------
/Examples/SingleField/data/alBetBi.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/data/alBetBi.npy
--------------------------------------------------------------------------------
/Examples/SingleField/data/alBetPz1.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/data/alBetPz1.npy
--------------------------------------------------------------------------------
/Examples/SingleField/data/alBetPz2.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/data/alBetPz2.npy
--------------------------------------------------------------------------------
/Examples/SingleField/data/alBetPz3.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/data/alBetPz3.npy
--------------------------------------------------------------------------------
/Examples/SingleField/old/alpBetEq2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/old/alpBetEq2.png
--------------------------------------------------------------------------------
/Examples/SingleField/old/alpBetEq3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/old/alpBetEq3.png
--------------------------------------------------------------------------------
/Examples/SingleField/old/alpbetMay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/old/alpbetMay.png
--------------------------------------------------------------------------------
/Examples/CurveNC/CartesianBackground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/CurveNC/CartesianBackground.png
--------------------------------------------------------------------------------
/Examples/CurveNC/twopointevolutionNC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/CurveNC/twopointevolutionNC.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/Pz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/Pz.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/ns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/ns.png
--------------------------------------------------------------------------------
/Examples/PseudoScalar/AlphaEvolution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/AlphaEvolution.png
--------------------------------------------------------------------------------
/Examples/PseudoScalar/MpiRun.py:
--------------------------------------------------------------------------------
1 | import subprocess
2 | subprocess.Popen(['mpiexec', '-n', '10', 'python', 'MpiAlpBetBi.py'])
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Examples/PseudoScalar/SigmaEvolution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/SigmaEvolution.png
--------------------------------------------------------------------------------
/Examples/PseudoScalar/data/alBetPz1.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/data/alBetPz1.npy
--------------------------------------------------------------------------------
/Examples/PseudoScalar/data/alBetPz2.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/data/alBetPz2.npy
--------------------------------------------------------------------------------
/Examples/PseudoScalar/data/alBetPz3.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/data/alBetPz3.npy
--------------------------------------------------------------------------------
/Examples/QuartAxNC/BackEvolution2ax.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/QuartAxNC/BackEvolution2ax.png
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/alpBetDBi1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/alpBetDBi1.png
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/alpBetFnl1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/alpBetFnl1.png
--------------------------------------------------------------------------------
/Examples/SingleField/data/alpBetFnl2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/data/alpBetFnl2.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/BiEq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/BiEq.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/DQ1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/DQ1.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/DQ2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/DQ2.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/DQ3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/DQ3.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/DQ4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/DQ4.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/DQ5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/DQ5.png
--------------------------------------------------------------------------------
/Examples/SingleField/data/alpbetFnlMay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/data/alpbetFnlMay.png
--------------------------------------------------------------------------------
/Examples/SingleField/old/PaperData/alp.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/old/PaperData/alp.npy
--------------------------------------------------------------------------------
/Examples/SingleField/old/PaperData/bet.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/old/PaperData/bet.npy
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/fnlEq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/fnlEq.png
--------------------------------------------------------------------------------
/Examples/PseudoScalar/BackgroudEvolution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/BackgroudEvolution.png
--------------------------------------------------------------------------------
/Examples/PseudoScalar/ThreepointEvolution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/PseudoScalar/ThreepointEvolution.png
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/paperData/alp.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/paperData/alp.npy
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/paperData/bet.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/paperData/bet.npy
--------------------------------------------------------------------------------
/Examples/SingleField/old/PaperData/alBetBi.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/old/PaperData/alBetBi.npy
--------------------------------------------------------------------------------
/PyTransport/PyTrans/lib/python/PyTransDQuad.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/PyTransport/PyTrans/lib/python/PyTransDQuad.so
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/alpBetEq2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/alpBetEq2.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/alpBetEq3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/alpBetEq3.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/alpbetMay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/alpbetMay.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/data/alp.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/data/alp.npy
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/data/bet.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/data/bet.npy
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/paperData/alBetBi.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/paperData/alBetBi.npy
--------------------------------------------------------------------------------
/Examples/SingleField/old/PaperData/alBetPz1.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/old/PaperData/alBetPz1.npy
--------------------------------------------------------------------------------
/Examples/SingleField/old/PaperData/alBetPz2.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/old/PaperData/alBetPz2.npy
--------------------------------------------------------------------------------
/Examples/SingleField/old/PaperData/alBetPz3.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/old/PaperData/alBetPz3.npy
--------------------------------------------------------------------------------
/PyTransport/CppTrans/stepper/gnu_lgpl.webarchive:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/PyTransport/CppTrans/stepper/gnu_lgpl.webarchive
--------------------------------------------------------------------------------
/PyTransport/PyTrans/lib/python/PyTransDQuadNC.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/PyTransport/PyTrans/lib/python/PyTransDQuadNC.so
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/PyTransLogo.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/PyTransLogo.pdf
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/data/alBetBi.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/data/alBetBi.npy
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/paperData/alBetPz1.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/paperData/alBetPz1.npy
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/paperData/alBetPz2.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/paperData/alBetPz2.npy
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/paperData/alBetPz3.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/SingleField/Paper/paperData/alBetPz3.npy
--------------------------------------------------------------------------------
/PyTransport/CppTrans/stepper/Note.txt:
--------------------------------------------------------------------------------
1 | Details of this ODE solver can be found at this link:
2 | https://people.sc.fsu.edu/~jburkardt/cpp_src/rkf45/rkf45.html
--------------------------------------------------------------------------------
/PyTransport/__pycache__/PyTransSetup.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/PyTransport/__pycache__/PyTransSetup.cpython-35.pyc
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/data/alBetPz1.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/data/alBetPz1.npy
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/data/alBetPz2.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/data/alBetPz2.npy
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/data/alBetPz3.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/data/alBetPz3.npy
--------------------------------------------------------------------------------
/PyTransport/__pycache__/PyTransScripts.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/PyTransport/__pycache__/PyTransScripts.cpython-35.pyc
--------------------------------------------------------------------------------
/Examples/CurveNC/fieldfieldcorrelation_kExit10efolds.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/CurveNC/fieldfieldcorrelation_kExit10efolds.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/fig12a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/fig12a.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/fig12b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/fig12b.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/fig12c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/fig12c.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/fig12d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/fig12d.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/fig13a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/fig13a.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/fig13b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/fig13b.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/fig13c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/fig13c.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/fig13d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/fig13d.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/times1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/times1.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/times2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/times2.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/times3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/times3.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/times4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/times4.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/DBiCon1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/DBiCon1.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/DBiCon2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/DBiCon2.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/DBiCon3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/DBiCon3.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/DBiCon4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/PaperPerformanceDataPlots/DBiCon4.png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/plots/DQ1 (David Mulryne's conflicted copy 2016-11-25).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/plots/DQ1 (David Mulryne's conflicted copy 2016-11-25).png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/plots/DQ2 (David Mulryne's conflicted copy 2016-11-25).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/plots/DQ2 (David Mulryne's conflicted copy 2016-11-25).png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/plots/DQ3 (David Mulryne's conflicted copy 2016-11-25).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/plots/DQ3 (David Mulryne's conflicted copy 2016-11-25).png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/plots/DQ4 (David Mulryne's conflicted copy 2016-11-25).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/plots/DQ4 (David Mulryne's conflicted copy 2016-11-25).png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/plots/DQ5 (David Mulryne's conflicted copy 2016-11-25).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/plots/DQ5 (David Mulryne's conflicted copy 2016-11-25).png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/DQ1 (David Mulryne's conflicted copy 2016-11-25).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/DQ1 (David Mulryne's conflicted copy 2016-11-25).png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/DQ2 (David Mulryne's conflicted copy 2016-11-25).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/DQ2 (David Mulryne's conflicted copy 2016-11-25).png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/DQ3 (David Mulryne's conflicted copy 2016-11-25).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/DQ3 (David Mulryne's conflicted copy 2016-11-25).png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/DQ4 (David Mulryne's conflicted copy 2016-11-25).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/DQ4 (David Mulryne's conflicted copy 2016-11-25).png
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/DQ5 (David Mulryne's conflicted copy 2016-11-25).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jronayne/PyTransport/HEAD/Examples/DoubleQuad/UserGuidePlots/DQ5 (David Mulryne's conflicted copy 2016-11-25).png
--------------------------------------------------------------------------------
/PyTransport/PyTrans/lib/python/PyTransDQuad-1.0.egg-info:
--------------------------------------------------------------------------------
1 | Metadata-Version: 1.0
2 | Name: PyTransDQuad
3 | Version: 1.0
4 | Summary: UNKNOWN
5 | Home-page: UNKNOWN
6 | Author: UNKNOWN
7 | Author-email: UNKNOWN
8 | License: UNKNOWN
9 | Description: UNKNOWN
10 | Platform: UNKNOWN
11 |
--------------------------------------------------------------------------------
/PyTransport/PyTrans/lib/python/PyTransDQuadNC-1.0.egg-info:
--------------------------------------------------------------------------------
1 | Metadata-Version: 1.0
2 | Name: PyTransDQuadNC
3 | Version: 1.0
4 | Summary: UNKNOWN
5 | Home-page: UNKNOWN
6 | Author: UNKNOWN
7 | Author-email: UNKNOWN
8 | License: UNKNOWN
9 | Description: UNKNOWN
10 | Platform: UNKNOWN
11 |
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/Note.txt:
--------------------------------------------------------------------------------
1 | The plots in this folder follow from the setup and initial conditions for the axion-quartic example in the paper.
2 |
3 | The data and plots were generated using the scripts in the folder above.
4 |
5 | The associated raw data is in the data subfolder of this folder.
--------------------------------------------------------------------------------
/Examples/LH/paper/Note.txt:
--------------------------------------------------------------------------------
1 | The plots in this folder follow from the setup and initial conditions for the non-adiabatic particle production model from the paper.
2 |
3 | The data and plots were generated using the scripts in the parent folder.
4 |
5 | The associated raw data is in the data subfolder of this folder.
--------------------------------------------------------------------------------
/Examples/SingleField/Paper/Note.txt:
--------------------------------------------------------------------------------
1 | The plots in this folder follow from the setup and initial conditions for the single field example in the paper (the curved potential example).
2 |
3 | The data and plots were generated using the scripts in the folder above.
4 |
5 | The associated raw data is in the data subfolder of this folder.
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/Note.txt:
--------------------------------------------------------------------------------
1 | The plots in this folder follow from the setup and initial conditions for the double quadratic model which are described in the user guide.
2 |
3 | The data and plots were generated using the scripts in the parent folder.
4 |
5 | The associated raw data is in the data subfolder of this folder.
--------------------------------------------------------------------------------
/Examples/QuartAx/MpiRun.py:
--------------------------------------------------------------------------------
1 | import subprocess
2 |
3 | ### only need to do this once for each new potential -- it creates a potential.h file for the potential, and then compliles a python extension model InfEasyPy
4 | #subprocess.call(["python", "potentialSetup.py"])
5 |
6 | #subprocess.check_output(["ls", "-l"])
7 | subprocess.Popen(['/usr/local/bin/mpiexec', '-n', '20', 'python', 'alpbetMpi.py'])
8 |
9 |
--------------------------------------------------------------------------------
/Examples/LH/MpiRun.py:
--------------------------------------------------------------------------------
1 | import subprocess
2 |
3 | ### only need to do this once for each new potential -- it creates a potential.h file for the potential, and then compliles a python extension model InfEasyPy
4 | #subprocess.call(["python", "potentialSetup.py"])
5 |
6 | #subprocess.check_output(["ls", "-l"])
7 | subprocess.Popen(['/usr/local/bin/mpiexec', '-n', '10', 'python', 'MpiExample.py'])
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Examples/SingleField/MpiRun.py:
--------------------------------------------------------------------------------
1 | import subprocess
2 |
3 | ### only need to do this once for each new potential -- it creates a potential.h file for the potential, and then compliles a python extension model InfEasyPy
4 | #subprocess.call(["python", "potentialSetup.py"])
5 |
6 | #subprocess.check_output(["ls", "-l"])
7 | subprocess.Popen(['/usr/local/bin/mpiexec', '-n', '10', 'python', 'MpiAlpBetBi.py'])
8 |
9 |
10 |
--------------------------------------------------------------------------------
/AutoTest/ReadMe.md:
--------------------------------------------------------------------------------
1 | ## Automatic Test of PyTransport 2.0
2 |
3 | Test of PyTransport distibution to ensure correct installation. This test uses the python package nose.
4 | Before running insure you have the correct location to the PyTransport distibution in TestSetup.py and Testrun.py.
5 | To excute the test run:
6 |
7 | python TestSetup.py
8 |
9 | In order to setup the test. Next run:
10 |
11 | nosetests Testrun.py
12 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/Note.txt:
--------------------------------------------------------------------------------
1 | The plots in this folder follow from the setup and initial conditions for the 4 cases of the double-quadratic example detailed the paper which are used to test the performance with sub-horizon e-folds and convergence.
2 |
3 | The data and plots were generated using the timing.py script adjusting the horizon crossing time and alpha beta configuration.
4 |
5 | The associated raw data is in the data subfolder of this folder.
--------------------------------------------------------------------------------
/Examples/DoubleQuad/UserGuidePlots/data/EqBi.dat:
--------------------------------------------------------------------------------
1 | 8.378868531335706749e+00 9.243080053043291500e+00 1.019642790043243963e+01 1.124810575393489387e+01 1.240825554666428410e+01
2 | 1.989817731210108409e-02 1.994390188573626557e-02 1.997444993077554173e-02 1.997131637813174751e-02 1.997112934517477137e-02
3 | 4.223674902996356756e-18 2.324455901147733022e-18 1.278341074657145475e-18 7.017055882541234634e-19 3.852444923653301742e-19
4 | 7.678693678642785974e-09 5.689896161755071109e-09 4.216331094593841162e-09 3.124085213964118822e-09 2.314811635399198332e-09
5 |
--------------------------------------------------------------------------------
/Examples/SingleField/data/eqDataT.dat:
--------------------------------------------------------------------------------
1 | 1.266670390961505461e+02 1.276277542115228556e+02 1.285956912703957755e+02 1.295709040671858929e+02 1.305534467932619123e+02
2 | 1.519999999999999929e+01 1.519899999999999984e+01 1.519799999999999862e+01 1.519699999999999918e+01 1.519599999999999973e+01
3 | 5.578843029678538230e-14 5.452588619766464799e-14 5.329049275951585297e-14 5.208257337391340599e-14 5.090513837167408017e-14
4 | 2.108494617952781380e-28 2.019006524692796654e-28 1.916286375463950499e-28 1.835399885334841820e-28 1.745398477611619594e-28
5 | 5.744279861450195312e+00 5.609894990921020508e+00 5.570218086242675781e+00 5.515174150466918945e+00 5.584074020385742188e+00
6 |
--------------------------------------------------------------------------------
/PyTransport/CppTrans/stepper/rkf45.hpp:
--------------------------------------------------------------------------------
1 | double r8_abs ( double x );
2 | double r8_epsilon ( );
3 | void r8_fehl ( void f ( double t, double y[], double yp[], double params[] ), int neqn,
4 | double y[], double t, double h, double yp[], double f1[], double f2[], double f3[],
5 | double f4[], double f5[], double s[] , double params[]);
6 | double r8_max ( double x, double y );
7 | double r8_min ( double x, double y );
8 | int r8_rkf45 ( void f ( double t, double y[], double yp[], double params[] ), int neqn,
9 | double y[], double yp[], double *t, double tout, double *relerr, double abserr,
10 | int flag, double params[] );
11 | double r8_sign ( double x );
12 |
13 | void timestamp ( );
14 |
--------------------------------------------------------------------------------
/Examples/QuartAx/AxionQurtSetup.py:
--------------------------------------------------------------------------------
1 | ####################################### Setup file for the axion quartic example ##########################################################
2 | import sympy as sym
3 | import numpy as np
4 | import math
5 | import sys
6 | ############################################################################################################################################
7 |
8 | location = "/Users/david/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
9 | sys.path.append(location) # we add this location to the python path
10 |
11 | import PyTransSetup
12 |
13 | ### Sets potential and compiles PyTransport, users may prefer to do this only once in a separate file (or comment after running below once) ###
14 | ### Restart the python kernel after running this file
15 | nF=2
16 | nP=3
17 | f=sym.symarray('f',nF)
18 | p=sym.symarray('p',nP)
19 | V= 1./4. * p[0] * f[0]**4 + p[2] * (1-sym.cos(2*math.pi * f[1] / p[1]))
20 |
21 |
22 | PyTransSetup.potential(V,nF,nP) # writes this potential into c file when run
23 |
24 | PyTransSetup.compileName("AxQrt") # this compiles the module with the new potential and places it in the location folder, and adds this folder to the path ready for use
25 | ############################################################################################################################################
26 |
27 |
--------------------------------------------------------------------------------
/Examples/SingleField/StepPotSetup.py:
--------------------------------------------------------------------------------
1 | ####################################### Setup file for the Step Potential example of Chen et al. ###########################################
2 | import sympy as sym
3 | import numpy as np
4 | import math
5 | import sys
6 | ############################################################################################################################################
7 |
8 | location = "/Users/mulryne/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
9 | sys.path.append(location) # we add this location to the python path
10 |
11 | import PyTransSetup
12 |
13 | ### Sets potential and compiles PyTransport, users may prefer to do this only once in a separate file (or comment after running below once) ###
14 | nF=1
15 | nP=4
16 | f=sym.symarray('f',nF)
17 | p=sym.symarray('p',nP)
18 |
19 | ## example step
20 | V = 1.0/2.0 *p[0]**2*f[0]**2*(1.0 + p[1]*(sym.tanh((f[0]-p[2])/p[3])))
21 |
22 | PyTransSetup.potential(V,nF,nP) # differentiates this potential and writes this potential and derivatives into c file when run (can be a
23 | # little slow, and so one may not wish to run if recompiling to alater other properties such as tols)
24 |
25 | PyTransSetup.compileName("Step") # this compiles the module with the new potential and places it in the location folder, and adds this folder to the path ready for use
26 | ############################################################################################################################################
27 |
28 |
--------------------------------------------------------------------------------
/AutoTest/TestSetup.py:
--------------------------------------------------------------------------------
1 | ####################################### Setup file for the Quartic Axion non-canonical Model ######################################################
2 |
3 | import sympy as sym # we import the sympy package
4 | import math # we import the math package (not used here, but has useful constants such math.pi which might be needed in other cases)
5 | import sys # import the sys module used below
6 | from pylab import *
7 | from gravipy import *
8 |
9 | ############################################################################################################################################
10 |
11 | # if using an integrated environment we recommend restarting the python console after running this script to make sure updates are found
12 |
13 | location = "/home/jwr/Code/nosetest/PyTransport-master/PyTransport/" # this should be the location of the PyTransport folder
14 | sys.path.append(location) # we add this location to the python path
15 |
16 | import PyTransSetup # the above commands allows python to find the PyTransSetup module and import it
17 |
18 | ############################################################################################################################################
19 |
20 | nF=2
21 | nP=4
22 |
23 | f=sym.symarray('f',nF)
24 | p=sym.symarray('p',nP)
25 | G=Matrix( [[p[3]**2.0, 0], [0, p[3]**2.0*sym.sin(f[0])**2.0] ] )
26 | V= 1./4. * p[0] * f[0]**4 + p[2] * (1-sym.cos(2*math.pi * f[1] / p[1]))
27 | PyTransSetup.potential(V,nF,nP,False,G) # writes this potential into c file when run
28 |
29 | PyTransSetup.compileName("QuartAxNC",True)
--------------------------------------------------------------------------------
/Examples/QuartAxNC/QuatAxNCsetup.py:
--------------------------------------------------------------------------------
1 | ####################################### Setup file for the Quartic Axion non-canonical Model ######################################################
2 |
3 | import sympy as sym # we import the sympy package
4 | import math # we import the math package (not used here, but has useful constants such math.pi which might be needed in other cases)
5 | import sys # import the sys module used below
6 | from pylab import *
7 | from gravipy import *
8 |
9 | ############################################################################################################################################
10 |
11 | # if using an integrated environment we recommend restarting the python console after running this script to make sure updates are found
12 |
13 | location = "/home/jwr/Code/PyTransport/" # this should be the location of the PyTransport folder
14 | sys.path.append(location) # we add this location to the python path
15 |
16 | import PyTransSetup # the above commands allows python to find the PyTransSetup module and import it
17 |
18 | ############################################################################################################################################
19 |
20 | nF=2
21 | nP=4
22 |
23 | f=sym.symarray('f',nF)
24 | p=sym.symarray('p',nP)
25 | G=Matrix( [[p[3]**2.0, 0], [0, p[3]**2.0*sym.sin(f[0])**2.0] ] )
26 | V= 1./4. * p[0] * f[0]**4 + p[2] * (1-sym.cos(2*math.pi * f[1] / p[1]))
27 |
28 | PyTransSetup.potential(V,nF,nP,False,G) # writes this potential into c file when run
29 |
30 | PyTransSetup.compileName("QuartAxNC",True)
31 |
--------------------------------------------------------------------------------
/PyTransport/PyTrans/moduleSetup.py:
--------------------------------------------------------------------------------
1 | #This file is part of PyTransport.
2 |
3 | #PyTransport is free software: you can redistribute it and/or modify
4 | #it under the terms of the GNU General Public License as published by
5 | #the Free Software Foundation, either version 3 of the License, or
6 | #(at your option) any later version.
7 |
8 | #PyTransport is distributed in the hope that it will be useful,
9 | #but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | #GNU General Public License for more details.
12 |
13 | #You should have received a copy of the GNU General Public License
14 | #along with PyTransport. If not, see .
15 |
16 |
17 | #module setup script
18 |
19 | from distutils.core import setup, Extension
20 | import numpy
21 | import time
22 | import os
23 | dir = os.path.dirname(__file__)
24 | filename = os.path.join(dir, 'PyTrans.cpp')
25 | f = open(filename,"r")
26 | lines = f.readlines()
27 | f.close()
28 | f = open(filename,"w")
29 |
30 | for line in lines:
31 | if not line.startswith("// Package recompile"):
32 | f.write(line)
33 |
34 | if line.startswith("// Package recompile"):
35 | f.write('// Package recompile attempted at: '+ time.strftime("%c") +'\n')
36 | f.close()
37 | filename2 = os.path.join(dir, '../CppTrans/stepper/rkf45.cpp')
38 | dirs = os.path.join(dir, '../CppTrans/')
39 |
40 | # don't edit the comment at the end of the setup line below #######################################
41 | setup(name="PyTransDQuadNC", version="1.0", ext_modules=[Extension("PyTransDQuadNC", [filename, filename2 ])], include_dirs=[numpy.get_include(), dirs])#setup
42 | ###################################################################################################
--------------------------------------------------------------------------------
/Examples/Curve/curveSetup.py:
--------------------------------------------------------------------------------
1 | ####################################### Setup file for the quasi-single field example ####################################################
2 | import sympy as sym
3 | import numpy as np
4 | import math
5 | import sys
6 | ############################################################################################################################################
7 |
8 | location = "/Users/david/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
9 | sys.path.append(location) # we add this location to the python path
10 |
11 | import PyTransSetup as PySet
12 |
13 | ### Sets potential and compiles PyTransport, users may prefer to do this only once in a separate file (or comment after running below once) ###
14 | ### Restart the python kernel after running this file
15 |
16 | nF=2
17 | nP=4
18 | f=sym.symarray('f',nF)
19 | p=sym.symarray('p',nP)
20 |
21 | #V = 10.0**(-10.0) * (10.0 - (2.0 * p[0])**(1./2.) * sym.atan(f[0]/f[1]) + 1./2. * p[1]**2.0*(4.0-4.0*(f[1]**2.0 + f[0]**2.0)**(1/2.) + (f[1]**2.0 + f[0]**2.0)))
22 | V = 10.0**(-10.0) * (1.0 + 29.0/120. *math.pi * sym.atan2(f[1],f[0])
23 | + 1./2. * p[1] * ((f[1]**2 + f[0]**2)**(1./2.) - p[0])**2
24 | + 1./3./2. * p[2] * ((f[1]**2 + f[0]**2)**(1./2.) - p[0])**3
25 | + 1./4./3./2. * p[3] * ((f[1]**2 + f[0]**2)**(1./2.) - p[0])**4)
26 |
27 | PySet.potential(V,nF,nP) # writes this potential into c file when run
28 |
29 | PySet.compileName("Curve") # this compiles the module with the new potential and places it in the location folder, and adds this folder to the path ready for use
30 | ############################################################################################################################################
31 |
32 |
--------------------------------------------------------------------------------
/Docs/UserGuide2.out:
--------------------------------------------------------------------------------
1 | \BOOKMARK [1][-]{section*.1}{Introduction}{}% 1
2 | \BOOKMARK [1][-]{section*.2}{Background}{}% 2
3 | \BOOKMARK [1][-]{section*.3}{ Code overview}{}% 3
4 | \BOOKMARK [1][-]{section*.4}{Setup}{}% 4
5 | \BOOKMARK [2][-]{section*.5}{Prerequisites}{section*.4}% 5
6 | \BOOKMARK [2][-]{section*.6}{Getting going}{section*.4}% 6
7 | \BOOKMARK [1][-]{section*.7}{Examples}{}% 7
8 | \BOOKMARK [2][-]{section*.8}{Double quadratic}{section*.7}% 8
9 | \BOOKMARK [2][-]{section*.9}{Double quadratic with a field-space metric}{section*.7}% 9
10 | \BOOKMARK [2][-]{section*.10}{Heavy field examples}{section*.7}% 10
11 | \BOOKMARK [2][-]{section*.11}{Further examples}{section*.7}% 11
12 | \BOOKMARK [1][-]{section*.12}{Things that can go wrong}{}% 12
13 | \BOOKMARK [2][-]{section*.13}{Potential computation fails and problems with simplification of expressions}{section*.12}% 13
14 | \BOOKMARK [2][-]{section*.14}{Make sure latest module version is imported}{section*.12}% 14
15 | \BOOKMARK [2][-]{section*.15}{Selecting the absolute and relative tolerances}{section*.12}% 15
16 | \BOOKMARK [2][-]{section*.16}{Integration stalling or failing}{section*.12}% 16
17 | \BOOKMARK [2][-]{section*.17}{Integration failing}{section*.12}% 17
18 | \BOOKMARK [2][-]{section*.18}{Not enough efolds before horizon exit}{section*.12}% 18
19 | \BOOKMARK [2][-]{section*.19}{Not enough efolds after horizon exit}{section*.12}% 19
20 | \BOOKMARK [2][-]{section*.20}{Computer crashes and data loss}{section*.12}% 20
21 | \BOOKMARK [1][-]{section*.21}{Summary}{}% 21
22 | \BOOKMARK [1][-]{section*.22}{Acknowledgments}{}% 22
23 | \BOOKMARK [1][-]{section*.23}{Appendix 1: Base code description}{}% 23
24 | \BOOKMARK [1][-]{section*.24}{Appendix 2: Setup functions}{}% 24
25 | \BOOKMARK [1][-]{section*.25}{Appendix 3: Compiled module }{}% 25
26 | \BOOKMARK [1][-]{section*.26}{Appendix 4: Python Scripts}{}% 26
27 | \BOOKMARK [1][-]{section*.27}{References}{}% 27
28 |
--------------------------------------------------------------------------------
/Examples/LH/LangHeavySetup.py:
--------------------------------------------------------------------------------
1 | ####################################### Setup file for the heavy field example of Langlois ###########################################
2 | import sympy as sym
3 | import numpy as np
4 | import math
5 | import sys
6 | ############################################################################################################################################
7 |
8 | ############################################################################################################################################
9 |
10 | # if using an integrated environment we recommend restarting the python console after running this script to make sure updates are found
11 |
12 | location = "/Users/david/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
13 |
14 | sys.path.append(location) # we add this location to the python path
15 |
16 | import PyTransSetup # the above commands allows python to find the PyTransSetup module and import it
17 |
18 | ############################################################################################################################################
19 |
20 | ### Sets potential and compiles PyTransport, users may prefer to do this only once in a separate file (or comment after running below once) ###
21 | ### Restart the python kernel after running this file
22 |
23 | nF=2
24 | nP=5
25 | f=sym.symarray('f',nF)
26 | p=sym.symarray('p',nP)
27 | V= 1./2. * p[0]**2 * f[0]**2 + 1/2.*p[1]**2 * sym.cos(p[2]/2.)**2*(f[1] - (f[0]-p[3])*sym.tan(p[2]/math.pi*sym.atan(p[4]*(f[0]-p[3]))))**2
28 |
29 | PyTransSetup.potential(V,nF,nP) # writes this potential into c file when run
30 |
31 | PyTransSetup.compileName("LH") # this compiles the module with the new potential and places it in the location folder, and adds this folder to the path ready for use
32 | ############################################################################################################################################
33 |
34 |
--------------------------------------------------------------------------------
/Examples/CurveNC/CurveSetup.py:
--------------------------------------------------------------------------------
1 | ####################################### Setup file for the Non-Canonical quasi-single field Model ######################################################
2 |
3 | import sympy as sym
4 | import numpy as np
5 | import math
6 | import sys
7 | from pylab import *
8 |
9 | from gravipy import *
10 |
11 | ############################################################################################################################################
12 |
13 | location = "/home/jwr/Code/PyTransport/" # this should be the location of the PyTransport folder
14 | sys.path.append(location) # we add this location to the python path
15 |
16 | import PyTransSetup as PySet
17 |
18 | ### Sets potential and compiles PyTransport, users may prefer to do this only once in a separate file (or comment after running below once) ###
19 | ### Restart the python kernel after running this file
20 | nF=2
21 | nP=4
22 |
23 | f=sym.symarray('f',nF)
24 | p=sym.symarray('p',nP)
25 | G=Matrix( [[ 1.0,0], [0,f[0]**2.0] ] )
26 |
27 | V = 10.0**(-10.0) * (1.0 + 29.0/120. *math.pi * f[1] + 1./2. * p[1] * (f[0] - p[0])**2 + 1./3./2. * p[2] * (f[0] - p[0])**3 + 1./4./3./2. * p[3] * (f[0] - p[0])**4)
28 |
29 | #The last argument is for whether the sympy's simplify is used to on derivatives of the potential and field geometric quantites.
30 | #Caution is recomended as sympy's simplify is known to have bugs. Simplification can increase the speed of numerically evolutions, but at the cost of compling more slowly.
31 | PySet.potential(V,nF,nP,False,G) # writes this potential into c file when run
32 | ##Set second argument to True to use the non-canonical set-up
33 | PySet.compileName("CurveNC",True) # this compiles the module with the new potential and places it in the location folder, and adds this folder to the path ready for use
34 | ############################################################################################################################################
35 |
36 |
--------------------------------------------------------------------------------
/Examples/PseudoScalar/PseudoSetup.py:
--------------------------------------------------------------------------------
1 | ####################################### Setup file for the PyTransPseudo Model ######################################################
2 |
3 | import sympy as sym # we import the sympy package
4 | import math # we import the math package (not used here, but has useful constants such math.pi which might be needed in other cases)
5 | import sys # import the sys module used below
6 | from pylab import *
7 | from gravipy import *
8 |
9 | ############################################################################################################################################
10 |
11 | # if using an integrated environment we recommend restarting the python console after running this script to make sure updates are found
12 |
13 | location = "/home/jwr/Code/PyTransport/" # this should be the location of the PyTransport folder
14 | sys.path.append(location) # we add this location to the python path
15 |
16 | import PyTransSetup # the above commands allows python to find the PyTransSetup module and import it
17 |
18 | ############################################################################################################################################
19 |
20 | nF=3 # number of fields needed to define the PseudoScalar potential
21 | nP=3 # number of parameters needed to define the PseudoScalar potential
22 | f=sym.symarray('f',nF) # an array representing the nF fields present for this model
23 | p=sym.symarray('p',nP) # an array representing the nP parameters needed to define this model (that we might wish to change) if we don't
24 | V= p[0] * f[0]**2 + p[1] * f[1]**2 + p[2] * f[2]**2 # this is the potential written in sympy notation
25 | R=(0.9)/((sym.cosh(2.0*((1.0*f[0])-7.0)/0.12))**(2.0))
26 | G=Matrix([[1,R,0],[R,1,0],[0,0,1]]) # selecting the field space metric in this instance.
27 |
28 | PyTransSetup.potential(V,nF,nP,False,G) # writes this potential and its derivatives into C++ file potential.h when run
29 |
30 | PyTransSetup.compileName("Pseudo",True) # this compiles a python module using the C++ code, including the edited potential.h file, called PyTransPseudo
31 | # and places it in the location folder, ready for use
32 |
33 | ############################################################################################################################################
--------------------------------------------------------------------------------
/PyTransport/CppTrans/fieldmetricProto.h:
--------------------------------------------------------------------------------
1 | //#This file is part of PyTransport.
2 |
3 | //#PyTransport is free software: you can redistribute it and/or modify
4 | //#it under the terms of the GNU General Public License as published by
5 | //#the Free Software Foundation, either version 3 of the License, or
6 | //#(at your option) any later version.
7 |
8 | //#PyTransport is distributed in the hope that it will be useful,
9 | //#but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | //#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | //#GNU General Public License for more details.
12 |
13 | //#You should have received a copy of the GNU General Public License
14 | //#along with PyTransport. If not, see .
15 |
16 | // This file contains a prototype of the potential.h file of PyTransport -- it is edited by the PyTransScripts module
17 |
18 | #ifndef FIELDMETRIC_H // Prevents the class being re-defined
19 | #define FIELDMETRIC_H
20 |
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | using namespace std;
28 |
29 |
30 | class fieldmetric
31 | {
32 | private:
33 | int nF; // field number
34 | int nP; // params number which definFs potential
35 |
36 | public:
37 | fieldmetric()
38 | {
39 | // #FP
40 |
41 | }
42 |
43 |
44 | //calculates fieldmetic()
45 | vector fmetric(vector f, vector p)
46 | {
47 | vector FM((2*nF)*(2*nF),0.0) ;
48 |
49 | // metric
50 |
51 | return FM;
52 | }
53 |
54 |
55 |
56 | //calculates ChristoffelSymbole()
57 | vector Chroff(vector f, vector p)
58 | {
59 | vector CS((2*nF)*(2*nF)*(2*nF),0.0);
60 |
61 | // Christoffel
62 |
63 | return CS;
64 | }
65 |
66 |
67 |
68 | // calculates RiemannTensor()
69 | vector Riemn(vector f, vector p)
70 | {
71 | vector RM((nF)*(nF)*(nF)*(nF),0.0);
72 |
73 | // Riemann
74 |
75 | return RM;
76 | }
77 |
78 | // calculates RiemannTensor() covariant derivatives
79 | vector Riemncd(vector f, vector p)
80 | {
81 | vector RMcd((nF)*(nF)*(nF)*(nF)*(nF),0.0);
82 |
83 | // Riemanncd
84 |
85 | return RMcd;
86 | }
87 |
88 | int getnF()
89 | {
90 | return nF;
91 | }
92 |
93 |
94 |
95 | };
96 | #endif
97 |
98 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/data/timesSq1.dat:
--------------------------------------------------------------------------------
1 | 4.558075975846872601e-41 4.521434713176310081e-41 4.512918385622758506e-41 4.476378139601923193e-41 4.473833722434576307e-41 4.467480884755280500e-41 4.444456401840605663e-41 4.468712133620635763e-41 4.449939443549407889e-41 4.451884535605807110e-41 4.472577983952331677e-41 4.474657281888982624e-41 4.474400373728898221e-41 4.471035462469308631e-41 4.464811763688884163e-41 4.463180673240251743e-41 4.473479194297193918e-41 4.459909402848608829e-41 4.473134144442328410e-41 4.465112898857834353e-41
2 | 2.054892220658112515e-20 2.054946093883646946e-20 2.055547162229397377e-20 2.056329862386896276e-20 2.055591128816689341e-20 2.056000207741383902e-20 2.056099862937435185e-20 2.056258441807945002e-20 2.056327521394261252e-20 2.056350756970093795e-20 2.056350672236158039e-20 2.056382974918031547e-20 2.056374364072969680e-20 2.056377088710319393e-20 2.056380254693094466e-20 2.056382172297323148e-20 2.056384157145314589e-20 2.056384367708512541e-20 2.056384882190906960e-20 2.056385316461279409e-20
3 | 2.054892220658078811e-20 2.054946093883747154e-20 2.055547162229233672e-20 2.056329862387048244e-20 2.055591128817032698e-20 2.056000207741750129e-20 2.056099862937997918e-20 2.056258441808250142e-20 2.056327521397187462e-20 2.056350756965707189e-20 2.056350672228278578e-20 2.056382974910608291e-20 2.056374364042802094e-20 2.056377088695348297e-20 2.056380254662143568e-20 2.056382172206258861e-20 2.056384156836972001e-20 2.056384367754622614e-20 2.056384883002383097e-20 2.056385314653483299e-20
4 | 2.054892220658078811e-20 2.054946093883747154e-20 2.055547162229233672e-20 2.056329862387048244e-20 2.055591128817032698e-20 2.056000207741750129e-20 2.056099862937997918e-20 2.056258441808250142e-20 2.056327521397187462e-20 2.056350756965707189e-20 2.056350672228278578e-20 2.056382974910608291e-20 2.056374364042802094e-20 2.056377088695348297e-20 2.056380254662143568e-20 2.056382172206258861e-20 2.056384156836972001e-20 2.056384367754622614e-20 2.056384883002383097e-20 2.056385314653483299e-20
5 | 9.597020149230957031e-01 1.100385189056396484e+00 1.200300931930541992e+00 1.381417989730834961e+00 1.519294977188110352e+00 1.715076923370361328e+00 2.054884910583496094e+00 2.381006956100463867e+00 2.949779987335205078e+00 3.467773199081420898e+00 4.194766998291015625e+00 5.262753963470458984e+00 6.425361156463623047e+00 7.939676046371459961e+00 1.039136195182800293e+01 1.313561391830444336e+01 1.678780484199523926e+01 2.065849900245666504e+01 2.605885791778564453e+01 3.466243195533752441e+01
6 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/data/timesSq2.dat:
--------------------------------------------------------------------------------
1 | 8.505311385835564511e-50 8.506215559925304026e-50 8.509005856990894659e-50 8.515456707255901596e-50 8.513806368887652116e-50 8.513260585318580273e-50 8.514597711643890722e-50 8.515189985530347441e-50 8.515298649684804510e-50 8.515184200213655089e-50 8.515502216185059492e-50 8.515549066174470301e-50 8.515750510248146593e-50 8.515847423097452172e-50 8.515707935758364232e-50 8.513872552411676415e-50 8.515943133079837916e-50 8.514820240126156167e-50 8.516690129045961096e-50 8.514619651151204566e-50
2 | 1.671415036338091350e-21 1.671431645893280912e-21 1.671961072077303951e-21 1.672994519518288920e-21 1.672577019791803473e-21 1.672586577710787303e-21 1.672870649362570621e-21 1.672911122124226707e-21 1.672975766587721669e-21 1.672970506080531087e-21 1.672991627343914440e-21 1.673005833214299828e-21 1.673012976003052854e-21 1.673023853678738553e-21 1.673022209766493491e-21 1.673022716084588569e-21 1.673023075475546716e-21 1.673024281433408221e-21 1.673023987258020522e-21 1.673024265190951834e-21
3 | 4.930093205316852141e-28 4.930094655599039219e-28 4.930094573748822836e-28 4.930094723403317800e-28 4.930094564784545714e-28 4.930094862098215772e-28 4.930094507287267996e-28 4.930094809403546175e-28 4.930093481112682516e-28 4.930097554741028621e-28 4.930103728263563153e-28 4.930108269582592558e-28 4.930159092545124531e-28 4.930148471115688370e-28 4.930124356528648677e-28 4.929770684342741648e-28 4.930176266223459964e-28 4.929959500208142300e-28 4.930355706931155403e-28 4.929927083132287470e-28
4 | 4.930093205316852141e-28 4.930094655599039219e-28 4.930094573748822836e-28 4.930094723403317800e-28 4.930094564784545714e-28 4.930094862098215772e-28 4.930094507287267996e-28 4.930094809403546175e-28 4.930093481112682516e-28 4.930097554741028621e-28 4.930103728263563153e-28 4.930108269582592558e-28 4.930159092545124531e-28 4.930148471115688370e-28 4.930124356528648677e-28 4.929770684342741648e-28 4.930176266223459964e-28 4.929959500208142300e-28 4.930355706931155403e-28 4.929927083132287470e-28
5 | 1.095234799385070801e+01 1.408320498466491699e+01 1.727037596702575684e+01 2.197023487091064453e+01 2.686039710044860840e+01 3.226337504386901855e+01 4.106535291671752930e+01 4.976109886169433594e+01 6.277408385276794434e+01 7.646424102783203125e+01 9.224659490585327148e+01 1.176412351131439209e+02 1.436206898689270020e+02 1.752993588447570801e+02 2.283026161193847656e+02 2.815520629882812500e+02 3.726421821117401123e+02 4.683003089427947998e+02 5.973505828380584717e+02 8.114180891513824463e+02
6 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/data/timesEq1.dat:
--------------------------------------------------------------------------------
1 | 4.558089908142863247e-41 4.521448997329531198e-41 4.512930500528934153e-41 4.476385252055130110e-41 4.473839868879605881e-41 4.467479542229843754e-41 4.444451630673880363e-41 4.468711459854833536e-41 4.449935726718329929e-41 4.451880450051081332e-41 4.472578925676461505e-41 4.474660791353187324e-41 4.474403712615129019e-41 4.471037311089631508e-41 4.464810394841663038e-41 4.463177924161710811e-41 4.473486617888264253e-41 4.459901994371933003e-41 4.473144527099629596e-41 4.465112750106994720e-41
2 | 2.054892243112944714e-20 2.054946092387707042e-20 2.055547153063902790e-20 2.056329857962664452e-20 2.055591094667184407e-20 2.056000190142839729e-20 2.056099841377065639e-20 2.056258424516505104e-20 2.056327502125399265e-20 2.056350735267590619e-20 2.056350653805341597e-20 2.056382956840802000e-20 2.056374348984066298e-20 2.056377064058133836e-20 2.056380237704586195e-20 2.056382148980529567e-20 2.056384138656356127e-20 2.056384346436323804e-20 2.056384856556255487e-20 2.056385286360783387e-20
3 | 2.054892243112945918e-20 2.054946092387793709e-20 2.055547153064031285e-20 2.056329857962520910e-20 2.055591094667052300e-20 2.056000190142769914e-20 2.056099841377111681e-20 2.056258424517379597e-20 2.056327502126131419e-20 2.056350735273833642e-20 2.056350653807409865e-20 2.056382956861766951e-20 2.056374348952493084e-20 2.056377064118020025e-20 2.056380237700461094e-20 2.056382149030576361e-20 2.056384139122500989e-20 2.056384347198737178e-20 2.056384857884191707e-20 2.056385290841704658e-20
4 | 2.054892243112945918e-20 2.054946092387793709e-20 2.055547153064031285e-20 2.056329857962520910e-20 2.055591094667052300e-20 2.056000190142769914e-20 2.056099841377111681e-20 2.056258424517379597e-20 2.056327502126131419e-20 2.056350735273833642e-20 2.056350653807409865e-20 2.056382956861766951e-20 2.056374348952493084e-20 2.056377064118020025e-20 2.056380237700461094e-20 2.056382149030576361e-20 2.056384139122500989e-20 2.056384347198737178e-20 2.056384857884191707e-20 2.056385290841704658e-20
5 | 2.411620616912841797e-01 2.639358043670654297e-01 2.915558815002441406e-01 3.481688499450683594e-01 3.986051082611083984e-01 4.718160629272460938e-01 6.020429134368896484e-01 7.231111526489257812e-01 9.149949550628662109e-01 1.125003814697265625e+00 1.371322154998779297e+00 1.793613910675048828e+00 2.352068901062011719e+00 2.872364044189453125e+00 3.908846139907836914e+00 4.901168823242187500e+00 6.587558031082153320e+00 8.377349853515625000e+00 1.048506402969360352e+01 1.390084385871887207e+01
6 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/data/timesEq2.dat:
--------------------------------------------------------------------------------
1 | 6.056296507044380488e-55 6.019431210698990772e-55 6.021654760523555295e-55 6.004257207049359400e-55 6.015136300695308988e-55 6.095025322089638948e-55 6.028039332847808544e-55 6.061604619233323226e-55 6.041253645160688674e-55 6.077445969246921857e-55 6.062283831366598000e-55 6.053037362216104524e-55 6.073262020626702263e-55 6.063653625482144027e-55 6.065940789609015410e-55 6.049381549197165759e-55 6.063585192968525263e-55 6.050061030946842890e-55 6.064743694430278944e-55 6.061946040390819222e-55
2 | 1.934792058113266756e-27 1.940327029467296529e-27 1.938600020901194190e-27 1.938779875217503596e-27 1.939724782137717026e-27 1.940327564366271689e-27 1.940094073201411105e-27 1.940244527087560034e-27 1.940457220177947728e-27 1.940398852316385247e-27 1.940459079769524189e-27 1.940453128679261217e-27 1.940471281717385641e-27 1.940483411515217950e-27 1.940482824054270104e-27 1.940481077873959924e-27 1.940485082374853728e-27 1.940485505194139633e-27 1.940485456365304978e-27 1.940485500399195651e-27
3 | 1.934792058113228013e-27 1.940327029467295812e-27 1.938600020901097332e-27 1.938779875217638838e-27 1.939724782137757204e-27 1.940327564366400833e-27 1.940094073201461328e-27 1.940244527087934551e-27 1.940457220179217640e-27 1.940398852318982469e-27 1.940459079770369721e-27 1.940453128692557992e-27 1.940471281694490263e-27 1.940483411534299285e-27 1.940482824119690698e-27 1.940481078148055160e-27 1.940485082130257417e-27 1.940485504998506350e-27 1.940485455850977053e-27 1.940485501994204234e-27
4 | 1.934792058113228013e-27 1.940327029467295812e-27 1.938600020901097332e-27 1.938779875217638838e-27 1.939724782137757204e-27 1.940327564366400833e-27 1.940094073201461328e-27 1.940244527087934551e-27 1.940457220179217640e-27 1.940398852318982469e-27 1.940459079770369721e-27 1.940453128692557992e-27 1.940471281694490263e-27 1.940483411534299285e-27 1.940482824119690698e-27 1.940481078148055160e-27 1.940485082130257417e-27 1.940485504998506350e-27 1.940485455850977053e-27 1.940485501994204234e-27
5 | 1.748099327087402344e-01 1.993699073791503906e-01 2.180280685424804688e-01 2.668979167938232422e-01 3.146319389343261719e-01 3.796567916870117188e-01 4.811468124389648438e-01 5.853848457336425781e-01 7.395169734954833984e-01 9.465160369873046875e-01 1.143223047256469727e+00 1.525096893310546875e+00 1.932997941970825195e+00 2.418967962265014648e+00 3.283528089523315430e+00 4.164561986923217773e+00 5.596544027328491211e+00 7.037759065628051758e+00 8.806499004364013672e+00 1.169934320449829102e+01
6 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/data/timesSq1.dat:
--------------------------------------------------------------------------------
1 | 3.423512086439493954e-36 3.423798123237675286e-36 3.423741315788815952e-36 3.426781470143008187e-36 3.425902158019134299e-36 3.426624720304517517e-36 3.426861467344709634e-36 3.426682325841277435e-36 3.426918390916926087e-36 3.426924555565915636e-36 3.426950576084946611e-36 3.426919930374256623e-36 3.427092902694455507e-36 3.426833396462492088e-36 3.427428827262021639e-36 3.426448003594396534e-36 3.427712420065763442e-36 3.426866152904137331e-36 3.428462271795951191e-36 3.425725114896960919e-36
2 | 1.039859841921369667e-14 1.039861388494546256e-14 1.039931018585793409e-14 1.040941961455279427e-14 1.040697388932276021e-14 1.040785227873733354e-14 1.040922272897525653e-14 1.040891203592532535e-14 1.040904656274042195e-14 1.040924264217557329e-14 1.040931890770233168e-14 1.040936634458306457e-14 1.040944039151070149e-14 1.040942232854440472e-14 1.040944149293198725e-14 1.040946008889496929e-14 1.040945402362232348e-14 1.040945613873127347e-14 1.040945945964577566e-14 1.040945902494259964e-14
3 | 5.801507495493454214e-21 5.801508546447671571e-21 5.801508354258550660e-21 5.801508545315192414e-21 5.801508708196236665e-21 5.801508678640323665e-21 5.801508355349076894e-21 5.801509333549869477e-21 5.801508693570119804e-21 5.801515640169145916e-21 5.801505445910820054e-21 5.801500236612292670e-21 5.801559054603021817e-21 5.801462786310654534e-21 5.801665007038797770e-21 5.801321262532371549e-21 5.801743867580696078e-21 5.801475267835245959e-21 5.802005719887314453e-21 5.800947383805793468e-21
4 | 5.801507495493454214e-21 5.801508546447671571e-21 5.801508354258550660e-21 5.801508545315192414e-21 5.801508708196236665e-21 5.801508678640323665e-21 5.801508355349076894e-21 5.801509333549869477e-21 5.801508693570119804e-21 5.801515640169145916e-21 5.801505445910820054e-21 5.801500236612292670e-21 5.801559054603021817e-21 5.801462786310654534e-21 5.801665007038797770e-21 5.801321262532371549e-21 5.801743867580696078e-21 5.801475267835245959e-21 5.802005719887314453e-21 5.800947383805793468e-21
5 | 1.106026291847229004e+01 1.467783284187316895e+01 1.826826286315917969e+01 2.369285202026367188e+01 2.924611711502075195e+01 3.590700411796569824e+01 4.529135799407958984e+01 5.498125410079956055e+01 7.051084303855895996e+01 8.587102007865905762e+01 1.053016521930694580e+02 1.344093770980834961e+02 1.638782889842987061e+02 2.007564980983734131e+02 2.615335822105407715e+02 3.267340939044952393e+02 4.350228548049926758e+02 5.519570858478546143e+02 7.005709271430969238e+02 9.417497780323028564e+02
6 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/data/timesSq2.dat:
--------------------------------------------------------------------------------
1 | 8.505311385835564511e-50 8.506215559925304026e-50 8.509005856990894659e-50 8.515456707255901596e-50 8.513806368887652116e-50 8.513260585318580273e-50 8.514597711643890722e-50 8.515189985530347441e-50 8.515298649684804510e-50 8.515184200213655089e-50 8.515502216185059492e-50 8.515549066174470301e-50 8.515750510248146593e-50 8.515847423097452172e-50 8.515707935758364232e-50 8.513872552411676415e-50 8.515943133079837916e-50 8.514820240126156167e-50 8.516690129045961096e-50 8.514619651151204566e-50
2 | 1.671415036338091350e-21 1.671431645893280912e-21 1.671961072077303951e-21 1.672994519518288920e-21 1.672577019791803473e-21 1.672586577710787303e-21 1.672870649362570621e-21 1.672911122124226707e-21 1.672975766587721669e-21 1.672970506080531087e-21 1.672991627343914440e-21 1.673005833214299828e-21 1.673012976003052854e-21 1.673023853678738553e-21 1.673022209766493491e-21 1.673022716084588569e-21 1.673023075475546716e-21 1.673024281433408221e-21 1.673023987258020522e-21 1.673024265190951834e-21
3 | 4.930093205316852141e-28 4.930094655599039219e-28 4.930094573748822836e-28 4.930094723403317800e-28 4.930094564784545714e-28 4.930094862098215772e-28 4.930094507287267996e-28 4.930094809403546175e-28 4.930093481112682516e-28 4.930097554741028621e-28 4.930103728263563153e-28 4.930108269582592558e-28 4.930159092545124531e-28 4.930148471115688370e-28 4.930124356528648677e-28 4.929770684342741648e-28 4.930176266223459964e-28 4.929959500208142300e-28 4.930355706931155403e-28 4.929927083132287470e-28
4 | 4.930093205316852141e-28 4.930094655599039219e-28 4.930094573748822836e-28 4.930094723403317800e-28 4.930094564784545714e-28 4.930094862098215772e-28 4.930094507287267996e-28 4.930094809403546175e-28 4.930093481112682516e-28 4.930097554741028621e-28 4.930103728263563153e-28 4.930108269582592558e-28 4.930159092545124531e-28 4.930148471115688370e-28 4.930124356528648677e-28 4.929770684342741648e-28 4.930176266223459964e-28 4.929959500208142300e-28 4.930355706931155403e-28 4.929927083132287470e-28
5 | 1.095234799385070801e+01 1.408320498466491699e+01 1.727037596702575684e+01 2.197023487091064453e+01 2.686039710044860840e+01 3.226337504386901855e+01 4.106535291671752930e+01 4.976109886169433594e+01 6.277408385276794434e+01 7.646424102783203125e+01 9.224659490585327148e+01 1.176412351131439209e+02 1.436206898689270020e+02 1.752993588447570801e+02 2.283026161193847656e+02 2.815520629882812500e+02 3.726421821117401123e+02 4.683003089427947998e+02 5.973505828380584717e+02 8.114180891513824463e+02
6 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/data/timesSq1 (David Mulryne's conflicted copy 2016-11-25).dat:
--------------------------------------------------------------------------------
1 | 3.423512086439493954e-36 3.423798123237675286e-36 3.423741315788815952e-36 3.426781470143008187e-36 3.425902158019134299e-36 3.426624720304517517e-36 3.426861467344709634e-36 3.426682325841277435e-36 3.426918390916926087e-36 3.426924555565915636e-36 3.426950576084946611e-36 3.426919930374256623e-36 3.427092902694455507e-36 3.426833396462492088e-36 3.427428827262021639e-36 3.426448003594396534e-36 3.427712420065763442e-36 3.426866152904137331e-36 3.428462271795951191e-36 3.425725114896960919e-36
2 | 1.039859841921369667e-14 1.039861388494546256e-14 1.039931018585793409e-14 1.040941961455279427e-14 1.040697388932276021e-14 1.040785227873733354e-14 1.040922272897525653e-14 1.040891203592532535e-14 1.040904656274042195e-14 1.040924264217557329e-14 1.040931890770233168e-14 1.040936634458306457e-14 1.040944039151070149e-14 1.040942232854440472e-14 1.040944149293198725e-14 1.040946008889496929e-14 1.040945402362232348e-14 1.040945613873127347e-14 1.040945945964577566e-14 1.040945902494259964e-14
3 | 5.801507495493454214e-21 5.801508546447671571e-21 5.801508354258550660e-21 5.801508545315192414e-21 5.801508708196236665e-21 5.801508678640323665e-21 5.801508355349076894e-21 5.801509333549869477e-21 5.801508693570119804e-21 5.801515640169145916e-21 5.801505445910820054e-21 5.801500236612292670e-21 5.801559054603021817e-21 5.801462786310654534e-21 5.801665007038797770e-21 5.801321262532371549e-21 5.801743867580696078e-21 5.801475267835245959e-21 5.802005719887314453e-21 5.800947383805793468e-21
4 | 5.801507495493454214e-21 5.801508546447671571e-21 5.801508354258550660e-21 5.801508545315192414e-21 5.801508708196236665e-21 5.801508678640323665e-21 5.801508355349076894e-21 5.801509333549869477e-21 5.801508693570119804e-21 5.801515640169145916e-21 5.801505445910820054e-21 5.801500236612292670e-21 5.801559054603021817e-21 5.801462786310654534e-21 5.801665007038797770e-21 5.801321262532371549e-21 5.801743867580696078e-21 5.801475267835245959e-21 5.802005719887314453e-21 5.800947383805793468e-21
5 | 1.128939104080200195e+01 1.453724098205566406e+01 1.821157908439636230e+01 2.389099001884460449e+01 2.931068181991577148e+01 3.620895314216613770e+01 4.619752407073974609e+01 5.566587281227111816e+01 7.183816599845886230e+01 8.633950614929199219e+01 1.043413460254669189e+02 1.347348029613494873e+02 1.639844830036163330e+02 2.005932850837707520e+02 2.645432438850402832e+02 3.310087130069732666e+02 4.443269629478454590e+02 5.560873510837554932e+02 7.004974801540374756e+02 1.502055396080017090e+03
6 |
--------------------------------------------------------------------------------
/PyTransport/CppTrans/potentialProto.h:
--------------------------------------------------------------------------------
1 | //#This file is part of PyTransport.
2 |
3 | //#PyTransport is free software: you can redistribute it and/or modify
4 | //#it under the terms of the GNU General Public License as published by
5 | //#the Free Software Foundation, either version 3 of the License, or
6 | //#(at your option) any later version.
7 |
8 | //#PyTransport is distributed in the hope that it will be useful,
9 | //#but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | //#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | //#GNU General Public License for more details.
12 |
13 | //#You should have received a copy of the GNU General Public License
14 | //#along with PyTransport. If not, see .
15 |
16 | // This file contains a prototype of the potential.h file of PyTransport -- it is edited by the PyTransScripts module
17 |
18 | #ifndef POTENTIAL_H // Prevents the class being re-defined
19 | #define POTENTIAL_H
20 |
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | using namespace std;
28 |
29 | // #Rewrite
30 |
31 | class potential
32 | {
33 | private:
34 | int nF; // field number
35 | int nP; // params number which definFs potential
36 |
37 |
38 | public:
39 | // flow constructor
40 | potential()
41 | {
42 | // #FP
43 |
44 | // p.resize(nP);
45 |
46 | // pdef
47 |
48 | }
49 |
50 | //void setP(vector pin){
51 | // p=pin;
52 | //}
53 | //calculates V()
54 | double V(vector f, vector p)
55 | {
56 | double sum ;
57 |
58 | // Pot
59 | return sum;
60 | }
61 |
62 | //calculates V'()
63 | vector dV(vector f, vector p)
64 | {
65 | vector sum(nF,0.0);
66 |
67 | // dPot
68 |
69 | return sum;
70 | }
71 |
72 | // calculates V''
73 | vector dVV(vector f, vector p)
74 | {
75 | vector sum(nF*nF,0.0);
76 |
77 | // ddPot
78 |
79 | return sum;
80 | }
81 |
82 | // calculates V'''
83 | vector dVVV(vector f, vector p)
84 | {
85 | vector sum(nF*nF*nF,0.0);
86 | // dddPot
87 |
88 | return sum;
89 | }
90 |
91 | int getnF()
92 | {
93 | return nF;
94 | }
95 |
96 | int getnP()
97 | {
98 | return nP;
99 | }
100 |
101 | };
102 | #endif
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/data/timesEq2 (David Mulryne's conflicted copy 2016-11-25).dat:
--------------------------------------------------------------------------------
1 | 5.791516144669470741e-55 5.692389734043805703e-55 6.205770614873847825e-55 6.160631034726544585e-55 5.992361137913538482e-55 6.043901610051405568e-55 6.114903912399643469e-55 6.061590369160450621e-55 6.038399368962129071e-55 6.087531767265676882e-55 6.037484959782879859e-55 6.041741187211246608e-55 6.040303411471212428e-55 6.070649838095599301e-55 6.053758996746567388e-55 6.045721143666142754e-55 6.072884815484979601e-55 6.054854409858813343e-55 6.046343437804208580e-55 6.047185957181937380e-55
2 | 1.931850914452176111e-27 1.934312281686342648e-27 1.936561938404172938e-27 1.938051164191143152e-27 1.940253840606561080e-27 1.938267572115727394e-27 1.940295110899004789e-27 1.940429333333863568e-27 1.940129541902889122e-27 1.940323129808504242e-27 1.940351897659162895e-27 1.940409764738603677e-27 1.940451059474790909e-27 1.940456965590635714e-27 1.940468027809498977e-27 1.940475318553188148e-27 1.940478109580231141e-27 1.940479575008664723e-27 1.940480774240216939e-27 1.940481707050673218e-27
3 | 1.931850914452176111e-27 1.934312281686342648e-27 1.936561938404172938e-27 1.938051164191143152e-27 1.940253840606561080e-27 1.938267572115727394e-27 1.940295110899004789e-27 1.940429333333863568e-27 1.940129541902889122e-27 1.940323129808504242e-27 1.940351897659162895e-27 1.940409764738603677e-27 1.940451059474790909e-27 1.940456965590635714e-27 1.940468027809498977e-27 1.940475318553188148e-27 1.940478109580231141e-27 1.940479575008664723e-27 1.940480774240216939e-27 1.940481707050673218e-27
4 | 1.931850914452176111e-27 1.934312281686342648e-27 1.936561938404172938e-27 1.938051164191143152e-27 1.940253840606561080e-27 1.938267572115727394e-27 1.940295110899004789e-27 1.940429333333863568e-27 1.940129541902889122e-27 1.940323129808504242e-27 1.940351897659162895e-27 1.940409764738603677e-27 1.940451059474790909e-27 1.940456965590635714e-27 1.940468027809498977e-27 1.940475318553188148e-27 1.940478109580231141e-27 1.940479575008664723e-27 1.940480774240216939e-27 1.940481707050673218e-27
5 | 3.571497917175292969e+00 3.476495027542114258e+00 3.473106861114501953e+00 3.565860986709594727e+00 3.614232063293457031e+00 3.571682929992675781e+00 3.556811809539794922e+00 3.596981048583984375e+00 3.692424058914184570e+00 3.767632007598876953e+00 3.902204036712646484e+00 3.833091020584106445e+00 4.035148859024047852e+00 4.122905969619750977e+00 4.329483985900878906e+00 4.798957109451293945e+00 5.061374902725219727e+00 5.831942081451416016e+00 6.796334981918334961e+00 8.365156888961791992e+00
6 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/DQuadSetup.py:
--------------------------------------------------------------------------------
1 | ####################################### Setup file for the double quadratic potential ######################################################
2 |
3 | import sympy as sym # we import the sympy package
4 | import math # we import the math package (not used here, but has useful constants such math.pi which might be needed in other cases)
5 | import sys # import the sys module used below
6 |
7 | ############################################################################################################################################
8 |
9 | # if using an integrated environment we recommend restarting the python console after running this script to make sure updates are found
10 |
11 | location = "/nethome/ronayne/Documents/PyTransport-master/PyTransport" # this should be the location of the PyTransport folder
12 | sys.path.append(location) # we add this location to the python path
13 |
14 | import PyTransSetup # the above commands allows python to find the PyTransSetup module and import it
15 |
16 | ############################################################################################################################################
17 |
18 | nF=2 # number of fields needed to define the double quadratic potential
19 | nP=2 # number of parameters needed to define the double quadtartic potential
20 | f=sym.symarray('f',nF) # an array representing the nF fields present for this model
21 | p=sym.symarray('p',nP) # an array representing the nP parameters needed to define this model (that we might wish to change) if we don't
22 | # wish to change them they could be typed explicitly in the potential below
23 |
24 | V = 1./2. * p[0]**2.0 *f [0]**2.0 + 1./2. * p[1]**2.0 * f[1]**2.0 # this is the potential written in sympy notation
25 |
26 | #The last argument is for whether the sympy's simplify is used to on derivatives of the potential and field geometric quantites.
27 | #Caution is recomended as sympy's simplify is known to have bugs. Simplification can increase the speed of numerically evolutions, but at the cost of compling more slowly.
28 | PyTransSetup.potential(V,nF,nP,True) # writes this potential and its derivatives into C++ file potential.h when run
29 |
30 | PyTransSetup.compileName("DQuad") # this compiles a python module using the C++ code, including the edited potential.h file, called PyTransDQuad
31 | # and places it in the location folder, ready for use
32 |
33 | ############################################################################################################################################
34 |
35 |
--------------------------------------------------------------------------------
/Examples/PseudoScalar/Plots.py:
--------------------------------------------------------------------------------
1 | #################### generate equilateral bispectrum using MTeasyDQuad and MPI ############################################################
2 | from pylab import *
3 | from mpl_toolkits.mplot3d import Axes3D
4 | import numpy as np
5 | from scipy.interpolate import griddata
6 | import matplotlib.pyplot as plt
7 | import numpy.ma as ma
8 | # make up some randomly distributed data
9 |
10 | bet = np.load('data/bet.npy'); alp= np.load('data/alp.npy'); Bztot = np.load('data/alBetBi.npy')
11 | Pz1tot = np.load('data/alBetPz1.npy'); Pz2tot=np.load('data/alBetPz2.npy'); Pz3tot=np.load('data/alBetPz3.npy')
12 | fnlOut = 5.0/6*Bztot[:,:,-1]/(Pz1tot[:,:,-1]*Pz2tot[:,:,-1] + Pz1tot[:,:,-1]*Pz3tot[:,:,-1] + Pz2tot[:,:,-1]*Pz3tot[:,:,-1])
13 |
14 | fig1 = plt.figure(1)
15 |
16 | ax = fig1.add_subplot(1, 1, 1, projection='3d')
17 | surf = ax.plot_surface(alp, bet, fnlOut, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.00, antialiased=False, vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut))
18 | ax.grid(True); ax.set_ylabel(r'$\beta$',fontsize=15);ax.set_xlabel(r'$\alpha$',fontsize=15);
19 | #ax.set_title('Slice through reduced bispectrum')
20 |
21 | fig1.colorbar(surf, shrink=0.5, aspect=5); plt.savefig("alpBetEq2.png")
22 |
23 |
24 | fig2 = plt.figure(2,figsize=(10,6),facecolor='white')
25 |
26 | ax1 = fig2.add_subplot(1, 1, 1)
27 | cont = ax1.contourf(alp, bet, fnlOut, 10, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.0, antialiased=False, vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut))
28 | contLines = ax1.contour(alp, bet, fnlOut, 10, colors='black', linewidth=.5); ax1.clabel(contLines, inline=1, fontsize=10)
29 | ax1.grid(True); ax1.set_ylabel(r'$\beta$',fontsize=15);ax1.set_xlabel(r'$\alpha$',fontsize=15);
30 | #ax1.set_title('Slice through reduced bispectrum')
31 | fig2.colorbar(cont, shrink=0.5, aspect=5); plt.savefig("alpBetEq3.png")
32 |
33 | plt.show(fig1); plt.show(fig2);
34 |
35 | from mayavi import mlab
36 | mlab.figure(bgcolor=(1.,1.,1.), fgcolor=None, engine=None, size=(600, 600))
37 | mlab.surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut),vmax=np.nanmax(fnlOut),warp_scale="auto",colormap = 'jet')
38 | #mlab.contour_surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut), warp_scale='auto')
39 | mlab.view(azimuth=250, elevation=15)
40 | mlab.show()
41 |
42 | mlab.savefig("test.png")
43 |
44 | data = loadtxt('dataT/EqBi.dat')
45 |
46 | fig4 = plt.figure(4)
47 | kOut = data[0,:]; fnlOut = data[1,:]; Bztot = data[2,:]; Pztot = data[3,:]
48 | plt.plot(np.log(kOut/kOut[0]), fnlOut, linewidth=2)
49 | #title('Reduced bispectrum in equilateral configuration',fontsize=15)
50 | grid(True); plt.legend(fontsize=15); ylabel('$fNL$', fontsize=20)
51 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15); grid(True); plt.legend(fontsize=15); plt.xlim(min(np.log(kOut/kOut[0])),max(np.log(kOut/kOut[0]))); plt.savefig("BiEq.png")
52 | plt.show(fig4)
53 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/Plots.py:
--------------------------------------------------------------------------------
1 | #################### generate equilateral bispectrum using MTeasyDQuad and MPI ############################################################
2 | from pylab import *
3 | from mpl_toolkits.mplot3d import Axes3D
4 | import numpy as np
5 | from scipy.interpolate import griddata
6 | import matplotlib.pyplot as plt
7 | import numpy.ma as ma
8 | # make up some randomly distributed data
9 |
10 | bet = np.load('dataT/bet.npy'); alp= np.load('dataT/alp.npy'); Bztot = np.load('dataT/alBetBi.npy')
11 | Pz1tot = np.load('dataT/alBetPz1.npy'); Pz2tot=np.load('dataT/alBetPz2.npy'); Pz3tot=np.load('dataT/alBetPz3.npy')
12 | fnlOut = 5.0/6*Bztot[:,:,-1]/(Pz1tot[:,:,-1]*Pz2tot[:,:,-1] + Pz1tot[:,:,-1]*Pz3tot[:,:,-1] + Pz2tot[:,:,-1]*Pz3tot[:,:,-1])
13 |
14 | fig1 = plt.figure(1)
15 |
16 | ax = fig1.add_subplot(1, 1, 1, projection='3d')
17 | surf = ax.plot_surface(alp, bet, fnlOut, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.00, antialiased=False, vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut))
18 | ax.grid(True); ax.set_ylabel(r'$\beta$',fontsize=15);ax.set_xlabel(r'$\alpha$',fontsize=15);
19 | #ax.set_title('Slice through reduced bispectrum')
20 |
21 | fig1.colorbar(surf, shrink=0.5, aspect=5); plt.savefig("alpBetEq2.png")
22 |
23 |
24 | fig2 = plt.figure(2,figsize=(10,6),facecolor='white')
25 |
26 | ax1 = fig2.add_subplot(1, 1, 1)
27 | cont = ax1.contourf(alp, bet, fnlOut, 10, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.0, antialiased=False, vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut))
28 | contLines = ax1.contour(alp, bet, fnlOut, 10, colors='black', linewidth=.5); ax1.clabel(contLines, inline=1, fontsize=10)
29 | ax1.grid(True); ax1.set_ylabel(r'$\beta$',fontsize=15);ax1.set_xlabel(r'$\alpha$',fontsize=15);
30 | #ax1.set_title('Slice through reduced bispectrum')
31 | fig2.colorbar(cont, shrink=0.5, aspect=5); plt.savefig("alpBetEq3.png")
32 |
33 | plt.show(fig1); plt.show(fig2);
34 |
35 | from mayavi import mlab
36 | mlab.figure(bgcolor=(1.,1.,1.), fgcolor=None, engine=None, size=(600, 600))
37 | mlab.surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut),vmax=np.nanmax(fnlOut),warp_scale="auto",colormap = 'jet')
38 | #mlab.contour_surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut), warp_scale='auto')
39 | mlab.view(azimuth=250, elevation=15)
40 | mlab.show()
41 |
42 | mlab.savefig("test.png")
43 |
44 | data = loadtxt('dataT/EqBi.dat')
45 |
46 | fig4 = plt.figure(4)
47 | kOut = data[0,:]; fnlOut = data[1,:]; Bztot = data[2,:]; Pztot = data[3,:]
48 | plt.plot(np.log(kOut/kOut[0]), fnlOut, linewidth=2)
49 | #title('Reduced bispectrum in equilateral configuration',fontsize=15)
50 | grid(True); plt.legend(fontsize=15); ylabel('$fNL$', fontsize=20)
51 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15); grid(True); plt.legend(fontsize=15); plt.xlim(min(np.log(kOut/kOut[0])),max(np.log(kOut/kOut[0]))); plt.savefig("BiEq.png")
52 | plt.show(fig4)
53 |
--------------------------------------------------------------------------------
/Examples/DoubleQuadNC/DQuadNCSetup.py:
--------------------------------------------------------------------------------
1 | ####################################### Setup file for the double quadratic potential with 2-sphere field space metric######################################################
2 |
3 | import sympy as sym # we import the sympy package
4 | import math # we import the math package (not used here, but has useful constants such math.pi which might be needed in other cases)
5 | import sys # import the sys module used below
6 | from gravipy import * # we import the gravipy package to write the field metric
7 | ############################################################################################################################################
8 |
9 | # if using an integrated environment we recommend restarting the python console after running this script to make sure updates are found
10 |
11 | location = "/nethome/ronayne/Documents/PyTransport-master/PyTransport/" # this should be the location of the PyTransport folder
12 | sys.path.append(location) # we add this location to the python path
13 |
14 | import PyTransSetup # the above commands allows python to find the PyTransSetup module and import it
15 |
16 | ############################################################################################################################################
17 |
18 | nF=2 # number of fields needed to define the double quadratic potential
19 | nP=3 # number of parameters needed to define the double quadtartic potential
20 | f=sym.symarray('f',nF) # an array representing the nF fields present for this model
21 | p=sym.symarray('p',nP) # an array representing the nP parameters needed to define this model (that we might wish to change) if we don't
22 | # wish to change them they could be typed explicitly in the potential below
23 |
24 | V = 1./2. * p[0]**2.0 *f [0]**2.0 + 1./2. * p[1]**2.0 * f[1]**2.0 # this is the potential written in sympy notation
25 | G=Matrix( [[p[2]**2.0, 0], [0, p[2]**2.0*sym.sin(f[0])**2.0] ] ) # this is the field metric written in sympy notation
26 | #The last argument is for whether the sympy's simplify is used to on derivatives of the potential and field geometric quantites.
27 | #Caution is recomended as sympy's simplify is known to have bugs. Simplification can increase the speed of numerically evolutions, but at the cost of compling more slowly.
28 | PyTransSetup.potential(V,nF,nP,False,G) # writes this potential and its derivatives into C++ file potential.h when run
29 |
30 | PyTransSetup.compileName("DQuadNC",True) # this compiles a python module using the C++ code, including the edited potential.h file, called PyTransDQuad
31 | # and places it in the location folder, ready for use
32 |
33 | ############################################################################################################################################
34 |
35 |
--------------------------------------------------------------------------------
/Examples/QuartAx/alpbetMpi.py:
--------------------------------------------------------------------------------
1 | #################### generate alpha beta bispectrum using PyTransAxQrt ############################################################
2 |
3 | from matplotlib import pyplot as plt
4 |
5 | from pylab import *
6 | import sys
7 | import math
8 | import numpy as np
9 |
10 | from mpi4py import MPI
11 |
12 | location = "/Users/david/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
13 | sys.path.append(location) # sets up python path to give access to PyTransSetup
14 |
15 | import PyTransSetup
16 | PyTransSetup.pathSet() # this sets the other paths that PyTransport uses
17 |
18 | import PyTransAxQrt as PyT # import module
19 | import PyTransScripts as PyS
20 |
21 | comm = MPI.COMM_WORLD
22 |
23 |
24 |
25 | ########################### set initial field values and parameters for a simple example run ###################################################
26 | nF=PyT.nF() # gets number of fields (useful check)
27 | nP=PyT.nP() # gets number of parameters needed (useful check)
28 |
29 | fields = np.array([23.5,.5-0.001])
30 |
31 | params = np.zeros(nP)
32 | params[0]=1.*pow(10.,-10); params[1]=1.; params[2]=25.0**2.0*params[0]/4.0/math.pi**2;
33 |
34 | V = PyT.V(fields,params) # calculate potential from some initial conditions
35 | dV=PyT.dV(fields,params) # calculate derivatives of potential (changes dV to derivatives)
36 | initial = np.concatenate((fields,np.array([0.,0.]))) # set initial conditions using slow roll expression
37 | ############################################################################################################################################
38 | tols = np.array([10**-8,10**-8])
39 |
40 |
41 | ################################## run the background fiducial run #########################################################################
42 | Nstart = 0.0
43 | Nend = 70.0
44 | t=np.linspace(Nstart, Nend, 1000) # array at which output is returned
45 | back = PyT.backEvolve(t, initial, params,tols,False) # The output is read into the back numpy array
46 | ############################################################################################################################################
47 |
48 | rank=comm.Get_rank()
49 |
50 | side = 140
51 | nsnaps = 150
52 | Nbefore=4.5
53 |
54 | NExit = 14.0
55 | kt = PyS.kexitN(NExit, back, params, PyT)
56 | kt =3.*kt
57 | alpha = np.linspace(-1,1,side)
58 | beta=np.linspace(0,1,side/2)
59 |
60 | Bztot, Pz1tot, Pz2tot, Pz3tot, times, snaps = PyS.alpBetSpecMpi(kt,alpha, beta, back, params, Nbefore, nsnaps,tols, PyT)
61 |
62 | if rank == 0:
63 | bet, alp = np.meshgrid(beta, alpha)
64 | np.save('data/alp',alp);np.save('data/bet',bet); np.save('data/alBetBi',Bztot); np.save('data/times',times)
65 | np.save('data/alBetPz1',Pz1tot); np.save('data/alBetPz2.npy',Pz2tot); np.save('data/alBetPz3',Pz3tot)
66 | np.save('data/snaps',snaps)
67 | print "\n\n process", rank, "done \n\n"
68 |
--------------------------------------------------------------------------------
/paper/paper.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 'PyTransport: A Python package for the calculation of inflationary correlation functions'
3 | tags:
4 | - Inflation
5 | - Cosmology
6 | - Early Universe
7 | authors:
8 | - name: David J. Mulryne
9 | affiliation: 1
10 | - name: John W. Ronayne
11 | orcid: 0000-0001-6464-6466
12 | affiliation: 1
13 | affiliations:
14 | - name: Astronomy Unit, Queen Mary University of London, E3 4NS, UK
15 | index: 1
16 | date: 23 November 2017
17 | bibliography: paper.bib
18 | ---
19 |
20 | # Summary
21 | 
22 | PyTransport constitutes a straightforward code written in C++ together with Python scripts which automatically edit, compile and run the C++ code as a Python module. It has been written for Unix-like systems (OS X and Linux). The transport method we utilise means only coupled differential equations need to be solved, and the implementation presented here combines the speed of C++ with the functionality and convenience of Python.
23 |
24 | The code is intended to be a reusable resource for inflationary cosmology. It enables users to quickly create a complied Python module(s) for any given model(s) of multi-field inflation. Primarily the module employs the transport approach to inflationary cosmology to calculate the tree-level power-spectrum and bispectrum of user specified models of multi-field inflation, accounting for all sub and super-horizon effects. To this end, the module contains a number functions that can be called from Python and that perform tasks such as calculating the background evolution of the cosmology, as well as the evolution of the two and three point functions. We also provide a number of further functions written in Python that perform common tasks such as calculating the power spectrum or bispectrum over a range of scales by utilising the compiled module. The true power of the approach, however, is that users can rapidly write their own scripts, or adapt ours, to suit their own needs.
25 |
26 | The transport approach to inflationary perturbation theory that the code employs can be seen as the differential version of the integral expressions of the In-In formalism. It is helpful numerically because it provides a set of ordinary differential equations for the correlation functions of inflationary perturbations. The code solves these equations from deep inside the horizon until some desired time after horizon crossing using a standard variable step size ordinary differential equation (ODE) routine with error control. Such off the shelf routines are extremely well tested, and provide an easy way to change the required accuracy. This is helpful in order to check convergence of the numerical solutions, or to respond to needs of models with very fine features. Details of the transport method itself that the code is based on can be found in the recent paper [@Dias] [@Ronayne]. We highly recommend reading this guide in combination with that paper.
27 | # References
28 |
--------------------------------------------------------------------------------
/Examples/SingleField/MpiAlpBetBi.py:
--------------------------------------------------------------------------------
1 | #################### generate equilateral bispectrum using PyTransStep and MPI ############################################################
2 | import numpy as np # imports numpu package as np for short
3 | import sys # imports sys package for sue below
4 |
5 | from mpi4py import MPI
6 |
7 | location = "/Users/mulryne/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
8 | sys.path.append(location) # sets up python path to give access to PyTransSetup
9 |
10 | import PyTransSetup
11 | PyTransSetup.pathSet() # this sets the other paths that PyTransport uses
12 |
13 | import PyTransStep as PyT # import module
14 | import PyTransScripts as PyS
15 |
16 | ########################### initial field values ###########################################################################################
17 |
18 | nF=PyT.nF() # gets number of fields (useful check)
19 | nP=PyT.nP() # gets number of parameters needed (useful check)
20 |
21 | fields = np.array([16.5])
22 |
23 | pvalue = np.zeros(nP)
24 | pvalue[0]=pow(10.,-5); pvalue[1]=0.0018; pvalue[2]=14.84; pvalue[3]=0.022;
25 |
26 | V = PyT.V(fields,pvalue) # calculate potential from some initial conditions
27 | dV=PyT.dV(fields,pvalue) # calculate derivatives of potential (changes dV to derivatives)
28 |
29 | initial = np.array([fields,-dV/np.sqrt(3.*V)]) # set initial conditions to be in slow roll
30 | ############################################################################################################################################
31 |
32 |
33 | ################################## run the background fiducial run #########################################################################
34 | tols = np.array([10**-8,10**-8])
35 |
36 | Nstart = 0.0
37 | Nend = 40.0
38 | t=np.linspace(Nstart, Nend, 1000)
39 | back = PyT.backEvolve(t, initial, pvalue,tols,False)
40 | #back = np.genfromtxt('../../runData/back.dat', dtype=None) #load data into python
41 | ############################################################################################################################################
42 |
43 | side = 140
44 | nsnaps = 0
45 | Nbefore=4.5
46 |
47 | #PhiExit = 14.6
48 | Nexit =14.8
49 | k = PyS.kexitN(Nexit, back, pvalue, PyT)
50 | kt = 3*k
51 |
52 | alpha = np.linspace(-1,1,side)
53 | beta=np.linspace(0,1,side/2)
54 |
55 | Bztot, Pz1tot, Pz2tot, Pz3tot, times = PyS.alpBetSpecMpi(kt,alpha, beta, back, pvalue, Nbefore, nsnaps,tols, PyT)
56 |
57 | comm = MPI.COMM_WORLD
58 | rank =comm.Get_rank()
59 | if rank == 0:
60 |
61 | fnlOut = 5.0/6*Bztot[:,:,-1]/(Pz1tot[:,:,-1]*Pz2tot[:,:,-1] + Pz1tot[:,:,-1]*Pz3tot[:,:,-1] + Pz2tot[:,:,-1]*Pz3tot[:,:,-1])
62 | bet, alp = np.meshgrid(beta, alpha)
63 |
64 | np.save('data/alp',alp);np.save('data/bet',bet); np.save('data/alBetBi',Bztot)
65 | np.save('data/alBetPz1',Pz1tot); np.save('data/alBetPz2.npy',Pz2tot); np.save('data/alBetPz3',Pz3tot)
66 | print "\n\n process", rank, "done \n\n"
67 |
--------------------------------------------------------------------------------
/Examples/QuartAx/movie.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #################### generate figures ############################################################
3 | from pylab import *
4 | from mpl_toolkits.mplot3d import Axes3D
5 | import numpy as np
6 | from scipy import interpolate
7 | from scipy.interpolate import griddata
8 | import matplotlib.pyplot as plt
9 | from numpy.random import uniform, seed
10 | from matplotlib.mlab import griddata
11 | #import numpy.ma as ma
12 |
13 | # load 3D data
14 | bet = np.load('data/bet.npy'); alp= np.load('data/alp.npy'); Bztot = np.load('data/alBetBi.npy'); snaps = np.load('data/snaps.npy');
15 | Pz1tot = np.load('data/alBetPz1.npy'); Pz2tot=np.load('data/alBetPz2.npy'); Pz3tot=np.load('data/alBetPz3.npy')
16 | for snap in range(0,np.size(snaps)):
17 |
18 | fnlOut = 5.0/6*Bztot[:,:,snap]/(Pz1tot[:,:,snap]*Pz2tot[:,:,snap] + Pz1tot[:,:,snap]*Pz3tot[:,:,snap] + Pz2tot[:,:,snap]*Pz3tot[:,:,snap])
19 | k = 1543.9416122555126
20 | kt = 3*k; k1 = kt/2 - bet*kt/2.; k2 = kt/4*(1+alp+bet); k3 = kt/4*(1-alp+bet)
21 | DBi = Bztot[:,:,snap]*( k1*k2*k3 )**2
22 | #X=np.linspace(-1,1,100); Y=np.linspace(0,1,1F00)
23 | #Y, X = np.meshgrid(X, Y)
24 | #a=np.reshape(alp,(np.size(alp)));b=reshape(bet,(np.size(bet)));f=reshape(fnlOut,np.size(fnlOut));X=reshape(X,np.size(X));Y=reshape(Y,np.size(Y))
25 | #F=griddata(a,b,f, X,Y,interp='linear')
26 |
27 |
28 | # 3D plot for fnl
29 | #fig1 = plt.figure(1)
30 | #ax = fig1.add_subplot(1, 1, 1, projection='3d')
31 | #surf = ax.plot_surface(alp, bet, fnlOut, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.00, antialiased=False, vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut))
32 | #ax.grid(True); ax.set_ylabel(r'$\beta$',fontsize=15);ax.set_xlabel(r'$\alpha$',fontsize=15);
33 | ##ax.set_title('Slice through reduced bispectrum')
34 |
35 | #fig1.colorbar(surf, shrink=0.5, aspect=5); plt.savefig("alpBetFnl1.png")
36 |
37 |
38 | # mayavi 3D plot for fnl
39 | from mayavi import mlab
40 | mlab.figure(bgcolor=(1.,1.,1.), fgcolor=None, engine=None, size=(600, 600))
41 | mlab.surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut),vmax=np.nanmax(fnlOut),warp_scale="auto",opacity=1.0, colormap = 'jet')
42 | #mlab.contour_surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut), warp_scale='auto')
43 | mlab.view(azimuth=250, elevation=15); mlab.savefig("movie/alpbetFnlMay"+'{0:03}'.format(snap)+".png")
44 | mlab.close()
45 |
46 | # mayavi 3D plot for DBi
47 | from mayavi import mlab
48 | mlab.figure(bgcolor=(1.,1.,1.), fgcolor=None, engine=None, size=(600, 600))
49 | mlab.surf(alp,bet,DBi,vmin=np.nanmin(DBi),vmax=np.nanmax(DBi),warp_scale="auto",colormap = 'jet')
50 | #mlab.contour_surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut), warp_scale='auto')
51 | mlab.view(azimuth=250, elevation=15); mlab.savefig("movie/alpbetDBiMay"+'{0:03}'.format(snap)+".png")
52 | mlab.close()
53 | # from command line run: ffmpeg -framerate 10 -i alpbetFnlMay%03d.png -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2"-c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
54 |
55 | #mlab.show()
56 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/MpiAlpBetBi.py:
--------------------------------------------------------------------------------
1 | #################### generate alpha beta bispectrum using PyTransDQuad and MPI ############################################################
2 | from matplotlib import pyplot as plt # import package for plotting
3 | from mpl_toolkits.mplot3d import Axes3D
4 | from pylab import * # contains some useful stuff for plotting
5 | import time # imports a package that allows us to see how long processes take
6 | import math # imports math package
7 | import numpy as np # imports numpu package as np for short
8 | import sys # imports sys package for sue below
9 |
10 | from mpi4py import MPI
11 |
12 | location = "/Users/mulryne/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
13 | sys.path.append(location) # sets up python path to give access to PyTransSetup
14 |
15 | import PyTransSetup
16 | PyTransSetup.pathSet() # this sets the other paths that PyTransport uses
17 |
18 | import PyTransDQuad as PyT # import module
19 | import PyTransScripts as PyS
20 |
21 | comm = MPI.COMM_WORLD
22 | tols = np.array([10**-8,10**-8])
23 |
24 | ########################### initial field values ###########################################################################################
25 | fields = np.array([12.0, 12.0]) # we set up a numpy array which contains the values of the fields
26 |
27 | nP=PyT.nP() # the .nP() function gets the number of parameters needed for the potential -- this can be used as a useful crosscheck
28 | pvalue = np.zeros(nP)
29 | pvalue[0]=10.0**(-5.0); pvalue[1]=9.0*10.0**(-5) # we set up numpy array which contains values of the parameters
30 |
31 | nF=PyT.nF() # use number of fields routine to get number of fields (can be used as a useful cross check)
32 |
33 | V = PyT.V(fields,pvalue) # calculate potential from some initial conditions
34 | dV=PyT.dV(fields,pvalue) # calculate derivatives of potential (changes dV to derivatives)
35 |
36 | initial = np.concatenate((fields, -dV/np.sqrt(3* V))) # sets an array containing field values and there derivative in cosmic time
37 | # (set using the slow roll equation)
38 | ############################################################################################################################################
39 |
40 |
41 | ################################## run the background fiducial run ########################################################################
42 | Nstart = 0.0
43 | Nend = 50.0
44 | t=np.linspace(Nstart, Nend, 1000)
45 | back = PyT.backEvolve(t, initial, pvalue,tols,False)
46 | ###########################################################################################################################################
47 |
48 | side = 100
49 | nsnaps = 0
50 | Nbefore=4.5
51 | rank=comm.Get_rank()
52 |
53 | NExit = 15.0
54 | kt = PyS.kexitN(NExit, back, pvalue, PyT)
55 |
56 | alpha = np.linspace(-1,1,side)
57 | beta=np.linspace(0,1,side/2)
58 |
59 | Bztot, Pz1tot, Pz2tot, Pz3tot, times, snaps = PyS.alpBetSpecMpi(kt,alpha, beta, back, pvalue, Nbefore, nsnaps,tols, PyT)
60 |
61 | if rank == 0:
62 | bet, alp = np.meshgrid(beta, alpha)
63 | np.save('data/alp',alp);np.save('data/bet',bet); np.save('data/alBetBi',Bztot)
64 | np.save('data/alBetPz1',Pz1tot); np.save('data/alBetPz2.npy',Pz2tot); np.save('data/alBetPz3',Pz3tot)
65 | print ("\n\n process " + str(rank) + " done \n\n")
66 |
--------------------------------------------------------------------------------
/Examples/QuartAxNC/BackgroundEvolution.py:
--------------------------------------------------------------------------------
1 | #################### Simple example of using PyTransQuartAxNC installed using the setup file which accompanies this one ####################
2 | from matplotlib import pyplot as plt # import package for plotting
3 | from pylab import * # contains some useful stuff for plotting
4 | import time # imports a package that allows us to see how long processes take
5 | import math # imports math package
6 | import numpy as np # imports numpu package as np for short
7 | import sys # imports sys package for sue below
8 | import timeit
9 |
10 |
11 | location = "/home/jwr/Code//PyTransport/" # this should be the location of the PyTransport folder
12 | sys.path.append(location) # sets up python path to give access to PyTransSetup
13 | tols = np.array([10**-10,10**-10])
14 |
15 | import PyTransSetup
16 | PyTransSetup.pathSet() # this sets the other paths that PyTransport uses
17 |
18 | import PyTransQuartAxNC as PyT # import module as PyT (PyTransQuartAxNC is quite long to type each time and it saves time to use a shorter name
19 | # using a generic name PyT means the file can be more easily reused for a different example (once field values
20 | # etc are altered)
21 | import PyTransScripts as PyS # import the scripts module as PyS for convenience
22 | ###########################################################################################################################################
23 | BB=10
24 | fields = np.array([2.0,0.5-0.001])
25 | nP=PyT.nP()
26 | nF=PyT.nF()
27 | params = np.zeros(nP)
28 | nS = np.zeros(BB)
29 | FNL=np.zeros([BB,1000])
30 | zzOut=np.empty([BB,100])
31 | zzzOut=np.empty([BB,100])
32 | timess=np.empty([BB,100])
33 | KO=np.empty([BB,100])
34 | def get_last_non_zero_index(d, default=None):
35 | rev = (len(d) - idx for idx, item in enumerate(reversed(d), 1) if item)
36 | return next(rev, default)
37 | #Sample over different values of the 2-sphere radius
38 | for bb in range(BB):
39 |
40 | params[0]=1.*pow(10.,-10); params[1]=1.; params[2]=25.0**2.0*params[0]/4.0/math.pi**2;
41 | params[3]=9.3-0.01*bb
42 |
43 | V = PyT.V(fields,params) # calculate potential from some initial conditions
44 | dV=PyT.dV(fields,params) # calculate derivatives of potential (changes dV to derivatives)
45 | initial = np.concatenate((fields,np.array([0.,0.]))) # set initial conditions using slow roll expression
46 |
47 | ################################## run the background fiducial run #########################################################################
48 | Nstart = 0.0
49 | Nend = 65.0
50 | t=np.linspace(Nstart, Nend, 10000) # array at which output is returned
51 | back = PyT.backEvolve(t, initial, params, tols,True ) # The output is read into the back numpy array
52 |
53 | numstart = (np.abs(back[:,0]-back[get_last_non_zero_index(back[:,0]),0]+64.0)).argmin()
54 | fieldsi=np.array([ back[numstart,1 ],back[numstart,2]])
55 | initiali = np.concatenate((fieldsi,np.array([0.,0.])))
56 | print numstart
57 | ti=np.linspace(Nstart, 65, 1000)
58 | back2 = PyT.backEvolve(ti, initiali, params, tols, False )
59 |
60 | fig1 = plt.figure(1)
61 | plt.plot(back2[:,0], back2[:,1 ], 'r',label=r'$\phi$',linewidth=2)
62 | plt.plot(back2[:,0],back2[:,2 ], 'g',label=r'$\chi$',linewidth=2)
63 |
64 | plt.legend()
65 | plt.title('Background Field Evolution')
66 | plt.xlabel('N')
67 | plt.ylabel('Field Value')
68 | plt.show()
--------------------------------------------------------------------------------
/Examples/PseudoScalar/MpiAlpBetBi.py:
--------------------------------------------------------------------------------
1 | #################### generate alpha beta bispectrum using PseudoScalar and MPI ############################################################
2 | from matplotlib import pyplot as plt # import package for plotting
3 | from mpl_toolkits.mplot3d import Axes3D
4 | from pylab import * # contains some useful stuff for plotting
5 | import time # imports a package that allows us to see how long processes take
6 | import math # imports math package
7 | import numpy as np # imports numpu package as np for short
8 | import sys # imports sys package for sue below
9 |
10 | from mpi4py import MPI
11 |
12 | location = "/home/jwr/Code/June/PyTransport2Dist/PyTransport/" # this should be the location of the PyTransport folder
13 | sys.path.append(location) # sets up python path to give access to PyTransSetup
14 |
15 | import PyTransSetup
16 | PyTransSetup.pathSet() # this sets the other paths that PyTransport uses
17 |
18 | import PyTransPseudo as PyT # import module
19 | import PyTransScripts as PyS
20 |
21 | comm = MPI.COMM_WORLD
22 | tols = np.array([10**-8,10**-8])
23 |
24 | ########################### initial field values ###########################################################################################
25 | fields = np.array([10.0,0.01,13.0]) # we set up a numpy array which contains the values of the fields
26 |
27 | nP=PyT.nP() # the .nP() function gets the number of parameters needed for the potential -- this can be used as a useful crosscheck
28 | pvalue = np.zeros(nP)
29 | M=1.*pow(10.,-6.0)
30 |
31 | pvalue[0]=1./2. *30.0 * M**2; pvalue[1]=1./2. *300.0 * M**2; pvalue[2]=1./2. *30./81. *M**2; # we set up numpy array which contains values of the parameters
32 |
33 | nF=PyT.nF() # use number of fields routine to get number of fields (can be used as a useful cross check)
34 |
35 | V = PyT.V(fields,pvalue) # calculate potential from some initial conditions
36 | dV=PyT.dV(fields,pvalue) # calculate derivatives of potential (changes dV to derivatives)
37 |
38 | initial = np.concatenate((fields,np.array([0,0,0]))) # sets an array containing field values and there derivative in cosmic time
39 | # (set using the slow roll equation)
40 | ############################################################################################################################################
41 |
42 |
43 | ################################## run the background fiducial run ########################################################################
44 | Nstart = 0.0
45 | Nend = 70.0
46 | t=np.linspace(Nstart, Nend, 1000)
47 | back = PyT.backEvolve(t, initial, pvalue,tols,False)
48 | ###########################################################################################################################################
49 |
50 | side = 100
51 | nsnaps = 0
52 | Nbefore=4.5
53 | rank=comm.Get_rank()
54 |
55 | NExit = 60.0
56 | kt = PyS.kexitN(NExit, back, pvalue, PyT)
57 |
58 | alpha = np.linspace(-1,1,side)
59 | beta=np.linspace(0,1,side/2)
60 |
61 | Bztot, Pz1tot, Pz2tot, Pz3tot, times, snaps = PyS.alpBetSpecMpi(kt,alpha, beta, back, pvalue, Nbefore, nsnaps,tols, PyT)
62 |
63 | if rank == 0:
64 | bet, alp = np.meshgrid(beta, alpha)
65 | np.save('data15/alp',alp);np.save('data15/bet',bet); np.save('data15/alBetBi',Bztot)
66 | np.save('data15/alBetPz1',Pz1tot); np.save('data15/alBetPz2.npy',Pz2tot); np.save('data15/alBetPz3',Pz3tot)
67 | print ("\n\n process " + str(rank) + " done \n\n")
--------------------------------------------------------------------------------
/Examples/DoubleQuad/MpiEqBi.py:
--------------------------------------------------------------------------------
1 | #################### generate equilateral bispectrum using PyTransDQuad and MPI ############################################################
2 | from matplotlib import pyplot as plt # import package for plotting
3 | from pylab import * # contains some useful stuff for plotting
4 | import time # imports a package that allows us to see how long processes take
5 | import math # imports math package
6 | import numpy as np # imports numpu package as np for short
7 | import sys # imports sys package for sue below
8 |
9 | from mpi4py import MPI
10 |
11 | location = "/Users/david/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
12 | sys.path.append(location) # sets up python path to give access to PyTransSetup
13 |
14 | import PyTransSetup
15 | PyTransSetup.pathSet() # this sets the other paths that PyTransport uses
16 |
17 | import PyTransDQuad as PyT # import module
18 | import PyTransScripts as PyS
19 |
20 | comm = MPI.COMM_WORLD
21 |
22 | ########################### initial field values ###########################################################################################
23 | fields = np.array([12.0, 12.0]) # we set up a numpy array which contains the values of the fields
24 |
25 | nP=PyT.nP() # the .nP() function gets the number of parameters needed for the potential -- this can be used as a useful crosscheck
26 | pvalue = np.zeros(nP)
27 | pvalue[0]=10.0**(-5.0); pvalue[1]=9.0*10.0**(-5) # we set up numpy array which contains values of the parameters
28 |
29 | nF=PyT.nF() # use number of fields routine to get number of fields (can be used as a useful cross check)
30 |
31 | V = PyT.V(fields,pvalue) # calculate potential from some initial conditions
32 | dV=PyT.dV(fields,pvalue) # calculate derivatives of potential (changes dV to derivatives)
33 |
34 | initial = np.concatenate((fields, -dV/np.sqrt(3* V))) # sets an array containing field values and there derivative in cosmic time
35 | # (set using the slow roll equation)
36 | ############################################################################################################################################
37 |
38 | tols = np.array([10**-8,10**-8])
39 |
40 | ################################## run the background fiducial run ########################################################################
41 | Nstart = 0.0
42 | Nend = 60.0
43 | t=np.linspace(Nstart, Nend, 1000)
44 | back = PyT.backEvolve(t, initial, pvalue,tols,False)
45 | ###########################################################################################################################################
46 |
47 | rank=comm.Get_rank()
48 | points = 500
49 |
50 | NExit1 = 10.0
51 | NExit2 = 10.0+0.08*points
52 | k1 = PyS.kexitN(NExit1, back, pvalue, PyT)
53 | k2 = PyS.kexitN(NExit2, back, pvalue, PyT)
54 | kOut= np.logspace(log10(k1), log10(k2), points)
55 |
56 | Pztot, Bztot, times = PyS.eqSpecMpi(kOut, back, pvalue, 4.5, tols,PyT)
57 |
58 | print ("\n\n process " + str(rank) + " done \n\n")
59 |
60 | if rank ==0:
61 | fnlOut = 5.0/6*Bztot/(3.0*Pztot**2.0)
62 | fig2 = plt.figure(2)
63 | plt.plot(np.log(kOut/kOut[0]), fnlOut, linewidth=2)
64 | title('Reduced bispectrum in equilateral configuration',fontsize=15) ;grid(True); plt.legend(fontsize=15); ylabel('$fNL$', fontsize=20)
65 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15); grid(True); plt.legend(fontsize=15); plt.xlim(min(np.log(kOut/kOut[0])),max(np.log(kOut/kOut[0])));
66 | plt.savefig("BiEq.png")
67 |
68 | np.savetxt('data/EqBi.dat', (kOut,fnlOut,Bztot,Pztot)) # x,y,z equal sized 1D arrays
69 |
--------------------------------------------------------------------------------
/AutoTest/Testrun.py:
--------------------------------------------------------------------------------
1 | #Test file for use with nose.
2 | import time # imports a package that allows us to see how long processes take
3 | import math # imports math package
4 | import numpy as np # imports numpu package as np for short
5 | import sys # imports sys package for sue below
6 |
7 | location = "/home/jwr/Code/nosetest/PyTransport-master/PyTransport/" # this should be the location of the PyTransport folder
8 | sys.path.append(location) # sets up python path to give access to PyTransSetup
9 | tols = np.array([10**-10,10**-10])
10 |
11 | import PyTransSetup
12 | PyTransSetup.pathSet() # this sets the other paths that PyTransport uses
13 | import PyTransQuartAxNC as PyT
14 | import PyTransScripts as PyS # import the scripts module as PyS for convenience
15 |
16 | fields = np.array([2.0,0.5-0.001])
17 | nP=PyT.nP()
18 | nF=PyT.nF()
19 | params = np.zeros(nP)
20 |
21 | params[0]=1.*pow(10.,-10); params[1]=1.; params[2]=25.0**2.0*params[0]/4.0/math.pi**2;params[3]=9.1
22 | V = PyT.V(fields,params) # calculate potential from some initial conditions
23 | dV=PyT.dV(fields,params) # calculate derivatives of potential (changes dV to derivatives)
24 | initial = np.concatenate((fields,np.array([0.,0.]))) # set initial conditions using slow roll expression
25 | Nstart = 0.0
26 | Nend = 65.0
27 | t=np.linspace(Nstart, Nend, 10000) # array at which output is returned
28 | back = PyT.backEvolve(t, initial, params, tols,True) # The output is read into the back numpy array
29 |
30 | ##test 1
31 | def test_Background():
32 | BR=back[:,1:]
33 | BD=np.loadtxt('TEST_backevo.out')
34 | Run1=np.array([str(BR[i,k])[0:10] for i in range(9862) for k in range(4)])
35 | Data1=np.array([str(BD[i,k])[0:10] for i in range(9862) for k in range(4)])
36 | assert np.array_equal(Run1,Data1)
37 |
38 |
39 | k = PyS.kexitN(14.0, back, params, PyT)
40 | NB = 5.0
41 | Nstart, backExitMinus = PyS.ICsBE(NB, k, back, params, PyT) #find conditions for 5 e-folds before horizon crossing of k mode
42 | tsig=np.linspace(Nstart,Nend, 1000)
43 | twoPt = PyT.sigEvolve(tsig, k, backExitMinus,params,tols, True) # puts information about the two point fuction in twoPt array
44 | zz1=twoPt[:,1] # the second column is the 2pt of zeta
45 | sigma = twoPt[:,1+1+2*nF:] # the last 2nF* 2nF columns correspond to the evolution of the sigma matrix
46 | zz1a=zz1[-1] # the value fo the power spectrum for this k value at the end of the run
47 | twoPt=PyT.sigEvolve(tsig, k+.1*k, backExitMinus,params,tols, True)
48 | zz2=twoPt[:,1]
49 | zz2a=zz2[-1]
50 | n_s = (np.log(zz2a)-np.log(zz1a))/(np.log(k+.1*k)-np.log(k))+4.0
51 |
52 | ##test 2
53 | def test_2pt():
54 | ZZR=(zz1,zz2)
55 | ZZD=np.loadtxt('TEST_zz.out')
56 | Run2=np.array([str(ZZR[k][i])[0:10] for i in range(1000) for k in range(2)])
57 | Data2=np.array([str(ZZD[k][i])[0:10] for i in range(1000) for k in range(2)])
58 | assert np.array_equal(Run2,Data2)
59 |
60 |
61 | alpha=0.0
62 | beta =1/3.
63 | k1 = k/2 - beta*k/2. ; k2 = k/4*(1+alpha+beta) ; k3 = k/4*(1-alpha+beta)
64 | kM = np.min(np.array([k1,k2,k3]))
65 | Nstart, backExitMinus = PyS.ICsBE(NB, kM, back, params, PyT)
66 |
67 | talp=np.linspace(Nstart,Nend, 1000)
68 | threePt = PyT.alphaEvolve(talp,k1,k2,k3, backExitMinus,params,tols, True)
69 | alpha= threePt[:,1+4+2*nF+6*2*nF*2*nF:] # this now contains the 3pt of the fields and field derivative pertruabtions
70 | zzz= threePt[:,1:5]
71 | fnl = 5.0/6.0*zzz[:,3]/(zzz[:,1]*zzz[:,2] + zzz[:,0]*zzz[:,1] + zzz[:,0]*zzz[:,2])
72 |
73 | #test 3
74 | def test_3pt():
75 | ZZZR=(zzz)
76 | ZZZD=np.loadtxt('TEST_zzz.out')
77 | Run3=np.array([str(ZZZR[i,k])[0:10] for i in range(1000) for k in range(4)])
78 | Data3=np.array([str(ZZZD[i,k])[0:10] for i in range(1000) for k in range(4)])
79 | assert np.array_equal(Run3,Data3)
--------------------------------------------------------------------------------
/Examples/Curve/EqBi.py:
--------------------------------------------------------------------------------
1 | #################### generate equilateral bispectrum ############################################################
2 | from matplotlib import pyplot as plt # import package for plotting
3 | from pylab import * # contains some useful stuff for plotting
4 | import time # imports a package that allows us to see how long processes take
5 | import math # imports math package
6 | import numpy as np # imports numpu package as np for short
7 | import sys # imports sys package for sue below
8 |
9 |
10 | location = "/Users/david/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
11 | sys.path.append(location) # sets up python path to give access to PyTransSetup
12 |
13 | import PyTransSetup
14 | PyTransSetup.pathSet() # this sets the other paths that PyTransport uses
15 |
16 | import PyTransCurve as PyT # import modules
17 | import PyTransScripts as PyS
18 | tols = np.array([10**-10,10**-10])
19 |
20 | ########################### set some field values and field derivatives in cosmic time ####################################################
21 | omega = math.pi/30.0
22 | R0 = np.sqrt(10.0**(-10)/3.0) / (omega *np.sqrt(10.0**(-9)))
23 |
24 | fields = np.array([-R0, (1e-2)*R0]) # we set up a numpy array which contains the values of the fields
25 |
26 | nP=PyT.nP() # the .np function gets the number of parameters needed for the potential -- this can be used as a useful crosscheck
27 | pvalue = np.zeros(nP)
28 | pvalue[1]=1./np.sqrt(3.0); pvalue[2]=1.0/10.0**(-5); pvalue[3]=1.0/omega**.5 * 1./2. * (10.0**(-10))**(-3./4.)
29 | pvalue[0]=R0
30 | # we set up numpy array which contains values of the parameters
31 |
32 | nF=PyT.nF() # use number of fields routine to get number of fields (can be used as a useful cross check)
33 |
34 | V = PyT.V(fields,pvalue) # calculate potential from some initial conditions
35 | dV = PyT.dV(fields,pvalue) # calculate derivatives of potential
36 |
37 | initial = np.concatenate((fields, np.array([0,0]))) # sets an array containing field values and there derivative in cosmic time
38 | # (set using the slow roll equation)
39 |
40 | ############################################################################################################################################
41 |
42 |
43 |
44 | ################################## run the background fiducial run #########################################################################
45 | Nstart = 0.0
46 | Nend = 28.0
47 | t=np.linspace(Nstart, Nend, 1000) # array at which output is returned
48 | back = PyT.backEvolve(t, initial, pvalue,tols,False) # The output is read into the back numpy array
49 |
50 | # plot background
51 | fig1 = plt.figure(1)
52 | plt.plot(back[:,0], back[:,2 ], 'r')
53 | plt.plot(back[:,0], back[:,1 ], 'g')
54 | ############################################################################################################################################
55 |
56 | points = 50
57 |
58 | kOut =np.array([])
59 | NOut = np.array([])
60 | Nexit1 = 17.0
61 | for ii in range(0,points):
62 | Nexit = Nexit1+0.14*ii
63 | k = PyS.kexitN(Nexit, back, pvalue, PyT)
64 | kOut= np.append(kOut,k)
65 | NOut = np.append(NOut,Nexit)
66 | print kOut
67 | Pztot, Bztot, times = PyS.eqSpectra(kOut, back, pvalue, 5.0,tols, PyT)
68 |
69 |
70 | fnlOut = 5.0/6*Bztot/(3.0*Pztot**2.0)
71 | fig2 = plt.figure(2)
72 | plt.plot(NOut, fnlOut, linewidth=2)
73 | #plt.plot(np.log(kOut/kOut[0]), fnlOut, linewidth=2)
74 | title('Reduced bispectrum in equilateral configuration',fontsize=15) ;grid(True); plt.legend(fontsize=15); ylabel('$fNL$', fontsize=20)
75 | xlabel(r'e-fold exit time', fontsize=15); grid(True); plt.legend(fontsize=15);
76 | #xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15); grid(True); plt.legend(fontsize=15);
77 | #plt.xlim(min(np.log(kOut/kOut[0])),max(np.log(kOut/kOut[0])));
78 | plt.savefig("BiEq.png")
79 |
80 | np.savetxt('data/EqBi.dat', (kOut,NOut, fnlOut,Bztot,Pztot)) # x,y,z equal sized 1D arrays
81 |
--------------------------------------------------------------------------------
/Examples/Curve/MpiEqBi.py:
--------------------------------------------------------------------------------
1 | #################### generate equilateral bispectrum using the quasi-single field and MPI ############################################################
2 | from matplotlib import pyplot as plt # import package for plotting
3 | from pylab import * # contains some useful stuff for plotting
4 | import time # imports a package that allows us to see how long processes take
5 | import math # imports math package
6 | import numpy as np # imports numpu package as np for short
7 | import sys # imports sys package for sue below
8 |
9 | from mpi4py import MPI
10 |
11 | location = "/Users/david/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
12 | sys.path.append(location) # sets up python path to give access to PyTransSetup
13 |
14 | import PyTransSetup
15 | PyTransSetup.pathSet() # this sets the other paths that PyTransport uses
16 |
17 | import PyTransCurve as PyT # import module
18 | import PyTransScripts as PyS
19 |
20 | comm = MPI.COMM_WORLD
21 | tols = np.array([10**-10,10**-10])
22 |
23 | ########################### set some field values and field derivatives in cosmic time ####################################################
24 | omega = pi/30.0
25 | R0 = np.sqrt(10.0**(-10)/3.0) / (omega *np.sqrt(10.0**(-9)))
26 |
27 | fields = np.array([-R0, (1e-2)*R0]) # we set up a numpy array which contains the values of the fields
28 |
29 | nP=PyT.nP() # the .np function gets the number of parameters needed for the potential -- this can be used as a useful crosscheck
30 | pvalue = np.zeros(nP)
31 | pvalue[1]=1./np.sqrt(3.0); pvalue[2]=1.0/10.0**(-5); pvalue[3]=1.0/omega**.5 * 1./2. * (10.0**(-10))**(-3./4.)
32 | pvalue[0]=R0
33 | # we set up numpy array which contains values of the parameters
34 |
35 | nF=PyT.nF() # use number of fields routine to get number of fields (can be used as a useful cross check)
36 |
37 | V = PyT.V(fields,pvalue) # calculate potential from some initial conditions
38 | dV = PyT.dV(fields,pvalue) # calculate derivatives of potential
39 |
40 | initial = np.concatenate((fields, np.array([0,0]))) # sets an array containing field values and there derivative in cosmic time
41 | # (set using the slow roll equation)
42 |
43 | ############################################################################################################################################
44 |
45 |
46 |
47 | ################################## run the background fiducial run #########################################################################
48 | Nstart = 0.0
49 | Nend = 28.0
50 | t=np.linspace(Nstart, Nend, 1000) # array at which output is returned
51 | back = PyT.backEvolve(t, initial, pvalue,tols,False) # The output is read into the back numpy array
52 |
53 | ############################################################################################################################################
54 |
55 | rank=comm.Get_rank()
56 | points = 500
57 | Nexit1=17.0
58 | kOut =np.array([])
59 | NOut = np.array([])
60 | for ii in range(0,points):
61 | Nexit = Nexit1+0.014*ii
62 | k = PyS.kexitN(Nexit, back, pvalue, PyT)
63 | kOut= np.append(kOut,k)
64 | NOut = np.append(NOut,Nexit)
65 |
66 | Pztot, Bztot, times = PyS.eqSpecMpi(kOut, back, pvalue, 5.0, tols,PyT)
67 |
68 | print ("\n\n process " + str(rank) + " done \n\n")
69 |
70 | if rank ==0:
71 | fnlOut = 5.0/6*Bztot/(3.0*Pztot**2.0)
72 | plt.plot(NOut, fnlOut, linewidth=2)
73 | #plt.plot(np.log(kOut/kOut[0]), fnlOut, linewidth=2)
74 | title('Reduced bispectrum in equilateral configuration',fontsize=15) ;grid(True); plt.legend(fontsize=15); ylabel('$fNL$', fontsize=20)
75 | xlabel(r'e-fold exit time', fontsize=15); grid(True); plt.legend(fontsize=15);
76 | #xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15); grid(True); plt.legend(fontsize=15);
77 | #plt.xlim(min(np.log(kOut/kOut[0])),max(np.log(kOut/kOut[0])));
78 | plt.savefig("BiEq.png")
79 |
80 | np.savetxt('data/EqBi.dat', (kOut,NOut,fnlOut,Bztot,Pztot)) # x,y,z equal sized 1D arrays
81 |
--------------------------------------------------------------------------------
/PyTransport/CppTrans/potential.h:
--------------------------------------------------------------------------------
1 | //#This file is part of PyTransport.
2 |
3 | //#PyTransport is free software: you can redistribute it and/or modify
4 | //#it under the terms of the GNU General Public License as published by
5 | //#the Free Software Foundation, either version 3 of the License, or
6 | //#(at your option) any later version.
7 |
8 | //#PyTransport is distributed in the hope that it will be useful,
9 | //#but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | //#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | //#GNU General Public License for more details.
12 |
13 | //#You should have received a copy of the GNU General Public License
14 | //#along with PyTransport. If not, see .
15 |
16 | // This file contains a prototype of the potential.h file of PyTransport -- it is edited by the PyTransScripts module
17 |
18 | #ifndef POTENTIAL_H // Prevents the class being re-defined
19 | #define POTENTIAL_H
20 |
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | using namespace std;
28 |
29 | // #Rewrite
30 | // Potential file rewriten at Wed Apr 24 14:30:20 2019
31 |
32 | class potential
33 | {
34 | private:
35 | int nF; // field number
36 | int nP; // params number which definFs potential
37 |
38 |
39 | public:
40 | // flow constructor
41 | potential()
42 | {
43 | // #FP
44 | nF=2;
45 | nP=3;
46 |
47 | // p.resize(nP);
48 |
49 | // pdef
50 |
51 | }
52 |
53 | //void setP(vector pin){
54 | // p=pin;
55 | //}
56 | //calculates V()
57 | double V(vector f, vector p)
58 | {
59 | double sum ;
60 |
61 | // Pot
62 | sum=0.5*std::pow(f[0], 2.0)*std::pow(p[0], 2.0) + 0.5*std::pow(f[1], 2.0)*std::pow(p[1], 2.0);
63 | return sum;
64 | }
65 |
66 | //calculates V'()
67 | vector dV(vector f, vector p)
68 | {
69 | vector sum(nF,0.0);
70 |
71 | // dPot
72 |
73 | sum[0]=1.0*std::pow(f[0], 1.0)*std::pow(p[0], 2.0);
74 |
75 | sum[1]=1.0*std::pow(f[1], 1.0)*std::pow(p[1], 2.0);
76 |
77 | return sum;
78 | }
79 |
80 | // calculates V''
81 | vector dVV(vector f, vector p)
82 | {
83 | vector sum(nF*nF,0.0);
84 |
85 | // ddPot
86 | double x0 = 1.0*std::pow(p[0], 2.0);
87 | double x1 = std::pow(std::sin(f[0]), 1.0);
88 | double x2 = std::cos(f[0]);
89 | double x3 = 1.0*std::pow(p[1], 2.0);
90 | double x4 = -std::pow(f[1], 1.0)*x2*x3/x1;
91 |
92 | sum[0]=x0;
93 |
94 | sum[2]=x4;
95 |
96 | sum[1]=x4;
97 |
98 | sum[3]=std::pow(f[0], 1.0)*x0*x1*x2 + x3;
99 |
100 | return sum;
101 | }
102 |
103 | // calculates V'''
104 | vector dVVV(vector f, vector p)
105 | {
106 | vector sum(nF*nF*nF,0.0);
107 | // dddPot
108 | double x0 = std::pow(f[1], 1.0);
109 | double x1 = std::sin(f[0]);
110 | double x2 = std::pow(x1, 2.0);
111 | double x3 = 1.0/x2;
112 | double x4 = std::cos(f[0]);
113 | double x5 = std::pow(x4, 2);
114 | double x6 = 1.0*x5;
115 | double x7 = x3*x6;
116 | double x8 = std::pow(p[1], 2.0);
117 | double x9 = 1.0*x8;
118 | double x10 = x0*x8;
119 | double x11 = -x0*x9*(-x7 - 1.0) + x10*x7;
120 | double x12 = std::pow(x1, 1.0);
121 | double x13 = 1.0*std::pow(p[0], 2.0);
122 | double x14 = x12*x13*x4;
123 | double x15 = std::pow(f[0], 1.0);
124 | double x16 = x4/x12;
125 | double x17 = x16*(x14*x15 + x9);
126 | double x18 = 2.0*x10*x5;
127 | double x19 = x14 - x16*x9 - 1.0*x17;
128 |
129 | sum[0]=0;
130 |
131 | sum[4]=x18*x3;
132 |
133 | sum[2]=x11;
134 |
135 | sum[6]=x19;
136 |
137 | sum[1]=x11;
138 |
139 | sum[5]=x19;
140 |
141 | sum[3]=-x13*x15*(1.0*x2 - x6) + x14 - 2.0*x17;
142 |
143 | sum[7]=-x18;
144 |
145 | return sum;
146 | }
147 |
148 | int getnF()
149 | {
150 | return nF;
151 | }
152 |
153 | int getnP()
154 | {
155 | return nP;
156 | }
157 |
158 | };
159 | #endif
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PyTransport
2 | PyTransport release 2.0 (2017).
3 | This code has been written by Dr. David J. Mulryne and John W. Ronayne.
4 |
5 | This upload contains the PyTransport code, as well as examples and many of the files and figures generated during testing.
6 |
7 | PyTransport constitutes a straightforward code written in C++ together with Python scripts which automatically edit, compile and run the C++ code as a Python module. The code is intended to be a reusable resource for inflationary cosmology. It enables users to quickly create a complied Python module(s) for any given model(s) of multi-field inflation. The primary function of the complied module is to calculate the power-spectrum and bi-spectrum of inflationary perturbations produced by multi-field inflation.
8 |
9 | # Update in Version 2.0
10 | New modules have been added and modifications to existing functions have been made to support non-canonical models of Inflation. In addition, new arguments in some functions are available to the end user which allow more control of the speed and output of the simulations. These new features modify the input of existing evolution functions to allow; the ability of the integrator to run until the end of inflation, for tolerances to be set for each individual function and the simplification of the model potential and field-metric quantities to speed up numerical evaluation at the sacrifice of a slower compilation.
11 | In addition error feedback has been improved and storage of model quantities has been made more efficient.
12 |
13 | PyTransport has been developed on OS X and Linux Ubuntu using Python 2.7, and is intended for use on Unix based systems.
14 | # Quick installation Guide
15 | In order to compile PyTransport some prerequisites are required:
16 | * A working Python installation (We recommend Python 2.7 however we have attempted to ensure compatibility with versions of Python 3).
17 | * The following python packages, Numpy, Matplotlib, SciPy, Gravipy (v 0.1.0 *Note: compatiability issues with v0.2.0*), SymPy, Distutils, Math and Sys.
18 | The simplist way to install these packages is by using pip, e.g.
19 | ```sh
20 | pip install numpy
21 | ```
22 | * Optional packages: Mpi4Py (also requiring [openMPI](https://wiki.helsinki.fi/display/HUGG/Open+MPI+install+on+Mac+OS+X) for distributed computing and Mayavi for 3D Bispectra plots.
23 | * C++ compiler.
24 |
25 | ## Installing PyTransport
26 | Download the repository and move it to a convenient location on your computer's file system.
27 | Each model requires a separate installation. The `PyTransport-master/PyTransport/Examples/` folder contains subfolders of sample inflationary models, within them are the `ModelSetup.py` scripts.
28 | Each setup scripts can be modified for a particular model (for a full description on modifying the setup file see the user guide in the `PyTransport-master/Docs/` folder).
29 |
30 | For example, let's say you want to install a PyTransport module for the non-canonical Quartic-Axion model.
31 | First, from the shell, navigate into the folder `PyTransport-master/PyTransport/Examples/QuartAxNC/` and open the file `QuartAxNCsetup.py`.
32 |
33 | You will first need to modify the following line which specifies the location of your PyTransport folder on your system.
34 | ```python
35 | location = "/path/to/PyTransport/" # this should be the location of the PyTransport folder
36 | ```
37 | Note, if you are using Python 3 you will also need to modify the line,
38 | ```python
39 | PyTransSetup.compileName("QuartAxNC",True)
40 | ```
41 | to,
42 | ```python
43 | PyTransSetup.compileName3("QuartAxNC",True)
44 | ```
45 | in the setup file.
46 |
47 | Back in shell, run the script,
48 | ```sh
49 | python QuartAxNCsetup.py
50 | ```
51 | which will install the `QuartAxNC` PyTranport library which can later be imported into a python script, e.g. `SimpleExample.py`.
52 |
53 | # Contibutions, Pull requests and Issues
54 | Any third party wishing to contribute to the PyTransport project is welcome to do so. We will attempt to implement submitted pull requests and fix issues submitted to this repository. If assistance or support is needed you can also contact us by email at j.ronayne@qmul.ac.uk and d.mulryne@qmul.ac.uk.
55 |
56 | # Licencing #
57 | PyTransport is distributed under the GNU General Public License version 3, or (at your option) any later version. This license is bundled with the source code as LICENSE.txt.
58 |
59 | Please visit the [PyTransport website](https://transportmethod.com) for further information and links to other repositories ultisiling the transport method.
60 |
--------------------------------------------------------------------------------
/Examples/SingleField/Plots.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #################### generate equilateral bispectrum using MTeasyDQuad and MPI ############################################################
3 | from pylab import *
4 | from mpl_toolkits.mplot3d import Axes3D
5 | import numpy as np
6 | from scipy import interpolate
7 | from scipy.interpolate import griddata
8 | import matplotlib.pyplot as plt
9 | from numpy.random import uniform, seed
10 | from matplotlib.mlab import griddata
11 | #import numpy.ma as ma
12 |
13 | # load 3D data
14 | bet = np.load('data/bet.npy'); alp= np.load('data/alp.npy'); Bztot = np.load('data/alBetBi.npy')
15 | Pz1tot = np.load('data/alBetPz1.npy'); Pz2tot=np.load('data/alBetPz2.npy'); Pz3tot=np.load('data/alBetPz3.npy')
16 | fnlOut = 5.0/6*Bztot[:,:,-1]/(Pz1tot[:,:,-1]*Pz2tot[:,:,-1] + Pz1tot[:,:,-1]*Pz3tot[:,:,-1] + Pz2tot[:,:,-1]*Pz3tot[:,:,-1])
17 | k = 2295.8032000107523
18 | kt = 3*k; k1 = kt/2 - bet*kt/2.; k2 = kt/4*(1+alp+bet); k3 = kt/4*(1-alp+bet)
19 | DBi = Bztot[:,:,-1]*( k1*k2*k3 )**2
20 | #X=np.linspace(-1,1,100); Y=np.linspace(0,1,1F00)
21 | #Y, X = np.meshgrid(X, Y)
22 | #a=np.reshape(alp,(np.size(alp)));b=reshape(bet,(np.size(bet)));f=reshape(fnlOut,np.size(fnlOut));X=reshape(X,np.size(X));Y=reshape(Y,np.size(Y))
23 | #F=griddata(a,b,f, X,Y,interp='linear')
24 |
25 |
26 | # 3D plot for fnl
27 | #fig1 = plt.figure(1)
28 | #ax = fig1.add_subplot(1, 1, 1, projection='3d')
29 | #surf = ax.plot_surface(alp, bet, fnlOut, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.00, antialiased=False, vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut))
30 | #ax.grid(True); ax.set_ylabel(r'$\beta$',fontsize=15);ax.set_xlabel(r'$\alpha$',fontsize=15);
31 | ##ax.set_title('Slice through reduced bispectrum')
32 |
33 | #fig1.colorbar(surf, shrink=0.5, aspect=5); plt.savefig("alpBetFnl1.png")
34 |
35 | # projecton plot
36 | fig2 = plt.figure(2,figsize=(10,6),facecolor='white')
37 |
38 | ax1 = fig2.add_subplot(1, 1, 1)
39 | cont = ax1.contourf(alp, bet, fnlOut,10, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.0, antialiased=False)#, vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut))
40 | contLines = ax1.contour(alp, bet, fnlOut, 10, colors='black', linewidth=.5); ax1.clabel(contLines, inline=1, fontsize=10)
41 | ax1.grid(True); ax1.set_ylabel(r'$\beta$',fontsize=15);ax1.set_xlabel(r'$\alpha$',fontsize=15);
42 | #ax1.set_title('Slice through reduced bispectrum')
43 | fig2.colorbar(cont, shrink=0.5, aspect=5); plt.savefig("alpBetFnl2.png")
44 |
45 | plt.show(fig2); #plt.show(fig1);
46 |
47 | # mayavi 3D plot for fnl
48 | from mayavi import mlab
49 | mlab.figure(bgcolor=(1.,1.,1.), fgcolor=None, engine=None, size=(600, 600))
50 | mlab.surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut),vmax=np.nanmax(fnlOut),warp_scale="auto",opacity=1.0, colormap = 'jet')
51 | #mlab.contour_surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut), warp_scale='auto')
52 | mlab.view(azimuth=250, elevation=15); mlab.savefig("alpbetFnlMay.png")
53 |
54 | mlab.show()
55 |
56 |
57 | # create 3D plot for DBi
58 | #fig3 = plt.figure(3)
59 | #ax = fig3.add_subplot(1, 1, 1, projection='3d')
60 | #surf = ax.plot_surface(alp, bet, DBi, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.00, antialiased=False, vmin=np.nanmin(DBi), vmax=np.nanmax(DBi))
61 | #ax.grid(True); ax.set_ylabel(r'$\beta$',fontsize=15);ax.set_xlabel(r'$\alpha$',fontsize=15);
62 | ##ax.set_title('Slice through reduced bispectrum')
63 | #fig3.colorbar(surf, shrink=0.5, aspect=5); plt.savefig("alpBetDBi1.png")
64 |
65 | # projection plot for DBi
66 |
67 | fig4 = plt.figure(4,figsize=(10,6),facecolor='white')
68 |
69 | ax2 = fig4.add_subplot(1, 1, 1)
70 | cont = ax2.contourf(alp, bet, DBi, 10, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.0, antialiased=False, vmin=np.nanmin(DBi), vmax=np.nanmax(DBi) )
71 | contLines = ax2.contour(alp, bet, DBi, 10, colors='black', linewidth=.5); ax2.clabel(contLines, inline=1, fontsize=10)
72 | ax2.grid(True); ax2.set_ylabel(r'$\beta$',fontsize=15);ax2.set_xlabel(r'$\alpha$',fontsize=15);
73 | #ax1.set_title('Slice through reduced bispectrum')
74 | fig4.colorbar(cont, shrink=0.5, aspect=5); plt.savefig("alpBetDBi2.png")
75 |
76 | plt.show(fig4); #plt.show(fig3);
77 |
78 | # mayavi 3D plot for fnl
79 | from mayavi import mlab
80 | mlab.figure(bgcolor=(1.,1.,1.), fgcolor=None, engine=None, size=(600, 600))
81 | mlab.surf(alp,bet,DBi,vmin=np.nanmin(DBi),vmax=np.nanmax(DBi),warp_scale="auto",colormap = 'jet')
82 | #mlab.contour_surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut), warp_scale='auto')
83 | mlab.view(azimuth=250, elevation=15); mlab.savefig("alpbetDBiMay.png")
84 |
85 | mlab.show()
86 |
--------------------------------------------------------------------------------
/Examples/LH/EqSpecMpi.py:
--------------------------------------------------------------------------------
1 | #################### generate equilateral bispectrum using Langlois model and MPI ############################################################
2 | from matplotlib import pyplot as plt
3 |
4 | from pylab import *
5 | import sys
6 | import math
7 | import numpy as np
8 |
9 | from mpi4py import MPI
10 |
11 | location = "/Users/mulryne/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
12 | sys.path.append(location) # sets up python path to give access to PyTransSetup
13 |
14 | import PyTransSetup
15 | PyTransSetup.pathSet() # this sets the other paths that PyTransport uses
16 |
17 | import PyTransLH as PyT # import module
18 | import PyTransScripts as PyS
19 |
20 | comm = MPI.COMM_WORLD
21 |
22 | ########################### initial field values ###########################################################################################
23 | nP=PyT.nP()
24 | shift=231.
25 | fields = np.array([-2.-100.*math.sqrt(6.) +shift, 2.*math.tan(math.pi/20.)])
26 | pvalue = np.zeros(nP)
27 | pvalue[0]=1.*pow(10.,-7); pvalue[1]=1.*pow(10.,-4); pvalue[2]=math.pi/10.; pvalue[3] = -100.*math.sqrt(6.) +shift; pvalue[4]=10.*math.sqrt(3.);# gelaton-like case (slow turn)
28 | #pvalue[0]=1.*pow(10.,-7); pvalue[1]=1.*pow(10.,-4); pvalue[2]=math.pi/10.; pvalue[3] = -100.*math.sqrt(6.) +shift; pvalue[4]=1000.*math.sqrt(3.);# oscillating case (particle production case in paper)
29 |
30 |
31 | nF=PyT.nF() # use number of fields routine to get number of fields (can be used as a useful cross check)
32 | V = PyT.V(fields,pvalue) # calculate potential from some initial conditions
33 | dV=PyT.dV(fields,pvalue) # calculate derivatives of potential (changes dV to derivatives)
34 | initial = np.concatenate((fields,np.array([0.,0.]))) # set initial conditions to be in slow roll
35 | ############################################################################################################################################
36 | tols = np.array([10**-8,10**-8])
37 |
38 |
39 | ################################## run the background fiducial run #########################################################################
40 | Nstart = 0.0
41 | Nend = 40.
42 | t=np.linspace(Nstart, Nend, 1000)
43 | back = PyT.backEvolve(t, initial, pvalue,tols,False)
44 | #back = np.genfromtxt('../../runData/back.dat', dtype=None) #load data into python
45 | ############################################################################################################################################
46 |
47 | rank=comm.Get_rank()
48 |
49 | points = 500
50 |
51 | for ii in range(0,points):
52 | PhiExit = -100.*math.sqrt(6.) +shift -0.3 + ii*0.0015
53 | #PhiExit = -100.*math.sqrt(6.) +shift -0.3 + ii*0.0025 +1.0
54 | k = PyS.kexitPhi(PhiExit, 1, back, pvalue, PyT)
55 | kOut= np.append(kOut, k)
56 | PhiOut = np.append(PhiOut, PhiExit)
57 |
58 | zztot, zzztot, timestot = PyS.eqSpecMpi(kOut, back, pvalue, 5.0,tols, PyT)
59 |
60 | if rank ==0:
61 | fnlOut = 5.0/6*zzztot/(3.0*zztot**2)
62 | np.savetxt('dataT/EqBi.dat', (kOut,PhiOut,fnlOut,zzztot,zztot)) # x,y,z equal sized 1D arrays
63 |
64 |
65 |
66 | fig2 = plt.figure(2)
67 | plt.plot(phiOut, fnlOut, 'g',linewidth = 2)
68 | title('Reduced bispectrum in equilateral configuration',fontsize=15)
69 | grid(True)
70 | plt.legend(fontsize=15)
71 | ylabel('$fNL$', fontsize=20)
72 | xlabel('$\phi^*$', fontsize=15)
73 | grid(True)
74 | plt.legend(fontsize=15)
75 | plt.xlim(min(phiOut),max(phiOut))
76 | plt.savefig("LH1.png")
77 |
78 |
79 | fig3 = plt.figure(3)
80 | plt.plot(np.log(kOut/kOut[-1]), fnlOut, 'g',linewidth = 2)
81 | title('Reduced bispectrum in equilateral configuration',fontsize=15)
82 | grid(True)
83 | plt.legend(fontsize=15)
84 | ylabel(r'$fNL$', fontsize=20)
85 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15)
86 | grid(True)
87 | plt.legend(fontsize=15)
88 | #plt.xlim((0,5.65))
89 | plt.savefig("LH2.png")
90 |
91 |
92 |
93 |
94 | fig4 = plt.figure(4)
95 | G = 9./10*5./6.*1/3.*zzztot*kOut**6/zztot[-1]**2/kOut[-1]**6
96 | plt.plot(np.log(kOut/kOut[-1]), G, 'g',linewidth = 2)
97 | title(r'G quantity',fontsize=15)
98 | grid(True)
99 | plt.legend(fontsize=15)
100 | ylabel(r'$G/k^3$', fontsize=20)
101 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15)
102 | grid(True)
103 | plt.legend(fontsize=15)
104 | #plt.xlim((0,5.65))
105 | plt.savefig("LH3.png")
106 |
107 |
108 | fig5 = plt.figure(5)
109 | plt.plot(np.log(kOut/kOut[-1]), np.log(zztot/zztot[-1]*kOut**3/kOut[-1]**3), 'g',linewidth = 2)
110 | title('Power spectrum',fontsize=15)
111 | grid(True)
112 | plt.legend(fontsize=15)
113 | ylabel(r'$\log({\cal P}/{\cal P}_{\rm pivot})$', fontsize=20)
114 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15)
115 | grid(True)
116 | plt.legend(fontsize=15)
117 | #plt.xlim((0,5.65))
118 | plt.savefig("LH4.png")
119 |
120 | np.savetxt('test.dat', (kOut,phiOut,fnlOut,G,zztot)) # x,y,z equal sized 1D arrays
121 |
122 |
123 |
124 | plt.show(fig2)
125 | plt.show(fig3)
126 | plt.show(fig4)
127 | plt.show(fig5)
--------------------------------------------------------------------------------
/Examples/SingleField/MpiEqBi.py:
--------------------------------------------------------------------------------
1 | #################### generate equilateral bispectrum using PyTransPyStep setup ############################################################
2 |
3 | from matplotlib import pyplot as plt
4 |
5 | from pylab import *
6 | import sys
7 | import math
8 | import numpy as np
9 |
10 | from mpi4py import MPI
11 |
12 | location = "/Users/mulryne/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
13 | sys.path.append(location) # sets up python path to give access to PyTransSetup
14 |
15 | import PyTransSetup
16 | PyTransSetup.pathSet() # this sets the other paths that PyTransport uses
17 |
18 | import PyTransStep as PyT # import module
19 | import PyTransScripts as PyS
20 |
21 | ############################################################################################################################################
22 |
23 |
24 |
25 |
26 | ########################### initial field values ###########################################################################################
27 | tols = np.array([10**-8,10**-8])
28 |
29 | nF=PyT.nF() # gets number of fields (useful check)
30 | nP=PyT.nP() # gets number of parameters needed (useful check)
31 |
32 | fields = np.array([17.0])
33 |
34 | params = np.zeros(nP)
35 | params[0]=pow(10.,-5); params[1]=0.0018; params[2]=14.84; params[3]=0.022;
36 |
37 | V = PyT.V(fields,params) # calculate potential from some initial conditions
38 | dV=PyT.dV(fields,params) # calculate derivatives of potential (changes dV to derivatives)
39 |
40 | initial = np.array([fields,-dV/np.sqrt(3.*V)]) # set initial conditions to be in slow roll
41 | ############################################################################################################################################
42 |
43 |
44 |
45 |
46 | ################################## run the background fiducial run #########################################################################
47 | Nstart = 0.0
48 | Nend = 40.0
49 | t=np.linspace(Nstart, Nend, 1000)
50 | back = PyT.backEvolve(t, initial, params,tols,False)
51 | #back = np.genfromtxt('../../runData/back.dat', dtype=None) #load data into python
52 | ############################################################################################################################################
53 |
54 |
55 | ################################## Calculate power spectrum and bispectrum for equilateral configs ########################################
56 | points = 5
57 |
58 | comm = MPI.COMM_WORLD
59 | rank=comm.Get_rank()
60 |
61 | kOut = np.array([])
62 | PhiOut = np.array([])
63 |
64 | for ii in range(0,points):
65 | PhiExit = params[2] + .36 - ii*0.001
66 | k = PyS.kexitPhi(PhiExit, 1, back, params, PyT)
67 | kOut= np.append(kOut, k)
68 | PhiOut = np.append(PhiOut, PhiExit)
69 |
70 | zzOut, zzzOut, times = PyS.eqSpecMpi(kOut, back, params, 5.0,tols, PyT)
71 |
72 | if rank==0:
73 | np.savetxt('data/eqDataT.dat', (kOut,PhiOut,zzOut,zzzOut,times)) # x,y,z equal sized 1D arrays
74 | fnlOut = 5.0/6*zzzOut/(3.0*zzOut**2)
75 |
76 | ############################################## Plots ######################################################################################
77 | fig2 = plt.figure(2)
78 | plt.plot(PhiOut, fnlOut, 'g',linewidth = 2)
79 | title('Reduced bispectrum in equilateral configuration',fontsize=15)
80 | grid(True)
81 | plt.legend(fontsize=15)
82 | ylabel('$fNL$', fontsize=20)
83 | xlabel('$\phi^*$', fontsize=15)
84 | grid(True)
85 | plt.legend(fontsize=15)
86 | plt.xlim(min(PhiOut),max(PhiOut))
87 | plt.savefig("CEL1.png")
88 |
89 |
90 | fig3 = plt.figure(3)
91 | logk = np.log(kOut/kOut[-1])
92 | plt.plot(logk, fnlOut, 'g',linewidth = 2)
93 | title('Reduced bispectrum in equilateral configuration',fontsize=15)
94 | grid(True)
95 | plt.legend(fontsize=15)
96 | ylabel(r'$fNL$', fontsize=20)
97 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15)
98 | grid(True)
99 | plt.legend(fontsize=15)
100 | plt.xlim(np.min(logk),np.max(logk))
101 | plt.savefig("CEL2.png")
102 |
103 |
104 |
105 |
106 | fig4 = plt.figure(4)
107 | G = 9./10*5./6.*1/3.*zzzOut*kOut**6/zzOut[-1]**2/kOut[-1]**6
108 | plt.plot(logk, G, 'g',linewidth = 2)
109 | title(r'G quantity',fontsize=15)
110 | grid(True)
111 | plt.legend(fontsize=15)
112 | ylabel(r'$G/k^3$', fontsize=20)
113 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15)
114 | grid(True)
115 | plt.legend(fontsize=15)
116 | plt.xlim(np.min(logk),np.max(logk))
117 | plt.savefig("CEL3.png")
118 |
119 |
120 | fig5 = plt.figure(5)
121 | plt.plot(logk, np.log(zzOut/zzOut[-1]*kOut**3/kOut[-1]**3), 'g',linewidth = 2)
122 | title('Power spectrum',fontsize=15)
123 | grid(True)
124 | plt.legend(fontsize=15)
125 | ylabel(r'$\log({\cal P}/{\cal P}_{\rm pivot})$', fontsize=20)
126 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15)
127 | grid(True)
128 | plt.legend(fontsize=15)
129 | plt.xlim(np.min(logk),np.max(logk))
130 | plt.savefig("CEL4.png")
131 |
132 | plt.show(fig2)
133 | plt.show(fig3)
134 | plt.show(fig4)
135 | plt.show(fig5)
136 | print "\n\n process", rank, "done \n\n"
137 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/PaperPerformanceDataPlots/timing.py:
--------------------------------------------------------------------------------
1 | #################### generate power spectrum using MTeasyDQuad installed using the setup file which accompanies this one #########################
2 |
3 | from matplotlib import pyplot as plt # import package for plotting
4 | from pylab import * # contains some useful stuff for plotting
5 | import timeit # imports a package that allows us to see how long processes take
6 | import math # imports math package
7 | import numpy as np # imports numpu package as np for short
8 | import sys # imports sys package for sue below
9 | ############################################################################################################################################
10 |
11 | #This file contains simple examples of using the MTeasyDQuad
12 | #It assumes the DQuadSetup file has been run to install a double quadratic version of MTeasyPy
13 | #It is recommended you restart the kernel before running this file to insure any updates to MTeasyPyDQuad are imported
14 |
15 | location = "/Users/david/Dropbox/MTeasyDist/MTeasy/" # this should be the location of the MTeasy folder
16 | sys.path.append(location) # sets up python path to give access to MTeasySetup
17 |
18 | import MTeasySetup
19 | MTeasySetup.pathSet() # his add sets the other paths that MTeasy uses
20 |
21 | import MTeasyPyDQuad as MTE # import module as MTE (MTeasyDQuad is quite long to type each time and it saves time to use a shorter name
22 | # using a generic name MTE means the file can be more easily reused for a different example (once field values
23 | # etc are altered)
24 | import MTeasyScripts as MTS # import the scripts module as MTS for convenience
25 |
26 | ###########################################################################################################################################
27 |
28 | ########################### set up initial conditions for background run ##################################################################
29 | fields = np.array([12.9, 10.0]) # we set up a numpy array which contains the values of the fields
30 |
31 | nP=MTE.nP() # the .nP() function gets the number of parameters needed for the potential -- this can be used as a useful crosscheck
32 | params = np.zeros(nP)
33 | params[0]=10.0**(-5.0); params[1]=9.0*10.0**(-5.0) # we set up numpy array which contains values of the parameters
34 |
35 | nF=MTE.nF() # use number of fields routine to get number of fields (can be used as a useful cross check)
36 |
37 | V = MTE.V(fields,params) # calculate potential from some initial conditions
38 | dV=MTE.dV(fields,params) # calculate derivatives of potential
39 |
40 | initial = np.concatenate((fields, -dV/np.sqrt(3* V))) # sets an array containing field values and there derivative in cosmic time
41 | # (set using the slow roll equation)
42 | ############################################################################################################################################
43 |
44 |
45 |
46 | ################################## run the background fiducial run ################################################################
47 | Nstart = 0.0
48 | Nend = 65.0
49 | t=np.linspace(Nstart, Nend, 1000)
50 |
51 | back = MTE.backEvolve(t, initial, params)
52 | ###########################################################################################################################################
53 |
54 |
55 | ###########################################################################################################################################
56 | # set up k values
57 | kt = MTS.kexitN(24.5,back,params,MTE)
58 |
59 |
60 | alpha = 0.0; beta = .99
61 | kt=3.*kt
62 | k1 = kt/2. - beta*kt/2.; k2 = kt/4.*(1.+alpha+beta); k3 = kt/4.*(1.-alpha+beta)
63 | kM = min(k1,k2,k3)
64 | NBefore = np.linspace(2,8,20)
65 | zzzOut = np.zeros(np.size(NBefore)); zz1Out = np.zeros(np.size(NBefore)); zz2Out = np.zeros(np.size(NBefore)); zz3Out = np.zeros(np.size(NBefore)); times = np.zeros(np.size(NBefore));
66 |
67 |
68 | for ii in range(0,np.size(NBefore)):
69 | print ii
70 | Nstart, backExitMinus = MTS.ICsBE(NBefore[ii], kM, back, params, MTE)
71 | timebefore = timeit.default_timer()
72 | t=np.linspace(Nstart,Nend, 10) # array at which output is returned -- initial value should correspond to initial field values
73 | threePt = MTE.alphaEvolve(t,k1,k2,k3, backExitMinus,params,0)
74 | time = timeit.default_timer() - timebefore
75 | zzzOut[ii] = threePt[-1,4]; zz1Out[ii] = threePt[-1,1]; zz2Out[ii] = threePt[-1,2]; zz3Out[ii] = threePt[-1,3];
76 | times[ii] = time
77 |
78 | fig1 = plt.figure(1)
79 | plt.scatter(NBefore,times)
80 | #ylim([9./10.*np.min(times),10./9.*np.max(times)])
81 | grid(True); plt.legend(fontsize=15); ylabel(r'time taken', fontsize=20);
82 | xlabel(r'e-folds before exit', fontsize=15); grid(True); yscale('log'); plt.legend(fontsize=15); plt.savefig("times4.png")
83 |
84 | fig2 = plt.figure(2)
85 | DBi=zzzOut*k1**2*k2**2*k3**2
86 | plt.scatter(NBefore,DBi)
87 | ylim([9./10.*np.min(DBi),10./9.*np.max(DBi)])
88 | grid(True); plt.legend(fontsize=15); ylabel(r'dimensionless bisecptrum', fontsize=20);
89 | xlabel(r'e-folds before exit', fontsize=15); grid(True); plt.legend(fontsize=15); plt.savefig("DBiCon4.png")
90 |
91 |
92 | np.savetxt('data/timesSq2.dat', (zzzOut,zz1Out,zz2Out,zz3Out,times)) # x,y,z equal sized 1D arrays
93 |
94 |
--------------------------------------------------------------------------------
/Examples/LH/SpectraExample.py:
--------------------------------------------------------------------------------
1 | ####################################### Langlois Spectra example of basic PyTransport functions ###########################################
2 | from matplotlib import pyplot as plt
3 | import time
4 | import imp
5 | from pylab import *
6 | import numpy as np
7 | from scipy import interpolate
8 | import sympy as sym
9 | import subprocess
10 | ############################################################################################################################################
11 |
12 | ############################################################################################################################################
13 |
14 | #This file contains simple examples of using the PyTransport package for the heavy field example of Langlois.
15 | #It assumes the LangHeavySeptup file has been run to install a LH version of PyTransport
16 | #It is recommended you restart the kernel to insure any updates to PyTransLH are imported
17 |
18 | location = "/Users/mulryne/Dropbox/PyTransportDist/PyTransport/" # this should be the location of the PyTransport folder
19 | sys.path.append(location) # sets up python path to give access to PyTransSetup
20 |
21 | import PyTransSetup
22 | PyTransSetup.pathSet() # his add sets the other paths that PyTransport uses
23 |
24 | import PyTransLH as PyT; # import module
25 | import PyTransScripts as PyS;
26 |
27 | # Example
28 |
29 | ########################### set initial field values and parameters for a simple example run ###################################################
30 | shift=231.
31 | fields = np.array([-2.0-100.*math.sqrt(6.) +shift, 2.0*math.tan(math.pi/20.)])
32 |
33 | nF=PyT.nF() # gets number of fields (useful check)
34 | nP=PyT.nP() # gets number of parameters needed (useful check)
35 |
36 | params = np.zeros(nP)
37 | params[0]=1.*pow(10.,-7); params[1]=1.*pow(10.,-4); params[2]=math.pi/10.; params[3] = -100.*math.sqrt(6.) +shift; params[4]=10.*math.sqrt(3.);
38 |
39 | V = PyT.V(fields,params) # calculate potential from some initial conditions
40 | dV=PyT.dV(fields,params) # calculate derivatives of potential (changes dV to derivatives)
41 | initial = np.concatenate((fields,np.array([0.,0.]))) # set initial conditions using slow roll expression
42 | ############################################################################################################################################
43 | ###########################################################################################################################################
44 | tols = np.array([10**-8,10**-8])
45 |
46 | ################################## run the background fiducial run #########################################################################
47 | Nstart = -5.0
48 | Nend = 30.
49 | t=np.linspace(Nstart, Nend, 1000)
50 | back = PyT.backEvolve(t, initial, params,tols,False)
51 | #back = np.genfromtxt('../../runData/back.dat', dtype=None) #load data into python
52 | # plot background
53 | fig1 = plt.figure(1)
54 | plt.plot(back[:,0], back[:,2 ], 'r')
55 | plt.plot(back[:,0], back[:,1 ], 'g') # always good to inspect this plot to make sure its senisble
56 | ############################################################################################################################################
57 |
58 |
59 | fnlOut=np.array([])
60 | kOut=np.array([])
61 | PhiOut=np.array([])
62 |
63 | # set up the points at which we want to know power spectrum and bispectrum in equilateral configuration
64 | for ii in range(0,50):
65 | PhiExit = -100.*math.sqrt(6.) + shift -0.1 + ii*0.011
66 | PhiOut = np.append(PhiOut, PhiExit)
67 | k = PyS.kexitPhi(PhiExit, 1, back, params, PyT)
68 | kOut= np.append(kOut, k)
69 |
70 | zzOut , zzzOut, times = PyS.eqSpectra(kOut, back, params, 4.0,tols, PyT)
71 |
72 | fnlOut = 5./6*zzzOut/(3.0*zzOut**2)
73 |
74 |
75 | fig2 = plt.figure(2)
76 | plt.plot(PhiOut, fnlOut, 'g',linewidth = 2)
77 | title('Reduced bispectrum in equilateral configuration',fontsize=15)
78 | grid(True)
79 | plt.legend(fontsize=15)
80 | ylabel('$fNL$', fontsize=20)
81 | xlabel('$\phi^*$', fontsize=15)
82 | grid(True)
83 | plt.legend(fontsize=15)
84 | plt.xlim(min(PhiOut),max(PhiOut))
85 | plt.savefig("LH1.png")
86 |
87 |
88 | fig3 = plt.figure(3)
89 | plt.plot(np.log(kOut/kOut[-1]), fnlOut, 'g',linewidth = 2)
90 | title('Reduced bispectrum in equilateral configuration',fontsize=15)
91 | grid(True)
92 | plt.legend(fontsize=15)
93 | ylabel(r'$fNL$', fontsize=20)
94 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15)
95 | grid(True)
96 | plt.legend(fontsize=15)
97 | #plt.xlim((0,5.65))
98 | plt.savefig("LH2.png")
99 |
100 |
101 |
102 | fig4 = plt.figure(4)
103 | G = 9./10*5./6.*1/3.*zzzOut*kOut**6/zzOut[-1]**2/kOut[-1]**6
104 | plt.plot(log(kOut/kOut[-1]), G, 'g',linewidth = 2)
105 | title(r'G quantity',fontsize=15)
106 | grid(True)
107 | plt.legend(fontsize=15)
108 | ylabel(r'$G/k^3$', fontsize=20)
109 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15)
110 | grid(True)
111 | plt.legend(fontsize=15)
112 | #plt.xlim((0,5.65))
113 | plt.savefig("LH3.png")
114 |
115 |
116 | fig5 = plt.figure(5)
117 | plt.plot(np.log(kOut/kOut[-1]), np.log(zzOut/zzOut[-1]*kOut**3/kOut[-1]**3), 'g',linewidth = 2)
118 | title('Power spectrum',fontsize=15)
119 | grid(True)
120 | plt.legend(fontsize=15)
121 | ylabel(r'$\log({\cal P}/{\cal P}_{\rm pivot})$', fontsize=20)
122 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15)
123 | grid(True)
124 | plt.legend(fontsize=15)
125 | #plt.xlim((0,5.65))
126 | plt.savefig("LH4.png")
127 |
128 |
129 | plt.show(fig1)
130 | plt.show(fig2)
131 | plt.show(fig3)
132 | plt.show(fig4)
133 | plt.show(fig5)
134 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/timing.py:
--------------------------------------------------------------------------------
1 | #################### Timing using PyTransDQuad installed using the setup file which accompanies this one #########################
2 |
3 | from matplotlib import pyplot as plt # import package for plotting
4 | from pylab import * # contains some useful stuff for plotting
5 | import timeit # imports a package that allows us to see how long processes take
6 | import math # imports math package
7 | import numpy as np # imports numpu package as np for short
8 | import sys # imports sys package for sue below
9 | ############################################################################################################################################
10 | tols = np.array([10**-8,10**-8])
11 | #This file contains simple examples of using the PyTransDQuad
12 | #It assumes the DQuadSetup file has been run to install a double quadratic version of PyTransport
13 | #It is recommended you restart the kernel before running this file to insure any updates to PyTransDQuad are imported
14 |
15 | location = "/home/jwr/Code/June/PyTransport2Dist/PyTransport/" # this should be the location of the PyTransport folder
16 | sys.path.append(location) # sets up python path to give access to PyTransSetup
17 |
18 | import PyTransSetup
19 | PyTransSetup.pathSet() # his add sets the other paths that PyTransport uses
20 |
21 | import PyTransDQuad as PyT # import module as PyT (PyTransDQuad is quite long to type each time and it saves time to use a shorter name
22 | # using a generic name PyT means the file can be more easily reused for a different example (once field values
23 | # etc are altered)
24 | import PyTransScripts as PyS # import the scripts module as PyS for convenience
25 |
26 | ###########################################################################################################################################
27 |
28 | ########################### set up initial conditions for background run ##################################################################
29 | fields = np.array([12.9, 10.0]) # we set up a numpy array which contains the values of the fields
30 |
31 | nP=PyT.nP() # the .nP() function gets the number of parameters needed for the potential -- this can be used as a useful crosscheck
32 | params = np.zeros(nP)
33 | params[0]=10.0**(-5.0); params[1]=9.0*10.0**(-5.0) # we set up numpy array which contains values of the parameters
34 |
35 | nF=PyT.nF() # use number of fields routine to get number of fields (can be used as a useful cross check)
36 |
37 | V = PyT.V(fields,params) # calculate potential from some initial conditions
38 | dV=PyT.dV(fields,params) # calculate derivatives of potential
39 |
40 | initial = np.concatenate((fields, -dV/np.sqrt(3* V))) # sets an array containing field values and there derivative in cosmic time
41 | # (set using the slow roll equation)
42 | ############################################################################################################################################
43 |
44 |
45 |
46 | ################################## run the background fiducial run ################################################################
47 | Nstart = 0.0
48 | Nend = 60
49 | t=np.linspace(Nstart, Nend, 1000)
50 |
51 | back = PyT.backEvolve(t, initial, params,tols,False)
52 | ###########################################################################################################################################
53 |
54 |
55 | ###########################################################################################################################################
56 | # set up k values
57 | kt = PyS.kexitN(19.0,back,params,PyT)
58 | #19.0 first exit time
59 | #24.5 second exit time
60 | print kt
61 | pause(10)
62 | alpha = 0.0; beta = 1/3.
63 | #alpha = 0.0; beta = .99
64 | kt=3.*kt
65 | k1 = kt/2. - beta*kt/2.; k2 = kt/4.*(1.+alpha+beta); k3 = kt/4.*(1.-alpha+beta)
66 | kM = min(k1,k2,k3)
67 | #NBefore = np.linspace(3,8,20)
68 | NBefore = 5.0
69 | tolarr=np.linspace(4,12,20)
70 | zzzOut = np.zeros(np.size(tolarr)); zz1Out = np.zeros(np.size(tolarr)); zz2Out = np.zeros(np.size(tolarr)); zz3Out = np.zeros(np.size(tolarr)); times = np.zeros(np.size(tolarr));
71 |
72 |
73 | for ii in range(0,np.size(tolarr)):
74 | print ii
75 | tols = np.array([10**(-1.0*tolarr[ii]),10**(-1.0*tolarr[ii])])
76 | Nstart, backExitMinus = PyS.ICsBE(NBefore, kM, back, params, PyT)
77 | timebefore = timeit.default_timer()
78 |
79 | t=np.linspace(Nstart,Nend, 10) # array at which output is returned -- initial value should correspond to initial field values
80 | threePt = PyT.alphaEvolve(t,k1,k2,k3, backExitMinus,params,tols,True)
81 | time = timeit.default_timer() - timebefore
82 | zzzOut[ii] = threePt[-1,4]; zz1Out[ii] = threePt[-1,1]; zz2Out[ii] = threePt[-1,2]; zz3Out[ii] = threePt[-1,3];
83 | times[ii] = time
84 |
85 | fig1 = plt.figure(1)
86 | plt.scatter(tolarr,times)
87 | ylim([9./10.*np.min(times),10./9.*np.max(times)])
88 | grid(True); plt.legend(fontsize=15); ylabel(r'time taken', fontsize=20);
89 | #xlabel(r'e-folds before exit', fontsize=15); grid(True); yscale('log'); plt.legend(fontsize=15); plt.savefig("eqc1.png")
90 | xlabel(r'Tolerance', fontsize=15); grid(True); yscale('log'); plt.legend(fontsize=15); plt.savefig("eqnc1tol.png")
91 |
92 | fig2 = plt.figure(2)
93 |
94 | DBi=zzzOut*k1**2*k2**2*k3**2
95 | plt.scatter(tolarr,DBi)
96 | ylim([9./10.*np.min(DBi),10./9.*np.max(DBi)])
97 | grid(True); plt.legend(fontsize=15); ylabel(r'dimensionless bisecptrum', fontsize=20);
98 | xlabel(r'Tolerance', fontsize=15);grid(True); plt.legend(fontsize=15); plt.savefig("eqnc2tol.png")
99 | plt.show()
100 |
101 | np.savetxt('dataeq/timenctol.dat', (zzzOut,zz1Out,zz2Out,zz3Out,times)) # x,y,z equal sized 1D arrays
102 |
103 |
--------------------------------------------------------------------------------
/PyTransport/CppTrans/fieldmetric.h:
--------------------------------------------------------------------------------
1 | //#This file is part of PyTransport.
2 |
3 | //#PyTransport is free software: you can redistribute it and/or modify
4 | //#it under the terms of the GNU General Public License as published by
5 | //#the Free Software Foundation, either version 3 of the License, or
6 | //#(at your option) any later version.
7 |
8 | //#PyTransport is distributed in the hope that it will be useful,
9 | //#but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | //#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | //#GNU General Public License for more details.
12 |
13 | //#You should have received a copy of the GNU General Public License
14 | //#along with PyTransport. If not, see .
15 |
16 | // This file contains a prototype of the potential.h file of PyTransport -- it is edited by the PyTransScripts module
17 |
18 | #ifndef FIELDMETRIC_H // Prevents the class being re-defined
19 | #define FIELDMETRIC_H
20 |
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | using namespace std;
28 |
29 |
30 | class fieldmetric
31 | {
32 | private:
33 | int nF; // field number
34 | int nP; // params number which definFs potential
35 |
36 | public:
37 | fieldmetric()
38 | {
39 | // #FP
40 | nF=2;
41 | nP=3;
42 |
43 | }
44 |
45 |
46 | //calculates fieldmetic()
47 | vector fmetric(vector f, vector p)
48 | {
49 | vector FM((2*nF)*(2*nF),0.0) ;
50 |
51 | // metric
52 | double x0 = std::pow(p[2], 2.0);
53 | double x1 = 1.0/x0;
54 | double x2 = std::pow(std::sin(f[0]), 2.0);
55 |
56 | FM[0]=x1;
57 |
58 | FM[1]=0;
59 |
60 | FM[2]=1;
61 |
62 | FM[3]=0;
63 |
64 | FM[4]=0;
65 |
66 | FM[5]=x1/x2;
67 |
68 | FM[6]=0;
69 |
70 | FM[7]=1;
71 |
72 | FM[8]=1;
73 |
74 | FM[9]=0;
75 |
76 | FM[10]=x0;
77 |
78 | FM[11]=0;
79 |
80 | FM[12]=0;
81 |
82 | FM[13]=1;
83 |
84 | FM[14]=0;
85 |
86 | FM[15]=x0*x2;
87 |
88 | return FM;
89 | }
90 |
91 |
92 |
93 | //calculates ChristoffelSymbole()
94 | vector Chroff(vector f, vector p)
95 | {
96 | vector CS((2*nF)*(2*nF)*(2*nF),0.0);
97 |
98 | // Christoffel
99 | double x0 = std::pow(std::sin(f[0]), 1.0);
100 | double x1 = 1.0*std::cos(f[0]);
101 | double x2 = x1/x0;
102 |
103 | CS[0]=0;
104 |
105 | CS[1]=0;
106 |
107 | CS[2]=0;
108 |
109 | CS[3]=0;
110 |
111 | CS[4]=0;
112 |
113 | CS[5]=0;
114 |
115 | CS[6]=0;
116 |
117 | CS[7]=0;
118 |
119 | CS[8]=0;
120 |
121 | CS[9]=0;
122 |
123 | CS[10]=0;
124 |
125 | CS[11]=0;
126 |
127 | CS[12]=0;
128 |
129 | CS[13]=0;
130 |
131 | CS[14]=0;
132 |
133 | CS[15]=-x0*x1;
134 |
135 | CS[16]=0;
136 |
137 | CS[17]=0;
138 |
139 | CS[18]=0;
140 |
141 | CS[19]=0;
142 |
143 | CS[20]=0;
144 |
145 | CS[21]=0;
146 |
147 | CS[22]=0;
148 |
149 | CS[23]=0;
150 |
151 | CS[24]=0;
152 |
153 | CS[25]=0;
154 |
155 | CS[26]=0;
156 |
157 | CS[27]=x2;
158 |
159 | CS[28]=0;
160 |
161 | CS[29]=0;
162 |
163 | CS[30]=x2;
164 |
165 | CS[31]=0;
166 |
167 | CS[32]=0;
168 |
169 | CS[33]=0;
170 |
171 | CS[34]=0;
172 |
173 | CS[35]=0;
174 |
175 | CS[36]=0;
176 |
177 | CS[37]=0;
178 |
179 | CS[38]=0;
180 |
181 | CS[39]=0;
182 |
183 | CS[40]=0;
184 |
185 | CS[41]=0;
186 |
187 | CS[42]=0;
188 |
189 | CS[43]=0;
190 |
191 | CS[44]=0;
192 |
193 | CS[45]=0;
194 |
195 | CS[46]=0;
196 |
197 | CS[47]=0;
198 |
199 | CS[48]=0;
200 |
201 | CS[49]=0;
202 |
203 | CS[50]=0;
204 |
205 | CS[51]=0;
206 |
207 | CS[52]=0;
208 |
209 | CS[53]=0;
210 |
211 | CS[54]=0;
212 |
213 | CS[55]=0;
214 |
215 | CS[56]=0;
216 |
217 | CS[57]=0;
218 |
219 | CS[58]=0;
220 |
221 | CS[59]=0;
222 |
223 | CS[60]=0;
224 |
225 | CS[61]=0;
226 |
227 | CS[62]=0;
228 |
229 | CS[63]=0;
230 |
231 | return CS;
232 | }
233 |
234 |
235 |
236 | // calculates RiemannTensor()
237 | vector Riemn(vector f, vector p)
238 | {
239 | vector RM((nF)*(nF)*(nF)*(nF),0.0);
240 |
241 | // Riemann
242 | double x0 = 1.0*std::pow(p[2], 2.0)*std::pow(std::sin(f[0]), 2.0);
243 | double x1 = -x0;
244 |
245 | RM[0]=0;
246 |
247 | RM[1]=0;
248 |
249 | RM[2]=0;
250 |
251 | RM[3]=0;
252 |
253 | RM[4]=0;
254 |
255 | RM[5]=x0;
256 |
257 | RM[6]=x1;
258 |
259 | RM[7]=0;
260 |
261 | RM[8]=0;
262 |
263 | RM[9]=x1;
264 |
265 | RM[10]=x0;
266 |
267 | RM[11]=0;
268 |
269 | RM[12]=0;
270 |
271 | RM[13]=0;
272 |
273 | RM[14]=0;
274 |
275 | RM[15]=0;
276 |
277 | return RM;
278 | }
279 |
280 | // calculates RiemannTensor() covariant derivatives
281 | vector Riemncd(vector f, vector p)
282 | {
283 | vector RMcd((nF)*(nF)*(nF)*(nF)*(nF),0.0);
284 |
285 | // Riemanncd
286 |
287 | RMcd[0]=0;
288 |
289 | RMcd[1]=0;
290 |
291 | RMcd[2]=0;
292 |
293 | RMcd[3]=0;
294 |
295 | RMcd[4]=0;
296 |
297 | RMcd[5]=0;
298 |
299 | RMcd[6]=0;
300 |
301 | RMcd[7]=0;
302 |
303 | RMcd[8]=0;
304 |
305 | RMcd[9]=0;
306 |
307 | RMcd[10]=0;
308 |
309 | RMcd[11]=0;
310 |
311 | RMcd[12]=0;
312 |
313 | RMcd[13]=0;
314 |
315 | RMcd[14]=0;
316 |
317 | RMcd[15]=0;
318 |
319 | RMcd[16]=0;
320 |
321 | RMcd[17]=0;
322 |
323 | RMcd[18]=0;
324 |
325 | RMcd[19]=0;
326 |
327 | RMcd[20]=0;
328 |
329 | RMcd[21]=0;
330 |
331 | RMcd[22]=0;
332 |
333 | RMcd[23]=0;
334 |
335 | RMcd[24]=0;
336 |
337 | RMcd[25]=0;
338 |
339 | RMcd[26]=0;
340 |
341 | RMcd[27]=0;
342 |
343 | RMcd[28]=0;
344 |
345 | RMcd[29]=0;
346 |
347 | RMcd[30]=0;
348 |
349 | RMcd[31]=0;
350 |
351 | return RMcd;
352 | }
353 |
354 | int getnF()
355 | {
356 | return nF;
357 | }
358 |
359 |
360 |
361 | };
362 | #endif
363 |
364 |
--------------------------------------------------------------------------------
/Examples/SingleField/SpectraExample.py:
--------------------------------------------------------------------------------
1 | ####################################### PyTransPyStep simple example of basic functions ###########################################
2 | from matplotlib import pyplot as plt
3 | import time
4 | import imp
5 | from pylab import *
6 | import numpy as np
7 | from scipy import interpolate
8 | import sympy as sym
9 | import subprocess
10 | ############################################################################################################################################
11 |
12 |
13 |
14 |
15 | ############################################################################################################################################
16 |
17 | #This file contains simple examples of using the PyTransport package for the single field example of Chen et al.
18 | #It assumes the StepExampleSeptup file has been run to install a Step version of PyTransPyStep
19 | #It is recommended you restart the kernel to insure any updates to PyTransPyStep are imported
20 |
21 | location = "/Users/David/Dropbox/MTeasyDist/MTeasy/" # this should be the location of the PyTransport folder
22 | sys.path.append(location) # sets up python path to give access to PyTransSetup
23 |
24 | import PyTransSetup
25 | PyTransSetup.pathSet() # his add sets the other paths that PyTransport uses
26 |
27 | import PyTransPyStep as MTSE; # import module
28 | import PyTransScripts as MTS;
29 | ###########################################################################################################################################
30 |
31 |
32 |
33 | # Example
34 | tols = np.array([10**-8,10**-8])
35 |
36 | #################################### set initial field values and parameters #############################################################
37 |
38 | nF=MTSE.nF() # gets number of fields (useful check)
39 | nP=MTSE.nP() # gets number of parameters needed (useful check)
40 |
41 | fields = np.array([17.0])
42 |
43 | params = np.zeros(nP)
44 | params[0]=pow(10.,-5); params[1]=0.0018; params[2]=14.84; params[3]=0.022;
45 |
46 | V = MTSE.V(fields,params) # calculate potential from some initial conditions
47 | dV=MTSE.dV(fields,params) # calculate derivatives of potential (changes dV to derivatives)
48 |
49 | initial = np.array([fields,-dV/np.sqrt(3.*V)]) # set initial conditions to be in slow roll
50 | ############################################################################################################################################
51 |
52 |
53 |
54 |
55 | ################################## run the background fiducial run #########################################################################
56 | Nstart = 0.0
57 | Nend = 40.0
58 | t=np.linspace(Nstart, Nend, 1000)
59 | back = MTSE.backEvolve(t, initial, params,tols,False)
60 | #back = np.genfromtxt('../../runData/back.dat', dtype=None) #load data into python
61 | # plot background
62 | fig1 = plt.figure(1)
63 | plt.plot(back[:,0], back[:,2 ], 'r')
64 | plt.plot(back[:,0], back[:,1 ], 'g') # always good to inspect this plot to make sure its senisble
65 | ###########################################################################################################################################
66 |
67 |
68 |
69 |
70 | ################################## Calculate power spectrum and bispectrum for equilateral configs ########################################
71 | fnlOut=np.array([])
72 | kOut=np.array([])
73 | PhiOut=np.array([])
74 |
75 | # set up the points at which we want to know power spectrum and bispectrum in equilateral configuration
76 | for ii in range(0,100):
77 | PhiExit = params[2] + .4 - ii*0.01
78 | PhiOut = np.append(PhiOut, PhiExit)
79 | k = MTS.kexitPhi(PhiExit, 1, back, params, MTSE)
80 | kOut= np.append(kOut, k)
81 |
82 | zzOut , zzzOut, times = MTS.eqSpectra(kOut, back, params, 5.0,tols, MTSE)
83 |
84 | fnlOut = 5./6*zzzOut/(3.0*zzOut**2)
85 | ############################################################################################################################################
86 |
87 |
88 |
89 |
90 | ################################################# Some plots ###############################################################################
91 | fig2 = plt.figure(2)
92 | plt.plot(PhiOut, fnlOut, 'g',linewidth = 2)
93 | title('Reduced bispectrum in equilateral configuration',fontsize=15)
94 | grid(True)
95 | plt.legend(fontsize=15)
96 | ylabel('$fNL$', fontsize=20)
97 | xlabel('$\phi^*$', fontsize=15)
98 | grid(True)
99 | plt.legend(fontsize=15)
100 | plt.xlim(min(PhiOut),max(PhiOut))
101 | plt.savefig("CEL1.png")
102 |
103 |
104 | fig3 = plt.figure(3)
105 | logk = np.log(kOut/kOut[-1])
106 | plt.plot(logk, fnlOut, 'g',linewidth = 2)
107 | title('Reduced bispectrum in equilateral configuration',fontsize=15)
108 | grid(True)
109 | plt.legend(fontsize=15)
110 | ylabel(r'$fNL$', fontsize=20)
111 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15)
112 | grid(True)
113 | plt.legend(fontsize=15)
114 | plt.xlim(np.min(logk),np.max(logk))
115 | plt.savefig("CEL2.png")
116 |
117 |
118 |
119 |
120 | fig4 = plt.figure(4)
121 | G = 9./10*5./6.*1/3.*zzzOut*kOut**6/zzOut[-1]**2/kOut[-1]**6
122 | plt.plot(logk, G, 'g',linewidth = 2)
123 | title(r'G quantity',fontsize=15)
124 | grid(True)
125 | plt.legend(fontsize=15)
126 | ylabel(r'$G/k^3$', fontsize=20)
127 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15)
128 | grid(True)
129 | plt.legend(fontsize=15)
130 | plt.xlim(np.min(logk),np.max(logk))
131 | plt.savefig("CEL3.png")
132 |
133 |
134 | fig5 = plt.figure(5)
135 | plt.plot(logk, np.log(zzOut/zzOut[-1]*kOut**3/kOut[-1]**3), 'g',linewidth = 2)
136 | title('Power spectrum',fontsize=15)
137 | grid(True)
138 | plt.legend(fontsize=15)
139 | ylabel(r'$\log({\cal P}/{\cal P}_{\rm pivot})$', fontsize=20)
140 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15)
141 | grid(True)
142 | plt.legend(fontsize=15)
143 | plt.xlim(np.min(logk),np.max(logk))
144 | plt.savefig("CEL4.png")
145 |
146 |
147 | plt.show(fig1)
148 | plt.show(fig2)
149 | plt.show(fig3)
150 | plt.show(fig4)
151 | plt.show(fig5)
--------------------------------------------------------------------------------
/Examples/QuartAx/Plots.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #################### generate plots ############################################################
3 | from pylab import *
4 | from mpl_toolkits.mplot3d import Axes3D
5 | import numpy as np
6 | from scipy import interpolate
7 | from scipy.interpolate import griddata
8 | import matplotlib.pyplot as plt
9 | from numpy.random import uniform, seed
10 | from matplotlib.mlab import griddata
11 | #import numpy.ma as ma
12 |
13 | # load 3D data
14 | bet = np.load('data/bet.npy'); alp= np.load('data/alp.npy'); Bztot = np.load('data/alBetBi.npy'); snaps = np.load('data/snaps.npy');
15 | Pz1tot = np.load('data/alBetPz1.npy'); Pz2tot=np.load('data/alBetPz2.npy'); Pz3tot=np.load('data/alBetPz3.npy')
16 | #snap = 95
17 | snap = 140
18 |
19 |
20 | fnlOut = 5.0/6*Bztot[:,:,snap]/(Pz1tot[:,:,snap]*Pz2tot[:,:,snap] + Pz1tot[:,:,snap]*Pz3tot[:,:,snap] + Pz2tot[:,:,snap]*Pz3tot[:,:,snap])
21 | k = 1543.9416122555126
22 | kt = k; k1 = kt/2 - bet*kt/2.; k2 = kt/4*(1+alp+bet); k3 = kt/4*(1-alp+bet)
23 | DBi = Bztot[:,:,snap]*( k1*k2*k3 )**2./(Bztot[np.size(alp[:,0])//2,np.size(alp[0,:])//3,snap]*( k1[np.size(alp[:,0])//2,np.size(alp[0,:])//3]*k2[np.size(alp[:,0])/2,np.size(alp[0,:])/3]*k3[np.size(alp[:,0])/2,np.size(alp[0,:])/3] )**2.)
24 |
25 | #X=np.linspace(-1,1,100); Y=np.linspace(0,1,1F00)
26 | #Y, X = np.meshgrid(X, Y)
27 | #a=np.reshape(alp,(np.size(alp)));b=reshape(bet,(np.size(bet)));f=reshape(fnlOut,np.size(fnlOut));X=reshape(X,np.size(X));Y=reshape(Y,np.size(Y))
28 | #F=griddata(a,b,f, X,Y,interp='linear')
29 |
30 | # 3D plot for fnl
31 | #fig1 = plt.figure(1)
32 | #ax = fig1.add_subplot(1, 1, 1, projection='3d')
33 | #surf = ax.plot_surface(alp, bet, fnlOut, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.00, antialiased=False, vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut))
34 | #ax.grid(True); ax.set_ylabel(r'$\beta$',fontsize=15);ax.set_xlabel(r'$\alpha$',fontsize=15);
35 | ##ax.set_title('Slice through reduced bispectrum')
36 | #fig1.colorbar(surf, shrink=0.5, aspect=5); plt.savefig("alpBetFnl1.png")
37 |
38 |
39 | # projecton plot
40 | fig2 = plt.figure(2,figsize=(10,6),facecolor='white')
41 |
42 | ax1 = fig2.add_subplot(1, 1, 1)
43 | cont = ax1.contourf(alp, bet, fnlOut,10, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.0, antialiased=False)#, vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut))
44 | contLines = ax1.contour(alp, bet, fnlOut, 10, colors='black', linewidth=.5); ax1.clabel(contLines, inline=1, fontsize=10)
45 | ax1.grid(True); ax1.set_ylabel(r'$\beta$',fontsize=15);ax1.set_xlabel(r'$\alpha$',fontsize=15);
46 | #ax1.set_title('Slice through reduced bispectrum')
47 | fig2.colorbar(cont, shrink=0.5, aspect=5); plt.savefig("alpBetFnl2.png")
48 |
49 | #plt.show(fig2); #plt.show(fig1);
50 |
51 |
52 | # mayavi 3D plot for fnl
53 | from mayavi import mlab
54 |
55 | mlab.figure(bgcolor=(1.,1.,1.), fgcolor=None, engine=None, size=(600, 600))
56 | mlab.surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut),vmax=np.nanmax(fnlOut),warp_scale="auto",opacity=1.0, colormap = 'jet')
57 | #mlab.contour_surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut), warp_scale='auto')
58 | mlab.view(azimuth=250, elevation=15); mlab.savefig("alpbetFnlMay.png")
59 |
60 | #mlab.show()
61 |
62 |
63 |
64 | # projecton plot for DBi
65 | fig4 = plt.figure(4,figsize=(10,6),facecolor='white')
66 | ax2 = fig4.add_subplot(1, 1, 1)
67 | cont = ax2.contourf(alp, bet, DBi, 10, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.0, antialiased=False, vmin=np.nanmin(DBi), vmax=np.nanmax(DBi) )
68 | contLines = ax2.contour(alp, bet, DBi, 10, colors='black', linewidth=.5); ax2.clabel(contLines, inline=1, fontsize=10)
69 | ax2.grid(True); ax2.set_ylabel(r'$\beta$',fontsize=15);ax2.set_xlabel(r'$\alpha$',fontsize=15);
70 | #ax1.set_title('Slice through reduced bispectrum')
71 | fig4.colorbar(cont, shrink=0.5, aspect=5); plt.savefig("alpBetDBi2.png")
72 |
73 | #plt.show(fig4); #plt.show(fig3);
74 |
75 | # mayavi 3D plot for DBi
76 | from mayavi import mlab
77 | mlab.figure(bgcolor=(1.,1.,1.), fgcolor=None, engine=None, size=(600, 600))
78 | mlab.surf(alp,bet,DBi,vmin=np.nanmin(DBi),vmax=np.nanmax(DBi),warp_scale="auto",colormap = 'jet')
79 | #mlab.contour_surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut), warp_scale='auto')
80 | mlab.view(azimuth=250, elevation=15); mlab.savefig("alpbetDBiMay.png")
81 |
82 |
83 | # Mask plots
84 |
85 | DBiMask = np.empty([np.size(DBi[:,0]),np.size(DBi[0,:])])
86 |
87 | cut = .3
88 | cut2 = 1-2.*cut
89 | #cut*2.*np.cos(math.pi/4)
90 | for ii in range(0,np.size(DBi[:,0])):
91 | for jj in range(0,np.size(DBi[0,:])):
92 | if bet[ii, jj] > (1-cut) or bet[ii, jj] < -alp[ii,jj] - cut2 or bet[ii, jj] < +alp[ii,jj] + (- cut2) :
93 | DBiMask[ii,jj] = np.nan
94 | else:
95 | DBiMask[ii,jj] = DBi[ii,jj]
96 |
97 | fig5 = plt.figure(5,figsize=(10,6),facecolor='white')
98 |
99 | ax3 = fig5.add_subplot(1, 1, 1)
100 | cont = ax3.contourf(alp, bet, DBiMask, 10, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.0, antialiased=False, vmin=np.nanmin(DBiMask), vmax=np.nanmax(DBiMask) )
101 | contLines = ax3.contour(alp, bet, DBiMask, 10, colors='black', linewidth=.5); ax2.clabel(contLines, inline=1, fontsize=10)
102 | ax3.grid(True); ax3.set_ylabel(r'$\beta$',fontsize=15);ax2.set_xlabel(r'$\alpha$',fontsize=15);
103 | #ax1.set_title('Slice through reduced bispectrum')
104 | fig5.colorbar(cont, shrink=0.5, aspect=5); plt.savefig("alpBetDBiMask.png")
105 |
106 | #plt.show(fig4); #plt.show(fig3);
107 |
108 | # mayavi 3D plot for DBiMask
109 | from mayavi import mlab
110 | mlab.figure(bgcolor=(1.,1.,1.), fgcolor=None, engine=None, size=(600, 600))
111 | mlab.surf(alp,bet,DBiMask,vmin=np.nanmin(DBiMask),vmax=np.nanmax(DBiMask),warp_scale="auto",colormap = 'jet')
112 | #mlab.contour_surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut), warp_scale='auto')
113 | mlab.view(azimuth=250, elevation=15); mlab.savefig("alpbetDBiMaskMay.png")
114 |
115 |
116 |
117 | #mlab.show()
118 |
--------------------------------------------------------------------------------
/Examples/QuartAx/paper/Plots.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #################### generate plots ############################################################
3 | from pylab import *
4 | from mpl_toolkits.mplot3d import Axes3D
5 | import numpy as np
6 | from scipy import interpolate
7 | from scipy.interpolate import griddata
8 | import matplotlib.pyplot as plt
9 | from numpy.random import uniform, seed
10 | from matplotlib.mlab import griddata
11 | #import numpy.ma as ma
12 |
13 | # load 3D data
14 | bet = np.load('data/bet.npy'); alp= np.load('data/alp.npy'); Bztot = np.load('data/alBetBi.npy'); snaps = np.load('data/snaps.npy');
15 | Pz1tot = np.load('data/alBetPz1.npy'); Pz2tot=np.load('data/alBetPz2.npy'); Pz3tot=np.load('data/alBetPz3.npy')
16 | #snap = 95
17 | snap = 140
18 |
19 |
20 | fnlOut = 5.0/6*Bztot[:,:,snap]/(Pz1tot[:,:,snap]*Pz2tot[:,:,snap] + Pz1tot[:,:,snap]*Pz3tot[:,:,snap] + Pz2tot[:,:,snap]*Pz3tot[:,:,snap])
21 | k = 1543.9416122555126
22 | kt = k; k1 = kt/2 - bet*kt/2.; k2 = kt/4*(1+alp+bet); k3 = kt/4*(1-alp+bet)
23 | DBi = Bztot[:,:,snap]*( k1*k2*k3 )**2./(Bztot[np.size(alp[:,0])//2,np.size(alp[0,:])//3,snap]*( k1[np.size(alp[:,0])//2,np.size(alp[0,:])//3]*k2[np.size(alp[:,0])/2,np.size(alp[0,:])/3]*k3[np.size(alp[:,0])/2,np.size(alp[0,:])/3] )**2.)
24 |
25 | #X=np.linspace(-1,1,100); Y=np.linspace(0,1,1F00)
26 | #Y, X = np.meshgrid(X, Y)
27 | #a=np.reshape(alp,(np.size(alp)));b=reshape(bet,(np.size(bet)));f=reshape(fnlOut,np.size(fnlOut));X=reshape(X,np.size(X));Y=reshape(Y,np.size(Y))
28 | #F=griddata(a,b,f, X,Y,interp='linear')
29 |
30 | # 3D plot for fnl
31 | #fig1 = plt.figure(1)
32 | #ax = fig1.add_subplot(1, 1, 1, projection='3d')
33 | #surf = ax.plot_surface(alp, bet, fnlOut, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.00, antialiased=False, vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut))
34 | #ax.grid(True); ax.set_ylabel(r'$\beta$',fontsize=15);ax.set_xlabel(r'$\alpha$',fontsize=15);
35 | ##ax.set_title('Slice through reduced bispectrum')
36 | #fig1.colorbar(surf, shrink=0.5, aspect=5); plt.savefig("alpBetFnl1.png")
37 |
38 |
39 | # projecton plot
40 | fig2 = plt.figure(2,figsize=(10,6),facecolor='white')
41 |
42 | ax1 = fig2.add_subplot(1, 1, 1)
43 | cont = ax1.contourf(alp, bet, fnlOut,10, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.0, antialiased=False)#, vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut))
44 | contLines = ax1.contour(alp, bet, fnlOut, 10, colors='black', linewidth=.5); ax1.clabel(contLines, inline=1, fontsize=10)
45 | ax1.grid(True); ax1.set_ylabel(r'$\beta$',fontsize=15);ax1.set_xlabel(r'$\alpha$',fontsize=15);
46 | #ax1.set_title('Slice through reduced bispectrum')
47 | fig2.colorbar(cont, shrink=0.5, aspect=5); plt.savefig("alpBetFnl2.png")
48 |
49 | #plt.show(fig2); #plt.show(fig1);
50 |
51 |
52 | # mayavi 3D plot for fnl
53 | from mayavi import mlab
54 |
55 | mlab.figure(bgcolor=(1.,1.,1.), fgcolor=None, engine=None, size=(600, 600))
56 | mlab.surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut),vmax=np.nanmax(fnlOut),warp_scale="auto",opacity=1.0, colormap = 'jet')
57 | #mlab.contour_surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut), warp_scale='auto')
58 | mlab.view(azimuth=250, elevation=15); mlab.savefig("alpbetFnlMay.png")
59 |
60 | #mlab.show()
61 |
62 |
63 |
64 | # projecton plot for DBi
65 | fig4 = plt.figure(4,figsize=(10,6),facecolor='white')
66 | ax2 = fig4.add_subplot(1, 1, 1)
67 | cont = ax2.contourf(alp, bet, DBi, 10, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.0, antialiased=False, vmin=np.nanmin(DBi), vmax=np.nanmax(DBi) )
68 | contLines = ax2.contour(alp, bet, DBi, 10, colors='black', linewidth=.5); ax2.clabel(contLines, inline=1, fontsize=10)
69 | ax2.grid(True); ax2.set_ylabel(r'$\beta$',fontsize=15);ax2.set_xlabel(r'$\alpha$',fontsize=15);
70 | #ax1.set_title('Slice through reduced bispectrum')
71 | fig4.colorbar(cont, shrink=0.5, aspect=5); plt.savefig("alpBetDBi2.png")
72 |
73 | #plt.show(fig4); #plt.show(fig3);
74 |
75 | # mayavi 3D plot for DBi
76 | from mayavi import mlab
77 | mlab.figure(bgcolor=(1.,1.,1.), fgcolor=None, engine=None, size=(600, 600))
78 | mlab.surf(alp,bet,DBi,vmin=np.nanmin(DBi),vmax=np.nanmax(DBi),warp_scale="auto",colormap = 'jet')
79 | #mlab.contour_surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut), warp_scale='auto')
80 | mlab.view(azimuth=250, elevation=15); mlab.savefig("alpbetDBiMay.png")
81 |
82 |
83 | # Mask plots
84 |
85 | DBiMask = np.empty([np.size(DBi[:,0]),np.size(DBi[0,:])])
86 |
87 | cut = .3
88 | cut2 = 1-2.*cut
89 | #cut*2.*np.cos(math.pi/4)
90 | for ii in range(0,np.size(DBi[:,0])):
91 | for jj in range(0,np.size(DBi[0,:])):
92 | if bet[ii, jj] > (1-cut) or bet[ii, jj] < -alp[ii,jj] - cut2 or bet[ii, jj] < +alp[ii,jj] + (- cut2) :
93 | DBiMask[ii,jj] = np.nan
94 | else:
95 | DBiMask[ii,jj] = DBi[ii,jj]
96 |
97 | fig5 = plt.figure(5,figsize=(10,6),facecolor='white')
98 |
99 | ax3 = fig5.add_subplot(1, 1, 1)
100 | cont = ax3.contourf(alp, bet, DBiMask, 10, rstride=1, cstride=1, cmap=cm.jet,linewidth=0.0, antialiased=False, vmin=np.nanmin(DBiMask), vmax=np.nanmax(DBiMask) )
101 | contLines = ax3.contour(alp, bet, DBiMask, 10, colors='black', linewidth=.5); ax2.clabel(contLines, inline=1, fontsize=10)
102 | ax3.grid(True); ax3.set_ylabel(r'$\beta$',fontsize=15);ax2.set_xlabel(r'$\alpha$',fontsize=15);
103 | #ax1.set_title('Slice through reduced bispectrum')
104 | fig5.colorbar(cont, shrink=0.5, aspect=5); plt.savefig("alpBetDBiMask.png")
105 |
106 | #plt.show(fig4); #plt.show(fig3);
107 |
108 | # mayavi 3D plot for DBiMask
109 | from mayavi import mlab
110 | mlab.figure(bgcolor=(1.,1.,1.), fgcolor=None, engine=None, size=(600, 600))
111 | mlab.surf(alp,bet,DBiMask,vmin=np.nanmin(DBiMask),vmax=np.nanmax(DBiMask),warp_scale="auto",colormap = 'jet')
112 | #mlab.contour_surf(alp,bet,fnlOut,vmin=np.nanmin(fnlOut), vmax=np.nanmax(fnlOut), warp_scale='auto')
113 | mlab.view(azimuth=250, elevation=15); mlab.savefig("alpbetDBiMaskMay.png")
114 |
115 |
116 |
117 | #mlab.show()
118 |
--------------------------------------------------------------------------------
/Examples/DoubleQuad/powerSpectrum.py:
--------------------------------------------------------------------------------
1 | #################### generate power spectrum using PyTransDQuad installed using the setup file which accompanies this one ####################
2 | from matplotlib import pyplot as plt # import package for plotting
3 | from pylab import * # contains some useful stuff for plotting
4 | import time # imports a package that allows us to see how long processes take
5 | import math # imports math package
6 | import numpy as np # imports numpu package as np for short
7 | import sys # imports sys package for sue below
8 | ############################################################################################################################################
9 |
10 |
11 | ############################################################################################################################################
12 | #This file contains simple examples of using the PyTransDQuad
13 | #It assumes the DQuadSetup file has been run to install a double quadratic version of PyTransport
14 | #It is recommended you restart the kernel before running this file to insure any updates to PyTransDQuad are imported
15 |
16 | location = "/home/jwr/Code/PyTransport/" # this should be the location of the PyTransport folder
17 | sys.path.append(location) # sets up python path to give access to PyTransSetup
18 |
19 | import PyTransSetup
20 | PyTransSetup.pathSet() # this sets the other paths that PyTransport uses
21 |
22 | import PyTransDQuad as PyT # import module as PyT (PyTransDQuad is quite long to type each time and it saves time to use a shorter name
23 | # using a generic name PyT means the file can be more easily reused for a different example (once field values
24 | # etc are altered)
25 | import PyTransScripts as PyS # import the scripts module as PyS for convenience
26 | ###########################################################################################################################################
27 |
28 |
29 | ########################### set up initial conditions for background run ##################################################################
30 | fields = np.array([12.0, 12.0]) # we set up a numpy array which contains the values of the fields
31 |
32 | nP=PyT.nP() # the .nP() function gets the number of parameters needed for the potential -- this can be used as a useful crosscheck
33 | pvalue = np.zeros(nP)
34 | pvalue[0]=10.0**(-5.0); pvalue[1]=9.0*10.0**(-5) # we set up numpy array which contains values of the parameters
35 |
36 | nF=PyT.nF() # use number of fields routine to get number of fields (can be used as a useful cross check)
37 |
38 | V = PyT.V(fields,pvalue) # calculate potential from some initial conditions
39 | dV=PyT.dV(fields,pvalue) # calculate derivatives of potential (changes dV to derivatives)
40 |
41 | initial = np.concatenate((fields, -dV/np.sqrt(3* V))) # sets an array containing field values and there derivative in cosmic time
42 | # (set using the slow roll equation)
43 | ############################################################################################################################################
44 |
45 |
46 | ################################## run the background fiducial run ################################################################
47 | Nstart = 0.0
48 | Nend = 70.0
49 | t=np.linspace(Nstart, Nend, 1000)
50 | tols = np.array([10**-8,10**-8])
51 |
52 | back = PyT.backEvolve(t, initial, pvalue,tols,False)
53 | ###########################################################################################################################################
54 |
55 |
56 | ###########################################################################################################################################
57 | # set up an array of k values to calculate power spectrum as a function of ks
58 | kOut = np.array([])
59 | for ii in range(0,500):
60 | NExit = 10.0 + ii*0.08
61 | k = PyS.kexitN(NExit, back, pvalue, PyT)
62 | kOut = np.append(kOut,k) # this builds an array of ks associated with different NExit times from 10 to 50
63 | Pz, times = PyS.pSpectra(kOut,back,pvalue,4.0,tols,PyT) # this cacalcute P_z for this range of ks, using 5.0 e-folds of subhorizon evolution
64 | #==============================================================================
65 | # zz, zzz, timesB = PyS.eqSpectra(kOut, back, pvalue, 4.0, PyT)
66 | #==============================================================================
67 |
68 |
69 | fig1=plt.figure(1)
70 | plt.plot(np.log(kOut/kOut[0]), Pz/Pz[0] *kOut**3/kOut[0]**3, linewidth = 2 )
71 | title('Power spectrum',fontsize=15); grid(True); plt.legend(fontsize=15); ylabel(r'$\log({\cal P}/{\cal P}_{\rm pivot})$', fontsize=20);
72 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15);yscale('log'); plt.xlim(min(np.log(kOut/kOut[0])),max(np.log(kOut/kOut[0])));plt.savefig("Pz.png")
73 |
74 | #fnl=5.0/6.0*zzz/(3.0*zz**2.0)
75 | #plt.plot(np.log(kOut/kOut[0]), fnl )
76 | ##fig3=plt.figure(3)
77 | #title(r'$f_{NL}$',fontsize=15); grid(True); plt.legend(fontsize=15); ylabel(r'$f_{NL}$', fontsize=20);
78 | #xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15); plt.xlim(min(np.log(kOut/kOut[0])),max(np.log(kOut/kOut[0]))); plt.savefig("fnl.png")
79 |
80 | ############################################################################################################################################
81 |
82 |
83 | ############################################################################################################################################
84 | # finally lets find n_s
85 | from scipy.interpolate import UnivariateSpline
86 | derivativeSp = UnivariateSpline(np.log(kOut/kOut[0]), np.log(Pz),k=4, s=1e-15).derivative()
87 | ns=derivativeSp(np.log(kOut/kOut[0]))+4.0
88 |
89 | fig2=plt.figure(2)
90 | plt.plot(np.log(kOut/kOut[0]), ns , linewidth = 2)
91 | title('Spectral index',fontsize=15); grid(True); plt.legend(fontsize=15); ylabel(r'$n_s$', fontsize=20);
92 | xlabel(r'$\log(k/k_{\rm pivot})$', fontsize=15); plt.xlim(min(np.log(kOut/kOut[0])),max(np.log(kOut/kOut[0]))); plt.savefig("ns.png")
93 | plt.show()
--------------------------------------------------------------------------------