Calculating the Weighting Potential

Hi all,

I’ve been trying to figure out how to plot a Weighting Potential using AllPix. So far I haven’t had much success so I wanted to start a thread and ask a few of the questions I’ve come up with.

First things’ first. I have a pair of TCAD files that one of my colleagues generated that contains data for a variable called “WeightingPotential”. When I try to run over this variable I get a pretty standard error:

|07:04:46.877| (FATAL) Fatal internal error
No matching region with observable “WeightingPotential” found in field file
Cannot continue.

My colleague and I investigated this, and we found that mesh_converter doesn’t have any mechanism for handling this variable. The source code has a list of conditional statements that pick out things like “ElectrostaticPotential” and “ElectricField”, but if it encounters a variable that isn’t listed it just spits out an error. The manual corroborates this with the same list of accepted variables.

I’ve also heard (from Simon as well as others) that TCAD files don’t usually contain weighting potentials at all. This still seems a bit weird to me, since there is a “WeightingPotentialReader” module in AllPix, which would imply that you are able to read it out of a converted TCAD file, no?

So my question is, how do I calculate and plot it in AllPix-Squared? My colleague has given me a simple explanation of how the weighting potential is defined; it’s the difference between two potentials at different applied voltages. However, this doesn’t seem to agree with the explanation in the manual, which talks about using a 3D map to calculate it.


Hi Damir,

It’s quite correct that TCAD files don’t normally directly contain weighting potentials. The [WeightingPotentialReader] module is indeed made to read weighting potentials, but they tend to come from slightly different sources rather than a directly converted TCAD file.

The most common way of generating a weighting potential file is to make TCAD fields with two slightly different bias voltages, and take the difference in electrostatic potential between them. The way we tend to do this in the Tangerine project for example is to

  • Create two fields at slightly different bias voltages
  • Use the mesh_converter to extract the electrostatic potential for both fields (in either INIT or .apf format; INIT is easier to work with as it’s human-readable)
  • Take the difference between entries in both files, and divide them by the difference in voltage (can be done with a Python script or so)
  • Save the file containing the difference (as in, still as an INIT file, just with new values), and import it into Allpix2 using [WeightingPotentialReader]

As for the 3D thing, what the manual implies is that it’s best to use 3D TCAD fields as the source of the electrostatic potentials, as the results can otherwise be unexpecred when applied to a 3D case (i.e. a matrix of pixels in Allpix2).

Kind regards,

1 Like