Models and fitting
A model gives transition energies E(B) as curves over the map. Draw one to compare it with the data by eye, then fit its parameters to the picked curves.
Adding a model
Models live in inspector › Models, on the Map tab. Add model… offers three kinds. Each model is a card with a colour, its name, a switch that shows or hides its curves, and a button that removes it. Visible models are drawn dashed in their colour, in the unit shown, and they go into journal figures.
Massive Dirac
Interband transitions L−n → Ln+1 of a massive Dirac band:
E = √(2eħv²Bn + Δ²) + √(2eħv²B(n+1) + Δ²), n = 0 … N-1
Set the Fermi velocity v (in 10⁵ m/s), the half-gap Δ (in the unit shown) and the number of transitions shown, N, with the sliders or by typing.
Zeeman / magnon
A list of branches. Each has a label, a multiplier m (e.g. +1 or −1; 0 gives a field-independent line, whose g is then held fixed) and a form on its first line, then its energy at zero field E0 and its g-factor g, each with a slider:
- lin: E = E0 + m g μB B
- hyp: E = √(E0² + (m g μB B)²)
Add branch adds a branch. With Coupled on, every pair of branches has a coupling Δij (with a slider), and the energies are the eigenvalues of diag(Ei) + Δ: where two branches would cross, they repel and anticross. Switching coupling off sets every Δij to 0 for the time being; switching it on again brings your values back.
Custom expression
Write the energies yourself, one branch per line, as an expression in the field B (in tesla). A # starts the branch's label. Every name that is not B, a constant or a function is a parameter, shared between the lines. For example, two spin-split branches and a cyclotron resonance:
E0 + g*muB*B # spin up
E0 - g*muB*B # spin down
hbar*e*B/(m*9.1093837e-31) # CR, m in electron masses
The expression is checked as you type, and an error names its line and column. Choose the output unit of the energies (meV, cm⁻¹ or THz). Below the editor each parameter has a value and a slider; the Fit limits table under them has a Fixed tick that holds a parameter in fits, and optional minimum and maximum values.
The constants with an energy in them are given in the output unit, so a g-factor means the same in every unit:
| Name | Meaning | In meV | In cm⁻¹ | In THz |
|---|---|---|---|---|
muB | Bohr magneton, per T | 0.057884 | 0.46687 | 0.013996 |
hbar | reduced Planck constant, times s | 6.5821 × 10⁻¹³ | 5.3089 × 10⁻¹² | 1.5916 × 10⁻¹³ |
kB | Boltzmann constant, per K | 0.086173 | 0.69504 | 0.020837 |
e | elementary charge | 1.602177 × 10⁻¹⁹ C | ||
c | speed of light | 299 792 458 m/s | ||
pi | π | 3.14159… | ||
Functions: sqrt, exp, log, log10, sin, cos, tan, arcsin, arccos, arctan, arctan2, sinh, cosh, tanh, abs, sign, minimum, maximum and hypot. Arithmetic is + - * / ** with parentheses; nothing else of Python is allowed, so an expression cannot do anything but compute.
Sliders
Each parameter is one line: its symbol (point at it for the full name), a slider and its value on the right, which you can also type. Dragging a slider moves the curves on the map as you go. One setting, Sliders at the top of the Models section (or a right-click on any slider), decides how all sliders work:
- Relative ±1 %, ±10 % or ±50 % (the default is ±10 %): the handle rests in the middle. Drag it away from the middle to change the value: at the end of the slider the value has changed by the chosen percentage of what it was when you started, and less near the middle, for fine adjustments. The change so far shows on the slider. When you let go, the handle springs back to the middle and the value stays, so the next drag continues from there. A small value or 0 is changed by a typical step instead (from 1 meV for energies, 1 for g, or the size the value last had), so it never gets stuck and g or an expression's parameter can be dragged through 0.
- Range: the slider spans a fixed range of values, e.g. 0 to the top of the map for E0 and −10 to 10 for g. A value typed outside it widens the range; one typed back inside the usual range narrows it again.
The sliders of v, Δ, the couplings and a hyperbolic branch's E0 stop at 0; a linear branch's E0 may go below 0.
In a narrow inspector a slider is short, so Range moves a value in coarse steps there; Relative, the default, gives the fine control, and a typed value is exact.
With a slider focused, the arrow keys nudge the value by a small step and Shift+arrow keys by ten steps: a tenth of the percentage and the whole percentage in a relative mode, 1 % and 10 % of the range in Range. The number of transitions of the Dirac model always uses a range. The setting is remembered between sessions.
Units of the parameters
The energy parameters of the built-in models (Δ, E0 and Δij) are shown and typed in the unit shown, and convert when you switch it. A custom expression keeps its parameters in its own output unit; only its curves are converted for the plot.
Fitting to the picked points
Fit to points… on a model card opens its fit area in its place (× closes it again):
- Choose how the points are assigned.
- By branch: each picked curve is fitted to the branch you choose for it (by default the first curve to the first branch, and so on).
- Sorted: you choose the lowest, 2nd lowest, … model energy at each field, which suits coupled branches whose order matters more than their names.
- Nearest: each point is fitted to the branch nearest to it.
- Fit. The free parameters are fitted by least squares; fixed ones keep their values. A long fit can be cancelled.
- Read the result: every parameter as value ± σ (from the fit's Jacobian), χ² and reduced χ² in the unit shown squared, the degrees of freedom and the number of points. The fitted curves are drawn as a preview.
- Apply writes the fitted values into the model, Discard drops them. Copy puts the results on the clipboard as a table, Export… saves them as a TSV file (format).
Changing what the model is (its branches, its expression or the expression's unit) drops a result that has not been applied, because its numbers would no longer mean the same.