Tanvir M. Mahim

Software

Twelve free research tools, tested in public and archived with DOIs.

Twelve research tools grew out of the research projects. They are free and open source, live under the TaN-MM-Org organization on GitHub, and each installs with one pip install command.

All twelve are built the same way. Automated tests run in public on every change and compare the main results with textbook formulas, published results or a second calculation done another way. Built-in constants carry a citation. Each package says what it does not do, and stops with an explanation when the data cannot answer the question. Each release is archived on Zenodo with its own DOI.

They are also made for a lab’s own measurements. Most can plan a measurement before it is taken (which settings to measure, and how many repeats a target error bar will cost) and then fit the data with error bars. labplan does just that planning and fitting, for any model you can write as a Python function.

Which tool does what

ToolWhat it is forLatest
ramansepRaman maps of 2D materials: separate strain from extra charge0.17.1
kpenvelopeNitride semiconductors (GaN, AlN): from layers to transistors0.41.0
sqzcombSqueezed light from ring resonators0.21.0
absnoiseBuilt-in noise of superconducting junctions and thermal detectors0.17.1
cavsqueezeSpin ensembles in resonators driven into quieter states1.21.1
SPARQScreening candidate single-photon sources0.16.1
vacspinDiamond color centers as quantum memories that talk to light0.11.1
hamopOne material model, every property0.18.1
fabtwinOptical coatings designed for a machine's real errors0.13.1
fracpllFrequency synthesizers (phase-locked loops) from measured parts0.9.1
lockkernelWhen a crowd of oscillators starts to beat together1.7.1
labplanPlan, fit and document a calibration of any model0.10.0

The latest releases came out between late November and early December 2026. Two of them add new science. hamop 0.17 computes how a 2D semiconductor absorbs light when the excited electron and the hole it leaves behind bind into an exciton, works out the light absorbed by point defects, and takes the matrices of a first-principles calculation directly. sqzcomb 0.20 adds the Raman noise of glass and the timing noise it causes in soliton microcombs. Then, on 3 December, all twelve tools got easier documentation: each README is now a short overview with a first example, and the examples, the list of functions, the checks and the limits each have their own page, in plainer words. That last update changes no code and no result. On 4 December, sqzcomb 0.21 and labplan 0.8 followed the revised version of our Raman timing-noise manuscript: sqzcomb checks whether a comb’s stated pump power, linewidth and detuning can hold a soliton at all, and plans a detuning scan that tests the Raman noise, and labplan gives the chance that a planned measurement rejects a wrong model. On 5 December, kpenvelope 0.39, hamop 0.18 and labplan 0.9 followed our manuscript on Mg-capped GaN hole gases: kpenvelope works out what scatters the holes and the quantum corrections that decide whether a gas conducts better or worse on cooling, hamop computes how a disordered 2D metal loses its conductance, and labplan fits several samples at once with shared and own parameters. On 6 December, kpenvelope 0.40, hamop 0.18.1 and labplan 0.10 made these new tools faster and more robust, with the same results, and kpenvelope 0.41 added the full theory of how the interaction between holes changes the conductance and the Hall effect at any temperature, not only in its two limits, checked against the published formulas and by redoing the main fit of the manuscript.

Every release is checked the same way. New features are tested against an exact answer, a published number or a second, independent calculation, the limits that could not be closed are still listed with the reason, and each changelog on GitHub lists every change.

The tools in detail

ramansep

Raman maps of 2D materials · separating strain from doping

When an atomically thin material such as MoS2 is stretched, or picks up extra electric charge, its Raman peaks shift. Both effects move the same peaks, so one peak alone cannot tell them apart. ramansep combines peaks that respond differently and turns a Raman map into separate maps of strain and charge, each with error bars. With three or more peaks it also flags any pixel that strain and charge alone cannot explain. It ships cited coefficients for MoS2 and graphene, and its tests reproduce the edge-charge result of the nanoribbon study on the Research page.

