bilby-cython
Optimized cython implementations of specific Bilby operations.
For very fast waveform models, computing the antenna response and time delays uses a significant amount of run time, see, e.g., this issue.
This repo provides optimized cython implementations of the existing Python
functions.
Most of the speed up comes from leveraging the fact that these are operations
of 3-element vectors.
Installation
bilby.cython is available through conda-forge and pypi and can be installed with either of the following
$ conda install -c conda-forge bilby.cython
$ python -m pip install bilby.cython
There are prebuilt versions for many architectures/OSs, however, non-standard systems will require a version of Cython to build from the source with
Usage
In order to use the functions implemented here you can import them from the
bilby.cython package
from bilby_cython import geometry
geometry.get_polarization_tensor(ra=0.0, dec=0.0, time=0.0, psi=0.0, mode="plus")
Ported functions
time_delay_geocentric: calculating time delays between two interferometersget_polarization_tensor: calculation of polarization tensorsthree_by_three_matrix_contraction: rojecting polarization tensors against detector response tensorscalculate_arm: calculate an interferometer arm vectorzenith_azimuth_to_theta_phi: rotating the reference from from detector-based coordinates to celestial
New functions
time_delay_from_geocenter: calculate the time delay between an interferometer and the geocenter. This removes an array allocation that was slow for some reason.get_polarization_tensor_multiple_modes: compute multiple polarization tensors in a single function call. This reduces the overheads per call.
Testing
test/test_geometry.py verifies that the new functions agree with the old
versions at sufficient precision.
The old code is deliberately copied from the current Bilby to enable testing
after Bilby switches to use this code.
Timing
This is the output of test/timing.py when run on a 2020 M1 MacBook Pro.
The new functions are 5-40x faster than the old versions.
These times are comparable with the lal` equivalents with greater flexibility.
Timing time delay calculation over 10000 trials.
Cython time: 2.366e-06
Numpy time: 1.026e-05
Timing polarization tensor calculation over 1000 trials.
Cython time: 2.470e-06
Numpy time: 4.247e-05
Timing two mode polarization tensor calculation over 1000 trials.
Cython time: 1.790e-06
Numpy time: 2.907e-05
Timing six mode polarization tensor calculation over 1000 trials.
Cython time: 1.250e-06
Numpy time: 4.111e-05
Timing antenna response calculation over 1000 trials.
Cython time: 4.269e-06
Numpy time: 4.709e-05
Timing frame conversion calculation over 1000 trials.
Cython time: 2.516e-06
Numpy time: 2.243e-05
Profiling the standard Bilby fast_tutorial.py example for a very fast
waveform model reduces the amount of time spent computing the antenna response
from 16% to 3% and computing time delays from 3% to 1%.
Metadata
Release files for bilby.cython 0.5.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bilby_cython-0.5.4.tar.gz | 255.9 kB | Details |
Built distributions (wheels)
Total release size: 13.7 MB
Release files / bilby_cython-0.5.4.tar.gz
| Download URL | bilby_cython-0.5.4.tar.gz |
|---|---|
| Size | 255.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
34af013f232187f25308cbf25f096e8c2be1662da78c421b85ecceba4fb5358d
|
|
BLAKE2b-256 checksum How to use checksums |
5f603a384798c7df2462343028d37e6adb9079eb0b155a50736b88bdd668d825
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
932fb4e308565b33f989bfbd4d506a0ae37e5a9ef41802ac841e8cb8a4abfe7b
|
|
BLAKE2b-256 checksum How to use checksums |
597443cd1609d4348920258cd6fde9265a2b9ff8955df1bdc5bc0ca60d80bfc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp314-cp314t-macosx_15_0_arm64.whl
| Download URL | bilby_cython-0.5.4-cp314-cp314t-macosx_15_0_arm64.whl |
|---|---|
| Size | 372.5 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
29ef89ef7c02a7a8aae3da2a0780a4c12d0036ba0d905660beced92388af0633
|
|
BLAKE2b-256 checksum How to use checksums |
f9ab1ce6f90eb2b050ba0b971b9eca26d9ff8a5a6ec7ce6a0e077a57168c6b98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp314-cp314t-macosx_13_0_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp314-cp314t-macosx_13_0_x86_64.whl |
|---|---|
| Size | 373.7 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
1dd8e79afb2761d20dfa14b044f70af22e89270989dc869d0d0a395b272a726e
|
|
BLAKE2b-256 checksum How to use checksums |
9954dbf2856d7fc4038070d6ef5165763dba2edbd8728cff7837f24abffe8b2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e6fa9fa4289749b92d1df5a1e74e552569c30bd67add0544d9c347cd7c13d9af
|
|
BLAKE2b-256 checksum How to use checksums |
1ebf6fb82f2c32b925b356c6daacac9c7c9add8ec700916bd24d53392e82209f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp314-cp314-macosx_13_0_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp314-cp314-macosx_13_0_x86_64.whl |
|---|---|
| Size | 365.9 kB |
| Tags | CPython 3.14 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
03e1e510466bb268cff6dad147ce7ce2e80009567da8ba48f384a7153cb2ed70
|
|
BLAKE2b-256 checksum How to use checksums |
31de3655df4f1d2e962a73daea71d533b19990c6593cbd2a2287eff808f8b282
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp314-cp314-macosx_12_0_arm64.whl
| Download URL | bilby_cython-0.5.4-cp314-cp314-macosx_12_0_arm64.whl |
|---|---|
| Size | 361.6 kB |
| Tags | CPython 3.14 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0239d47206b5c79c612dbe5347c308c69c1b10337c3ed63b4958446238cf556c
|
|
BLAKE2b-256 checksum How to use checksums |
90760d45a1742c8f1fa4bff1755905f6513c1cf1340d284b7618b1fdac044dbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.13 CPython 3.13 free-threading Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
92b7f985cf102d043d6ead018327f58e6bffc1166f2077dc4e2253cfd67a64c4
|
|
BLAKE2b-256 checksum How to use checksums |
01810b0b5558b2e86642fe6e980898745f0b0471ff895ce82e32800f3b23acdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
b28ff13b884eb727d91276d52220707162e4157258b15477a283c8936b156679
|
|
BLAKE2b-256 checksum How to use checksums |
40ff062a65c322e0dd4225a78627243b2925ebc902d5a6282871506d1d6767fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp313-cp313-macosx_15_0_arm64.whl
| Download URL | bilby_cython-0.5.4-cp313-cp313-macosx_15_0_arm64.whl |
|---|---|
| Size | 360.6 kB |
| Tags | CPython 3.13 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
799ccc984e0eb88a20127dc0218866eb22517a1b9e71fc737a89cfc868a8f13d
|
|
BLAKE2b-256 checksum How to use checksums |
0b78956c0eff488ec23402bcd0ff169b72909e43cb4bc1b0a9d9f1a7cc195cc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp313-cp313-macosx_13_0_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp313-cp313-macosx_13_0_x86_64.whl |
|---|---|
| Size | 362.7 kB |
| Tags | CPython 3.13 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
c9dd36128bfc48aacca3f0191babdbdf4ba17acc479c7bb2e24f5ba2d2a7f4c2
|
|
BLAKE2b-256 checksum How to use checksums |
d1eec371f1fa5963be4458acbeb6ac15d32fd07092234be871357069baad9535
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
1599c1ed9f0f169370ab85a975c130447784c998f45f4a63418e0f677461d22f
|
|
BLAKE2b-256 checksum How to use checksums |
2d0a1584b9f60741fd045b9fa57576a524256f31ac9e00162b2c5355f7ef2c80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp312-cp312-macosx_13_0_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp312-cp312-macosx_13_0_x86_64.whl |
|---|---|
| Size | 363.3 kB |
| Tags | CPython 3.12 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
a059c40b5794f094a17c36e3034e5b84a8e92cfed965533577af576beaaff133
|
|
BLAKE2b-256 checksum How to use checksums |
572f7bc651e30d1e9cea5ee4c35b92641c474d652471be49048e38c6512efbfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp312-cp312-macosx_12_0_arm64.whl
| Download URL | bilby_cython-0.5.4-cp312-cp312-macosx_12_0_arm64.whl |
|---|---|
| Size | 357.3 kB |
| Tags | CPython 3.12 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
04945e17d0a9c31f896bec88d4a1bfd8951e4337c2cfc22ef227dd9ece383078
|
|
BLAKE2b-256 checksum How to use checksums |
2d32960859bf3552f3d0e303924d1ce8b02470c6dbf683d985f7377fde41681c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d2aff524c0603111d55b9b24215bb708acad53adaa177493862eaaa10ce39b85
|
|
BLAKE2b-256 checksum How to use checksums |
f7994b8ed531febe5aca745b5522d19d5d2e18744e4cb0d9cd83c0eaad464fd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp311-cp311-macosx_15_0_arm64.whl
| Download URL | bilby_cython-0.5.4-cp311-cp311-macosx_15_0_arm64.whl |
|---|---|
| Size | 362.6 kB |
| Tags | CPython 3.11 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2526574d12ca7807bc5b7f19cf88829fc1b126a980de5e1969c027c1f11ccb34
|
|
BLAKE2b-256 checksum How to use checksums |
66ffd7d033a7578c2b6030c86f2706bf1af051731a0b6aedd59475c18542f2c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp311-cp311-macosx_13_0_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp311-cp311-macosx_13_0_x86_64.whl |
|---|---|
| Size | 364.3 kB |
| Tags | CPython 3.11 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
a5ee0659d7896e91024650dfc77e304f5db43e307e452c91caa6864e4062e426
|
|
BLAKE2b-256 checksum How to use checksums |
ca18448999d244b985582af77471f2bb1a0399b554ffa4bfe3554a813dd026c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
58ac5126ed8422cecec00f85a8aa993602210757108dd88974858a1ff9c67eca
|
|
BLAKE2b-256 checksum How to use checksums |
66d08e31ee74382d8ee22a5a0ef38921a59bba244228aa884d84dcaa28a67776
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp310-cp310-macosx_13_0_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp310-cp310-macosx_13_0_x86_64.whl |
|---|---|
| Size | 364.1 kB |
| Tags | CPython 3.10 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
d3ad3f2ea2a84b724c5e02baea7a01a562028ebdfd2c1b69df2ad7c6de082ecc
|
|
BLAKE2b-256 checksum How to use checksums |
f261b42e96de924605c72e07c216e45d4cfd42149a6f13ee8e9927f394de61ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp310-cp310-macosx_12_0_arm64.whl
| Download URL | bilby_cython-0.5.4-cp310-cp310-macosx_12_0_arm64.whl |
|---|---|
| Size | 360.0 kB |
| Tags | CPython 3.10 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f1f0ea909b172c4c9a2de47445eda51c0122d15408aa08b89114ddf84b60a573
|
|
BLAKE2b-256 checksum How to use checksums |
a3e2bb07655e06cc18ce18e32825d5541e92abbca1f9e5fd4261e95695c64b52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 997.0 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
b25f059f9ccf595fae461b4d8b6c2d8f22d86a1644d68d01270a3a80eefd4103
|
|
BLAKE2b-256 checksum How to use checksums |
3a1c625f29a244dcabc9acab6a08b8e21b1f4e619a55c306108bbcab6769b53b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp39-cp39-macosx_15_0_arm64.whl
| Download URL | bilby_cython-0.5.4-cp39-cp39-macosx_15_0_arm64.whl |
|---|---|
| Size | 363.9 kB |
| Tags | CPython 3.9 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9cec193ecaf196460ec32349bd75b2fce6ce4c5ffbfdee4c71e8ddb4dd2688f4
|
|
BLAKE2b-256 checksum How to use checksums |
2be296b99fb87ec25ecc5d4d59062340fe3aac9d26ebe9a8f1ca5ea121132c0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / bilby_cython-0.5.4-cp39-cp39-macosx_13_0_x86_64.whl
| Download URL | bilby_cython-0.5.4-cp39-cp39-macosx_13_0_x86_64.whl |
|---|---|
| Size | 365.3 kB |
| Tags | CPython 3.9 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
c5713b3d1996f94f6ee17ad492f6ba4311b0f8faed185cb25f28cb100406d80c
|
|
BLAKE2b-256 checksum How to use checksums |
633d9925808700df5fd4f4cf25ce954a259d27db459c0d88c021ce7140fd6cc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|