Skip to content

Can changing bond lengths produce gravity?

A local change in bond length can attract a second source. We calculate when that force has the Newtonian distance law, then ask what the same rods and clocks would predict for a radio signal passing the Sun.

What the model has to produce

The programme asks whether one microscopic update can account for the matter that makes rods and clocks, the propagation of light and the gravitational field produced by that matter. Letting the sites of the walk move gives a concrete test. First derive how a localized excitation changes the bonds. Then let a second excitation or a light pulse interact with the changed medium. An inverse-square acceleration is one observation. The time taken by a light signal passing the same source is another.

Candidate and inputDerived consequencePhysical test
Stable central springs with local length-sensitive sourcesThe long-range directional pair energy starts at inverse distance cubed for an ordinary force dipoleCompare the response to the same source along an axis and a diagonal
Stiffness for differences in elongation, with the uniform modulus tuned to zeroA scalar dilation source gives an attractive inverse-distance energy and a quadratic longitudinal wave frequencyMeasure force, wave dispersion and material charge independently
Clocks respond universally to that field while compatible surveyed rods are at restMatching slow orbits gives half the relativistic solar light delayCassini's conjunction measurement excludes this completion
Four extra internal paths move the long-wave coneA specified inward drift reproduces the outgoing radial light characteristic in an exterior Schwarzschild shellCouple its speed to dilation, then check clock rates at the center of a hollow shell

The elastic calculation supplies a source and an interaction. The drifting walk supplies a propagation law for a prescribed field. An additional coupling links the two in the exterior of a spherical shell. Continuing that same coupling to the regular center contradicts the symmetry of the source. It also fails at the midpoint between two equal sources. The microwave experiment later in the study gives an example where changing the bonds produces a measured internal gauge field in a planar material. It helps identify which observations could establish the origin of a geometric signal. Previous study of independent rod and spin measurements

Can a measured rod network set the speed of light in the walk?

Sections in this chapter

Begin with the unitary sequence x,y,z,z,y,x. Each gate sends the two eigenstates of a Pauli spin axis in opposite directions along one bond. Survey a uniform cell in laboratory coordinates. The columns of B are the three physical displacements bᵢ for two successive positive fine shifts of each type. T is the elapsed time per full tick. Both come from independent rods and timing. Native alternating update

Three spin axes impose a restriction

Choose a unit spin axis nᵢ for each pair of like gates. Near the zero-momentum crossing the two frequencies are ±|Vᵀk|/T, with V = Σ bᵢ nᵢᵀ = BNᵀ. This follows by expanding the actual shifts exp[−i(k·bᵢ)nᵢ·σ/2] and multiplying the six gates to first order. The closure of the ray velocities at the crossing is an ellipsoidal surface with support function |Vᵀk|/T. A common speed c in the rod geometry requires VVᵀ = (cT)²I.

If B is invertible, that condition forces V = cT O for an orthogonal O. Consequently nᵢ = cT OᵀB⁻ᵀeᵢ. Each reciprocal vector B⁻ᵀeᵢ is normal to the opposite face of the material cell and has length equal to the inverse face altitude. Three unit spin axes therefore work exactly when the three altitudes are equal and cT equals their common value. A common rotation of the spin basis cannot change those lengths.

For b₁=(1,0,0), b₂=(3/4,1,0), b₃=(0,0,1), the three reciprocal lengths are 5/4, 1, 1. Aligning each spin axis with its own bond gives squared packet speeds along the three detector normals of 197/80, 1 and 1 in units with T=1. The underlying Euclidean space here is exactly flat. Even arbitrary choices of the three spin axes cannot make the linear cone spherical for this cell.

A six-gate construction that passes the speed test

The outgoing and returning stages for one bond can use different spin axes. Pick unit mᵢ along the reciprocal vector, a unit pᵢ perpendicular to it, and wᵢ = cT |B⁻ᵀeᵢ| ≤ 1. Use wᵢmᵢ ± √(1−wᵢ²)pᵢ for the two spin axes. These are unit vectors, each gate remains unitary, and their average is wᵢmᵢ. The resulting linear cone has V = cT I. For the sheared example, cT = 4/5 gives weights 1, 4/5 and 4/5. The checker propagates an actual spinor through all six gates for five independent momentum directions. Directional differences return at finite wavelength. The construction fixes the low-energy packet cone for a homogeneous cell under the specified timing bound.

A clock adds an independent condition. In material coordinates let a homogeneous physical length grow by a factor s, let the clock frequency in laboratory time change by N, and let the packet slope in material coordinates change by a factor v. A common local light speed requires sv/N = 1. Simply stretching the time of every unchanged tick changes its clock gap and coordinate packet slope in the same proportion. The ratio measured by rods and clocks would then be s. An adjustable gate strength or a separately responding clock is needed. This is one reason the cone calculation alone cannot establish a spacetime metric.

Two routes through a flat arrangement of rods

Sections in this chapter

A change in a bond can affect both the route of a signal and its phase at the coupler. We can make those effects distinguishable within the six-stage walk. Every rod, every spin axis and every locally homogeneous wave band agree between the two prescriptions in this example. A single detector at the end of one tick distinguishes them.

Locate the labelled sites (u,v,w) at Euclidean positions a(u,v,w exp[q f(u,v)]), where f = uv on the finite patch used by the experiment. Continue f smoothly to a bounded function outside the patch. The vertical rod length is Lz = a exp[q f]. This is a one-to-one deformation of flat space. At each site the vertical and the horizontal projection of the x rod define the laboratory z and x spin axes. The orthogonal third axis is y. These choices give the same three axes everywhere for this particular deformation.

One implementation uses the ordinary Pauli shifts. The other conjugates each x-stage shift by the onsite phase exp[iλ log(Lz/a)]. Thus an x-stage hop acquires the difference of the phases at its endpoints. The y and z stages retain their original couplers. The parameter λ is a coupling of a material length to a phase. A constant length field drops out of every hop. Conjugating every stage by the same site phase would only change the common basis, whereas applying it to the x stages changes a relative path phase.

A detector that isolates the coupling

Prepare +z spin at the origin. Detect at fine coordinates (0,2,2), or coarse coordinates (0,1,1), after one x,y,z,z,y,x tick. This requires two positive y shifts and two positive z shifts. The first and last x shifts must be opposite. The two paths therefore see final x-stage phases exp(±2iθ), where θ = λq. Multiplying the six spin projectors gives the unnormalized final spinor in the z basis:

ψ(target) = [−sin(2θ), i cos(2θ)] / 4.

The position alone has probability 1/16 for every coupling. Among arrivals at that position, the +z fraction is sin²(2θ) and the +y fraction is [1−sin(4θ)]/2. With λ = 0 the +z channel is dark. At θ = π/4 every arrival is +z. The y analyzer resolves the sign near zero. These are native walk predictions for a proposed length-sensitive coupler. A laboratory reading would require an independently surveyed geometry, a phase calibration and absolute port counts.

Recoil on the length coordinate

Promote q to the quantum coordinate of a slow material mode. During a tick take its position to be stationary, let p = −iℏ∂q, and use the same controlled unitary. At the selected site the +x and −x paths multiply the mode wavefunction by exp(±2iλq), shifting its mean canonical momentum by ±2ℏλ. The two ports are equally probable conditional on arrival. For an initially uncorrelated Gaussian mode of mean q₀ and variance σ², the spin interference is proportional to the characteristic function exp[4iλq₀−8λ²σ²]. The spin contrast and the conditional momentum shifts therefore test the same λ using different readouts. The canonical momentum is conjugate to the log-length mode. To convert it to an ordinary force on a specified support, its inertia and mode shape must be measured. A dynamical law for gravity has not been used.

Read the spin at the selected site

Choose the phase θ induced by the log-length deformation. The position detector receives 1 in 16 of the prepared walkers at every setting.

50.0% of those arrivals have +z spin.

Can changing actual bond lengths mediate a static force?

Sections in this chapter

Two localized sources that alter bonds in an ordinary three-dimensional elastic lattice can interact. Their leading static interaction energy generally falls as 1/r³, depends on direction and can change sign. A different local stiffness law for the same displacements produces an attractive scalar 1/r potential. It requires a vanishing uniform elastic modulus and predicts a quadratic longitudinal phonon. Both results concern specified harmonic models. Exact finite-lattice replay

What a hopping perturbation exerts

Let the physical position at vertex n be n + uₙ, in units of the lattice spacing. A bond in direction d has first-order elongation

ℓ_d(n) = d̂ · [u(n+d) − u(n)].

Every bond sharing a vertex uses the same displacement. For a stationary matter source, expand its energy as E_A = E_A(0) − Σ_{n,d} h_A(n,d) ℓ_d(n). For a nondegenerate Hamiltonian eigenstate the coefficient is minus the expectation of the derivative of the matter Hamiltonian with respect to that length. This includes length-dependent hopping. A particular walk or driven system requires its own calibrated source operator and dynamical response.

A source on one bond applies opposite endpoint forces +h d̂ and −h d̂. Its displacement-space vertex contains exp(ik·d) − 1. Every compact source of this form has zero total force and a Fourier vertex f_A(k) = O(|k|). The continuum stress dipole for source A is Pᵢⱼ = Σ_{n,d} h_A(n,d) d̂ᵢ dⱼ. With a positive static dynamical matrix K(k), completing the square gives the cross energy

V_AB = −Re ∫ f_A(k)† K(k)⁺ f_B(k) d³k/(2π)³ .

The Fourier forces include the source positions. The pseudoinverse fixes the common translation. For static, prescribed source amplitudes, quantizing the harmonic displacements gives the same energy shift exactly. The oscillator centers shift while their level spacings and zero-point energies are unchanged. Static force measurements alone cannot identify quantization.

For a homogeneous bulk with finite-range couplings, only translation zeros, and all acoustic eigenvalues bounded above and below by positive multiples of k² near the origin, the two vertices cancel the 1/k² pole. Thus this static harmonic exchange supplies no 1/r potential. The displacement due to one stress dipole is generically O(r⁻²), the strain and pair energy O(r⁻³), and the force obtained by moving the second inclusion O(r⁻⁴). Angular cancellation or a vanishing dipole can suppress these leading terms. An externally balanced point load acting directly on displacement carries a force monopole and samples the 1/r displacement Green function. Boundaries, additional fields, nonlocal sources and other low-energy poles require their own calculation. Clouet, Varvenne and Jourdan, elastic dipole and Green-function equations

A lattice with an angular sign change

Use the three positive axial bonds and six face diagonals, counting each undirected bond once. Give each bond energy κℓ_d²/2 and each vertex mass M. Their exact unit-stiffness matrix and continuum expansion are

D₀(k) = Σ_d 4 sin²(k·d/2) d̂ d̂ᵀ = |k|² I + 2 k kᵀ + O(|k|⁴).

The continuum Lamé moduli are therefore λ = μ = κ, with unit cell volume. The displacement Green tensor in this limit is Gᵢⱼ = (2δᵢⱼ + r̂ᵢr̂ⱼ)/(12πκr). Two identical axial probe orientations, each coupled by −P ∂ₓuₓ, give V_AB = P_A P_B ∂ₓ²Gₓₓ away from contact. Writing s = r̂ₓ gives

V_AB(r) ≃ P_A P_B (5s⁴ − 3s²)/(4πκr³).

For positive charges the coefficient is +1/(2πκ) along x and −1/(16πκ) along the xy diagonal. It vanishes in the transverse plane and on the cone s² = 3/5. These zeros apply to the leading continuum term.

A scalar dilation probe couples to B(n) = Σᵢ ℓ_{eᵢ}(n), whose long-wave limit is div u. In the ordinary isotropic continuum its static susceptibility is 1/C_L, with C_L = λ + 2μ = 3κ. This is a contact term. At nonzero angular frequency the longitudinal mode gives

χ_BB(k,ω) = k²/[C_L k² − ρ(ω+i0)²],      c_L² = C_L/ρ,
χ_BB(r,ω) = (ω/c_L)² exp(iωr/c_L)/(4π C_L r),    r>0 .

Here ρ = M in lattice units and the time convention is exp(−iωt). The 1/r response to harmonic driving loses its amplitude quadratically as the drive frequency goes to zero. A static measurement and a frequency sweep distinguish it from a static pole.

A strain-mediated scalar pole and its dynamical cost

Add a nonnegative stiffness b for spatial differences of each bond's elongation. This uses actual neighboring bonds of the same orientation. The harmonic Hamiltonian is local in the vertex positions and momenta,

H = Σ_n |p_n|²/(2M) + (κ/2) Σ_{n,d} ℓ_d(n)²
                     + (b/2) Σ_{n,d,i} [ℓ_d(n+e_i) − ℓ_d(n)]².
