{"library":"optimistix","title":"Optimistix","description":"Optimistix is a JAX library for nonlinear solvers, including root finding, minimisation, fixed points, and least squares. It features highly modular optimisers, interoperable solvers (e.g., converting root find problems to least squares), PyTree-based state management, fast compilation and runtimes, and deep integration with the JAX ecosystem for features like autodiff, autoparallelism, and GPU/TPU support. As of version 0.1.0, it requires Python 3.11+ and is under active, rapid development with frequent updates.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install optimistix"],"cli":null},"imports":["import optimistix as optx","import jax.numpy as jnp","import equinox as eqx"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import jax.numpy as jnp\nimport optimistix as optx\n\n# Let's solve the ODE dy/dt = tanh(y(t)) with the implicit Euler method.\n# We need to find y1 s.t. y1 = y0 + tanh(y1) * dt.\ny0 = jnp.array(1.0)\ndt = jnp.array(0.1)\n\ndef fn(y, args):\n    # The function to find the fixed point of: y1 = fn(y1, args)\n    # Here, fn(y1) = y0 + tanh(y1) * dt\n    return y0 + jnp.tanh(y) * dt\n\nsolver = optx.Newton(rtol=1e-5, atol=1e-5)\n\n# Find the fixed point: y1 such that y1 = fn(y1).\nsol = optx.fixed_point(fn, solver, y0)\ny1 = sol.value\n\nprint(f\"Initial y0: {y0}\")\nprint(f\"dt: {dt}\")\nprint(f\"Fixed point y1: {y1}\")\nprint(f\"Check fn(y1): {fn(y1, None)}\")\nprint(f\"Solution result (0 is success): {sol.result}\")\n","lang":"python","description":"This quickstart demonstrates finding a fixed point for an implicit Euler step of an ODE. It uses `optimistix.fixed_point` with a `Newton` solver. The `fn` defines the function for which the fixed point is sought, taking `y` and `args` and returning the next `y` value. The solution object `sol` contains the `value` of the fixed point and a `result` code indicating success or failure.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}