{"id":13736641,"url":"https://github.com/google/ceviche-challenges","last_synced_at":"2025-05-08T12:33:19.236Z","repository":{"id":39580404,"uuid":"475076627","full_name":"google/ceviche-challenges","owner":"google","description":"A suite of photonic inverse design challenge problems for topology optimization benchmarking","archived":false,"fork":false,"pushed_at":"2024-01-20T18:04:58.000Z","size":761,"stargazers_count":94,"open_issues_count":1,"forks_count":13,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-10T02:52:04.681Z","etag":null,"topics":["adjoint","electromagnetics","fdfd","optimization","photonics"],"latest_commit_sha":null,"homepage":"https://doi.org/10.1021/acsphotonics.2c00313","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-03-28T16:01:26.000Z","updated_at":"2024-10-09T21:15:15.000Z","dependencies_parsed_at":"2024-01-24T22:13:23.382Z","dependency_job_id":null,"html_url":"https://github.com/google/ceviche-challenges","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fceviche-challenges","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fceviche-challenges/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fceviche-challenges/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fceviche-challenges/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/ceviche-challenges/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224732129,"owners_count":17360416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adjoint","electromagnetics","fdfd","optimization","photonics"],"created_at":"2024-08-03T03:01:25.614Z","updated_at":"2024-11-15T04:32:11.210Z","avatar_url":"https://github.com/google.png","language":"Python","readme":"# Ceviche Challenges: Photonic Inverse Design Suite\n\nThe `ceviche_challenges` module contains a suite of photonic inverse design\nchallenge problems, backed by the open source\n[`ceviche`](https://github.com/fancompute/ceviche/) finite difference frequency\ndomain (FDFD) simulator, and packaged into a standard API for calculating\nscattering parameters and fields. Gradients and automatic differentiation\ncapabilities are provided by [HIPS autograd](https://github.com/HIPS/autograd).\n\nThe suite of challenge problems may be used to benchmark different topology \noptimization algorithms in designing relevant photonic components. The suite \nincludes several integrated photonic components, including a waveguide beam \nsplitter, a waveguide mode converter, a waveguide bend, and a wavelength\ndivision multiplexer (WDM).\n\nThe code in this module was used to produce the results in the\n[Inverse Design of Photonic Devices with Strict Foundry Fabrication Constraints](https://doi.org/10.1021/acsphotonics.2c00313)\npaper.\n\n## Challenge problems\n\n### Waveguide bend\n\n![Waveguide bend](/img/waveguide_bend.png)\n\n### Beam splitter\n\n![Beam splitter](/img/beam_splitter.png)\n\n### Mode converter\n\n![Mode converter](/img/mode_converter.png)\n\n### Wavelength division multiplexer (WDM)\n\n![Wavelength division multiplexer (WDM)](/img/wavelength_divison_multiplexer.png)\n\n## Installation\n\n`ceviche_challenges` can be installed via `pip`:\n\n```\npip install ceviche_challenges\n```\n\n## Usage\n\n `ceviche_challenges` provides several \"prefab\" component configurations, which\n live in the following submodules:\n\n*   `ceviche_challenges.beam_splitter.prefabs`\n*   `ceviche_challenges.mode_converter.prefabs`\n*   `ceviche_challenges.waveguide_bend.prefabs`\n*   `ceviche_challenges.wdm.prefabs`\n\nEach component type (i.e. beam splitter, mode converter, etc) has an associated\nmodel class for performing simulations and returning complex-valued scattering\nparameters. An example using the 2 um x 2 um waveguide bend prefab is shown\nbelow.\n\n```python\nimport numpy as np\nimport ceviche_challenges\n\nspec = ceviche_challenges.waveguide_bend.prefabs.waveguide_bend_2umx2um_spec()\nparams = ceviche_challenges.waveguide_bend.prefabs.waveguide_bend_sim_params()\nmodel = ceviche_challenges.waveguide_bend.model.WaveguideBendModel(params, spec)\n\n# The model class provides a convenience property, `design_variable_shape`\n# which specifies the design shape it expects.\ndesign = np.ones(model.design_variable_shape)\n\n# The model class has a `simulate()` method which takes the design variable as\n# an input and returns scattering parameters and fields.\ns_params, fields = model.simulate(design)\n```\n\nThe model class can also be used inside of an objective function to perform an\noptimization. Gradients and loss function automatic differentiation is supported\nby [HIPS autograd](https://github.com/HIPS/autograd).\n\n```python\nimport autograd\nimport autograd.numpy as npa\n\n# Construct a loss function, assuming the `model` and `design` from the code\n# snippet above are instantiated.\n\ndef loss_fn(x):\n  \"\"\"A simple loss function taking mean s11 - mean s21.\"\"\"\n  s_params, _ = model.simulate(x)\n  s11 = npa.abs(s_params[:, 0, 0])\n  s21 = npa.abs(s_params[:, 0, 1])\n  return npa.mean(s11) - npa.mean(s21)\n\nloss_value, loss_grad = autograd.value_and_grad(loss_fn)(design)\n```\n\nThere are a number of other features in the device model class, such as\nreturning an image of the structure. These features are best explored by reading\nthe code and the function docstrings, as we don't have comprehensive standalone\ndocumentation at this time.\n\n## Citation\n\nIf you find `ceviche_challenges` to be useful for your research, please consider\nciting our [paper](https://doi.org/10.1021/acsphotonics.2c00313). A BibTex\ncitation is provided below for convenience.\n\n```\n@article{schubert_inverse_2022,\n  title = {Inverse Design of Photonic Devices with Strict Foundry Fabrication Constraints},\n  author = {Schubert, Martin F. and Cheung, Alfred K. C. and Williamson, Ian A. D. and Spyra, Aleksandra and Alexander, David H.},\n  journal = {ACS Photonics},\n  volume = {9},\n  number = {7},\n  pages = {2327-2336},\n  year = {2022},\n  doi = {10.1021/acsphotonics.2c00313},\n}\n```\n","funding_links":[],"categories":["simulation"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fceviche-challenges","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fceviche-challenges","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fceviche-challenges/lists"}