{"id":13736537,"url":"https://github.com/fancompute/ceviche","last_synced_at":"2026-01-21T16:06:42.387Z","repository":{"id":37925107,"uuid":"188323485","full_name":"fancompute/ceviche","owner":"fancompute","description":":shrimp: Electromagnetic Simulation + Automatic Differentiation ","archived":false,"fork":false,"pushed_at":"2023-07-06T21:35:53.000Z","size":16748,"stargazers_count":392,"open_issues_count":10,"forks_count":85,"subscribers_count":20,"default_branch":"master","last_synced_at":"2026-01-04T22:50:13.413Z","etag":null,"topics":["adjoint","electromagnetics","fdfd","fdtd","inverse-problems","optimization"],"latest_commit_sha":null,"homepage":"https://doi.org/10.1021/acsphotonics.9b01238","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fancompute.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-05-24T00:08:23.000Z","updated_at":"2025-12-30T09:06:17.000Z","dependencies_parsed_at":"2023-02-19T01:31:01.579Z","dependency_job_id":"d0c52bf7-dc01-4db8-a54a-f700d1deeee6","html_url":"https://github.com/fancompute/ceviche","commit_stats":{"total_commits":270,"total_committers":10,"mean_commits":27.0,"dds":"0.22962962962962963","last_synced_commit":"dcb8587c46e8e64b281004c3dee02a8ecd139721"},"previous_names":["twhughes/ceviche"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/fancompute/ceviche","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fancompute%2Fceviche","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fancompute%2Fceviche/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fancompute%2Fceviche/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fancompute%2Fceviche/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fancompute","download_url":"https://codeload.github.com/fancompute/ceviche/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fancompute%2Fceviche/sbom","scorecard":{"id":392008,"data":{"date":"2025-08-11","repo":{"name":"github.com/fancompute/ceviche","commit":"dcb8587c46e8e64b281004c3dee02a8ecd139721"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":3,"reason":"Found 4/11 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/python-publish.yml:16","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/fancompute/ceviche/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/fancompute/ceviche/python-publish.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:32","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: GHSA-6p56-wp2h-9hxr","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2023-102","Warn: Project is vulnerable to: PYSEC-2023-114"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T18:04:23.827Z","repository_id":37925107,"created_at":"2025-08-18T18:04:23.828Z","updated_at":"2025-08-18T18:04:23.828Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28635927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T15:01:31.228Z","status":"ssl_error","status_checked_at":"2026-01-21T14:42:58.942Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","fdtd","inverse-problems","optimization"],"created_at":"2024-08-03T03:01:23.630Z","updated_at":"2026-01-21T16:06:42.370Z","avatar_url":"https://github.com/fancompute.png","language":"Python","readme":"# ceviche [![Build Status](https://travis-ci.com/fancompute/ceviche.svg?token=ZCPktA3Ki2eYVXYnfbrz\u0026branch=master)](https://travis-ci.com/twhughes/ceviche)\n\nElectromagnetic Simulation Tools + Automatic Differentiation.  Code for paper [Forward-Mode Differentiation of Maxwell's Equations](https://arxiv.org/abs/1908.10507).\n\n\u003cimg src=\"/img/horizontal-color.png\" title=\"ceviche\" alt=\"ceviche\"\u003e\n\n## What is ceviche?\n\n`ceviche` provides two core electromagnetic simulation tools for solving Maxwell's equations:\n\n- finite-difference frequency-domain (FDFD)\n\n- finite-difference time-domain (FDTD)\n\nBoth are written in `numpy` / `scipy` and are compatible with the [HIPS autograd package](https://github.com/HIPS/autograd), supporting forward-mode and reverse-mode automatic differentiation.\n\nThis allows you to write code to solve your E\u0026M problem, and then use automatic differentiation on your results.\n\nAs a result, you can do gradient-based optimization, sensitivity analysis, or plug your E\u0026M solver into a machine learning model without having to go through the tedious process of deriving your derivatives by hand.\n\n## Examples\n\nThere is a comprehensive ceviche tutorial available at [this link](https://github.com/fancompute/workshop-invdesign) with several ipython notebook examples:\n1. [Running FDFD simulations in ceviche.](https://nbviewer.jupyter.org/github/fancompute/workshop-invdesign/blob/master/01_First_simulation.ipynb)\n2. [Performing inverse design of a mode converter.](https://nbviewer.jupyter.org/github/fancompute/workshop-invdesign/blob/master/02_Invdes_intro.ipynb)\n3. [Adding fabrication constraints and device parameterizations.](https://nbviewer.jupyter.org/github/fancompute/workshop-invdesign/blob/master/03_Invdes_parameterization.ipynb)\n4. [Inverse design of a wavelength-division multiplexer and advanced topics.](https://nbviewer.jupyter.org/github/fancompute/workshop-invdesign/blob/master/04_Invdes_wdm_scheduling.ipynb)\n\nThere are also a few examples in the `examples/*` directory.\n\n## Installation\n\nThere are many ways to install `ceviche`.\n\nThe easiest is by \n\n    pip install ceviche\n\nBut to install from a local copy, one can instead do\n\n    git clone https://github.com/twhughes/ceviche.git\n    pip install -e ceviche\n    pip install -r ceviche/requirements.txt\n\nfrom the main directory.\n\nAlternatively, just download it:\n\n    git clone https://github.com/twhughes/ceviche.git\n\nand then import the package from within your python script\n    \n```python\nimport sys\nsys.path.append('path/to/ceviche')\n```\n\n## Package Structure\n\n### Ceviche\n\nThe `ceviche` directory contains everything needed.\n\nTo get the FDFD and FDTD simulators, import directly `from ceviche import fdtd, fdfd_ez, fdfd_hz`\n\nTo get the differentiation, import `from ceviche import jacobian`.\n\n`constants.py` contains some constants `EPSILON_0`, `C_0`, `ETA_0`, `Q_E`, which are needed throughout the package\n\n`utils.py` contains a few useful functions for plotting, autogradding, and various other things.\n\n`optimizers.py` contains optimizer functions for doing inverse design.\n\n`viz.py` are functions that help with plotting fields and sructures.\n\n`modes.py` contains a mode sorter (WIP) that can be used to create waveguide mode profiles for the simulation, for example.\n\n### Examples\n\nThere are many demos in the `examples` directory, which will give you a good sense of how to use the package.\n\n### Tests\n\nTests are located in `tests`.  To run, `cd` into `tests` and\n\n    python -m unittest\n\nto run all or\n\n    python specific_test.py\n\nto run a specific one.  Some of these tests involve visual inspection of the field plots rather than error checking on values.\n\nTo run all of the gradient checking functions, run \n\n    chmod +x test/test_all_gradients.sh\n    tests/test_all_gradients.sh\n\n## Credits\n\nIf you use this for your research or work, please cite\n\n    @article{hughes2019forward,\n      title={Forward-Mode Differentiation of Maxwell’s Equations},\n      author={Hughes, Tyler W and Williamson, Ian AD and Minkov, Momchil and Fan, Shanhui},\n      journal={ACS Photonics},\n      volume={6},\n      number={11},\n      pages={3010--3016},\n      year={2019},\n      publisher={ACS Publications}\n    }\n\nOur logo was created by [@nagilmer](http://nadinegilmer.com/)\n","funding_links":[],"categories":["simulation","Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffancompute%2Fceviche","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffancompute%2Fceviche","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffancompute%2Fceviche/lists"}