Skip to content

Ensure CoilCurvature and CoilTorsion are resolution independent - #2302

Open
singh-jaydeep wants to merge 6 commits into
masterfrom
js/resolution-coilobjective
Open

Ensure CoilCurvature and CoilTorsion are resolution independent#2302
singh-jaydeep wants to merge 6 commits into
masterfrom
js/resolution-coilobjective

Conversation

@singh-jaydeep

Copy link
Copy Markdown
Collaborator

Resolves #2301 by replacing quad_weights with their square roots for these objectives. Also strengthens the resolution independence test for coil objectives.

@singh-jaydeep
singh-jaydeep marked this pull request as ready for review August 25, 2026 15:08
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Memory benchmark result

|               Test Name                |      %Δ      |    Master (MB)     |      PR (MB)       |    Δ (MB)    |    Time PR (s)     |  Time Master (s)   |
| -------------------------------------- | ------------ | ------------------ | ------------------ | ------------ | ------------------ | ------------------ |
  test_objective_jac_w7x                 |   -0.03 %    |     4.239e+03      |     4.238e+03      |    -1.35     |       30.60        |       28.79        |
  test_proximal_jac_w7x_with_eq_update   |   -0.25 %    |     6.848e+03      |     6.831e+03      |    -16.88    |       151.43       |       152.48       |
  test_proximal_freeb_jac                |    0.03 %    |     1.354e+04      |     1.355e+04      |     4.68     |       77.91        |       79.64        |
  test_proximal_freeb_jac_blocked        |    0.25 %    |     7.879e+03      |     7.899e+03      |    19.96     |       69.94        |       68.35        |
  test_proximal_freeb_jac_batched        |   -0.24 %    |     7.878e+03      |     7.860e+03      |    -18.53    |       69.79        |       67.79        |
  test_proximal_jac_ripple               |   -0.85 %    |     3.848e+03      |     3.815e+03      |    -32.69    |       53.58        |       51.46        |
  test_proximal_jac_ripple_bounce1d      |    0.03 %    |     4.026e+03      |     4.028e+03      |     1.30     |       67.04        |       66.56        |
  test_eq_solve                          |    1.83 %    |     1.801e+03      |     1.834e+03      |    32.88     |       52.84        |       52.36        |
  test_objective_quadratic_flux_jac      |    0.70 %    |     1.881e+03      |     1.894e+03      |    13.26     |       35.08        |       35.16        |

For the memory plots, go to the summary of Memory Benchmarks workflow and download the artifact.

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.36%. Comparing base (bf8e337) to head (dd1cc3a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2302   +/-   ##
=======================================
  Coverage   94.36%   94.36%           
=======================================
  Files         101      101           
  Lines       29053    29053           
=======================================
  Hits        27415    27415           
  Misses       1638     1638           
Files with missing lines Coverage Δ
desc/objectives/_coils.py 99.34% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dpanici

dpanici commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Can you also rerun the coil optimization notebook? Just so that they are up to date with master in case any minor changes have occurred

Comment thread CHANGELOG.md Outdated
Comment thread tests/test_objective_funs.py
singh-jaydeep and others added 3 commits August 25, 2026 20:13
Co-authored-by: Yigit Gunsur Elmacioglu <102380275+YigitElma@users.noreply.github.com>
@YigitElma
YigitElma requested review from a team, IssraAli, YigitElma, ddudt, dpanici, f0uriest, lkadz and rahulgaur104 and removed request for a team September 3, 2026 17:14
@review-notebook-app

review-notebook-app Bot commented Sep 3, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

YigitElma commented on 2026-09-03T19:52:21Z
----------------------------------------------------------------

Line #64.        LinkingCurrentConsistency(eq, coilset, eq_fixed=True, jac_chunk_size=5),

Any specific reason for adding additional constraint?


@review-notebook-app

review-notebook-app Bot commented Sep 3, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

YigitElma commented on 2026-09-03T19:52:22Z
----------------------------------------------------------------

I guess new constraint and weight caused this, but still this is a weirdly small number.


@review-notebook-app

review-notebook-app Bot commented Sep 3, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

YigitElma commented on 2026-09-03T19:52:23Z
----------------------------------------------------------------

These are couple orders of magnitude higher compared to before. This optimization was never intended to be a proper one (I think it is here to show MixedCoilSet optimization only), so probably fine.


@YigitElma YigitElma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the additional constraint for mixed coilset optimization notebook seems to be very similar. Looks good to me. If you think the additional constraint is necessary I can approve.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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.

Certain coil objectives depend on resolution

3 participants