Skip to content

Return port linewidths in Hz and support single-port eigenmodes - #97

Open
davrens101 wants to merge 1 commit into
sqdlab:mainfrom
davrens101:fix/port-linewidth-units
Open

davrens101 wants to merge 1 commit into
sqdlab:mainfrom
davrens101:fix/port-linewidth-units

Conversation

@davrens101

@davrens101 davrens101 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

retrieve_mode_port_EPR_from_file documents linewidths in Hz, but returns Palace's GHz values without conversion. It also discards every valid single-port result as NaN by requiring at least two linewidth columns.

Accept one or more linewidth columns and convert the existing absolute-value sum from GHz to Hz. Update the field-plot consumer to convert Hz to MHz; its displayed physical linewidth is unchanged for multi-port data. Missing/unavailable port data retain the existing NaN behavior. Public signatures and return keys are unchanged.

Primary source: Palace CSV writer creates port-Q.csv for any nonempty set of resistive ports and labels its linewidth columns with (GHz).

Direct before/after verification, without mocks or new permanent tests:

  • Single-port linewidths 5e-5/3e-5 GHz: previously NaN; now 50,000/30,000 Hz.
  • Two-port sums: now 70,000 Hz rather than 7e-5.
  • Actual Palace four-port regression values, including signed values, give the expected absolute sum 1,991,110.91900154 Hz.
  • Missing linewidth columns/files preserve NaN. Missing optional EPR data preserve None; frequencies remain Hz.
  • Executed the real field-image plotting path with temporary eigenmode, surface participation and configuration data. Inspected the rendered image and its actual annotation: a 50 kHz single-port linewidth displays as 0.050 MHz. The temporary field image is synthetic; no EM solver was run.
  • Python compilation passes; independent read-only AI review found no blocker. Matplotlib's expected non-interactive Agg warning was not suppressed. CPU-only, no full-suite or external-solver claim.

Review and assistance

I supervised and checked the AI-assisted work as it progressed. AI assistance was used for investigation, implementation and verification. No maintainer review or approval is claimed. Verification was CPU-only; no GPU validation is claimed.

@davrens101

davrens101 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

I cherry-picked all seven SQDMetal fixes (#91-97) onto their shared upstream base and they apply cleanly together. The existing focused tests give 14 passed, 21 subtests passed (19 source/dependency/SciPy warnings, not suppressed). I also ran the 15 ordered three-mode EPR selections, 18 single-qubit capacitance configurations, three two-qubit input forms, single- and multi-port linewidths, and absent optional files directly, and they all work. No new permanent tests for #95-97, and I did not run the full suite or an external EM solver.

This branch has not been deployed

No deployments
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.

1 participant