Latest new features (0.17.0). It can now choose how smooth a strain-and-charge map should be from the data itself, instead of asking you to set it, and it takes correlated errors in the map inversion. Large maps are much faster: a 200 by 200 map went from about 2 s to 0.01 s. A fix: a calibration matrix that is almost singular is now refused; before, it could give a wildly wrong strain with only a warning.

pip install ramansep

kpenvelope

Nitride semiconductors · from a stack of layers to a working transistor

It began with one question: what energy levels do holes (missing electrons) have when they are trapped in a thin GaN layer? That is the physics behind the hole-mass study on the Research page. The package has since grown to cover the path from a stack of layers to a working transistor: the charges and electron densities of nitride stacks, with fits to measured C-V and Hall data; current, traps, self-heating and breakdown in 2D and 3D devices; quantum transport; electron mobility; and the process steps that give a device its shape and doping. A browser app runs many of these calculations without code, and every material number in it has a written source.

Latest new features (0.41.0). What limits a hole gas at low temperature. A neutral Mg acceptor keeps its own hole, so the holes around it cannot screen it away; kpenvelope now solves how strongly one such atom scatters a hole, exactly rather than in the usual weak-scattering approximation, and gives the most any such centre can scatter (the quantum limit). It adds the quantum corrections that decide, near a conductance of about e2/h, whether a gas grows more or less resistive on cooling, the mobility edge of insulating gases, the scaling law of the resistance and the reasons a Hall density can differ from the true one. The tests reproduce the numbers of our manuscript on Mg-capped GaN hole gases. Since 0.40.0 this exact scattering is 8 to 40 times faster, finds by itself how many partial waves it needs, and can refine its own steps until the answer settles. Since 0.41.0 the interaction correction works at any temperature, between the two limits that were given before, with the change of the Hall coefficient too; the tests redo the main fit of the manuscript from its data. (0.38.0 solved tunneling and self-heating together.)

pip install kpenvelope

sqzcomb

Microcombs · squeezed light · quantum noise

Tiny ring resonators can make squeezed light: light whose noise drops below the usual quantum limit when it is measured the right way. sqzcomb predicts how much of that squeezing a detector will see after everything that eats it on the way, such as losses, imperfect detectors and the way the light is coupled out. It also handles pairs of coupled rings, which its tests drive past the single-ring limit, and the entanglement between pairs of comb lines. It also predicts how steadily a soliton comb ticks.

Latest new features (0.21.0). The glass of a ring resonator answers light with a slight delay (its Raman response), which pulls a soliton's spectrum toward the red and also jostles it at random, so the comb ticks less steadily (added in 0.20). New in 0.21: a check of whether a stated pump power, linewidth and detuning can hold a soliton at all; the red shift from a textbook formula, next to the full calculation; which vibrations of the glass make the noise; and the planning of a detuning scan, with the exact chance that it tells the models apart. The tests reproduce the new numbers of the revised manuscript.

pip install sqzcomb

absnoise

Superconducting junctions · noise limits of thermal detectors

In some superconducting devices the current is carried by a few quantum levels whose occupation flickers at random, even in perfect equilibrium. absnoise computes that flicker and what it means for using such devices as very sensitive thermometers and photon-energy detectors: how precisely they can read temperature, and where the hard limits are. It ships junction recipes taken from published devices. It also works backward: from a noisy measured readout, it recovers the hidden level occupation and the flip rates.

Latest new features (0.17.0). It now models readouts that average over each sample and records of finite length, gives each state its own noise width when decoding a trace, and picks the best set of temperatures to measure at. Calibration at low temperature is about 8 to 70 times faster, with the same results to nine digits. Twelve small bugs are fixed, mostly inputs that gave nonsense without a warning.

pip install absnoise

cavsqueeze

Spin ensembles in resonators · spin squeezing

It simulates how a huge number of spins inside a resonator can be driven into a collectively quieter, squeezed state, a route to better clocks and magnetometers. The cost of its solver depends on the shape of the spin ensemble rather than its size (one documented example has 1015 spins), and it checks itself against exact results for small ensembles and against a second method. It was built for 171Yb3+:CaWO4 crystals but works for any spin ensemble in a resonator. It turns its results into the numbers an experiment is designed against, clock stability and magnetic-field sensitivity, and it exports its states to the QuTiP toolbox.

