Magneto-Optical Detective

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

The Models section of the inspector with a Massive Dirac card: sliders and fields for the Fermi velocity, the half-gap and the number of transitions, and the formula; its dashed curves follow the picked points on the map.
A massive Dirac model in the Models section; its dashed curves follow the picked transitions.

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:

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:

NameMeaningIn meVIn cm⁻¹In THz
muBBohr magneton, per T0.0578840.466870.013996
hbarreduced Planck constant, times s6.5821 × 10⁻¹³5.3089 × 10⁻¹²1.5916 × 10⁻¹³
kBBoltzmann constant, per K0.0861730.695040.020837
eelementary charge1.602177 × 10⁻¹⁹ C
cspeed of light299 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:

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

The Dirac card with its fit area open: the assignment By branch, the curves LL 1, LL 2 and CR each assigned a transition, and the result: v = 5.4013 ± 0.0049 × 10⁵ m/s and Δ = 96.39 ± 0.97 cm⁻¹ with χ², reduced χ², 35 degrees of freedom and 37 points. The fitted curves run through the points on the map.
A Dirac model fitted to three picked curves. The fit started from v = 5 and Δ = 9 meV; the result is shown as value ± σ, and the fitted curves are drawn over the map until you apply or discard them.

Fit to points… on a model card opens its fit area in its place (× closes it again):

  1. 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.
    Skip leaves a curve out of the fit.
  2. Fit. The free parameters are fitted by least squares; fixed ones keep their values. A long fit can be cancelled.
  3. 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.
  4. 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.