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

gmeep adjoint optimization extension #760

Merged
merged 25 commits into from Oct 7, 2022

Conversation

SkandanC
Copy link
Contributor

@SkandanC SkandanC commented Oct 7, 2022

gmeep extension to include Meep's Adjoint Optimization capabilities. This lets us optimize and generate photonic components.

To use this:

  1. Define a component, design region, design variables, objective function
  2. Obtain an OptimizationProblem object using the new get_meep_adjoint_optimizer function
  3. Define bitmasks, cost function (we can compute the FOM in this)
  4. Run the optimization using the run_meep_adjoint_optimizer function
  5. On the last run of the optimization, we can turn on a flag to return the optimized gdsfactory Component

Added:

  • functions to get OptimizationProblem object, run optimization, and get a component from a Simulation object

Modified:

  • Updated gmeep docs to include tutorials on using the new extension

#749

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 7, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 1.62%.

Quality metrics Before After Change
Complexity 0.00 ⭐ 0.00 ⭐ 0.00
Method Length 139.00 😞 154.00 😞 15.00 👎
Working memory 7.00 🙂 7.00 🙂 0.00
Quality 70.74% 🙂 69.12% 🙂 -1.62% 👎
Other metrics Before After Change
Lines 48 54 6
Changed files Quality Before Quality After Quality Change
gdsfactory/simulation/gmeep/init.py 70.74% 🙂 69.12% 🙂 -1.62% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@codecov
Copy link

codecov bot commented Oct 7, 2022

Codecov Report

Merging #760 (3d7604e) into master (b3f12d5) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #760   +/-   ##
=======================================
  Coverage   74.66%   74.66%           
=======================================
  Files         422      422           
  Lines       20841    20841           
  Branches     2830     2830           
=======================================
  Hits        15561    15561           
  Misses       4409     4409           
  Partials      871      871           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@SkandanC SkandanC marked this pull request as draft October 7, 2022 16:52
@sonarcloud
Copy link

sonarcloud bot commented Oct 7, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 10 Code Smells

No Coverage information No Coverage information
3.2% 3.2% Duplication

@SkandanC SkandanC marked this pull request as ready for review October 7, 2022 17:16
@joamatab joamatab merged commit 3d7604e into gdsfactory:master Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants