Metadata-Version: 2.4
Name: absnoise
Version: 0.17.1
Summary: Andreev-bound-state occupation noise and detector budgets for proximity Josephson junctions
Author-email: "Tanvir M. Mahim" <tanvir.mahim@bracu.ac.bd>
License-Expression: Apache-2.0
Project-URL: Homepage, https://tanvir-mahmud-mahim.github.io/software/
Project-URL: Repository, https://github.com/TaN-MM-Org/absnoise
Project-URL: Issues, https://github.com/TaN-MM-Org/absnoise/issues
Project-URL: Changelog, https://github.com/TaN-MM-Org/absnoise/releases
Keywords: Andreev bound states,Josephson junction,graphene,thermal detector,bolometer,calorimeter,occupation noise,superconductivity
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: scipy>=1.10
Provides-Extra: plot
Requires-Dist: matplotlib; extra == "plot"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# absnoise

[![PyPI](https://img.shields.io/pypi/v/absnoise)](https://pypi.org/project/absnoise/) [![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.22048608-blue)](https://doi.org/10.5281/zenodo.22048608) [![tests](https://github.com/TaN-MM-Org/absnoise/actions/workflows/ci.yml/badge.svg)](https://github.com/TaN-MM-Org/absnoise/actions)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)

`absnoise` is a Python package about one question: **how well can a
superconducting junction measure temperature, or detect a single
photon?** The junctions in question are proximity Josephson junctions:
two superconductors joined by a short piece of normal (not
superconducting) conductor, in the shipped examples graphene. Such a
junction carries its supercurrent (a current that flows with zero
resistance) through a few discrete energy levels, the Andreev levels. Each level is
randomly filled and emptied, even in perfect thermal equilibrium. That
flicker (not the readout electronics) sets the final limit on how
well the junction can sense temperature.

The package follows the whole chain, from the levels to a detector:

- Where are the Andreev levels, and how do they move with phase and
  temperature?
- How large and how fast is the occupation flicker, and what
  temperature resolution does it allow?
- For a real device read out by a microwave resonator: what are the
  frequency-noise spectrum, the noise-equivalent power and the energy
  resolution for a single photon?

It also works backward from measured data: a critical-current curve, a
readout time trace, or a noise spectrum. And it helps plan those
measurements before the fridge time is spent.

The main results are checked by automated tests against exact formulas
or a second, independent calculation (see
[How the results are checked](https://github.com/TaN-MM-Org/absnoise/blob/main/docs/checks.md)). When a
question cannot be answered from the data or parameters given, the
package stops with an error that says why, instead of returning a
number that looks fine but is not.

## Install

```
pip install absnoise
```

It needs Python 3.9 or newer, NumPy 1.24 or newer and SciPy 1.10 or
newer. The optional extra `absnoise[plot]` installs matplotlib; no part
of the package imports it. For development: clone the repository and
run `pip install -e .[test]`, then `pytest`.

Units and conventions are listed in [the guide](https://github.com/TaN-MM-Org/absnoise/blob/main/docs/guide.md).

## A first look

**1. A detector budget for a shipped junction**

```python
import numpy as np
from absnoise import RECIPES, SensorBudget, H_PLANCK

budget = SensorBudget(RECIPES[1])        # the Ti/Al/Au junction of Jung et al.
T = 0.3 * budget.recipe.Tc               # operating temperature (K)
tauA = 1e-6                              # occupation correlation time (s), illustrative

dT_A, sums = budget.dT_andreev(T, tauA, t=1.0)    # 1 s of averaging
dT_ph = budget.dT_phonon(T, t=1.0)
print(f"T = {T:.3f} K, thermal time tau_th = {budget.tau_th(T) * 1e9:.2f} ns")
print(f"temperature resolution in 1 s: Andreev {dT_A * 1e6:.2f} uK, "
      f"phonon {dT_ph * 1e6:.2f} uK")
print(f"tauA/C_A = {tauA / sums['C_A']:.3e} s K/J, "
      f"tau_th/C_e = {budget.tau_th(T) / budget.Ce(T):.3e} s K/J")

sigE = budget.energy_resolution(T, tauA)
print(f"energy resolution: {sigE:.3e} J "
      f"(the energy of a {sigE / H_PLANCK / 1e9:.0f} GHz photon)")

f = np.array([0.0, 1e7, 1e8])
nep = budget.nep_spectrum(T, tauA, f)
for fi, a, p in zip(f, nep["andreev"], nep["phonon"]):
    print(f"NEP at {fi:.0e} Hz: Andreev {a:.2e}, phonon {p:.2e} W/sqrt(Hz)")
```

```
T = 0.225 K, thermal time tau_th = 0.78 ns
temperature resolution in 1 s: Andreev 40.48 uK, phonon 3.58 uK
tauA/C_A = 1.172e+15 s K/J, tau_th/C_e = 9.145e+12 s K/J
energy resolution: 1.752e-22 J (the energy of a 264 GHz photon)
NEP at 0e+00 Hz: Andreev 6.26e-18, phonon 5.53e-19 W/sqrt(Hz)
NEP at 1e+07 Hz: Andreev 6.27e-18, phonon 5.53e-19 W/sqrt(Hz)
NEP at 1e+08 Hz: Andreev 6.97e-18, phonon 5.53e-19 W/sqrt(Hz)
```

At this operating point the occupation noise, not the phonon noise,
sets the temperature resolution. That matches the criterion stated in
the code: occupation noise dominates when `tauA/C_A` is larger than
`tau_th/C_e`. In the NEP, the phonon part is flat at every frequency
(`sqrt(4 kB T^2 G)`), and the occupation part rises as
`sqrt(1 + (2 pi f tau_th)^2)`. The energy resolution is computed in
closed form over all frequencies (since 0.11.0; 0.10.x printed
1.810e-22 J here, 3.3 % too high, because its numerical integral
stopped at a finite frequency).

More in [the examples](https://github.com/TaN-MM-Org/absnoise/blob/main/docs/examples.md).

## Where to read on

- [Examples](https://github.com/TaN-MM-Org/absnoise/blob/main/docs/examples.md): 20 short examples, each with the output it prints.
- [Tutorials](https://github.com/TaN-MM-Org/absnoise/blob/main/docs/tutorials.md): complete analyses, from data to a result with error bars.
- [Words, units and conventions](https://github.com/TaN-MM-Org/absnoise/blob/main/docs/guide.md): the terms used here, explained in plain words, and every unit and sign convention.
- [What is in the package](https://github.com/TaN-MM-Org/absnoise/blob/main/docs/reference.md): every function, grouped by task.
- [How the results are checked](https://github.com/TaN-MM-Org/absnoise/blob/main/docs/checks.md): what each test compares with and how closely, and the mistakes fixed in earlier versions.
- [Limits](https://github.com/TaN-MM-Org/absnoise/blob/main/docs/limits.md): when the package refuses an input and why, and what it deliberately does not do.
- [CHANGELOG](https://github.com/TaN-MM-Org/absnoise/blob/main/CHANGELOG.md): what changed in each version.

## Where it comes from

Methodological basis:

> T. M. Mahim, A. S. M. Mohsin and M. M. Rahman, "Andreev occupation
> noise sets the sensitivity limit of proximity Josephson thermal
> detectors"; code for the paper:
> https://github.com/Tanvir-Mahmud-Mahim/andreev-occupation-noise

This package is the general-purpose engine; the paper repository
reproduces the specific study.

Six junction recipes ship with full provenance (Table I of W. Jung et
al., Phys. Rev. Applied 26, 014078 (2026), arXiv:2503.06850);
graphene electron-phonon cooling follows G.-H. Lee et al., Nature
586, 42 (2020); physical constants are CODATA 2018. The phonon NEP is
compared with J. C. Mather, Appl. Opt. 21, 1125 (1982). The
matched-filter energy resolution is the frequency-domain optimal-filter
result `(int_0^inf 4 df / NEP^2)^(-1/2)` of S. H. Moseley, J. C. Mather
and D. McCammon, J. Appl. Phys. 56, 1257 (1984); its band-limited form
(0.14.0) stops the integral at the readout bandwidth. The Allan
variance follows D. W. Allan, Proc. IEEE 54, 221 (1966) and W. J.
Riley, Handbook of Frequency Stability Analysis, NIST Special
Publication 1065 (2008). The temperature design follows F. Pukelsheim,
Optimal Design of Experiments, SIAM (2006). The Matsubara-sum free
energy of `cpr_series` and `cpr_matsubara` follows from Eqs. (6) and (8) of P. W. Brouwer
and C. W. J. Beenakker, Chaos, Solitons & Fractals 8, 1249 (1997); the
tests check it against the closed-form short-junction current. The
heating-curve fit of `fit_ep_coupling` is the analysis of Lee et al.
(their Fig. 4c and Table I: `delta = 3`, `Sigma` = 2.04 to 3.30
W m^-2 K^-3). Near `Tc` the gap equation
is solved in its Matsubara-sum form, which follows from the integral
form through the partial-fraction expansion
`tanh(x/2) / x = sum_n 4 / (x^2 + (2n+1)^2 pi^2)`; the tests check the
two forms against each other. The spectrum and the Allan variance of
sampled data (0.16.0) follow from summing the sampled autocovariance
`var e^(-|k| dt/tau)`; the tests check both against that sum, done
term by term. The spectrum of averaged samples and the expected
periodogram of a finite record (0.17.0) follow in the same way, from
the autocovariance of the averaged samples (obtained by integrating
`var e^(-|t-s|/tau)` over two sample intervals) and from the finite
sum `sum_{|h|<N} (N - |h|) C(h) e^(-2 pi i j h / N)`; the tests check
them against the Lorentzian times `sinc^2` summed over its aliases,
numerical integration and the quadratic form of the full covariance
matrix. The tail of the Matsubara sums (0.17.0) uses the midpoint form
of the Euler-Maclaurin formula, checked against the full sum. A
replacement recipe number
must arrive with a new source. No phonon-stack parameters are shipped
at all: they are measurements of a real device, and calls without
them raise.

## Citing, support and license

If `absnoise` helps your work, please cite it with the concept DOI
[10.5281/zenodo.22048608](https://doi.org/10.5281/zenodo.22048608),
which always resolves to the latest version; every release is archived
on Zenodo. [CITATION.cff](CITATION.cff) has the details.

Written and maintained by Tanvir Mahmud Mahim (Department of
Electrical and Electronic Engineering, BRAC University), who reviews
every change and takes the final decision on scope and releases.
Design questions are discussed in the open in issues and pull
requests, and the standing rule of
[CONTRIBUTING.md](CONTRIBUTING.md) binds the maintainer exactly as it
binds contributors: a change that touches physics arrives with a
test, and a constant arrives with its source.

Support runs through the
[issue tracker](https://github.com/TaN-MM-Org/absnoise/issues). Usage
questions are welcome alongside bug reports; a docstring that left a
unit or a sign convention unclear is treated as a documentation bug,
not user error. While the version is below 1.0 the API may still move
between minor versions; such changes are called out in the release
notes.

Licensed under Apache-2.0.
