diff --git a/.bumpversion.toml b/.bumpversion.toml index 619b319..a27a899 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "v1.4.0" +current_version = "v1.4.1" commit = true commit_args = "--no-verify" tag = true diff --git a/README.md b/README.md index 70b673f..f4a35d3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # invrs-gym -`v1.4.0` +`v1.4.1` ## Overview The `invrs_gym` package is an open-source gym containing a diverse set of photonic design challenges, which are relevant for a wide range of applications such as AR/VR, optical networking, LIDAR, and others. diff --git a/docs/notebooks/challenges/meta_atom_library.ipynb b/docs/notebooks/challenges/meta_atom_library.ipynb index c50ab58..083b985 100644 --- a/docs/notebooks/challenges/meta_atom_library.ipynb +++ b/docs/notebooks/challenges/meta_atom_library.ipynb @@ -65,14 +65,14 @@ "source": [ "# Data from figs 2a and 2b of Chen et al.\n", "expected_conserved = (\n", - " (0.000, 0.501, 1.137, 1.910, 2.259, 3.693, 4.005, 4.641), # 450 nm\n", + " (0.000, 0.451, 1.212, 1.985, 2.471, 3.843, 4.641, 5.489), # 450 nm\n", " (0.000, 0.925, 1.898, 2.783, 3.195, 4.354, 5.140, 5.738), # 550 nm\n", - " (0.000, 0.451, 1.212, 1.985, 2.471, 3.843, 4.641, 5.489), # 650 nm\n", + " (0.000, 0.501, 1.137, 1.910, 2.259, 3.693, 4.005, 4.641), # 650 nm\n", ")\n", "expected_converted = (\n", - " (0.000, 0.502, 1.137, 1.945, 2.306, 3.600, 3.861, 4.843), # 450 nm\n", + " (0.000, 0.391, 1.137, 1.821, 2.194, 3.749, 4.632, 5.465), # 450 nm\n", " (0.000, 0.900, 2.331, 2.567, 3.052, 4.308, 4.433, 5.540), # 550 nm\n", - " (0.000, 0.391, 1.137, 1.821, 2.194, 3.749, 4.632, 5.465), # 650 nm\n", + " (0.000, 0.502, 1.137, 1.945, 2.306, 3.600, 3.861, 4.843), # 650 nm \n", ")\n", "\n", "_, axs = plt.subplots(2, 3, figsize=(8, 5))\n", diff --git a/pyproject.toml b/pyproject.toml index 15c584b..3a4be70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "invrs_gym" -version = "v1.4.0" +version = "v1.4.1" description = "A collection of inverse design challenges" keywords = ["topology", "optimization", "jax", "inverse design"] readme = "README.md" diff --git a/src/invrs_gym/__init__.py b/src/invrs_gym/__init__.py index f57d79a..982434d 100644 --- a/src/invrs_gym/__init__.py +++ b/src/invrs_gym/__init__.py @@ -3,7 +3,7 @@ Copyright (c) 2023 The INVRS-IO authors. """ -__version__ = "v1.4.0" +__version__ = "v1.4.1" __author__ = "Martin F. Schubert " from invrs_gym import challenges as challenges diff --git a/src/invrs_gym/challenges/ceviche/defaults.py b/src/invrs_gym/challenges/ceviche/defaults.py index f4e1c08..2c41aa2 100644 --- a/src/invrs_gym/challenges/ceviche/defaults.py +++ b/src/invrs_gym/challenges/ceviche/defaults.py @@ -75,7 +75,7 @@ def _linear_from_decibels(x_decibels: float) -> jnp.ndarray: BEAM_SPLITTER_SPEC = beam_splitter.spec.BeamSplitterSpec( wg_width=WG_WIDTH, wg_length=WG_LENGTH, - wg_separation=1040 * u.nm, + wg_separation=1120 * u.nm, wg_mode_padding=WG_MODE_PADDING, port_pml_offset=PORT_PML_OFFSET, variable_region_size=(3200 * u.nm, 2000 * u.nm), diff --git a/tests/challenges/library/test_reference_nanostructures.py b/tests/challenges/library/test_reference_nanostructures.py index 426c03f..326ddd1 100644 --- a/tests/challenges/library/test_reference_nanostructures.py +++ b/tests/challenges/library/test_reference_nanostructures.py @@ -23,46 +23,25 @@ # The nanostructure phases from Chen 2023, Figure 2a and 2b. EXPECTED_RELATIVE_PHASE_CONSERVED = ( + # 450, 550, 650 nm (0.000, 0.000, 0.000), - (0.501, 0.925, 0.451), - (1.137, 1.898, 1.212), - (1.910, 2.783, 1.985), - (2.259, 3.195, 2.471), - (3.693, 4.354, 3.843), - (4.005, 5.140, 4.641), - (4.641, 5.738, 5.489), + (0.451, 0.925, 0.501), + (1.212, 1.898, 1.137), + (1.985, 2.783, 1.910), + (2.471, 3.195, 2.259), + (3.843, 4.354, 3.693), + (4.641, 5.140, 4.005), + (5.489, 5.738, 4.641), ) EXPECTED_RELATIVE_PHASE_CONVERTED = ( (0.000, 0.000, 0.000), - (0.502, 0.900, 0.391), + (0.391, 0.900, 0.502), (1.137, 2.331, 1.137), - (1.945, 2.567, 1.821), - (2.306, 3.052, 2.194), - (3.600, 4.308, 3.749), - (3.861, 4.433, 4.632), - (4.843, 5.540, 5.465), -) - -ATOL_CONSERVED = ( - (0.1, 0.1, 0.1), - (0.1, 0.1, 0.1), - (0.1, 0.2, 0.2), - (0.1, 0.2, 0.2), - (0.3, 0.1, 0.4), - (0.2, 0.1, 0.3), - # Final two nanostructures have larger error for some unknown reason. - (0.6, 0.1, 0.9), - (0.8, 0.2, 1.0), -) -ATOL_CONVERTED = ( - (0.1, 0.1, 0.1), - (0.1, 0.1, 0.1), - (0.1, 0.2, 0.2), - (0.1, 0.1, 0.1), - (0.1, 0.1, 0.1), - (0.3, 0.2, 0.4), - (0.8, 0.1, 1.1), - (0.6, 0.2, 0.9), + (1.821, 2.567, 1.945), + (2.194, 3.052, 2.306), + (3.749, 4.308, 3.600), + (4.632, 4.433, 3.861), + (5.465, 5.540, 4.843), ) @@ -128,18 +107,16 @@ def _relative_phase(t): expected_converted = onp.asarray(EXPECTED_RELATIVE_PHASE_CONVERTED)[ :, color_idx ] - atol_conserved = onp.asarray(ATOL_CONSERVED)[:, color_idx] - atol_converted = onp.asarray(ATOL_CONVERTED)[:, color_idx] for i in range(8): with self.subTest(f"nanostructure_{i}_color_{color_idx}_conserved"): onp.testing.assert_allclose( phase_conserved[i, color_idx], expected_conserved[i], - atol=atol_conserved[i], + rtol=0.12, ) with self.subTest(f"nanostructure_{i}_color_{color_idx}_converted"): onp.testing.assert_allclose( phase_converted[i, color_idx], expected_converted[i], - atol=atol_converted[i], + rtol=0.12, )