Skip to content

Correct the transmon Josephson-to-charging energy ratio - #94

Merged
PP501 merged 1 commit into
sqdlab:mainfrom
davrens101:fix/transmon-energy-ratio
Nov 9, 2026
Merged

PP501 merged 1 commit into
sqdlab:mainfrom
davrens101:fix/transmon-energy-ratio

Conversation

@davrens101

@davrens101 davrens101 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

TransmonBase.EJonEC returns h*f01/EC, not EJ/EC. Both Xmon and floating-transmon design objectives and reports use this method for the Ej/Ec constraint, so the wrong quantity is fitted and reported.

For an effective capacitance of 60 fF and a 6.133905952808723 GHz transition, the leading-order transmon relation gives EJ/EC = 50. The original method instead reports 19.00000009487094.

Change

Invert h*f01 = sqrt(8*EJ*EC) - EC, giving EJ/EC = (h*f01/EC + 1)**2/8, consistent with the existing _EJ_from_QubitFreqHertz helper and EC = e**2/(2*Ceff) convention. No caller, signature or physical-constant changes.

Document that this is a leading-order transmon approximation, not an exact charge-basis Hamiltonian solution; cite Koch et al. (2007), Eq. 11.

Verification

  • The same real-import scenario now returns 50.00000047435469, within the existing rounded electron-charge precision.
  • Analytic round trips cover ratios 20, 50 and 100 at three capacitances (30, 60 and 120 fF).
  • python -m pytest -q UnitTests/test_transmon_energy_ratio.py UnitTests/testBasicQiskitMetal.py: 3 passed, 9 subtests passed. Eight existing dependency/source deprecation warnings remain.
  • Separately diagonalized the actual 61-state charge-basis Hamiltonian H/EC = 4*n**2 - (EJ/EC)*cos(phi) at zero offset charge. Inverting its exact first transition gives 19.7029437359, 49.7100167695 and 99.7234611496 for ratios 20, 50 and 100: the expected finite-approximation differences, not exact-equality claims.
  • New-test Ruff lint and format pass. Independent read-only AI review found no blocker.
  • Windows/Python 3.11, CPU only. No full-suite, external EM-solver or hardware-performance 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 the four independent SQDMetal fixes (#91-94) onto their shared upstream base and they apply cleanly together. Parser, LC, optimizer, transmon and the existing component geometry tests: 14 passed, 21 subtests passed. The optimizer/JSON run and a 61-state charge-basis Hamiltonian check also pass. With #94's corrected energy physics the floating original-target cost becomes 131.30895980700444 and still matches the independently calculated residual. CPU only, existing warnings not suppressed, no full suite or external EM solver.

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.

2 participants