Latest new features (1.21.0). A new exact reference keeps the cavity itself for a few spins, which measures the error of leaving it out. It showed that the documented sign of the detuning was backwards (corrected in the documentation; no number changes) and added a small frequency shift from thermal photons. The calibration now takes error bars on the atom numbers, and the shot planner no longer asks for one shot too many.

pip install cavsqueeze

SPARQ

Single-photon emitters · automated screening

Finding a good single-photon source (the light source behind many quantum technologies) means measuring hundreds of candidate spots, most of them useless. SPARQ automates that screening. It simulates the standard photon-correlation measurement, analyzes real data with error bars, and decides spot by spot how long to keep measuring, stopping as soon as the evidence is enough instead of waiting out a fixed time. It also includes the machine-learning agents from our SPARQ paper (ACS Photonics, 2026). It ships parameter ranges for four kinds of emitter (NV and SiV centers in diamond, and emitters in hBN and GaN), and you can add your own.

Latest new features (0.16.0). Saturation fits now give correct intervals when the counts scatter more than photon counting alone explains, for example with a drifting focus: with 1% drift, 38 of 40 intervals covered the true value in a test, against 19 before. A stationarity check now works with few counts, and profile intervals are about 4.5 times faster. Inputs that gave wrong answers without any warning are now refused.

pip install sparq-triage

vacspin

Diamond color centers · spin-photon interfaces

Some atom-sized defects in diamond, such as the silicon-, germanium- and tin-vacancy centers, are tiny quantum memories that talk to light, which makes them building blocks for quantum networks. vacspin computes how such a center behaves in a real sample: how strain and magnetic fields shift its energy levels, how cleanly it can be read in a single shot, and how its light splits between its optical lines. The tin-vacancy set uses the values of a published experiment. For the silicon- and germanium-vacancy centers only the measured energy splittings are built in, and sample values such as strain are left for you to fit. The lead-vacancy center is documented but not shipped, because its parameters are not fully measured yet. vacspin grew out of our tin-vacancy readout study, published in Optics Express and described on the Research page.

Latest new features (0.11.0). The readout model can now let the spin turn bright and dark any number of times during the readout, with spin relaxation (T1), and lifetimes can be fitted together with a measured detector timing response. In one documented case the old shortcut gave a fidelity of 0.722 where the full model gives 0.752; the documentation says when to switch. Every earlier result is unchanged.

pip install vacspin

hamop

Materials modeling · one model, every property

Many properties of a material, such as its energy levels, how it absorbs light, how well it carries current and its topological properties, are usually computed by separate programs with separate conventions, and the answers can drift apart without anyone noticing. hamop computes all of them from one simple model of electrons hopping between atoms. It handles magnetic fields, spin, disorder and very large systems. Its tests compare it with textbook results, with symmetries or with a second calculation done another way. It was distilled from the modeling behind our MoS2 defect study and works with any material model.

Latest new features (0.18.1). How a disordered 2D metal loses its conductance as it grows: the scaling function from the theory of weak localization (to five loops, with and without strong spin-orbit coupling), and the same slope measured numerically on the Anderson model of a disordered square lattice. Since 0.18.1 the disorder samples are solved together, 4 to 200 times faster, with the same results. (0.17.0 added optics straight from first-principles matrices, excitons in 2D semiconductors and point defects in supercells, from our study of sulfur vacancies in MoS2.)

pip install hamop

fabtwin

Optical coatings · designing for the factory's real errors

Optical filters are built from many thin layers, and no deposition machine hits its targets exactly. The errors are not simple random scatter: they drift, they depend on the recipe, and the rare bad runs, not the average one, decide how many filters work. fabtwin learns a machine's errors from its own production logs and then redesigns the filter so that even the bad runs come out well. Its optics is exact, and each derivative it uses is checked against an independent method. It grew out of our FabGAN-ID paper (IEEE Sensors Journal, 2026), reads any lab's logs in a documented format, and says clearly what a model learned from logs can and cannot promise.