Q²(k) = 4 Σ_i sin²(k_i/2),       K(k) = [κ + b Q²(k)] D₀(k).

The scalar source is −P B(n). When κ = 0 and b > 0, K(k) is positive for every nonzero wavevector of the fixed periodic lattice and vanishes as k⁴ near the origin. Its long-wave dilation susceptibility is 1/(3bk²). The same-sign static sources now attract, with

V_AB(r) ≃ −P_A P_B/(12π b r),         ω_L(k) ≃ √(3b/M) |k|² .

The omitted affine strains have zero energy at this tuning. Fix the simulation cell or mean strain and fix the rigid translation. A freely variable homogeneous strain with a net linear dilation source would be unbounded in the harmonic theory. Locality and translation symmetry allow κ > 0, so achieving this point requires a material mechanism or tuning. With positive κ and b the leading continuum response is 1/[3(κ + bk²)], giving −P_A P_B exp(−r/ξ)/(12πbr), ξ = √(b/κ). Interpreting ξ in the gradient continuum requires it to span many cells. Higher-order, direction-dependent lattice terms may leave algebraic tails. Mindlin and Eshel, first strain-gradient elasticity90036-X)

For a grating along x, put Q = 2 sin(q/2). The volume channel involves only the longitudinal displacement on this symmetry line. Its retarded susceptibility and resonance are exact at every nonzero lattice momentum,

χ_BB(q x̂,ω) = Q²/[3 Q²(κ+bQ²) − M(ω+i0)²],
M ω_L(q)² = 3 Q²(κ+bQ²).

Drive the bond-strength grating at q₁ = π/3 and q₂ = 2π/3 and read the dilation at the same momentum. If only κ is present, the resonance ratio ω₂/ω₁ = √3 and the static gain ratio χ₁/χ₂ = 1. At the soft point both ratios equal 3. At κ = b > 0 the ratios are √6 and 2. A spatially normalized quantum mode has squared ground-to-one-phonon dilation matrix element ℏQ²/(2Mω_L). This vanishes linearly in |q| in the ordinary solid and tends to ℏ/(2√(3Mb)) at the soft point. A calibrated unsymmetrized noise measurement at controlled occupation could distinguish quantum emission and absorption from the reciprocal driven susceptibility.

Finite lattice check

The standard-library replay builds the stiffness from individual central bond lengths, verifies the analytic longitudinal poles and sums the static Green matrix on periodic lattices. It compares its symmetry-reduced sum to a direct full-zone sum with complex vertices on an independent small grid. For the coefficients below it differences the interaction at R and 2R to remove a constant finite-size offset. An A/R³ term gives A = (8R³/7)[V(R) − V(2R)], while a −A/R term gives A = −2R[V(R) − V(2R)]. The coordinates are (10,0,0) or (10,10,0) on a periodic lattice of side 160, with unit source strengths and unit active stiffness.

QuantityLattice coefficientLong-wave coefficient
Ordinary x-bond pair, along x+0.1589004+0.1591549
Ordinary x-bond pair, along xy diagonal−0.0212463−0.0198944
Soft dilation pair, along x+0.0262671+0.0265258

Length-dependent hopping supplies source strengths only after the microscopic matter coupling is specified. Equality of those strengths to inertial masses would require a further law. The model supplies a static scalar force, a wave dispersion and a susceptibility that can be tested together. A spacetime metric with feedback and agreement with gravitational observations remain separate physical tests.

Can the same material charge weigh two different particles?

Sections in this chapter

For a pointlike excitation with energy E, a small dilation D = ∇·u changes its local energy by −P D. The derivative P = −∂E/∂D can be measured by deforming a cell while the excitation stays in a fixed material mode. The same coefficient acts as the source in the elastic energy. For gravity from that energy alone to accelerate different slow excitations alike, the ratio of P to independently measured inertial mass must be common.

An example that passes at small momentum

Double the two-component walk with a second species carrying its inverse W†, and mix the two species locally by exp(−imτₓ), where τₓ exchanges them. The gapped one-particle branches obey cos Ω = cos m cos ω, with ω the massless walk phase. In a cubic reference cell let the two stages on each axis have spin directions with mean length w. Along any coordinate axis cos ω = 1−2w² sin²(k/2) exactly. Near the rest point Ω = m + (w² cot m)k²/2 + O(k⁴). k is material wave number in reference-cell units. At rest the phase gap from the empty one-particle reference is m.

Specify an isotropic length change s and measure time relative to an external reference clock. Give the tick period the law T(s)=T₀s² and the dimensionless mass the law m(s)=s m₀. The rest frequency then scales as N=1/s. For a photon choose average-axis length wγ=4/5. Its measured speed in rod length per local clock time is c=wγa₀/T₀, independent of s. For a massive excitation choose

wₘ(s)² = wγ² tan[m(s)] / m(s).

This one function of the rest phase gives every admissible mass the same relativistic rest and quadratic kinetic calibration. Writing p for momentum in physical rod coordinates and M=ℏm₀/(T₀c²), the energy in reference time is E = N[Mc²+p²/(2M)] + O(p⁴). Because D = 3(s−1) to first order, P = Mc²/3 at rest. In the tuned longitudinal elastic medium, the two-body energy would be −G_eff M₁M₂/r with G_eff = c⁴/(108πb) in the continuum normalization of the preceding chapter. This follows by eliminating the medium with the same coupling at both ends. The stiffness b and the laws for T, m and w remain inputs.

For this split-gate construction wₘ ≤ 1 sets a maximum mass phase, even before the Floquet branch boundary. Along a coordinate axis at s=1 the difference from the relativistic dispersion at order k⁴ has coefficient −wγ²/(24m)+wγ⁴(1−m cot m)/(8m³). The checker uses the actual spin gates and evaluates energies under dilation for three different mass phases. This construction applies to the low-momentum one-particle branch and a uniform, weak dilation. It leaves the response of binding energies, anisotropic strain, and higher orders to be derived.

Comparison with universality measurements

If the elastic interaction supplied all the Earth's attraction and each sample could be treated as pointlike, the Eötvös parameter would be twice the difference in P/M between the two samples divided by their sum. MICROSCOPE measured −1.5 × 10⁻¹⁵ for titanium versus platinum, with statistical and systematic uncertainties of 2.3 and 1.5 × 10⁻¹⁵ respectively. The calculation above makes no prediction of P for the constituent and binding energies of those two alloys. Producing the correct ratio for ideal wave packets is only the first of those tests. MICROSCOPE final results

What does the static dilation pole predict for solar light?

Sections in this chapter

The tuned compatible lattice produces a scalar inverse-distance potential. If the potential sets one universal lapse, all clocks and light follow that lapse, spatial rods use the deformed lattice's Euclidean distances, and the static shift is zero, the model predicts half the observed solar-conjunction delay coefficient. The slow-orbit calibration fixes the relevant lapse coefficient before light propagation is tested. Static lattice derivation · Numerical ray replay

What moves outside a spherical source

Use the long-wavelength tuned point with strain-gradient stiffness b, total scalar source P, and A = P/(12πb). The linear dilation B = div u obeys ordinary Poisson inversion in this limit and B = A/r outside a spherical body. The mean strain vanishes at infinity. For a radial deformation, r is the undeformed radius and

d(r² u_r)/dr = r² B,       u_r = A/2 + C/r²  outside the source.

The interior or an inner boundary fixes C. For a uniform source ball of radius a with a regular center, the Poisson solution and corresponding displacement are

B_in   = A(3a²−r²)/(2a³),       u_in   = A[r/(2a) − r³/(10a³)],
B_out  = A/r,                    u_out  = A/2 − Aa²/(10r²).

The solution is continuous with continuous first displacement derivative at a. Its displacement approaches a finite direction-dependent vector, while its strain decays at infinity. If fixed outer displacements are imposed on a finite sample, the boundary must also be included. Small enough strains keep the deformation one-to-one.

Let R = r + u_r be the physical radius. When rods measure the distances of these displaced vertices in Euclidean space, their exact spatial metric is the pullback g = FᵀF, where F is the Jacobian of the deformation. In spherical coordinates,

dℓ² = (1+u′_r)² dr² + (r+u_r)² dΩ² = dR² + R² dΩ² .

Rods joining fixed material labels do change length. Their compatible deformation leaves every intrinsically measured spatial curvature zero in a smooth Euclidean patch. A field that independently determines physical rod lengths, for example an additional factor multiplying this metric, would give a different hypothesis and a new coefficient to measure.

Calibrate the clock, then send light

Assume a static zero-shift spacetime with universal propagation, ds² = −N(R)²c²dt² + dℓ², and fix N → 1 at infinity. The slow radial acceleration to leading order is −c² ∂_R N. Write m = GM/c², with GM measured from slow orbits. Then N = 1 − m/R + O(m²/R²). For a dilation coupling N = 1 − ηB + higher orders, this calibrates ηA = m at first order. The r-to-R conversion only affects higher order terms.

In isotropic spatial coordinates the first-order parametrized post-Newtonian metric has spatial factor 1 + 2γm/R and time component −(1−2m/R). R here is already the Euclidean isotropic radius, so the static compatible-rod hypothesis gives γ = 0. General relativity gives γ = 1. The optical index is 1 + (1+γ)m/R at this order. The straight unperturbed ray is stationary in flat space, so integrating the index perturbation on that ray gives the first-order travel-time excess for fixed endpoints.

Take the endpoints at (−x₁,h) and (+x₂,h) in a plane through the Sun, with positive x₁,x₂. The Euclidean chord length is x₁+x₂. The one-way excess and the magnitude of the integrated first-order bend are

Δt(h) = (1+γ) GM/c³ [asinh(x₁/h) + asinh(x₂/h)],
−c ∂ₕ Δt = (1+γ) m/h [x₁/√(x₁²+h²) + x₂/√(x₂²+h²)].

The derivative varies both endpoint heights at fixed axial distances. For distant endpoints the bend tends to 2(1+γ)m/h. The following examples use an illustrative geometry with x₁ = 1 au and x₂ = 7.43 au, holding those axial projections fixed between configurations. The one-way delay is the difference Δt(1.6 R☉) − Δt(5 R☉). The return trip repeats the static path. The limb-bending values use distant endpoints and h = R☉. Numerical scales use the IAU nominal solar GM and radius. IAU nominal conversion constants

First-order predictionStatic lapse, γ = 0General relativity, γ = 1
Differential one-way delay11.223938 μs22.447876 μs
Differential return-trip delay22.447876 μs44.895753 μs
Solar limb bending0.875595 arcsec1.751190 arcsec

The independent numerical calculation shoots actual Fermat rays between the fixed endpoints. It uses optical index exp(ε/r) in impact-parameter units and differentiates the solved excess length at ε = 0, where only its first-order coefficient matters. The resulting derivatives are 13.193402212 and 10.914657140, compared with 13.193402209 and 10.914657140 from the finite-endpoint integral. The replay also checks the derivative with respect to impact parameter.

Bertotti, Iess and Tortora used coherent two-way Cassini radio tracking during the 2002 solar conjunction. They inferred γ − 1 = (2.1 ± 2.3) × 10⁻⁵ from the changing light-time delay expressed in Doppler data. This single published fit excludes γ = 0 under the stated universal coupling and slow-orbit calibration. The illustrative delays above are predictions for fixed endpoints. Recovering the mission fit would require its moving trajectories, measurement times, propagation corrections and tracking data. Original Cassini measurement

Why the shift matters

Schwarzschild spacetime itself admits flat spatial slices. In ingoing Painlevé–Gullstrand time T, its metric is

ds² = −c² dT² + (dR + v(R)dT)² + R² dΩ²,       v(R) = √(2GM/R).

The lapse is one. The shift coefficient v in this convention gives coordinate speed −v for the inward-moving slice normals. Its square is of order GM/R. Substituting dT = dt + v dR/(c²−v²) outside the horizon recovers the diagonal Schwarzschild metric, including its non-Euclidean spatial line element on the new t slices. The spacetime therefore gives the full relativistic delay and deflection. The solar comparison tests the combination of the static zero shift, the specified rod geometry and a universal lapse. Martel and Poisson, regular Schwarzschild coordinates

If a material model identifies the inward speed −v with a stationary conserved spherical mass flow, continuity requires 4πR²ρv to be constant in a source-free annulus. Consequently ρ is proportional to R⁻³ᐟ² and the flux requires appropriate inner and outer boundary conditions. A coordinate shift in general relativity imposes no material density profile. A physical completion proposing such a flow would have to derive its velocity, density and coupling to propagation.

A local unitary with a continuously tilted light cone

Sections in this chapter

Adding four transport rails to a two-component Weyl walk allows its low-energy cone to move with a prescribed velocity. In a one-dimensional radial test, a packet evolved by the resulting exact unitary follows an outgoing Painlevé–Gullstrand characteristic. Doubling the resolution from 256 to 512 sites reduces the envelope error from 0.00424 to 0.00110 in normalized L² distance. The velocity profile in this test is an input.

Why enlarge the walk?

For a translation-invariant, finite-range, exactly unitary two-band walk on a fixed lattice, det U(k) and its inverse are Laurent polynomials. Units in that polynomial ring are monomials, giving det U(k) = exp[iφ − i n·k] with an integer vector n. Equivalently, freeze all momenta but one and apply the one-dimensional determinant argument along each axis. The sum of the two eigenphases has gradient n, in the convention that U has eigenvalues exp(−iω). At a Weyl crossing this fixes the common velocity of the pair at n/2 in lattice-site/tick units. A continuous change of the update at fixed lattice and exact unitarity preserves these integers. Extra bands allow the low pair's drift to vary while the other bands compensate. Gross, Nesme, Vogts and Werner, translation-invariant walk index

Four rails and two spin components

Take the four rail displacements dⱼ to be (1,1,1), (1,−1,−1), (−1,1,−1) and (−1,−1,1). At each site choose probabilities pⱼ = (1 + dⱼ·v)/4 and a real normalized vector with components aⱼ = √pⱼ. Then Σⱼ pⱼdⱼ = v. The following three operations are finite-range unitaries.

1. Reflect the rails by C(x) = 2a(x)a(x)ᵀ − I, acting identically on each spin. 2. Shift rail j by dⱼ, retaining its spin. 3. Apply the original determinant-one Pauli walk to the spin on each rail. Units are chosen so its small-k Hamiltonian is σ·k. On the x axis it is exactly exp(−ikₓσₓ) for the palindromic six-shift walk on its coarse lattice.

For constant v, the first two operations have symbol R(k) = diag[exp(−i dⱼ·k)] C. At k=0 the rail a has eigenvalue +1 and its three orthogonal rails have eigenvalue −1. Thus the low pair is isolated from six ancillary modes near k=0. The near-zero rail frequency obeys

Σⱼ pⱼ tan[(dⱼ·k − ω)/2] = 0 .

This follows by eliminating the four amplitudes from the eigenvalue equation for R(k). The axial root is exactly ω = asin(vᵢ sin kᵢ) on its near-zero branch. In arbitrary directions write qⱼ = dⱼ·k and μ = v·k. The expansion is ω = μ + Σⱼ pⱼ(qⱼ−μ)³/12 + O(|k|⁵). The two full low frequencies are ω plus the original spin frequencies. Their linear terms are v·k ± |k|. The rail probabilities must be nonnegative and smooth square roots are guaranteed inside the open tetrahedron. A spherical distribution of drifts in a fixed rail frame allows all directions at speeds below 1/√3 in these units.

With smooth v(x), launch a low-band envelope aⱼ(x)ψ(x). Projecting the conditional shift onto the local rail gives Σⱼ aⱼ(x)aⱼ(x−h dⱼ)ψ(x−h dⱼ). At first order this is ψ − h[v·∇ψ + (∇·v)ψ/2]. The real normalized rail obeys aᵀ∂ᵢa=0, so no additional first-order scalar Berry phase appears when the native spin walk is applied. The effective Hamiltonian is σ·p + (v·p + p·v)/2 with p = −i∇. This gives the principal cone and the half-density transport term. Higher-order dispersion and population outside the local rail projection remain measurable properties of the proposed walk.

Exact lattice propagation on an exterior ray

Set c = rₛ = 1 and prescribe axial v(r) = −1/√r. In the native σₓ = +1 sector the two shifts combine to displacements of 0 or +2 lattice sites on each tick. The computation reflects all four complex rail amplitudes at each site and transports each amplitude exactly. Its continuum comparator has outward speed u(r) = 1 − 1/√r. At final radius r and time t, the initial radius r₀ satisfies F(r)−F(r₀)=t, with F(r)=r+2√r+2 log(√r−1). Conservation of one-dimensional probability gives the continuum envelope √[u(r₀)/u(r)] ψ₀(r₀).

The initial complex packet has smooth compact support in 3.55 < r < 6.45. We evolve to t = 1 on [2,10) with time step equal to the lattice spacing. The finite-speed support stays clear of the periodic seam. This calculation tests the outgoing axial fiber with a prescribed radial profile. Three-dimensional angular spreading and the horizon require separate calculations. Outside mass is measured against the local zero-momentum rail a(r), so it includes finite-momentum dressing as well as dynamical departures from that rail.

SitesLow-envelope L² errorOutside mass at t = 1Maximum outside mass across all ticks
640.0565660.0493850.063808
1280.0156970.0126670.016740
2560.0042400.0031850.004240
5120.0010970.0007970.001064

The full probability norm is conserved within 1.4 × 10⁻¹⁵ in these runs. A separate homogeneous test uses all three spatial axes at v = (0.25,−0.15,0.10) and k = h(0.7,−0.2,0.5). As h falls from 0.2 to 0.1, the absolute linear dispersion error decreases from 3.00 × 10⁻⁴ to 3.72 × 10⁻⁵. Subtracting the explicit cubic term reduces the residuals to 2.39 × 10⁻⁶ and 7.43 × 10⁻⁸. Direct evaluation of the four-by-four characteristic determinant at each numerical root gives residuals below 2.0 × 10⁻¹⁵. Run python3 tilted.py to reproduce both checks. Standard-library replay

What the gravitational assignment requires

The continuum cone admits the unit-lapse, flat-slice representative ds² = −c²dt² + |dx − c v dt|². Assigning v = −√(2GM/(rc²)) r̂ reproduces the Schwarzschild Painlevé–Gullstrand line element. This choice of a velocity profile and of a metric representative supplies physical information beyond the existence of the lattice walk. In particular, the four fixed rails accommodate this entire spherical field smoothly only for r > 3rₛ, where rₛ = 2GM/c². The axial test has a wider admissible range. A finite-range variant doubles each rail displacement and uses pⱼ = (1 + dⱼ·v/2)/4. Its inscribed velocity sphere has radius 2/√3, which permits all horizon directions with |v| = 1. This changes the microscopic range. The numerical results above use the original one-site rail components. Hamilton and Lisle on the Schwarzschild river geometry

For clocks held fixed in this metric, dτ/dt = √(1−|v|²). The leading Newtonian potential inferred from it is −c²|v|²/2. If a static source drives an initially zero analytic shift v = O(M), this clock potential begins at order M². Obtaining the order-M point-mass potential via a shift alone requires additional dynamics or a square-root source law. Adding two individual radial velocities introduces −c²v₁·v₂ into the potential. Fixing a one-source drift therefore leaves the multi-source law, physical clock and rod coupling, and backreaction open.

Can the matter source set the velocity of the moving channels?

Sections in this chapter

In the spherical exterior we can supply a relation that the walk by itself leaves open. Set the lapse to one, use the four transport channels of the preceding chapter and couple their mean velocity v to the elastic dilation D through |v|²/c² = 2D/3. Choose the inward radial direction in the exterior. This dimensionless relation and the direction selection are additional material laws. The channel populations can encode that velocity in a weak field. A change in the source now changes the exterior drift through an energy equation.

Derive the source once

In the long-wavelength continuum candidate take the static energy of the dilation to be (3b/2)∫|∇D|² d³X in physical Cartesian coordinates. This is the longitudinal energy from the tuned elastic lattice to leading order. Keeping that form at finite strain is an extra constitutive assumption. Use a relativistic low-energy matter branch with energy √(m²c⁴+c²p²) + v·p. Minimizing over canonical momentum at fixed position sets the physical velocity to zero and gives mc²√(1−2D/3). The term linear in D gives charge mc²/3. It already arises from the shift, so adding a second direct charge of that size would count the interaction twice. The exact square root beyond the tested kinetic order is also an assumption about the continuum matter spectrum.

Hold a thin spherical shell of rest mass M₀ at physical radius R. Write x=2D(R)/3 and η=2G_eff M₀/(Rc²), with G_eff=c⁴/(108πb). The regular scalar solution is constant inside and falls as R/r outside. Substituting it into the scalar gradient energy plus the shell energy leaves

E/(M₀c²) = √(1−x) + x²/(4η).
Stationarity requires x√(1−x) = η.

The root x < 2/3 is a local minimum of this reduced scalar problem. For η small it gives x = η + η²/2 + higher orders. Outside the shell |v|²/c² = xR/r. The optical metric with that shift has the Schwarzschild exterior form for mass M_ext = M₀/√(1−x). Thus the exterior amplitude follows from the shell in this specified model. An exact identification at finite compactness additionally assumes the continuum constitutive laws just given. The microscopic checks currently establish weak-field, long-wave propagation only.

Why the same closure fails inside

The shell has zero force at the center and a finite potential there relative to infinity. In the scalar calculation D(0)=D(R)>0. A smooth vector that respects all rotations of the shell must vanish at the center. The closure demands a nonzero vector magnitude there. A nonzero radial vector field of constant magnitude has no continuous extension to that point. Merely choosing another inward direction moves the problem or breaks the symmetry of the material state.

The same issue occurs at the midpoint between two equal, held sources in the weak-field limit. Their scalar potentials add to a positive D, but inversion interchanges the sources and forces any invariant polar vector at the midpoint to be zero. A stationary clock there can distinguish the predictions although the forces cancel. Relative to infinity, the unit-lapse, zero-velocity clock would have rate 1. The scalar potential calls for √(1−2D/3). At the center of the thin shell GR likewise gives the interior clock a finite redshift when compared with infinity. A lapse that can vary independently or a different material geometry is needed for a regular symmetry-preserving completion of this kind.

Even the reduced exterior solution leaves a mass discrepancy. Its stationary field-plus-shell energy divided by M₀c² is (1−3x/4)/√(1−x), while the exterior mass divided by M₀ is 1/√(1−x). Their difference is 3x/[4√(1−x)]. For x=25/169, the difference is exactly 25/208. The leading binding term in the field-plus-shell energy is the Newtonian value −G_eff M₀²/(2R). The fractional mass discrepancy starts at order η, and its effect on the exterior metric coefficient G_eff M/r starts at second order in G_eff. The shell is held at fixed radius, and its supporting stresses and their energy are absent. A full account of the inertia and gravity of an isolated body must supply those terms. This formal shell comparison and the independent symmetry obstruction identify where a source law for clocks, rods and gravity is still missing.

A finite honeycomb test with flat rods

Sections in this chapter

A planar array can have trivial geometric parallel transport and still move the two valleys of a honeycomb band in opposite directions. A finite ribbon gives a detector test. Resolve the zero-energy mode at a chosen longitudinal momentum, image its intensity on three successive rows, and reverse a gradient of bond strengths. In the example below their intensity ratio changes from 16/25 to 25/16. A separate change of momentum moves the intensity maximum in opposite directions at the two valleys.

Three bonds and one zero mode

Use a strip with horizontal cell label j, A rows numbered 0 through 2L and B rows numbered 0 through 2L−1. Connect B(j,n) to A(j,n) and A(j+1,n) with the same positive hopping t, and to A(j,n+1) with positive hopping tₙ. Include the Hermitian reverse bonds and take every onsite energy as zero. Energy is measured relative to that onsite value. The strip repeats horizontally. A Fourier component carries phase exp(ikj), with k in radians per horizontal cell.

At zero energy, set every B amplitude to zero. The equation at each B site reads

tₙ aₙ₊₁ = −t(1+exp(ik)) aₙ.

Since every tₙ is positive, these 2L independent equations on 2L+1 A amplitudes give exactly one zero mode at every k. The open edge termination guarantees that eigenvalue even with uniform hopping. The measurable information here lies in the profile and in the gap to the nearest other mode.

Choose tₙ/t = exp[γ(n+1/2−L)] and c(k) = |2 cos(k/2)|. Iterating the recursion gives the intensity on row n,

Pₙ(k) ∝ exp[−γ(n−L)²] c(k)²ⁿ.

Consequently Pₙ₋₁ Pₙ₊₁ / Pₙ² = exp(−2γ) wherever the three intensities are nonzero. A common detection efficiency and the mode normalization cancel. For a single setting relative row efficiencies must be calibrated. With the same three detector channels in both gradient settings, their efficiencies cancel in the ratio of the two ratios. The fixture predicts (16/25)/(25/16) = 256/625 for that reversal. This cancellation assumes the optical response of each channel stays fixed between settings. The relation is exact at finite size and does not require a smooth-gradient expansion.

Take L=3, so each momentum has 13 sites. At either unstrained valley momentum, k=±2π/3, a positive gradient γ=log(5/4) puts the peak at row 3. The next row has 4/5 of the peak intensity, and the outermost row has (4/5)⁹. Uniform hopping gives 1/7 on each A row. Reversing γ gives a minimum at the center. The calibrated three-row ratio is 16/25, 1, or 25/16 in the three settings. The nearest nonzero energy at either valley has magnitude 0.651754 t, 0.445042 t, or 0.241235 t, respectively. These gaps refer to a fixed momentum.

