Composition and doping do not have to be constant through a layer. Write two values separated by a slash and the layer is graded between them.
01The syntax
In place of a single number, enter two separated by a slash, optionally followed by an interpolation mode:
- 35 — a constant layer, as usual.
- 20/35 — graded from 20 to 35 across the layer.
- 1e18/1e17 ln — graded, with the mode stated explicitly.
Spacing is forgiving and the mode is not case-sensitive.
02Which end is which
This is the one thing to get right, because it runs opposite to the way you read the table.
A gradient is written in growth order: substrate side first, surface side second. So 20/35 means 20% at the deep end of the layer and 35% at the shallow end. The layer table itself is ordered the other way — the top row is the surface — so within a cell you are writing bottom-to-top while the rows run top-to-bottom.
The mnemonic that helps: a gradient describes the layer as it was grown, starting from the substrate, which is the order a grower would naturally say it aloud.
03Linear or logarithmic
Two interpolation modes are available, and the sensible default differs by column, so you usually need not state one at all:
- lin — linear interpolation. The default for composition, where a straight ramp in mole fraction is almost always what is meant.
- ln — logarithmic interpolation. The default for doping, because doping is set in decades: a grade from 1018 to 1017 should pass through 1017.5 in the middle, not through half of 1018.
State a mode explicitly whenever you want the other behaviour — for instance 20/35 ln for a logarithmic composition ramp, or 1e18/1e17 lin for a linear doping ramp.
04A logarithmic grade cannot reach zero
Logarithmic interpolation is undefined at zero, so a ln gradient with an endpoint of 0 is rejected with an error. This bites most often when grading an alloy down to a binary: 0/53 ln will not run.
There are two ways out. Either switch that grade to linear — 0/53 lin — which is usually what you wanted for composition anyway; or stop just short of zero, using something like 1/53, if you specifically need the logarithmic shape.
05Which columns accept gradients
Three: Fraction (%), p-doping (cm⁻³) and n-doping (cm⁻³). The remaining columns take a single value per layer.
A graded layer is still one row. If you need a profile that a single ramp cannot describe, split it into several thinner layers and grade each in turn — the solver meshes them as one continuous structure.