Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add changelog, and add default formulation for all eigensolve fns #32

Merged
merged 3 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Change log

## Unreleased
- Set `Formulation.JONES_DIRECT_FOURIER` as the default formulation for all eigensolve functions in `fmm` module.

## 0.14.4 (February 25, 2025)
- Set `Formulation.JONES_DIRECT_FOURIER` as the default formulation for `fmm.eigensolve_isotropic_media`.
- Set `Truncation.CIRCULAR` as the default truncation for `basis.generate_expansion`.
- Expand documentation for `fmm.Formulation` enum, describing each formulation.

## 0.13.4 (January 30, 2025)
- Add a `fields.time_average_z_poynting_flux` function to compute the real-space z-oriented Poynting flux from the real-space electromagnetic fields.

## 0.13.3 (January 25, 2025)
- Avoid post-init validation for `fmm.LayerSolveResult` when the attributes are not arrays, e.g. tracer objects. This allows the `LayerSolveResult` to be returned by a jit-ed function.

## 0.13.2 (January 24, 2025)
- Adjust shapes of transverse and z permeability matrices for uniform isotropic media to ensure they have shapes matching those obtained when performing a patterned layer eigensolve. This allows solve reuslts to be concatenated.

## 0.13.1 (January 15, 2025)
- Relax minimum jax dependency to `>= 0.4.27`. There is a bug in some newer jax versions which causes hanging with the CPU backend (https://github.com/jax-ml/jax/issues/24219).

## 0.13.0 (January 14, 2025)
- Reorganize the project to make the `_fmm_matrices` and `_fft` modules are made private.
- Update the build CI workflow to test older, known-good jax versions.
9 changes: 6 additions & 3 deletions src/fmmax/fmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ class Formulation(enum.Enum):
POL_FOURIER = vector.POL_FOURIER


_DEFAULT_FORMULATION = Formulation.JONES_DIRECT_FOURIER


def eigensolve_isotropic_media(
wavelength: jnp.ndarray,
in_plane_wavevector: jnp.ndarray,
primitive_lattice_vectors: basis.LatticeVectors,
permittivity: jnp.ndarray,
expansion: basis.Expansion,
formulation: Formulation | VectorFn = Formulation.JONES_DIRECT_FOURIER,
formulation: Formulation | VectorFn = _DEFAULT_FORMULATION,
) -> "LayerSolveResult":
"""Performs the eigensolve for a layer with isotropic permittivity.

Expand Down Expand Up @@ -130,7 +133,7 @@ def eigensolve_anisotropic_media(
permittivity_yy: jnp.ndarray,
permittivity_zz: jnp.ndarray,
expansion: basis.Expansion,
formulation: Formulation | VectorFn,
formulation: Formulation | VectorFn = _DEFAULT_FORMULATION,
) -> "LayerSolveResult":
"""Performs the eigensolve for a layer with anisotropic permittivity.

Expand Down Expand Up @@ -191,7 +194,7 @@ def eigensolve_general_anisotropic_media(
permeability_yy: jnp.ndarray,
permeability_zz: jnp.ndarray,
expansion: basis.Expansion,
formulation: Formulation | VectorFn,
formulation: Formulation | VectorFn = _DEFAULT_FORMULATION,
vector_field_source: Optional[jnp.ndarray] = None,
) -> "LayerSolveResult":
"""Performs the eigensolve for a general anistropic layer.
Expand Down