Where the valley degree of freedom enters

Freezing the couplings at one row and extending those couplings periodically gives the local band equation t(1+exp(ik)) + tₙ exp(ip) = 0 for some transverse phase p. Its two longitudinal node positions are k±(n) = ±2 arccos[tₙ/(2t)] as long as 0 < tₙ < 2t. All six bond rows of this fixture satisfy that condition. As the positive node shifts toward zero, the negative node shifts toward zero from the other side. The horizontal cell spacing stays fixed, so the two shifts are in a common laboratory momentum coordinate.

For γ > 0 the continuous maximum of the finite intensity envelope occurs at n* = L + log(c)/γ. The measured maximum lies on the nearest allowed row, with clipping at an edge. At the two unstrained valleys the slopes with respect to the same added momentum are ∓√3/(2γ). For the finite example, adding +π/12 to +2π/3 puts the maximum on row 2. Adding the same +π/12 to −2π/3 puts it on row 4. Time reversal compares k to −k and gives identical intensities, as required for real hoppings. The two measured momenta in the offset test are different from that time-reversed pair.

When the hopping varies slowly on the cell scale, the varying valley centers act as opposite Abelian vector potentials in the two low-energy valley equations. With translation symmetry along x, a transverse gradient of their x component gives opposite effective curls. The exact finite intensities and energies above come directly from the lattice Hamiltonian for the chosen gradient. The nearest-neighbor bonds have real positive amplitudes, so the microscopic phase around a hexagon is zero. The A/B amplitudes are the sublattice pseudospin. The valley label selects one of two separated band nodes. A physical electron spin, if included as a spectator, is acted on by the identity. Guinea, Katsnelson and Geim, strain-induced valley fields

Measuring the rod geometry independently

Set the length of a slant bond to one. Put A(j,n) at (√3(j+n/2), Yₙ) and B(j,n) at (√3(j+(n+1)/2), Yₙ+1/2). Choose Y₀=0 and Yₙ₊₁−Yₙ = 1/2+dₙ. Both slant bonds then have length one and the third bond has length dₙ. For an independently specified hopping law t(d)/t=exp[−β(d−1)], choose dₙ=1−γ(n+1/2−L)/β. With β=3 all the lengths in the example are positive. This is a planar placement with a single Cartesian frame across every row. Euclidean rod parallel transport returns every vector to itself around any contractible loop, for either sign of the gradient. A measured hopping law would be required to use a physical device's rod lengths to predict the intensities.

Jamadi and colleagues fabricated a related planar photonic honeycomb in which the horizontal pillar spacing ranged from 1.9 to 2.7 μm while the other link lengths stayed at 2.4 μm. They reported momentum-resolved spectra and sublattice-resolved intensities. Their apparatus motivates independent calibration of the bond changes. The 13-site profiles and momentum tests here are predictions for the specified ribbon termination and exponential hopping profile. Jamadi et al., photonic Landau levels and helical edge states

The companion program independently diagonalizes the finite hopping matrix, then checks the proposed state against every real-space bond in a 24-cell Bloch repeat. Both valleys, both gradient signs, uniform hopping and the offset momenta are included.

A measured spectral response to deforming links

Sections in this chapter

Bellec and colleagues displaced the sites of a honeycomb array of 196 microwave resonators. The distance between neighboring sites controls their evanescent coupling. A spatial gradient of those couplings changes the microwave spectrum. After calibrating a Dirac pseudo-Landau ladder on just two peaks, we predict four other peak frequencies with a root-mean-square error of 0.956 MHz. The second pair comes from a separately deformed array configuration. This is a retrospective reanalysis of an existing experiment. Primary paper · Experimental spectra in Fig. 2

Measured microwave spectra for deformation strengths 0.20 and 0.15. Diamonds mark two calibration peaks, circles four held-back peaks. All four square-root predictions fall within 1.3 MHz of the measurements.
Each measured trace is scaled to its own peak height for display. Two frequencies set the center and spacing of the predicted levels. Bellec et al., Figure 2 · Download the figure

Predictions withheld from the fit

At the dimensionless coupling-gradient setting β = 0.20, we use only the first strong peak on each side of the central resonance. Their frequencies, 6634.8 and 6671.1 MHz, give the midpoint f₀ = 6652.95 MHz and half-splitting A = 18.15 MHz. With these values fixed, the predicted frequency is f₀ + sgn(n) A √(|n| β/0.20). A comparison spectrum using equally spaced levels has the same two fitted parameters and the same √β strain dependence.

βLevel nMeasured MHzDirac prediction MHzObserved minus prediction MHzEqual-spacing prediction MHz
0.20−26628.36627.282+1.0186616.650
0.20+26679.96678.618+1.2826689.250
0.15−16636.76637.232−0.5326637.232
0.15+16669.56668.668+0.8326668.668

The equally spaced ladder gives 7.485 MHz RMS error. Only the |n| = 2 rows distinguish the two level-spacing laws. The second deformation tests a different dependence. Its measured half-splitting is 16.40 MHz, compared with 15.72 MHz from √β scaling and 18.15 MHz for a spectrum independent of β. The absolute continuum prediction has a measurable discrepancy too. The reported coupling t₀ = 21.5 MHz gives 3t₀√(β/2) = 20.40 MHz at β = 0.20, about 2.25 MHz above the measured 18.15 MHz. Calibrating A absorbs that discrepancy. Coupled-mode parameters and continuum spectrum

Which numbers were measured

The authors' Fig. 2 stores each measured density-of-states curve as 4,001 vector samples. The processing starts from the filled experimental curve, separate from the dashed theoretical markers. Four printed frequency ticks calibrate the horizontal axis. The data excerpt contains every frequency sample within the displayed 6610–6697 MHz interval for each of the two deformations. The vertical coordinates are baseline-subtracted figure units. Absolute density normalization does not enter peak selection. These are plotted processed spectra from the network analyzer experiment. The authors also list a separate data and plotting-script deposit. Author figure source archive · Lancaster experimental data record

In each trace we locate the local maximum nearest the published bare frequency of 6653 MHz. Moving outwards in each direction, we select successive local maxima with height at least half the central peak height. All six frequencies persist as the threshold varies from 35% to 65% in five-percentage-point increments. The 0.1 MHz sample interval gives a sensitivity scale for locating maxima. Moving each calibration and target peak by one sample changes any tabulated residual by at most 0.242 MHz. The reported homogeneous resonator linewidth of 1.7 MHz describes a physical width. Neither the grid nor the linewidth gives a standard error for these peak centers. Fig. 2 supplies no repeat-level covariance, so a significance test would need further data. Experimental methods

Here β controls a spatial hopping gradient, and the observable is a microwave resonance frequency. The spectral comparison supports the effective gauge-field description over the two resolved orders and two deformations examined. This experiment supplies no independent measurement of spacetime curvature, a changed spacetime rod length, or a lagging edge-relaxation law. Those hypotheses require their own physical measurements.

Replay

Run python3 measured.py beside measured.csv for the offline, standard-library calculation. To audit every bundled sample, download the source archive above and run python3 measured.py --verify-source path/to/archive.tar.gz. The same option accepts the original fig2.pdf. The extractor checks its SHA-256, reads the underlying vector vertices, verifies the interior frequency ticks, and compares the two extracted traces to the bundled file. The figure digest is f78f5351588ad20713b7364e34723fdc1efc3f0d9141ff1ca4cbf1d472b9f59a. Replay and extraction code

The plotted measurements are by Matthieu Bellec, Charles Poli, Ulrich Kuhl, Fabrice Mortessagne and Henning Schomerus (2020). The extraction, data split and comparisons here are new. Original publication and open-access license

Programs and transcript

The offline study includes the nine calculation programs and all 22 native Tally checks. Run the supplied replay with the published Tally runtime. The solar-delay and microwave chapters link to the original measurements.

Complete Tally transcript
✓ the second surveyed bond has the calibrated unit tangent  (by cross-pairing plus and minus sides; derived)
✓ one shear produces different squared front speeds along the two detector normals  (by cross-pairing plus and minus sides; derived)
✓ the first reciprocal squared altitude differs from the other two  (by cross-pairing plus and minus sides; derived)
✓ the chosen speed fits inside all three fine shift bounds  (by cross-pairing plus and minus sides; derived)
✓ rotating and splitting the spin axes cancels the mixed cone entry  (by cross-pairing plus and minus sides; derived)
✓ a rational pulse gives a spin-resolved signal at fixed target probability  (by cross-pairing plus and minus sides; derived)
✓ an independent transverse spin analyzer measures the signed quadrature  (by cross-pairing plus and minus sides; derived)
✓ opposite canonical momentum kicks cancel in the mean but add in the variance  (by cross-pairing plus and minus sides; derived)
✓ an ordinary elastic dipole changes interaction sign between axial and diagonal pairs  (by cross-pairing plus and minus sides; derived)
✓ two angles null the leading elastic interaction  (by cross-pairing plus and minus sides; derived)
✓ ordinary and tuned longitudinal squared resonance ratios at two measured wave numbers  (by cross-pairing plus and minus sides; derived)
✓ at zero uniform modulus the two axial static susceptibilities distinguish the tuned limit  (by cross-pairing plus and minus sides; derived)
✓ rest dilation charges give the candidate Newton coefficient in units c to the fourth over pi b  (by cross-pairing plus and minus sides; derived)
✓ the two post-Newtonian shape factors predict a factor of two in relative light delay  (by cross-pairing plus and minus sides; derived)
✓ the opposite ribbon gradients give a detector-gain-cancelling ratio  (by cross-pairing plus and minus sides; derived)
✓ the measured microwave half splitting is 181.5 tenths of a MHz  (by cross-pairing plus and minus sides; derived)
✓ the four ancillary rail populations are positive and normalized  (by cross-pairing plus and minus sides; derived)
✓ the coherent rail state reproduces all three components of a prescribed drift  (by cross-pairing plus and minus sides; derived)
✓ a unit-lapse flow of one quarter light speed supplies a squared shift of one sixteenth  (by cross-pairing plus and minus sides; derived)
✓ the held shell has a self-consistent weak-branch exterior speed  (by cross-pairing plus and minus sides; derived)
✓ the field and shell energy differ from the exterior mass at the rational benchmark  (by cross-pairing plus and minus sides; derived)
✓ the weak branch requires a finite central clock shift even where inversion forces a zero vector  (by cross-pairing plus and minus sides; derived)
Native Tally source
# Rational controls on the deforming-link study.
ratchet 32 step
import "atom"
let zero=whole(0 trial)
let one=whole(1 trial)
let two=whole(2 trial)
let three=whole(3 trial)
let four=whole(4 trial)
let half=fraction(1 trial,2 trial)
let shear=fraction(3 trial,4 trial)
let tx=fraction(3 trial,5 trial)
let ty=fraction(4 trial,5 trial)
let vxx=one+shear*tx
let vxy=shear*ty
check tx*tx+ty*ty==one and tx==shear*ty "the second surveyed bond has the calibrated unit tangent"
check vxx*vxx+vxy*vxy==fraction(197 trial,80 trial) and tx*tx+ty*ty==one "one shear produces different squared front speeds along the two detector normals"
check one+shear*shear==fraction(25 trial,16 trial) "the first reciprocal squared altitude differs from the other two"
let slow=ty
check slow*fraction(5 trial,4 trial)==one and slow*one<one "the chosen speed fits inside all three fine shift bounds"
check tx+flip(shear*ty)==zero and slow*slow+tx*tx==one "rotating and splitting the spin axes cancels the mixed cone entry"

let s2=fraction(3 trial,5 trial)
let c2=fraction(4 trial,5 trial)
let target=fraction(1 trial,16 trial)
let up=target*s2*s2
let down=target*c2*c2
check up==fraction(9 trial,400 trial) and up+down==target "a rational pulse gives a spin-resolved signal at fixed target probability"
check share(target*(one+flip(two*s2*c2)),two)==fraction(1 trial,800 trial) "an independent transverse spin analyzer measures the signed quadrature"
check two*slow+flip(two*slow)==zero and power(two*slow,2 trial)==fraction(64 trial,25 trial) "opposite canonical momentum kicks cancel in the mean but add in the variance"

fn angular(nx2)
  return whole(5 trial)*nx2*nx2+flip(three*nx2)
