Diffractive splitter

Diffractive splitter#

Visit the invrs-gym docs for the diffractive splitter challenge.

The diffractive splitter challenge is based on the “Design and rigorous analysis of a non-paraxial diffractive beamsplitter” slide deck retrieved from the LightTrans web site, and entails the design of a metasurface that evenly splits a normally-incident plane wave into a 7x7 array of beams, with diffraction angles of ±15 degrees.

The diffractive splitter eval metric is defined as follows:

Hide code cell source
from invrs_gym import challenges

challenge = challenges.diffractive_splitter()
docstring = challenge.eval_metric.__doc__
print("\n".join([s[8:] for s in docstring.split("Args")[0].split("\n")[2:-2]]))
The eval metric rewards high total efficiency and minimum nonuniformity.
It is computed by,

    eval_metric = total_efficiency * (1 - uniformity_error)

In cases where multiple wavelengths or incident angles are considered, the
eval metric is the minimum across all excitation conditions.
Hide code cell content
import os
import plotly.express as px
from IPython import display
from invrs_leaderboard import data

df = data.leaderboard_dataframe(base_path="../../../")
grid_spacing_nm = challenge.component.spec.grid_spacing * 1000
df["minimum_width_nm"] = df["minimum_width"] * grid_spacing_nm
df["minimum_spacing_nm"] = df["minimum_spacing"] * grid_spacing_nm
df["minimum_length_scale_nm"] = df["minimum_length_scale"] * grid_spacing_nm

def _trim_filename(name):
    return name if len(name) < 40 else name[:25] + "..." + name[-12:]

df["file"] = [_trim_filename(f) for f in df["file"]]

def plot_challenge_metrics(challenge_name: str) -> display.DisplayHandle:
    challenge_df = df[df["challenge"] == challenge_name]
    fig = px.scatter(
        challenge_df,
        x="minimum_length_scale_nm",
        y="eval_metric",
        color="file_prefix",
        hover_data=["file", "minimum_width_nm", "minimum_spacing_nm", "binarization_degree"],
    )
    if not os.path.exists("_plots/"):
        os.mkdir("_plots/")
    filename = f"_plots/eval_metric_{challenge_name}.html"
    fig.write_html(filename)
    return display.display(display.HTML(filename))
plot_challenge_metrics("diffractive_splitter")