Metadata-Version: 2.4
Name: exogibbs
Version: 0.3.9
Summary: Differentiable Thermochemical Equilibrium Solver for Exoplanet Atmospheres
Author-email: Hajime Kawahara <divrot@gmail.com>
Maintainer-email: Hajime Kawahara <divrot@gmail.com>
License: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/HajimeKawahara/exogibbs
Project-URL: Repository, https://github.com/HajimeKawahara/exogibbs
Project-URL: Issues, https://github.com/HajimeKawahara/exogibbs/issues
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: interpax
Requires-Dist: jax<0.7,>=0.4.30
Requires-Dist: tqdm
Requires-Dist: pandas
Requires-Dist: xarray
Requires-Dist: pyfastchem
Requires-Dist: thermochem
Dynamic: license-file

# ExoGibbs
 [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/HajimeKawahara/exogibbs)

Differentiable Thermochemical Equilibrium, powered by JAX. 

The optimization scheme is based on the Lagrange multiplier, similar to [NASA/CEA algorithm](https://ntrs.nasa.gov/api/citations/19950013764/downloads/19950013764.pdf). 
The terminology follows Smith and Missen, [Chemical Reaction Equilibrium Analysis](https://aiche.onlinelibrary.wiley.com/doi/10.1002/aic.690310127) (1983, Wiley-Interscience). 

## Basic Use

```python
from jax import config
config.update("jax_enable_x64", True)

from exogibbs.presets.ykb4 import chemsetup
from exogibbs.api.equilibrium import equilibrium_profile, EquilibriumOptions

# chemical setup
chem = chemsetup()

# Thermodynamic conditions
opts = EquilibriumOptions(epsilon_crit=1e-15, max_iter=1000)

res = equilibrium_profile(
    chem,
    temperature_profile,
    pressure_profile,
    chem.element_vector_reference,
    Pref=1.0,
    options=opts,
)
nk_result = res.x #mixing ratio
```

## presets

- ykb4: number of species: 160     elements: 12
- fastchem: number of species: 523    elements: 28


ExoGibbs is designed to plug into [ExoJAX](https://github.com/HajimeKawahara/exojax) and enable gradient-based equilibrium retrievals. 
It is still in a beta stage, so please use it at your own risk.


This package bundles logK data from [FastChem](https://github.com/NewStrangeWorlds/FastChem) in `fastchem` presets,
which is distributed under the GNU General Public License v3 (GPLv3).
Accordingly, ExoGibbs is also distributed under the GPLv3 license.