end
check angular(one)==two and angular(half)==flip(fraction(1 trial,4 trial)) "an ordinary elastic dipole changes interaction sign between axial and diagonal pairs"
check angular(zero)==zero and angular(fraction(3 trial,5 trial))==zero "two angles null the leading elastic interaction"
let qlo=one
let qhi=three
check share(three*qhi,three*qlo)==three and share(three*qhi*qhi,three*qlo*qlo)==whole(9 trial) "ordinary and tuned longitudinal squared resonance ratios at two measured wave numbers"
check share(share(one,three*qlo),share(one,three*qhi))==three "at zero uniform modulus the two axial static susceptibilities distinguish the tuned limit"
let scalar=fraction(1 trial,3 trial)
check share(scalar*scalar,whole(12 trial))==fraction(1 trial,108 trial) "rest dilation charges give the candidate Newton coefficient in units c to the fourth over pi b"
check share(one,two)==half and share(one+one,one+zero)==two "the two post-Newtonian shape factors predict a factor of two in relative light delay"

let row=fraction(4 trial,5 trial)
let curve=row*row
check curve==fraction(16 trial,25 trial) and share(curve,share(one,curve))==fraction(256 trial,625 trial) "the opposite ribbon gradients give a detector-gain-cancelling ratio"
let left=whole(66348 trial)
let right=whole(66711 trial)
check share(right+flip(left),two)==fraction(363 trial,2 trial) "the measured microwave half splitting is 181.5 tenths of a MHz"

let vx=fraction(1 trial,4 trial)
let vy=flip(fraction(1 trial,2 trial))
let vz=fraction(1 trial,8 trial)
let a=share(one+vx+vy+vz,four)
let b=share(one+vx+flip(vy)+flip(vz),four)
let c=share(one+flip(vx)+vy+flip(vz),four)
let d=share(one+flip(vx)+flip(vy)+vz,four)
check a+b+c+d==one and a>zero and b>zero and c>zero and d>zero "the four ancillary rail populations are positive and normalized"
check a+b+flip(c)+flip(d)==vx and a+flip(b)+c+flip(d)==vy and a+flip(b)+flip(c)+d==vz "the coherent rail state reproduces all three components of a prescribed drift"
check share(one,four)*four==one and share(one,four)*share(one,four)==fraction(1 trial,16 trial) "a unit-lapse flow of one quarter light speed supplies a squared shift of one sixteenth"

let shellx=fraction(25 trial,169 trial)
let lapse=fraction(12 trial,13 trial)
let compact=shellx*lapse
check lapse*lapse+shellx==one and compact==fraction(300 trial,2197 trial) "the held shell has a self-consistent weak-branch exterior speed"
let energy=lapse+share(shellx,four*lapse)
check energy==fraction(601 trial,624 trial) and share(one,lapse)+flip(energy)==fraction(25 trial,208 trial) "the field and shell energy differ from the exterior mass at the rational benchmark"
check three*shellx<two and shellx>zero and lapse<one "the weak branch requires a finite central clock shift even where inversion forces a zero vector"
axes.py
"""Homogeneous six-gate cone in independently surveyed physical coordinates."""
from math import acos, cos, sin, sqrt
from itertools import product

UNIT = ((1.,0.,0.), (0.,1.,0.), (0.,0.,1.))
BONDS = ((1.,0.,0.), (.75,1.,0.), (0.,0.,1.))  # columns, twice one fine shift
DUAL = ((1.,-.75,0.), (0.,1.,0.), (0.,0.,1.))


def dot(a,b):
    return sum(x*y for x,y in zip(a,b))


def norm(a):
    return sqrt(dot(a,a))


def unit(a):
    return tuple(x/norm(a) for x in a)


def matrix(left,right):
    return [[sum(a[i]*b[j] for a,b in zip(left,right)) for j in range(3)] for i in range(3)]


def split(mean,perp,w):
    assert abs(dot(mean,perp)) < 1e-14 and 0 <= w <= 1
    s=sqrt(1-w*w)
    return tuple(tuple(w*x+sign*s*y for x,y in zip(mean,perp)) for sign in (-1,1))


def spin_gate(spin,axis,angle):
    x,y,z=axis
    a,b=spin
    sa,ca=sin(angle),cos(angle)
    return (ca*a-1j*sa*(z*a+(x-1j*y)*b),
            ca*b-1j*sa*((x+1j*y)*a-z*b))


def node_speed(direction, k, gates):
    # Extract the traceless, anti-Hermitian part to avoid loss of accuracy near identity.
    col=(1,0);order=(0,1,2,2,1,0)
    for j,i in enumerate(order):
        col=spin_gate(col,gates[i][int(j>=3)],.5*k*dot(direction,BONDS[i]))
    return sqrt(col[0].imag**2+abs(col[1])**2)/k


def main():
    for i,j in product(range(3),repeat=2):
        assert abs(dot(BONDS[i],DUAL[j])-int(i==j))<1e-15
    tangents=tuple(map(unit,BONDS))
    frozen=matrix(BONDS,tangents)
    assert abs(dot(frozen[0],frozen[0])-197/80)<1e-14
    assert abs(dot(frozen[1],frozen[1])-1)<1e-14
    assert tuple(map(norm,DUAL))==(1.25,1.,1.)
    gates=[split(unit(r),p,.8*norm(r)) for r,p in zip(DUAL,(UNIT[2],UNIT[2],UNIT[0]))]
    means=[tuple((x+y)/2 for x,y in zip(a,b)) for a,b in gates]
    calibrated=matrix(BONDS,means)
    for i,j in product(range(3),repeat=2):
        assert abs(calibrated[i][j]-.8*int(i==j))<1e-14
    probes=(*UNIT,unit((1,1,-1)),unit((2,-3,1)))
    ref=[(node_speed(v,1e-5,[(a,a) for a in tangents]),node_speed(v,1e-5,gates)) for v in probes]
    for v,(bare,fit) in zip(probes,ref):
        expected=norm([sum(v[i]*frozen[i][j] for i in range(3)) for j in range(3)])
        assert abs(bare-expected)<1e-8 and abs(fit-.8)<5e-6
    finite=[node_speed(v,.4,gates) for v in probes]
    assert max(finite)-min(finite)>.001
    print("Rod dual lengths:",tuple(map(norm,DUAL)))
    print("Tangent gate squared front support:",[dot(row,row) for row in frozen])
    print("Calibrated low-k speeds:",[round(b,8) for _,b in ref])
    print("Finite-k sin(eigenphase)/|k|:",[round(x,6) for x in finite])


if __name__=="__main__":
    main()
interferometer.py
"""Direct six-stage spinor propagation with a material-dependent link phase."""
from cmath import exp
from math import cos, sin, pi, sqrt

ORIGIN = (0,0,0)
TARGET = (0,2,2)


def split(axis,sign,state):
    a,b=state
    pa,pb=[(b,a),(-1j*b,1j*a),(a,-b)][axis]
    return (a+sign*pa)/2,(b+sign*pb)/2


def walk(theta):
    states={ORIGIN:(1,0)}
    for axis in (0,1,2,2,1,0):
        following={}
        for pos,spin in states.items():
            for sign in (-1,1):
                dest=list(pos);dest[axis]+=sign;dest=tuple(dest)
                da,db=split(axis,sign,spin)
                angle=theta*(dest[0]*dest[1]-pos[0]*pos[1]) if axis==0 else 0
                phase=exp(1j*angle)
                a,b=following.get(dest,(0,0))
                following[dest]=a+phase*da,b+phase*db
        states=following
    return states


def validate_pointer():
    # Conditional on the rare destination, the two x ports each have probability 1/2.
    a,sigma,mean=1.1,.22,.35
    h=.002
    q=[mean+i*h for i in range(-1200,1201)]
    f=[exp(-(t-mean)**2/(4*sigma**2)) for t in q]
    total=sum(abs(x)**2 for x in f)
    predicted=exp(4j*a*mean-8*a*a*sigma*sigma)
    observed=sum(abs(g)**2*exp(4j*a*t) for t,g in zip(q,f))/total
    assert abs(predicted-observed)<1e-12
    kicks=[]
    for sign in (-1,1):
        packet=[g*exp(2j*sign*a*t) for t,g in zip(q,f)]
        mom=sum((packet[i].conjugate()*(packet[i+1]-packet[i-1])/(2j*h)).real
                for i in range(1,len(q)-1))/total
        assert abs(mom-2*sign*a)<.0001
        kicks.append(mom)
    print("Gaussian fringe visibility:",round(abs(observed),8),"port-conditioned momenta:",kicks)


def main():
    for theta in (0,.133,-.133,pi/8,pi/4,pi/2):
        all_sites=walk(theta)
        assert abs(sum(abs(a)**2+abs(b)**2 for a,b in all_sites.values())-1)<1e-14
        a,b=all_sites[TARGET]
        assert abs(a+sin(2*theta)/4)<1e-14 and abs(b-1j*cos(2*theta)/4)<1e-14
        joint=abs(a-1j*b)**2/2
        assert abs(joint-(1-sin(4*theta))/32)<1e-14
        assert abs(abs(a)**2+abs(b)**2-1/16)<1e-14
    validate_pointer()
    print("Both spin quadratures agree with the entire six-stage unitary.")


if __name__=="__main__":
    main()
elastic.py
"""Compatible central-spring lattice. Run with python3 elastic.py (standard library)."""
from math import cos, sin, pi, sqrt, isclose

AXES = ((1, 0, 0), (0, 1, 0), (0, 0, 1))
BONDS = AXES + ((1, 1, 0), (1, -1, 0), (1, 0, 1), (1, 0, -1),
                (0, 1, 1), (0, 1, -1))


def bond_matrix(q):
    """Hessian from actual linearized length changes of individual bonds."""
    matrix = [[0.0] * 3 for _ in AXES]
    for d in BONDS:
        qd = sum(x*y for x, y in zip(q, d))
        factor = 4*sin(qd/2)**2 / sum(x*x for x in d)
        for i in range(3):
            for j in range(3):
                matrix[i][j] += factor*d[i]*d[j]
    return matrix


def entries(c, s):
    x, y, z = c
    u, v, w = s
    return (2*(3-x-x*y-x*z), 2*(3-y-y*z-y*x), 2*(3-z-z*x-z*y),
            2*u*v, 2*u*w, 2*v*w)


def lattice_laws():
    for q in ((.8, .4, -.7), (0, .1, 0), (pi, pi, pi), (1.3, -2.6, .7)):
        direct = bond_matrix(q)
        pairs = ((0, 0), (1, 1), (2, 2), (0, 1), (0, 2), (1, 2))
        analytic = entries(tuple(map(cos, q)), tuple(map(sin, q)))
        assert all(abs(direct[i][j]-v) < 1e-13 for (i,j), v in zip(pairs, analytic))
    for kappa, b in ((1, 0), (0, 1), (1, 1)):
        poles, static = [], []
        for q in (pi/3, 2*pi/3):
            scale = 4*sin(q/2)**2
            longitudinal = bond_matrix((q, 0, 0))[0][0] * (kappa+b*scale)
            assert isclose(longitudinal, 3*scale*(kappa+b*scale))
            poles.append(sqrt(longitudinal))
            static.append(scale/longitudinal)
        print(f"kappa={kappa}, b={b}: pole ratio {poles[1]/poles[0]:.9f}, "
              f"static chi(q1)/chi(q2) {static[0]/static[1]:.9f}")
    # Unit mass, unit stiffness, unit angular drive frequency, q1 then q2.
    assert isclose((1/(3-1))/(3/(9-1)), 4/3)


def real_space(size, radii):
    """Periodic infinite-time static kernel. Mean displacement and cell are fixed.
    Apply octant symmetry, then Fourier inversion. Dilation is summed only
    along x, where each transverse odd Fourier coefficient integrates to zero.
    """
    half = size//2
    freq = [2*pi*j/size for j in range(half+1)]
    c, s = list(map(cos, freq)), list(map(sin, freq))
    weight = [1] + [2]*(half-1) + [1]
    modes = sorted(set(radii) | {2*r for r in radii})
    phase = {r: [cos(r*q) for q in freq] for r in modes}
    axial = dict.fromkeys(modes, 0.0)
    diagonal = dict.fromkeys(modes, 0.0)
    volume = dict.fromkeys(modes, 0.0)
    for i, x in enumerate(c):
        for j, y in enumerate(c):
            sum_bond = sum_volume = 0.0
            xy = 2*s[i]*s[j]
            for k, z in enumerate(c):
                if i == j == k == 0:
                    continue
                xx = 2*(3-x-x*y-x*z)
                yy = 2*(3-y-y*z-y*x)
                zz = 2*(3-z-z*x-z*y)
                xz, yz = 2*s[i]*s[k], 2*s[j]*s[k]
                gxx = yy*zz-yz*yz
                gyy = zz*xx-xz*xz
                gzz = xx*yy-xy*xy
                gxy = xz*yz-xy*zz
                gxz = xy*yz-xz*yy
                gyz = xy*xz-yz*xx
                det = xx*gxx + xy*gxy + xz*gxz
                qx, qy, qz = 2*(1-x), 2*(1-y), 2*(1-z)
                invdet = weight[k]/det
                sum_bond += qx*gxx*invdet
                # For v_l=exp(i k_l)-1, reflection-averaged 2 Re(v_i v_j*)
                # contracted with the off-diagonal inverse keeps 2 sin(k_i)sin(k_j).
                vol = qx*gxx + qy*gyy + qz*gzz + xy*gxy + xz*gxz + yz*gyz
                sum_volume += vol*invdet/(qx+qy+qz)
            pref = -weight[i]*weight[j]/size**3
            for r in modes:
                arm = pref*phase[r][i]
                axial[r] += arm*sum_bond
                diagonal[r] += arm*phase[r][j]*sum_bond
                volume[r] += arm*sum_volume
    return [(r,
             (8/7)*r**3*(axial[r]-axial[2*r]),
             (8/7)*(sqrt(2)*r)**3*(diagonal[r]-diagonal[2*r]),
             -2*r*(volume[r]-volume[2*r])) for r in radii]


