Skip to content

fix: correct higher multipole field components - #194

Merged
maureeungaro merged 1 commit into
gemc:mainfrom
zhaozhiwen:fix/185-quadrupole-field
Nov 18, 2026
Merged

maureeungaro merged 1 commit into
gemc:mainfrom
zhaozhiwen:fix/185-quadrupole-field

Conversation

@zhaozhiwen

Copy link
Copy Markdown
Collaborator

Fix quadrupole and higher multipole field components

The multipole plugin returned the radial quadrupole field (Gx, Gy, 0), which has nonzero divergence and does not respond to roll. Use the normal higher-multipole component convention so the quadrupole returns (Gy, Gx, 0). Preserve the existing dipole direction, uniform longitudinal mode, unit parsing, and coordinate transforms.

Add a regression that loads the real field plugin and checks independent quadrupole/sextupole reference vectors, X/Y/Z axes, displaced origin, roll, divergence/curl, and dipole/longitudinal compatibility.

Validation:

  • New regression failed on the original code with incorrect vectors and nonzero divergence/curl.
  • All 11 affected field tests pass after the correction, including the existing field random-state test and ASCII map examples/queries.
  • Original GEMC field query now gives Bx=0, By=10 G at (1 mm, 0, 0) for the 1-T-at-1-m quadrupole; a 45-degree roll gives Bx=-10 G.
  • Independent read-only review found no actionable issues.
  • Environment: baseline db22b3c1, AlmaLinux 10.2, GCC 14.3.1, Geant4 11.4.3, Meson 1.12.1.

The broader source-example sweep has a separately recorded baseline of 19/32 passing, including missing geometry/setup failures. This change validates the affected field module and does not claim a clean full-project suite.

Closes #185.

Verification on 2026-11-15: all 44 selected affected regressions passed again on the combined nine-fix source. Each issue also has a separate failing-original/passing-fixed regression. These PR branches each contain only their own fix; shared-file conflicts may need resolving as other fixes merge. No clean full-project-suite claim: the broader source-example baseline remains 19/32, with no newly failing examples in the combined sweep.

@maureeungaro

Copy link
Copy Markdown
Contributor

Addresses angular/component and implements test.

@maureeungaro
maureeungaro merged commit 3085394 into gemc:main Nov 18, 2026
41 of 43 checks passed
@maureeungaro
maureeungaro self-requested a review November 18, 2026 15:33
@maureeungaro maureeungaro self-assigned this Nov 18, 2026
@maureeungaro maureeungaro added bug Something isn't working documentation Improvements or additions to documentation labels Nov 18, 2026
@github-project-automation github-project-automation Bot moved this to Current Milestones Done in gemc3 Nov 18, 2026
@maureeungaro maureeungaro added this to the GEMC Version 0.6 milestone Nov 18, 2026
maureeungaro added a commit that referenced this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

Status: Current Milestones Done

Development

Successfully merging this pull request may close these issues.

Quadrupole component convention produces a nonzero magnetic divergence

2 participants