Latest new features (0.13.0). It models errors in each layer's refractive index during a monitored run, and monitoring through a plate that absorbs, checked against the independent tmm package. Scoring designs is about 6 times faster. Five fixes, among them a negative layer thickness that gave more light out than in.

pip install fabtwin

fracpll

Frequency synthesizers · loop design from measured pieces

Almost every radio, radar and fast chip has a phase-locked loop: a circuit that multiplies a clean reference clock up to the frequency the system needs. fracpll answers the usual design questions from your own measured parts (tuning curves, noise points, pump current): is the loop stable and by how much, how much noise the fractional divider adds, how much timing jitter comes out, and whether it will lock. Every input carries a note of where it came from. It computes the divider's control sequence with exact integer arithmetic, can simulate the loop edge by edge as the phase detector and charge pump switch, and refuses, with an explanation, where its simpler model stops being trustworthy. Those edge-by-edge runs showed that a fractional divider raises the noise near the loop bandwidth (by 15 dB in the worked example) because each charge-pump pulse lasts a finite time, and a fast model now predicts this without fitted numbers. It grew out of the GaN-on-SOI synthesizer study on the Research page and works for any charge-pump loop in any technology.

Latest new features (0.9.0). New: the closed-loop bandwidth and peaking of the per-cycle model, the design of third-order loop filters, and correlated inputs in the error bar of the stability margin. An important fix: a loop with extra poles could be reported stable with a 171° margin when it was really unstable. Fractional counts that were silently cut to whole numbers are now refused.

pip install fracpll

lockkernel

Synchronization transitions · exact thresholds and exponents

Fireflies, heart cells, power grids and laser arrays all do the same thing: above a critical coupling, a crowd of slightly different oscillators suddenly starts beating together. How sharply that order grows near the onset is set by one object, the locking kernel. lockkernel computes the whole transition exactly for any spread of frequencies and any kernel, with no fitting and no simulation error near the critical point. It also works the other way: from a measured synchronization curve it fits the threshold and the growth exponent with error bars, says what the exponent reveals about the kernel, refuses to over-claim when the data cannot tell the candidates apart, and tells you how many measurement points a target error bar will cost. It is the maintained version of the code behind the locking-kernel universality study.

Latest new features (1.7.0). Amplitudes now reach 40 to 60 digits instead of stopping near 20, the rule for the growth exponent covers line shapes whose top is not rounded, and two-peaked lines can be used in the dynamics. Input checks were added where bad settings gave impossible results.

pip install lockkernel

labplan

Any experiment · plan, fit, and certify a calibration

Before every calibration, a lab has to decide which settings to measure and how many repeats the error bar it needs will cost. labplan answers that for any instrument or experiment you can describe with a Python function. It plans the measurement, fits the data once you have it, and tells you when a planned measurement cannot determine what you asked for. It can also wrap the result in error bounds that hold even if the model is wrong. Then it writes the record an audit or a lab notebook needs: values with error bars, a fingerprint of the raw data, software versions, time and operator. It needs only NumPy, and every model must carry a literature reference.

Latest new features (0.10.0). Several samples or runs that follow one law can be fitted at once, with some numbers shared by all and some each sample's own, and with each sample left out in turn to see whether one of them drives the result (0.9.0). Since 0.10.0 such fits need about four times fewer evaluations of the model for ten samples, and take exact slopes if you have them. (0.8.0 added the chance that a planned measurement rejects a wrong model.)

pip install labplan

Citing the tools

Each repository carries a CITATION.cff file with citation details that GitHub shows directly, and each release has its own Zenodo DOI. If one of these tools contributes to a publication, please cite the versioned DOI you used.

Contributing

Issues and pull requests are welcome on each repository. A change that touches the physics should come with a test, and a constant with its source.

Support this work

This software is developed at the Department of Electrical and Electronic Engineering, BRAC University, and released openly under the Apache-2.0 license. The Support page lists every way to help, from citing the tools to a small monthly donation.

Support this work