def direct_small(size, r):
    """Full Brillouin zone with complex bond vertices; independent of octant reduction."""
    vals = [0.0]*3
    for i in range(size):
        for j in range(size):
            for k in range(size):
                if i == j == k == 0:
                    continue
                q = [2*pi*t/size for t in (i, j, k)]
                c, s = list(map(cos, q)), list(map(sin, q))
                xx, yy, zz, xy, xz, yz = entries(c, s)
                a, b, d = yy*zz-yz*yz, xx*zz-xz*xz, xx*yy-xy*xy
                e, f, g = xz*yz-xy*zz, xy*yz-xz*yy, xy*xz-xx*yz
                adj = ((a,e,f), (e,b,g), (f,g,d))
                det = xx*a+xy*e+xz*f
                v = [complex(x-1,y) for x,y in zip(c,s)]
                q2 = sum(abs(t)**2 for t in v)
                bond = abs(v[0])**2*a/det
                volume = sum(v[l].conjugate()*adj[l][m]*v[m]
                             for l in range(3) for m in range(3)).real/(det*q2)
                dx = cos(q[0]*r)-cos(q[0]*2*r)
                dxy = cos((q[0]+q[1])*r)-cos((q[0]+q[1])*2*r)
                vals[0] -= (8/7)*r**3*bond*dx/size**3
                vals[1] -= (8/7)*(sqrt(2)*r)**3*bond*dxy/size**3
                vals[2] += 2*r*volume*dx/size**3
    return vals


if __name__ == "__main__":
    lattice_laws()
    assert all(abs(a-b)<1e-12 for a,b in
               zip(real_space(10,(2,))[0][1:], direct_small(10,2)))
    print("L    r    axial bond A      diagonal bond A      soft dilation A")
    for size in (96, 160):
        for r, ax, dg, vol in real_space(size, (6, 10)):
            print(f"{size:3d} {r:3d} {ax:16.9f} {dg:18.9f} {vol:16.9f}")
            if size == 160 and r == 10:
                assert isclose(ax, 1/(2*pi), rel_tol=.06)
                assert isclose(dg, -1/(16*pi), rel_tol=.12)
                assert isclose(vol, 1/(12*pi), rel_tol=.05)
    print("Continuum     ", *(f"{v:16.9f}" for v in (1/(2*pi), -1/(16*pi), 1/(12*pi))))
charge.py
"""Rest, kinetic and passive dilation responses of a doubled six-stage unitary."""
from math import acos, cos, sin, sqrt, tan
from axes import spin_gate, split

PHOTON = 4/5


def weight(m):
    return PHOTON*sqrt(tan(m)/m)


def axial_cos(k,w):
    axes=split((1,0,0),(0,0,1),w)
    a,b=(1,0)
    for axis in axes:
        a,b=spin_gate((a,b),axis,k/2)
    return a.real


def omega(m,k,w):
    return acos(cos(m)*axial_cos(k,w))


def lab_energy(s,m0,p):
    # Laboratory time T=s², rod spacing s, hbar=T0=a0=1.
    m=s*m0
    return omega(m,s*p,weight(m))/s**2


def main():
    for m in (.25,.7,.95):
        w=weight(m)
        assert w<=1
        for k in (.1,.6,1.2):
            assert abs(axial_cos(k,w)-(1-2*w*w*sin(k/2)**2))<1e-14
        for s in (.98,1.,1.02):
            h=.0005
            energy=lab_energy(s,m,0)
            inverse_mass=2*(lab_energy(s,m,h)-energy)/h**2
            assert abs(energy-m/s)<1e-13
            assert abs(inverse_mass-PHOTON**2/(s*m))<2e-5
        charge=-(lab_energy(1+.00001,m,0)-lab_energy(1-.00001,m,0))/.00006
        assert abs(charge-m/3)<1e-9
        expected4=-PHOTON**2/(24*m)+PHOTON**4*(1-m/tan(m))/(8*m**3)
        k=.012
        residual=(omega(m,k,w)-sqrt(m*m+(PHOTON*k)**2))/k**4
        assert abs(residual-expected4)<.00012
        print(f"mass phase {m:.2f}  mixing {w:.6f}  P/E {charge/m:.6f}  quartic difference {expected4:.6f}")
    lo,hi=1.0,1.2
    for _ in range(50):
        mid=(lo+hi)/2
        if weight(mid)>1:hi=mid
        else:lo=mid
    print("Maximum admissible positive mass phase for this photon speed:",round(lo,8))
    assert 1<lo<1.1


if __name__=="__main__":
    main()
solar.py
"""Static solar light propagation with compatible Euclidean rods; standard library."""
from math import asinh, cosh, expm1, hypot, isclose, pi, sinh

C = 299792458.0
AU = 149597870700.0
SOLAR_GM = 1.3271244e20
SOLAR_RADIUS = 6.957e8
SOLAR_M = SOLAR_GM/C**2
X1, X2 = AU, 7.43*AU


def log_factor(h):
    return asinh(X1/h) + asinh(X2/h)


def optical_ray(x1, x2, epsilon, steps=800):
    """Fixed endpoints (-x1,1),(x2,1); length unit = impact parameter.
    Solve Fermat's equation for n=exp(epsilon/r); return optical excess length.
    """
    t0, t1 = -asinh(x1), asinh(x2)
    dt = (t1-t0)/steps

    def rhs(t, y, slope):
        x, jac = sinh(t), cosh(t)
        radius = hypot(x, y)
        sec = hypot(1, slope)
        bend = -epsilon*(y-slope*x)*sec**2/radius**3
        excess = expm1(epsilon/radius)*sec + slope*slope/(sec+1)
        return jac*slope, jac*bend, jac*excess

    def shoot(initial_slope):
        y, p, excess = 1.0, initial_slope, 0.0
        for i in range(steps):
            t = t0+i*dt
            a = rhs(t, y, p)
            b = rhs(t+dt/2, y+dt*a[0]/2, p+dt*a[1]/2)
            d = rhs(t+dt/2, y+dt*b[0]/2, p+dt*b[1]/2)
            e = rhs(t+dt, y+dt*d[0], p+dt*d[1])
            y += dt*(a[0]+2*b[0]+2*d[0]+e[0])/6
            p += dt*(a[1]+2*b[1]+2*d[1]+e[1])/6
            excess += dt*(a[2]+2*b[2]+2*d[2]+e[2])/6
        return y-1, excess

    # Secant shooting varies the initial slope until the other endpoint is hit.
    p0, p1 = 0.0, 3*epsilon
    res0, _ = shoot(p0)
    for _ in range(10):
        res1, excess = shoot(p1)
        if abs(res1) < 3e-13:
            return excess
        p0, res0, p1 = p1, res1, p1-res1*(p1-p0)/(res1-res0)
    raise ArithmeticError("Optical ray missed the endpoint")


def check_source():
    strength, radius = .034, 2.3

    def displacement(r):
        if r < radius:
            return strength*(r/(2*radius)-r**3/(10*radius**3))
        return strength*(.5-radius**2/(10*r**2))

    for r in (.1*radius, .5*radius, radius, 2*radius, 10*radius):
        h = 1e-5*radius
        divergence = (displacement(r+h)-displacement(r-h))/(2*h) + 2*displacement(r)/r
        expected = (strength*(3*radius**2-r*r)/(2*radius**3)
                    if r < radius else strength/r)
        assert isclose(divergence, expected, rel_tol=2e-8)


def main():
    check_source()
    near, far = 1.6*SOLAR_RADIUS, 5*SOLAR_RADIUS
    print("Fixed endpoint axial distances 1 au and 7.43 au.")
    eps = 2e-7
    for h in (near, far):
        n1, n2 = X1/h, X2/h
        slope = (optical_ray(n1,n2,eps)-optical_ray(n1,n2,-eps))/(2*eps)
        theory = log_factor(h)
        print(f"h/Rsun={h/SOLAR_RADIUS:.1f}, ray derivative {slope:.9f}, "
              f"closed form {theory:.9f}")
        assert isclose(slope, theory, rel_tol=2e-8)
        dh = .00001*h
        minus_gradient = -(log_factor(h+dh)-log_factor(h-dh))/(2*dh)
        analytical = (X1/hypot(X1,h)+X2/hypot(X2,h))/h
        assert isclose(minus_gradient, analytical, rel_tol=2e-9)
    for gamma in (0, 1):
        coeff = (1+gamma)*SOLAR_M/C
        relative = coeff*(log_factor(near)-log_factor(far))
        limb = 2*(1+gamma)*SOLAR_M/SOLAR_RADIUS * 180/pi*3600
        print(f"gamma={gamma}: differential delay {relative*1e6:.6f} us one-way, "
              f"{2*relative*1e6:.6f} us return trip; limb bending {limb:.6f} arcsec")
    # Verify the exact change to diagonal Schwarzschild coordinates outside the horizon.
    for r in (3., 10., 50.):  # geometric units with GM=c=1
        v, f = (2/r)**.5, 1-2/r
        a = v/f
        assert abs(-f*a+v) < 1e-13
        assert isclose(1 + 2*v*a-f*a*a, 1/f)


if __name__ == "__main__":
    main()
tilted.py
"""An eight-channel walk with a continuously tunable low-energy drift.

Run python3 tilted.py. The propagation is an axial invariant sector of the
full model, with the native Pauli spin in its +x eigenstate.
"""
import cmath
import math


RAILS = ((1, 1, 1), (1, -1, -1), (-1, 1, -1), (-1, -1, 1))


def dot(a, b):
    return sum(x*y for x, y in zip(a, b))


def weights(v):
    p = [(1 + dot(d, v))/4 for d in RAILS]
    if min(p) <= 0:
        raise ValueError('Velocity must be in the open rail tetrahedron')
    return p


def low_frequency(p, k):
    phases = [dot(d, k) for d in RAILS]
    lo, hi = min(phases), max(phases)
    if hi-lo >= math.pi:
        raise ValueError('Bisection needs the near-origin pole-free interval')
    for _ in range(60):
        w = (lo + hi)/2
        if sum(m*math.tan((z-w)/2) for m, z in zip(p, phases)) > 0:
            lo = w
        else:
            hi = w
    return (lo + hi)/2


def direct_residual(p, k, w):
    # Evaluate det[diag(exp(-i*d.k)) (2aa^T-I) - exp(-i*w) I] by
    # elimination on the physical rail matrix, separately from the secular sum.
    a = [math.sqrt(v) for v in p]
    eigen = cmath.exp(-1j*w)
    matrix = []
    for i, d in enumerate(RAILS):
        shift = cmath.exp(-1j*dot(d, k))
        matrix.append([2*shift*a[i]*a[j] - ((shift + eigen) if i == j else 0)
                       for j in range(4)])
    product = 1.
    for i in range(4):
        row = max(range(i, 4), key=lambda j: abs(matrix[j][i]))
        if row != i:
            matrix[i], matrix[row] = matrix[row], matrix[i]
            product = -product
        pivot = matrix[i][i]
        product *= pivot
        if pivot == 0:
            return 0.
        for j in range(i+1, 4):
            fac = matrix[j][i]/pivot
            for col in range(i+1, 4):
                matrix[j][col] -= fac*matrix[i][col]
    return abs(product)


