You are handed three measured numbers and a resonator frequency. Which EJ, EC and g make the model say the same?
The last two topics step back. The first follows a chip from its layout to the numbers EJ and EC, names the other open tools used on either side of the two programs, and says plainly what could not be established about which of them is used where. The second turns it round: given three measured numbers, find the circuit that makes them.
A device is chosen for you, and its three measured numbers are shown. Its true EJ, EC and g are hidden. Move the three sliders until the model’s column matches the measured one, then press Check. The Hint button shows the closed-form starting point from the figure; the New device button picks another. Nothing is scored or stored: the point is to feel which knob moves which number.
Honest limits: the devices are invented by this page (a seeded list of six), not data from any real chip. The model is a transmon with four levels coupled to a resonator of eight, the one in topic 37, so the answer has no noise in it and a perfect fit exists. A real fit has measurement error, fabrication spread and effects this model leaves out, and it ends with an uncertainty, not a number.
Everything in this part so far ran forward: give the parameters of a circuit and get its levels, its readout shift, its decay. A lab has the opposite problem. It has a chip, a fridge and an instrument, and it measures numbers; the parameters are what it wants to learn. Going from the numbers back to the parameters is an inverse problem, and it is solved by running the forward model and adjusting the knobs until the forward answer matches the measurement.
Why three numbers for three knobs works. The three knobs act on the three numbers in different ways. The anharmonicity α is set almost entirely by EC (for a transmon it is close to −EC), so measuring α reads EC directly. With EC known, the frequency f01 is a steadily rising function of EJ (it goes roughly as √(8EJEC) − EC), so f01 reads EJ. And with the qubit's frequency and anharmonicity known, the readout shift χ depends on the coupling g and on nothing else you have not already fixed, so χ reads g. That order (EC, then EJ, then g) is why the closed forms in the figure are chained: each uses the one before.
Why the closed forms are not the end. Each is a leading-order result (topic 29 for the first two, topic 31 for the third) and drops higher-order terms. For the example chip the f01 formula is within 12 MHz of the exact value, but −α is 13% larger than the EC it is meant to give, because at EJ/EC near 60 the true anharmonicity is larger in size than EC (topic 29 has −0.345 GHz against EC = 0.3 GHz at a ratio of 50); and the error in EC then passes into EJ. An error of 12 MHz in a frequency and of 13% in a parameter are both large enough for a fit to see, so the formulas serve to start the search and the exact forward model finishes it. On the page you do it by hand; in code, a least-squares routine does it, as below.
What a fit does not tell you. Two chips with the same three numbers are, as far as this model goes, the same chip. But the model has a particular set of knobs: if the real capacitance includes a stray term that the model does not have, the fit will absorb it into EC or g and report a number that is accurate for the model and wrong for the physics. The habit is to ask of every fitted parameter whether it could be a stand-in for something that is not in the model, and to check it against a second, independent measurement when there is one.
The starting point, in three steps. From a measured anharmonicity α (negative for a transmon), f01 and the readout shift χ at a detuning Δ = f01 − ωr from the resonator:
EC ≈ −α, EJ ≈ (f01 + EC)² / (8EC), g² ≈ χ Δ (Δ + α) / α
The first two are the inversion of the transmon formulas of topic 29 (Koch et al. 2007); the third is the inversion of the shift of topic 31. In the example chip of the previous topic (EJ = 14.901 GHz, EC = 0.2421 GHz) the exact f01 is 5.1178 GHz and α is −273.5 MHz, so the first line gives EC = 0.2735 GHz, 13% too big, and the second EJ = 13.28 GHz, 11% too small. That is the size of the correction the exact model removes: starting from the closed forms (EC = 0.2735 GHz, EJ = 13.28 GHz) the exact fit lands on EJ = 14.900 GHz and EC = 0.2421 GHz.
The exact fit. Let p = (EJ, EC) and let F(p) be the model’s (f01, α), computed by diagonalising the Hamiltonian. The fit minimises the sum of squared differences, S(p) = Σk (Fk(p) − mk)², over the measurements mk, by the Gauss–Newton step p ← p − (JTJ)−1JTr, where r = F(p) − m and J is the table of derivatives ∂Fk/∂pj. Each step is a few diagonalisations; the routine below takes a handful of steps.
How well the numbers pin the knobs down. The table J says how much each measurement moves when a knob moves. For the example chip, from full diagonalisations: raising EC by 1% raises f01 by 0.47% (24 MHz) and makes α 1.08% larger in size (2.9 MHz); raising EJ by 1% raises f01 by 0.53% (27 MHz) and changes α by only 0.07% (0.2 MHz). Both knobs move f01 by about the same amount per percent, so f01 alone cannot tell them apart; α is moved by EC about fourteen times more than by EJ, so α separates them. That is the reason the closed forms are chained in the order of the figure, and the reason two measurements are enough for two knobs. If a measurement has an error of σ, the error in a knob is about σ divided by that column’s sensitivity, which is the quickest way to ask whether a parameter is really determined by the data.
Try it in Python. The routine below does the exact fit with SciPy’s least_squares and scqubits as the forward model, starting from the closed forms, for the f01 and α printed in the previous topic. Run on scqubits 4.3.1 with QuTiP 5.2.0 and SciPy 1.14.1, 25 October 2026:
import numpy as np
import scqubits as scq
from scipy.optimize import least_squares
scq.settings.PROGRESSBAR_DISABLED = True
def transmon_numbers(EJ, EC):
t = scq.Transmon(EJ=EJ, EC=EC, ng=0.0, ncut=30)
E = t.eigenvals(evals_count=3)
return E[1] - E[0], (E[2] - E[1]) - (E[1] - E[0]) # f01 and the anharmonicity, GHz
target = (5.1178, -0.2735) # "measured" f01 and alpha, GHz
EC0 = -target[1] # closed-form guess: alpha ~ -EC
EJ0 = (target[0] + EC0) ** 2 / (8 * EC0) # then f01 ~ sqrt(8 EJ EC) - EC
print("starting guess: EJ = %.3f, EC = %.4f GHz" % (EJ0, EC0))
fit = least_squares(lambda p: np.subtract(transmon_numbers(*p), target) * 1e3, x0=[EJ0, EC0], x_scale=[1.0, 0.01])
print("fitted: EJ = %.3f, EC = %.4f GHz" % tuple(fit.x))
print("largest residual: %.3f MHz" % np.max(np.abs(fit.fun)))
starting guess: EJ = 13.284, EC = 0.2735 GHz
fitted: EJ = 14.900, EC = 0.2421 GHz
largest residual: 0.000 MHz
The loop is the job Design a chip, simulate it, fabricate it, measure it, fit the measurement, and compare the fitted parameters with the design: this is the loop of the figure in the previous topic, and the fit is the step that closes it. The two programs of this part are the machinery for it. What changes in real work is the size of the model (more qubits, a coupler, a control line), the care taken over uncertainty, and the use of an optimiser instead of a hand. What does not change is the shape: a forward model you trust because you have checked it against a second one, as the verifier behind these pages checks the browser explorers against QuTiP and scqubits.
If you want to go on Three reviews cover this ground at the depth of a textbook chapter: Krantz, Kjaergaard, Yan, Orlando, Gustavsson and Oliver, “A quantum engineer’s guide to superconducting qubits”, Applied Physics Reviews 6, 021318 (2019); Blais, Grimsmo, Girvin and Wallraff, “Circuit quantum electrodynamics”, Reviews of Modern Physics 93, 025005 (2021); and the QuTiP 5 paper, arXiv:2412.04705, for the numerical methods. Then take a notebook from each tool’s own collection (topic 33 lists them) and change one number at a time. On this site, Inside the machine shows what these circuits look like as hardware, quantum error correction is what the numbers of this part are in service of, and the Bench puts every explorer of this part on one page.
Check yourself
To fit E_J, E_C and g to a measured f01, α and χ, in which order do the numbers best give up the knobs?
For the example chip a 1% rise in E_C moves α by 1.08% and a 1% rise in E_J moves it by 0.07%, about fourteen times less, while both move f01 by about the same. That is why the closed forms are chained.
The tempting wrong answers.