semvec/pypi-packages huggingface dataset:
invrs-utils 1.4.1
Miscellaneous utilities for the invrs-io ecosystem
Requires Python: >=3.7
Keywords: topology, optimization, jax, inverse design

# invrs-utils - Miscellaneous utilities
[![Continuous integration](https://github.com/invrs-io/utils/actions/workflows/build-ci.yml/badge.svg)](https://github.com/invrs-io/utils/actions)
[![PyPI version](https://img.shields.io/pypi/v/invrs-utils)](https://pypi.org/project/invrs-utils/)

This package is a collection of utilities that may be useful, but do not have fundamental roles in the invrs-io ecosystem. These currently include,

- `experiment.checkpoint`: Defines a simple checkpoint manager with an [orbax](https://github.com/google/orbax)-like API.
- `experiment.sweep`: Functions to construct experiments involving hyperparameter sweeps.
- `experiment.data`: Functions to load and summarize data from experiments.
- `experiment.work_unit`: Provides a function to run a single work unit in an experiment.

## Install
```
pip install invrs-utils
```
totypes 0.9.1
Custom datatypes useful in a topology optimization context
Requires Python: >=3.7
Keywords: topology, optimization, jax, inverse design

# totypes - Custom types for topology optimization
[![Continuous integration](https://github.com/invrs-io/totypes/actions/workflows/build-ci.yml/badge.svg)](https://github.com/invrs-io/agjax/actions)
[![PyPI version](https://img.shields.io/pypi/v/totypes)](https://pypi.org/project/totypes/)

## Overview

The `totypes` package defines custom jax-compatible datatypes for use in a topology optimization, inverse design, or AI-guided design context. The custom types are pytree nodes consisting of standard jax arrays along with metadata that describe the desired characteristics of the arrays.
- `BoundedArray`, an array with optional lower and/or upper bounds, used e.g. for representing layer thicknesses.
- `Density2DArray`, an array with lower and upper bounds and characteristics such as fixed pixels, minimum feature size, or symmetry, used for representing layer density as is common in topology optimization.

Custom types do not modify the underlying arrays to ensure that e.g. bounds are obeyed. Instead, it is intended that any scheme for generating arrays be aware of and respect the metadata. For example, a topology optimization scheme could read the minimum width and spacing of layers, and use these quantities to construct an appropriate filtering scheme.

Several related utilities are also provided. The `json_utils` module provides functions for serializing and deserializing pytrees containing the custom types. And, the `symmetry` module provides functions that symmetrize arrays; the allowed symmetries of the `Density2DArray` are restricted to those implemented in the `symmetry` module.

## Install

```
pip install totypes
```
refractiveindex2 0.1.1
A python interface to the refractiveindex.info database.
Requires Python: >=3.10

# A python interface to refractiveindex.info
[![Continuous integration](https://github.com/invrs-io/refractiveindex2/actions/workflows/build-ci.yml/badge.svg)](https://github.com/invrs-io/refractiveindex2/actions)
[![PyPI version](https://img.shields.io/pypi/v/refractiveindex2)](https://pypi.org/project/refractiveindex2/)

This repo is based on the [refractiveindex repo](https://github.com/toftul/refractiveindex) by [Ivan Toftul](https://github.com/toftul), which itself is based on the `refractiveindex.py` module from the [PyTMM project](https://github.com/kitchenknif/PyTMM) by [Pavel Dmitriev](https://github.com/kitchenknif). It provides a python interface to the [refractiveindex.info database](https://github.com/polyanskiy/refractiveindex.info-database) by [Mikhail Polyanskiy](https://github.com/polyanskiy).

Compared to other interfaces to the database, `refractiveindex2` implements additional formulas required by some materials in the database and is rewritten to have a simpler class structure. It also includes extensive tests for all materials in the database.


## Installation

```
pip install refractiveindex2
```

## Usage


```python
import refractiveindex2 as ri

SiO = ri.RefractiveIndexMaterial(shelf="main", book="SiO", page="Hass")

wavelength_um = 0.6  # [microns]

SiO.get_epsilon(wavelength_um=wavelength_um)
# (3.8633404437869827 + 0.003931076923076923j)

SiO.get_refractive_index(wavelength_um=wavelength_um)
# (1.96553846)

SiO.get_extinction_coefficient(wavelength_um=wavelength_um)
# (0.001)
```

Notes:
- here the time dependence is assumed to be $\mathrm{e}^{-\mathrm{i} \omega t}$, so $\mathrm{Im}(\varepsilon) > 0$ is responsible for the losses.
- if there is a space in the name, one should write underscore instead of it, i.e. not `page='Rodriguez-de Marcos'` but `page='Rodriguez-de_Marcos'`.


## How to get material page names

You can find the proper “page” name by hovering your cursor on the link in the Data section

![How to get page name](https://github.com/invrs-io/refractiveindex2/blob/main/docs/img/material_page_names.png?raw=true)

Or you can look up folders in this repository<br>
https://github.com/polyanskiy/refractiveindex.info-database

## Related projects

- https://github.com/stillyslalom/RefractiveIndex.jl
- https://github.com/kitchenknif/PyTMM
- https://github.com/toftul/refractiveindex
- https://github.com/polyanskiy/refractiveindex.info-database
invrs-opt 0.12.1
Algorithms for inverse design
Requires Python: >=3.7
Keywords: topology, optimization, jax, inverse design

# invrs-opt - Optimization algorithms for inverse design
[![Continuous integration](https://github.com/invrs-io/opt/actions/workflows/build-ci.yml/badge.svg)](https://github.com/invrs-io/opt/actions)
[![PyPI version](https://img.shields.io/pypi/v/invrs-opt)](https://pypi.org/project/invrs-opt/)

## Overview

The `invrs-opt` package defines an optimizer API intended for topology optimization, inverse design, or AI-guided design. It (currently) implements the L-BFGS-B optimization algorithm along with some variants. The API is intended to be general so that new algorithms can be accommodated, and is inspired by the functional optimizer approach used in jax. Example usage is as follows:

```python
initial_params = ...

optimizer = invrs_opt.lbfgsb()
state = optimizer.init(initial_params)

for _ in range(steps):
    params = optimizer.params(state)
    value, grad = jax.value_and_grad(loss_fn)(params)
    state = optimizer.update(grad=grad, value=value, params=params, state=state)
```

Optimizers in `invrs-opt` are compatible with custom types defined in the [totypes](https://github.com/invrs-io/totypes) package. The basic `lbfgsb` optimizer enforces bounds for custom types, while the `density_lbfgsb` optimizer implements a filter-and-threshold operation for `DensityArray2D` types to ensure that solutions have the correct length scale.

## Install
```
pip install invrs_opt
```