def dispersion():
    v = (0.25, -0.15, 0.1)
    p = weights(v)
    for i in range(3):
        k = [0., 0., 0.]
        k[i] = .37
        w = low_frequency(p, k)
        assert abs(w-math.asin(v[i]*math.sin(k[i]))) < 2e-15
        assert direct_residual(p, k, w) < 2e-14
    direction = (.7, -.2, .5)
    print('oblique h   abs(w-v.k)   after cubic correction   |det|')
    for h in (.2, .1, .05, .025):
        k = [h*z for z in direction]
        linear = dot(v, k)
        cubic = sum(w*(dot(d, k)-linear)**3 for w, d in zip(p, RAILS))/12
        w = low_frequency(p, k)
        res = direct_residual(p, k, w)
        assert res < 2e-14
        assert abs(w-linear-cubic) < 0.01*h**5
        print(f'{h:9.3g}  {abs(w-linear):11.4e}  {abs(w-linear-cubic):20.4e}  {res:.2e}')


def initial(r):
    s = (r - 5.)/1.45
    if abs(s) >= 1.:
        return 0j
    return math.exp(1 - 1/(1-s*s)) * cmath.exp(2j*(r-5.))


def speed(r):
    return 1-1/math.sqrt(r)


def radial_time(r):
    return r + 2*math.sqrt(r) + 2*math.log(math.sqrt(r)-1)


def transported(r, t):
    # The outgoing PG null characteristic takes t = F(r) - F(r0).
    target = radial_time(r)-t
    lo, hi = 1 + 1e-10, r
    for _ in range(60):
        mid = (lo+hi)/2
        if radial_time(mid) < target:
            lo = mid
        else:
            hi = mid
    r0 = (lo+hi)/2
    return math.sqrt(speed(r0)/speed(r))*initial(r0)


def packet(n):
    dx = 8/n
    steps = n//8
    rr = [2+i*dx for i in range(n)]
    aa = [[math.sqrt(q) for q in weights((-1/math.sqrt(r), 0., 0.))] for r in rr]
    norm = math.sqrt(dx*sum(abs(initial(r))**2 for r in rr))
    psi = [[a*initial(r)/norm for a in row] for row, r in zip(aa, rr)]
    max_leak = 0.
    for _ in range(steps):
        nxt = [[0j]*4 for _ in rr]
        for i, (a, row) in enumerate(zip(aa, psi)):
            overlap = dot(a, row)
            for j, d in enumerate(RAILS):
                # Native +x adds one site to each rail's signed axial shift.
                nxt[(i + 1 + d[0]) % n][j] = 2*a[j]*overlap-row[j]
        psi = nxt
        low = [dot(a, row) for a, row in zip(aa, psi)]
        leakage = dx*sum(abs(q-a[j]*f)**2 for row, a, f in zip(psi, aa, low)
                         for j, q in enumerate(row))
        max_leak = max(max_leak, leakage)
    total = dx*sum(abs(q)**2 for row in psi for q in row)
    assert abs(total-1) < 1e-12
    # No support can reach the periodic seam by t=1: range at most +2/tick.
    assert max(map(abs, psi[0]+psi[-1])) == 0.
    exact = [transported(r, steps*dx)/norm for r in rr]
    err = math.sqrt(dx*sum(abs(f-g)**2 for f, g in zip(low, exact)))
    return err, leakage, max_leak, abs(total-1)


def main():
    dispersion()
    print('N      envelope L2    final outside mass   max outside mass   norm defect')
    previous = None
    for n in (64, 128, 256, 512):
        result = packet(n)
        if previous is not None:
            assert result[0] < previous[0] and result[2] < previous[2]
        print(f'{n:3d}  {result[0]:14.6e}  {result[1]:17.6e}  '
              f'{result[2]:17.6e}  {result[3]:.1e}')
        previous = result


if __name__ == '__main__':
    main()
closure.py
"""Thin-shell exterior, sourced closure, and its obstruction at a symmetry center."""
from fractions import Fraction as F
from math import sqrt


def potential_shell(r, panels=40000):
    """Normalized potential of a unit spherical shell via midpoint angular quadrature."""
    return sum(1/sqrt(1+r*r-2*r*(-1+(2*j+1)/panels))
               for j in range(panels))/panels


def energy(x, eta):
    return sqrt(1-x)+x*x/(4*eta)


def solve(eta):
    lo,hi=0.,2/3
    assert 0<eta<hi*sqrt(1-hi)
    for _ in range(60):
        m=(lo+hi)/2
        if m*sqrt(1-m)<eta:lo=m
        else:hi=m
    return (lo+hi)/2


def main():
    x=F(25,169)
    root=F(12,13)
    eta=x*root
    stationary_energy=root+x/(4*root)
    exterior_mass=1/root
    assert (1-x)==root*root and eta==F(300,2197)
    assert stationary_energy==F(601,624) and exterior_mass-stationary_energy==F(25,208)
    assert abs(solve(float(eta))-float(x))<1e-14
    eps=1e-5
    assert energy(float(x)+eps,float(eta))>energy(float(x),float(eta))
    assert energy(float(x)-eps,float(eta))>energy(float(x),float(eta))
    # Independent angular sum over the actual spherical source.
    for r in (0.,.2,.7,1.3,2.,4.):
        assert abs(potential_shell(r)-1/max(1.,r))<1e-8
    for eta in (.0001,.001,.02):
        x=solve(eta)
        assert abs(x*sqrt(1-x)-eta)<1e-14
        assert abs((energy(x,eta)-1)/eta+.25)<.01
        # The gradient is zero at the center, while the required velocity norm is positive.
        assert potential_shell(0)==1 and x>0
        print(f"compactness {eta:g}; squared shell speed {x:.9g}; exterior/rest mass {1/sqrt(1-x):.9f}")
    print("Stationary shell, normalized exterior strength, and nonzero central clock potential checked.")


if __name__=="__main__":
    main()
honeycomb.py
"""Planar honeycomb hopping and an exact zero-mode intensity test.

Standard-library replay. Energies are in units of the unstrained hopping.
The longitudinal 24-cell repeat is a Bloch normalization box. The primitive
honeycomb lives in the plane; no curvature is introduced by gluing a specimen.
"""
from cmath import exp as phase
from math import acos, atan2, cos, exp, hypot, isclose, log, pi, sin, sqrt


def symmetric_spectrum(matrix):
    """Jacobi diagonalization, including the independent numerical eigenstates."""
    a = [row[:] for row in matrix]
    size = len(a)
    vectors = [[float(i == j) for j in range(size)] for i in range(size)]
    for _ in range(100*size*size):
        r, s = max(((i, j) for i in range(size) for j in range(i+1, size)),
                   key=lambda pair: abs(a[pair[0]][pair[1]]))
        if abs(a[r][s]) < 2e-15:
            break
        angle = atan2(2*a[r][s], a[s][s]-a[r][r])/2
        c, u = cos(angle), sin(angle)
        rr, ss, rs = a[r][r], a[s][s], a[r][s]
        a[r][r] = c*c*rr - 2*c*u*rs + u*u*ss
        a[s][s] = u*u*rr + 2*c*u*rs + c*c*ss
        a[r][s] = a[s][r] = 0.0
        for i in range(size):
            if i not in (r,s):
                ir, ik = a[i][r], a[i][s]
                a[i][r] = a[r][i] = c*ir-u*ik
                a[i][s] = a[s][i] = u*ir+c*ik
            vr, vs = vectors[i][r], vectors[i][s]
            vectors[i][r], vectors[i][s] = c*vr-u*vs, u*vr+c*vs
    else:
        raise ArithmeticError("Jacobi iteration failed")
    return sorted((a[i][i], [row[i] for row in vectors]) for i in range(size))


def real_space_check(k, gamma, middle, weights):
    """Apply the three actual bonds to the proposed Bloch eigenstate."""
    columns = 24
    assert abs(phase(1j*columns*k)-1) < 2e-13
    # With zero B amplitudes H|psi> vanishes on A automatically.
    a = {(j,n): phase(1j*k*(j+n/2))*(-1)**n*sqrt(p/columns)
         for j in range(columns) for n,p in enumerate(weights)}
    b_image = [a[j,n]+a[(j+1) % columns,n]
               + exp(gamma*(n+0.5-middle))*a[j,n+1]
               for j in range(columns) for n in range(2*middle)]
    assert max(map(abs,b_image)) < 2e-13
    assert isclose(sum(abs(v)**2 for v in a.values()),1,abs_tol=1e-13)


def fixture(k, gamma, middle=3):
    scale = abs(2*cos(k/2))
    hop = [exp(gamma*(n+0.5-middle)) for n in range(2*middle)]
    bonds = [edge for t in hop for edge in (scale,t)]
    count = len(bonds)+1
    matrix = [[0.0]*count for _ in range(count)]
    for i, t in enumerate(bonds):
        matrix[i][i+1] = matrix[i+1][i] = t
    spectrum = symmetric_spectrum(matrix)
    energy, state = min(spectrum,key=lambda eigenpair:abs(eigenpair[0]))
    gap = min(abs(e) for e,_ in spectrum if abs(e)>1e-12)
    assert abs(energy)<1e-12 and sum(abs(e)<1e-12 for e,_ in spectrum)==1
    assert all(abs(state[i])<2e-13 for i in range(1,count,2))
    weights = [exp(-gamma*(n-middle)**2)*scale**(2*n) for n in range(2*middle+1)]
    weights = [p/sum(weights) for p in weights]
    observed = [state[i]**2 for i in range(0,count,2)]
    assert max(abs(p-q) for p,q in zip(observed,weights))<2e-13
    ratios = [a*c/(b*b) for a,b,c in zip(observed,observed[1:],observed[2:])]
    assert all(isclose(r,exp(-2*gamma),abs_tol=3e-12) for r in ratios)
    real_space_check(k,gamma,middle,weights)
    return observed,gap,ratios[0]


def check_rods(gamma,middle=3,beta=3):
    # A_j,n = (sqrt(3)*(j+n/2), Y_n); B is halfway across the slants.
    # A rows are separated by a slant's vertical projection plus vertical bond length.
    heights = [0.0]
    for n in range(2*middle):
        length = 1-gamma*(n+0.5-middle)/beta
        assert length>0
        assert isclose(exp(-beta*(length-1)),exp(gamma*(n+0.5-middle)),abs_tol=1e-14)
        heights.append(heights[-1]+0.5+length)
        assert hypot(sqrt(3)/2,0.5)==1
        assert isclose(heights[-1]-heights[-2]-0.5,length,abs_tol=1e-14)
    # A frozen row has two longitudinal Dirac momenta so long as t_n<2.
    nodes = [2*acos(exp(gamma*(n+0.5-middle))/2) for n in range(2*middle)]
    assert all(0<k<pi for k in nodes)
    return nodes


def main():
    g = log(5/4)
    K, q = 2*pi/3, pi/12
    for gamma in (g,0,-g):
        frozen=check_rods(gamma)
        print(f"gamma={gamma:+.8f}, frozen positive nodes: {frozen[0]:.6f} -> {frozen[-1]:.6f} rad")
        for k in (K,-K,K+q,-K+q):
            p,gap,ratio=fixture(k,gamma)
            if gamma==g and abs(abs(k)-K)<1e-12:
                assert isclose(p[0]/p[3],(4/5)**9,abs_tol=1e-13)
                assert p.index(max(p))==3
            if gamma==g and k==K+q:assert p.index(max(p))==2
            if gamma==g and k==-K+q:assert p.index(max(p))==4
            if gamma==0 and abs(abs(k)-K)<1e-12:
                assert max(abs(x-1/7) for x in p)<1e-13
            print(f"  k/pi={k/pi:+.6f}  ratio={ratio:.8f}  gap/t={gap:.8f}")
    plus,_,_ = fixture(K,g)
    minus,_,_ = fixture(K,-g)
    gains = (0.32, 0.81, 0.47)
    def measured_ratio(profile):
        a,b,c = (gain*row for gain,row in zip(gains,profile[2:5]))
        return a*c/(b*b)
    assert isclose(measured_ratio(plus)/measured_ratio(minus),256/625,abs_tol=1e-13)
    print("Reversing the gradient in fixed unequal detector channels gives 256/625.")
    print("Both valleys, two gradients, uniform hopping, full real-space bonds and finite spectra passed.")


if __name__ == "__main__":
    main()
measured.py
"""Replay a signed Landau-level test on Bellec et al., Fig. 2 (2020).

python3 measured.py
python3 measured.py --verify-source path/to/2001.10287v1.tar.gz
The source check also accepts its unmodified fig2.pdf member.
"""
import argparse
import csv
import hashlib
import io
import math
from pathlib import Path
import re
import tarfile
import zlib


FIGURE_HASH = 'f78f5351588ad20713b7364e34723fdc1efc3f0d9141ff1ca4cbf1d472b9f59a'
DATA = Path(__file__).with_name('measured.csv')


