Metadata-Version: 2.4
Name: gigalens
Version: 2.0
Summary: Gradient Informed, GPU Accelerated Lens modelling (GIGA-Lens).
License-File: LICENSE
Requires-Python: >=3.12
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: cuda
Requires-Dist: jax (==0.6.2)
Requires-Dist: jax[cuda12] (==0.6.2) ; extra == "cuda"
Requires-Dist: lenstronomy (>=1.13.2,<2.0.0)
Requires-Dist: numpy (>=2.0.2)
Requires-Dist: objax (>=1.8.0,<2.0.0)
Requires-Dist: optax (>=0.2.6,<0.3.0)
Requires-Dist: tensorflow (>=2.19.0)
Requires-Dist: tensorflow-probability (==0.25.0)
Requires-Dist: tqdm (>=4.67.1,<5.0.0)
Description-Content-Type: text/x-rst

GIGA-Lens
========================

.. image:: https://img.shields.io/pypi/v/gigalens.svg
    :target: https://pypi.python.org/pypi/gigalens
    :alt: Latest PyPI version
.. image:: https://img.shields.io/badge/arXiv-2606.30633-b31b1b.svg
    :target: https://arxiv.org/abs/2606.30633
    :alt: Latest arXiv release
.. image:: https://img.shields.io/github/v/release/giga-lens/gigalens?logo=github&label=github
    :target: https://github.com/giga-lens/gigalens
    :alt: Latest GitHub release

Gradient Informed, GPU Accelerated Lens modelling (GIGA-Lens) is a package for fast and rigorous Bayesian inference on strong gravitational lenses, with support for multi-device and multi-node GPU acceleration for large-scale inference workloads. For details, please see our `original paper <https://arxiv.org/abs/2202.07663>`__ and our `latest paper <https://arxiv.org/abs/2606.30633>`. Documentation is provided `here <https://giga-lens.github.io/gigalens/>`__.

Note: Documentation follows our Github release, which will be updated pending paper acceptance

Installation
------------
``GIGA-Lens`` can be installed via pip: ::

    pip install gigalens[cuda]

the ``cuda`` extension is recommended to ensure
If you wish to test the installation, tests can be run simply by running ``tox`` in the root directory.

If you don’t have access to institutional GPUs, one easy way is to use GPU on Google Colab. Please remember the very first cell should have ``!pip install gigalens[cuda]``.

If you do have access to institutional GPUs, you can set up a notebook to run on GPU. For example, at `NESRC <https://jupyter.nersc.gov/hub/>`__, for running GIGA-Lens on a single GPU node, you can choose the kernel
``tensorflow-2.6.0``, and include in the first cell: ``!pip install gigalens[cuda]``.

Demo Notebooks
--------------------------

The notebooks below demonstrate some examples of lens modeling with JAX and Tensorflow respectively. For the quickstart notebooks, you can run them directly using Google Colab.

* `JAX quickstart <https://github.com/giga-lens/gigalens/blob/master/jax-demo.ipynb>`__ on `Google Colab <https://colab.research.google.com/drive/1ApvVnd8Ys9SMOhsMIIXHt5MxBubOmnWm?usp=sharing>`__
* `TensorFlow quickstart <https://github.com/giga-lens/gigalens/blob/master/tf-demo.ipynb>`__ on `Google Colab <https://colab.research.google.com/drive/1NXdmVj2EAuxAd3IX7z-PBvSH-zTxZG9T?usp=sharing>`__
* `Shapelets demo to model the source galaxy (Birrer+ 2015) on JAX <https://github.com/giga-lens/gigalens/blob/master/jax-shapelets-demo.ipynb>`__


Requirements
------------
Python Version >= 3.12

The following packages are requirements for GIGA-Lens. However, we recommend using pip to avoid issues with subpackage dependencies.

- ``jax==0.6.2``
- ``tensorflow-probability==0.25.0``
- ``lenstronomy>=1.13.2,<2.0.0``
- ``optax>=0.2.6,<0.3.0``
- ``objax>=1.8.0,<2.0.0``
- ``numpy>=2.0.2``
- ``tqdm>=4.67.1,<5.0.0``

Authors
-------

`GIGALens` was written by `Andi Gu <andi.gu@berkeley.edu>`_ in 2021, and is developed by:

- `Chase Graham <chase_graham@berkeley.edu>`_
- `Xiaosheng Huang <xhuang22@usfca.edu>`_
- `Joon Kim <joonkim1@berkeley.edu>`_
- `Harry Lu <harrylu@berkeley.edu>`_
- `Evan Odell <evanodell@berkeley.edu>`_
- `Ansel Parke <aparke@berkeley.edu>`_
- `Linus Upson <linusu@berkeley.edu>`_
- `Felipe Urcelay <fjurcelay@uc.cl>`_
- `Sean Xu <seanjx@berkeley.edu>`_
- `Elden Yap <eldenyap@berkeley.edu>`_

Cite:
-------
.. image:: https://img.shields.io/badge/arXiv-2606.30633-b31b1b.svg
    :target: https://arxiv.org/abs/2606.30633
    :alt: Latest arXiv release

.. code-block:: bibtex

    @misc{huang2026gigalens20stronglensmodeling,
        title={GIGA-Lens 2.0: Strong-Lens Modeling on Multiple GPU Nodes}, 
        author={Xiaosheng Huang and Linus Upson and Nicolas Ratier-Werbin and Harry Lu and Sean Xu and Elden Yap and Evan Odell and Ansel Parke and Harsh Ambardekar and Saul Baltasar and Nestor Demeure and Bradley Richardson and Andi Gu and Yuan-Ming Hsu and Junyi Liu},
        year={2026},
        eprint={2606.30633},
        archivePrefix={arXiv},
        primaryClass={astro-ph.CO},
        url={https://arxiv.org/abs/2606.30633}, 
    }

