"""Simple detector estimates at the operating temperature. All functions are pure (SI units unless the name gives another unit). Each is a standard closed formula; the source is in the docstring. They are estimates for design work, not a replacement for a measurement. Temperature laws used (t = T / Tc): * gap: Delta(T) = Delta(0) tanh(1.74 sqrt(1/t - 1)), Delta(0) = 1.764 kB Tc (interpolation, accurate to about 2 %) * inductance: Lk(T) = Lk(0) / [(Delta/Delta(0)) tanh(Delta / 2 kB T)] (dirty limit) * penetration: lambda(T) = lambda(0) sqrt(Lk(T) / Lk(0)) * coherence: xi(T) = xi(0) / sqrt(1 - t) (Ginzburg-Landau) * currents: I(T) = I(0) (1 - t^2)^(3/2) (Bardeen) Material values (xi, lambda, Lk) are taken as T = 0 values. """ from __future__ import annotations import math from .physics import HBAR, KB, MU0, PHI0 E_CHARGE = 1.602176634e-19 # C Z0 = 376.730313668 # impedance of free space (ohm) BCS_GAP_RATIO = 1.764 LIKHAREV_FACTOR = 4.4 # a vortex fits in the wire if W > 4.4 xi # -------------------------------------------------------------------------- # Temperature laws # -------------------------------------------------------------------------- def gap_factor(t: float) -> float: """Delta(T) / Delta(0), interpolation of the BCS gap.""" if t <= 0: return 1.0 if t >= 1: return 0.0 return math.tanh(1.74 * math.sqrt(1 / t - 1)) def inductance_factor(t: float) -> float: """Lk(T) / Lk(0) in the dirty limit: 1 / [(D/D0) tanh(D / 2 kB T)].""" if t <= 0: return 1.0 g = gap_factor(t) return 1 / (g * math.tanh(BCS_GAP_RATIO * g / (2 * t))) def coherence_factor(t: float) -> float: """xi(T) / xi(0), Ginzburg-Landau.""" return 1 / math.sqrt(1 - t) def current_factor(t: float) -> float: """I(T) / I(0) for depairing-type critical currents (Bardeen).""" return (1 - t * t) ** 1.5 # -------------------------------------------------------------------------- # Estimates # -------------------------------------------------------------------------- def density_of_states(rs: float, thickness: float, diffusion: float) -> float: """Single-spin density of states N(0) = 1 / (2 e^2 D Rs d) (1 / J m^3). Einstein relation. Frasca et al., PRB 100, 054520 (2019), below Eq. (5). """ return 1 / (2 * E_CHARGE**2 * diffusion * rs * thickness) def depairing_current(rs: float, tc: float, diffusion: float, width: float, t: float) -> float: """Depairing current of a straight wire (A), Kupriyanov-Lukichev. I(0) = 1.491 e N(0) Delta(0)^(3/2) sqrt(D / hbar) w d (Frasca et al. 2019, Eq. 5), which is 1.491 Delta^(3/2) w / (2 e Rs sqrt(hbar D)). Temperature: Bardeen factor (1 - t^2)^(3/2). """ gap = BCS_GAP_RATIO * KB * tc i0 = 1.491 * gap**1.5 * width / (2 * E_CHARGE * rs * math.sqrt(HBAR * diffusion)) return i0 * current_factor(t) def dark_count_exponent(lambda_t: float, thickness: float, temperature: float) -> float: """Exponent nu of the vortex-entry dark-count rate, DCR ~ (I / Ic)^nu. Clem & Berggren Eq. (15): the barrier is Gb = eps0 ln(Ic / I) with eps0 = phi0^2 / (2 pi mu0 Lambda), Lambda = 2 lambda^2 / d. A thermal rate exp(-Gb / kB T) gives nu = eps0 / (kB T). Straight-wire value. """ pearl = 2 * lambda_t**2 / thickness return PHI0**2 / (2 * math.pi * MU0 * pearl) / (KB * temperature) def absorptance(rs: float, fill_factor: float, n_substrate: float = 1.0) -> float: """Absorbed fraction of light, electric field parallel to the wires. Thin resistive sheet between vacuum (light comes from here) and a substrate of index n: A = 4 r / (1 + n + r)^2 with r = Z0 / Rs_eff. A grating with a pitch much smaller than the wavelength acts as a sheet with Rs_eff = Rs / fill factor for this polarisation. No cavity, no reflection from the back of the substrate. The largest value is 1 / (1 + n), at r = 1 + n. """ r = Z0 * fill_factor / rs return 4 * r / (1 + n_substrate + r) ** 2 def retrapping_current(rs: float, tc: float, width: float, hc: float, temperature: float) -> float: """Current below which a normal region cools down again (A). I_r = w sqrt(2 hc (Tc - T) / Rs): Eq. (4) of Incalza et al., Nano Lett. (2026), solved for I_r. ``hc`` = film-to-substrate conductance (W/m^2 K). """ return width * math.sqrt(2 * hc * (tc - temperature) / rs) def thermal_time(rs: float, tc: float, thickness: float, diffusion: float, hc: float) -> float: """Cooling time of the electrons through the substrate contact (s). tau = C_e d / hc with the BCS electron heat capacity at Tc, C_e = 2.43 gamma Tc, gamma = (2 pi^2 / 3) N(0) kB^2. The phonon heat capacity is not included, so this is a lower limit. """ gamma = (2 * math.pi**2 / 3) * density_of_states(rs, thickness, diffusion) * KB**2 return 2.43 * gamma * tc * thickness / hc