def extract_source(path):
    if path.suffix.lower() == '.pdf':
        pdf = path.read_bytes()
    else:
        with tarfile.open(path) as archive:
            pdf = archive.extractfile('fig2.pdf').read()
    if hashlib.sha256(pdf).hexdigest() != FIGURE_HASH:
        raise ValueError('This extractor expects fig2.pdf from arXiv:2001.10287v1')
    stream = re.search(rb'(?ms)^9 0 obj\s.*?stream\r?\n(.*?)\r?\nendstream', pdf)
    page = zlib.decompress(stream[1]).decode('latin-1')
    tick_positions = [float(x) for x in re.findall(
        r'^([.\d]+) 28\.0584 m\n\1 24\.5584 l', page, re.MULTILINE)]
    if len(tick_positions) != 4:
        raise ValueError('Failed to locate four labeled frequency ticks')
    def frequency(x):
        return 6620 + 60*(x-tick_positions[0])/(tick_positions[-1]-tick_positions[0])
    if max(abs(frequency(x)-mhz)
           for x, mhz in zip(tick_positions, (6620, 6640, 6660, 6680))) > 0.0001:
        raise ValueError('Interior tick calibration mismatch')
    traces = []
    for baseline in ('85.2144', '28.0584'):
        beginning = page.index('-142.604672 ' + baseline + ' m\n')
        rows = page[beginning:].splitlines()[1:4002]
        trace = []
        for row in rows:
            x, y, operation = row.split()
            f = frequency(float(x))
            if operation != 'l' or abs(f - round(f, 1)) > 0.0001:
                raise ValueError('Unexpected vector trace sample')
            if 6610 <= round(f, 1) <= 6697:
                trace.append((round(f, 1), float(y)-float(baseline)))
        traces.append(trace)
    buf = io.StringIO()
    buf.write('frequency_MHz,beta_015_DOS_plot_units,beta_020_DOS_plot_units\n')
    for (f1, h1), (f2, h2) in zip(*traces):
        if f1 != f2:
            raise ValueError('Frequency grids differ')
        buf.write(f'{f1:.1f},{h1:.6f},{h2:.6f}\n')
    return buf.getvalue()


def peak_centres(points, heights, fraction):
    peaks = [i for i in range(1, len(points)-1)
             if heights[i] > heights[i-1] and heights[i] > heights[i+1]]
    centre = min(peaks, key=lambda i: abs(points[i]-6653))
    strong = [i for i in peaks if heights[i] >= fraction*heights[centre]]
    left = [points[i] for i in reversed(strong) if i < centre]
    right = [points[i] for i in strong if i > centre]
    return left, right


def selected(rows, fraction):
    freq, low, high = zip(*rows)
    neg_low, pos_low = peak_centres(freq, low, fraction)
    neg_high, pos_high = peak_centres(freq, high, fraction)
    return ((neg_high[0], pos_high[0]),
            ((0.20, -2, neg_high[1]), (0.20, 2, pos_high[1]),
             (0.15, -1, neg_low[0]), (0.15, 1, pos_low[0])))


def main():
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument('--verify-source', type=Path)
    args = parser.parse_args()
    if args.verify_source:
        if extract_source(args.verify_source) != DATA.read_text():
            raise ValueError('Bundled spectra differ from author figure')
        print('Both complete plotted intervals match the pinned vector figure.')
    with DATA.open(newline='') as fin:
        table = csv.reader(fin)
        next(table)
        rows = [tuple(map(float, r)) for r in table]
    if len(rows) != 871 or any(abs(row[0] - 6610 - i/10) > 1e-8
                               for i, row in enumerate(rows)):
        raise ValueError('Incomplete plotted frequency interval')
    pair, holdout = selected(rows, 0.50)
    for fraction in (0.35, 0.40, 0.45, 0.55, 0.60, 0.65):
        if selected(rows, fraction) != (pair, holdout):
            raise ValueError('Peak assignment is threshold sensitive')
    centre = sum(pair)/2
    gap = (pair[1]-pair[0])/2
    print(f'Calibration +/-1 at beta=0.20: {pair[0]:.1f}, {pair[1]:.1f} MHz')
    print(f'Centre {centre:.2f} MHz, half-splitting {gap:.2f} MHz')
    print('beta   n   observed   sqrt(n)   observed-predicted   equal spacing')
    errors, equal_errors = [], []
    for beta, n, observed in holdout:
        amplitude = math.copysign(gap*math.sqrt(beta/.2), n)
        pred = centre + amplitude*math.sqrt(abs(n))
        equal = centre + amplitude*abs(n)
        errors.append(observed-pred)
        equal_errors.append(observed-equal)
        print(f'{beta:.2f} {n:+3d} {observed:10.1f} {pred:9.3f} '
              f'{observed-pred:+19.3f} {equal:15.3f}')
    low = [observed for beta, _, observed in holdout if beta == 0.15]
    print(f'At beta=0.15 measured half-splitting {(low[1]-low[0])/2:.2f} MHz, '
          f'predicted {gap*math.sqrt(.15/.20):.2f}, frozen spectrum {gap:.2f}')
    nominal = 3*21.5*math.sqrt(.20/2)
    print(f'Absolute continuum gap from published t0 is {nominal:.2f} MHz, '
          f'measured {gap:.2f} MHz')
    for label, err in (('Dirac', errors), ('Equal spacing', equal_errors)):
        print(f'{label} residual RMS {math.sqrt(sum(x*x for x in err)/len(err)):.3f} MHz')


if __name__ == '__main__':
    main()
replay.py
"""Replay the deforming-link and gravitational-response study using standard Python and a pinned Tally runtime."""
import argparse
import hashlib
from pathlib import Path
import shutil
import subprocess
import sys
import tempfile
from zipfile import ZipFile

ROOT = Path(__file__).resolve().parent
RUNTIME_SHA = "89d3f42bd1417a0d26320d0231f0252c872318b82de6cb423d76a4fbcbee4500"
ATOM_SHA = "4c08a122480cb2d6c1efb48b9e868b5b45432d78dc40b339dbe9db7ebdacf02d"


def checked(path, expected):
    data = path.read_bytes()
    if hashlib.sha256(data).hexdigest() != expected:
        raise ValueError(f"SHA-256 mismatch for {path.name}")
    return data


def main():
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("runtime", type=Path, help="published Tally 0.3.0 runtime ZIP")
    args = parser.parse_args()
    checked(args.runtime, RUNTIME_SHA)
    lib = ROOT / "lib/atom.tly"
    if not lib.is_file():
        lib = ROOT.parent / "walk-clock-recoil/tally/lib/atom.tly"
    atom = checked(lib, ATOM_SHA)
    python = [sys.executable, "-E", "-s", "-B", "-X", "utf8"]
    for script in ("axes", "interferometer", "elastic", "charge", "solar", "tilted", "closure", "honeycomb", "measured"):
        subprocess.run([*python, str(ROOT / (script + ".py"))], check=True)

    with tempfile.TemporaryDirectory() as work_path:
        work = Path(work_path)
        with ZipFile(args.runtime) as runtime:
            runtime.extractall(work)
        tally = work / "Tally-0.3.0"
        (tally / "lib/atom.tly").write_bytes(atom)
        shutil.copyfile(ROOT / "links.tly", work / "links.tly")
        result = subprocess.run([*python, str(tally / "tally.py"), "links.tly"], cwd=work,
                                stdout=subprocess.PIPE, check=True)
        actual = result.stdout.decode("utf-8").splitlines()
        expected = (ROOT / "links.out").read_text(encoding="utf-8").splitlines()
        if actual != expected or sum(line.startswith("✓") for line in actual) != 22:
            raise ValueError("Tally output differs from the 22 published checks")
    print("All nine offline checks and the complete 22-assertion Tally transcript passed.")


if __name__ == "__main__":
    main()
plot_measured.py
"""Plot the measured spectra. Matplotlib is optional and used only by this script."""
import csv
from io import BytesIO
from math import copysign, sqrt
from pathlib import Path

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from PIL import Image, PngImagePlugin

from measured import DATA, selected


OUTPUT = Path(__file__).with_name('measured-peaks.png')
INK = '#17323A'
TRACE = '#0F5660'
FIT = '#AB500A'
PRED = '#7A3596'


def main():
    with DATA.open(newline='') as source:
        reader = csv.reader(source)
        next(reader)
        rows = [tuple(map(float, row)) for row in reader]
    pair, holdout = selected(rows, .50)
    centre, gap = sum(pair)/2, (pair[1]-pair[0])/2
    frequencies, low, high = zip(*rows)
    plt.rcParams.update({
        'font.family': 'DejaVu Sans', 'font.size': 9.5, 'text.color': INK,
        'axes.labelcolor': INK, 'xtick.color': INK, 'ytick.color': INK,
        'axes.spines.top': False, 'axes.spines.right': False,
        'axes.edgecolor': '#708489', 'axes.linewidth': .6,
        'path.simplify': False,
    })
    fig = plt.figure(figsize=(4.3, 6.2), dpi=300, facecolor='white')
    fig.text(.067, .961, 'Microwave resonance spectra',
             va='center', size=15.4, weight='bold')
    dashed = (0, (3, 2))
    legend = [
        Line2D([], [], color=TRACE, lw=1.5, label='Measured spectrum'),
        Line2D([], [], marker='o', ls='', mec=TRACE, mfc='white', mew=1.5,
               ms=5, label='Held-out peak'),
        Line2D([], [], marker='D', ls='', color=FIT, ms=5, label='Peak used to fit'),
        Line2D([], [], color=PRED, ls=dashed, lw=1.5, label='√|n| prediction'),
    ]
    fig.legend(handles=legend, loc='upper left', bbox_to_anchor=(.063,.927),
               ncol=2, frameon=False, handlelength=1.7, handletextpad=.5,
               columnspacing=1.6, fontsize=9.6, borderaxespad=0, labelspacing=.56)
    settings = ((.20, high, .550, 'Fit ±1 and test ±2'),
                (.15, low, .208, 'Test ±1 at the second deformation'))
    for beta, values, bottom, description in settings:
        ax = fig.add_axes((.16, bottom, .798, .232))
        fig.text(.16, bottom+.25, f'β = {beta:.2f}', fontsize=11, weight='bold')
        fig.text(.37, bottom+.25, description, fontsize=9.2)
        maximum = max(values)
        heights = [v/maximum for v in values]
        observed_height = dict(zip(frequencies, heights))
        ax.fill_between(frequencies, heights, facecolor='#E5F0F1', linewidth=0)
        ax.plot(frequencies, heights, color=TRACE, lw=1.18, zorder=3)
        for setting, level, observed in holdout:
            if setting != beta:
                continue
            predicted = centre + copysign(gap*sqrt(abs(level)*beta/.20), level)
            ax.axvline(predicted, color=PRED, ls=dashed, lw=1.25, zorder=2)
            ax.plot(observed, observed_height[observed], marker='o', mfc='white',
                    mec=TRACE, mew=1.55, ms=5.1, zorder=4)
        if beta == .20:
            ax.plot(pair, [observed_height[f] for f in pair], ls='', marker='D',
                    mfc=FIT, mec='white', mew=.55, ms=6.2, zorder=5)
        ax.set(xlim=(frequencies[0],frequencies[-1]), ylim=(0,1.07),
               xticks=(6620,6640,6660,6680), yticks=(0,.5,1),
               yticklabels=('0','0.5','1'), ylabel='Relative density')
        ax.ticklabel_format(axis='x', useOffset=False, style='plain')
        ax.tick_params(length=2.7, width=.6, pad=3)
        ax.grid(axis='y', color='#C6D1D2', lw=.55)
        ax.set_axisbelow(True)
        if beta == .15:
            ax.set_xlabel('Resonance frequency (MHz)', labelpad=5)
    fig.text(.067, .102, 'Each trace is scaled to its maximum over 6610–6697 MHz.',
             size=8.35)
    fig.text(.067, .069, 'Measurements from Bellec et al. (2020), Fig. 2.',
             size=9.1, weight='bold')
    fig.text(.067, .038, 'doi.org/10.1038/s41377-020-00351-2', size=8.6)
    metadata = PngImagePlugin.PngInfo()
    metadata.add_text('Title', 'Microwave resonance spectra')
    metadata.add_text('Description', 'Measured curves from Bellec et al. (2020), '
                      'Fig. 2; new peak selection, model fit and predictions.')
    metadata.add_text('Source', 'https://doi.org/10.1038/s41377-020-00351-2')
    with BytesIO() as raw:
        fig.savefig(raw, format='png')
        raw.seek(0)
        with Image.open(raw) as image:
            indexed = image.convert('RGB').quantize(
                colors=48, method=Image.Quantize.MEDIANCUT, dither=Image.Dither.NONE)
            indexed.save(OUTPUT, optimize=True, dpi=(300,300), pnginfo=metadata)
    plt.close(fig)


if __name__ == '__main__':
    main()
Back to contents ↑

Independent research by Anthony Michael Collado.
Bond strain, forces and light travel time · 1 December 2026

Position and spin → · Study sources (ZIP) ↓