Skip to content

Can a pair of particles measure a gravitational tide?

Three pairs have the same energy, and measuring either particle alone gives the same answer in all three cases. Comparing their frequencies under a tidal field could reveal a coupling that is invisible to every one-particle measurement.

Which colliding pairs have an exact energy line?

Sections in this chapter

Two bosons can occupy the same cubic site and yet completely suppress the hopping that would pull them apart. The required preparation combines a staggered phase between sites with entangled internal spins. A measurement of the energy needed to add such a pair isolates the collision energy. When several pairs are prepared, the measured energy spectrum acquires a calculable width.

Staggered pair creation has an established precedent in Yang's exact η pairs for the fermionic Hubbard model. Here the hopping rotates a two-component bosonic spin, and a site can hold more than two particles. Both details enter the flat one-pair lines and the higher moments below. Yang, Physical Review Letters (1989)

Three preparations on the cubic lattice

Use periodic axes of even length L≥4, V=L³ sites, and the autonomous Hamiltonian from the collision study. Each particle has offset E₀ and hopping operator h(k)=ε d(k)·σ. At one site, n bosons cost additional interaction energy u n(n−1)/2. Wave numbers here are dimensionless coordinates relative to the reciprocal axes of the material.

d(k) = (sin kₓ cos kᵧ cos k_z, sin kᵧ cos k_z, sin k_z)
|Dₐ⟩ = V^(−1/2) Σₙ exp(iKₐ·n) |n,n⟩ |vₐ⟩
vₐ = (I ⊗ σₐ)(|↑↓⟩−|↓↑⟩)/√2

All three vₐ are symmetric spin states. Overall phases have no physical significance. In Dₐ the probability of finding both particles at the same site is one, while the center of the pair is spread coherently over the sample.

Internal axis aTotal material wave number KₐSign changes in d(Kₐ−k) relative to d(k)
x(π,0,0)(+,−,−)
y(π,π,0)(−,+,−)
z(0,π,π)(−,−,+)

These signs are a π rotation about the indicated axis. Conjugation by σₐ implements that rotation on spin matrices. The singlet is killed by the sum of the two Pauli matrices along any common direction. It follows that [h(k)⊗I + I⊗h(Kₐ−k)]vₐ vanishes separately for every k. Each exact energy is 2E₀+u at every contact strength. Independent real scale factors multiplying the three components of d preserve this conclusion.

These exhaust the pure onsite pair eigenstates with definite total wave number for the native hopping. Averaging the free eigenvalue equation over all k gives zero hopping energy. Taking k=0 then requires d(K)=0, so each K component is 0 or π. For sᵢ=cos Kᵢ the sign matrix is S=diag(−sₓsᵧs_z,−sᵧs_z,−s_z). The three independently available Pauli directions require (σᵢ¹+Sᵢᵢσᵢ²)v=0 for every i. Their commutators force det S=+1. Of these proper rotations the identity singles out the antisymmetric singlet, which is excluded at bosonic contact. Each of the remaining three selects one triplet in the table. On a continuous Brillouin torus the same argument applies to the Fourier equation. A length-two periodic axis can lose its sine hopping and admits extra degeneracies.

What a strain measurement isolates

A coherent pair source with the specified spin and spatial phase has a single vacuum addition line at 2E₀+u in this ideal model. Separately measure the one-particle node frequency E₀/ℏ. Subtracting twice that frequency from the pair line gives u/ℏ. Under homogeneous deformation that preserves the hopping parities, the derivative of this difference measures the independent strain response of the contact. This includes variation of the three hopping scales, even when they vary differently. Tracking the same material wave number accounts for the changed reciprocal spacing. General shear that mixes the required spin parities, spin-dependent collisions, loss and dynamical lattice fluctuations need their own response model. Uniform strain is an independently calibrated material perturbation.

What changes at finite pair density

At a site write bₙ† for the normalized local Bell-pair creator, so [bₙ,bₙ†]=nₙ+1. For example, on axis x it is (a↑†²−a↓†²)/2. Let D† be its staggered sum divided by √V. The commutator [H_hop,D†] vanishes as an operator because its pair-creation coefficient is precisely the zero two-spin matrix element above. Consequently the free energy of (D†)^m applied to vacuum is 2mE₀ on the entire Fock space. With a contact, distinct site occupancies can carry different interaction energies.

The normalized measurement of how the m pairs occupy V sites is uniform over all weak compositions l₁+⋯+l_V=m, with nⱼ=2lⱼ. The factorials in the multinomial expansion cancel the norms of the local pair states, since ||(b†)^l|0⟩||²=(l!)². For each configuration the contact energy is U=u[m+2Σⱼ lⱼ(lⱼ−1)]. The following are the exact mean and variance of a projective measurement of the full Hamiltonian on the prepared state.

mean(H) = 2mE₀ + u[m + 4m(m−1)/(V+1)]
var(H)  = 16u² m(m−1)(V−1)(m+V)(m+V+1)
          / [(V+1)²(V+2)(V+3)]

The norm of (H−2mE₀) acting once on the preparation equals the norm of the contact operator on it. This establishes the second moment even though the contact and the hopping need not commute. For the composition average, the joint falling-factorial moment of orders rⱼ is (m falling r) times the product of rⱼ!, divided by (V rising r), where r=Σrⱼ. It follows by taking these many derivatives of the generating function ∏ⱼ(1−z xⱼ)⁻¹, setting xⱼ=1 and extracting z^m. This identity gives the two expressions displayed above. One pair has zero variance. At fixed density of pairs ρ=m/V, the mean contact energy per site tends to u(ρ+4ρ²), and the variance per site tends to 16u²ρ²(1+ρ)². These are preparation-dependent spectral moments, not an equilibrium equation of state.

Where the anisotropic hopping reappears

For two prepared pairs, exactly four particles, the fourth energy moment can resolve hopping. Write βᵢ for the independent scale multipliers of the spin components. The single-particle hopping variance is s²=ε²(βₓ²/8+βᵧ²/4+β_z²/2), the uniform momentum average of h(k)². Then

⟨(H−4E₀)⁴⟩ = [16(V−1)+2592]u⁴/(V+1) + 128u²s²/(V+1).

The chance that all four particles occupy one site is 2/(V+1). The contact energies for one and two occupied sites are 6u and 2u. Acting on the initial state, the contact therefore equals 2u plus 4u times the projection onto all four at one site. One application of the hopping to the projected state produces three particles at the original site and one at a neighbor. Those outputs identify their origin and are orthogonal to the configurations with only even occupancies. The squared outgoing hopping norm for a normalized four-on-one-site state is 4s². Taking the squared norm after two Hamiltonian applications gives the displayed fourth moment. It does not imply a two-line interacting spectrum.

This supplies a finite-density control for material spectroscopy. Calibrate u with the one-pair line, calibrate the three hopping scales with single-particle dispersion, and then measure the energy distribution of two prepared pairs. The fourth-moment prediction uses both calibrations. Its force or gravitational interpretation additionally requires a dynamical material and a coupling to a physical metric.

A pair clock with identical one-particle states

Sections in this chapter

The three pair preparations in the preceding calculation offer a way to ask what a gravitational measurement could add to the flat theory. They occupy the same sites with the same probabilities. The difference lies in a correlation between their spins. A measurement that sees each particle separately has no information about that correlation.

A frequency difference that cancels one-particle shifts

Prepare a normalized onsite two-boson state by applying a pair source to the vacuum. At site r its amplitude is f(r) exp(iK_A·r), and its spin state |A⟩ is the triplet with zero projection on material axis A. Use the same envelope f for all preparations. With a uniform envelope the momenta in the previous chapter give three exact lines in the flat autonomous Hamiltonian. For any common envelope, tracing out one particle gives the same normalized density operator for all three preparations.

ρ₁ = Σ_r |f(r)|² |r⟩⟨r| ⊗ I₂/2 .

This follows because different coincident-site configurations have orthogonal second-particle positions, and each of the three spin states is maximally entangled. Consequently every common one-particle term has the same expectation in all three pairs. This includes arbitrary spin fields, traps, hopping, spin-dependent forces and gravitational coupling to a one-particle bond energy. A scalar contact strength varying from site to site also has the same expectation. For pair addition from the vacuum the centroid of the entire normalized spectrum is exactly ⟨H⟩ relative to the vacuum energy. The cancellation holds for this centroid even if the added terms split or broaden the line. Following only the brightest peak generally loses the cancellation. Matched preparation, matched envelopes and sufficient coverage of spectral weight are experimental requirements.

A single spin one-half has no traceless symmetric spin quadrupole built from its spin alone. The coincident pair has spin one and admits five independent quadrupole components. In units where spin matrices are dimensionless, let Qij=(SiSj+SjSi)/2−2δij/3 on the triplet. Use the Newtonian tidal convention Gij=∂i∂jΦ, so relative acceleration is −Gij times separation. In vacuum this equals c² times the electric Weyl curvature in a local orthonormal rest frame with the convention used here. Specify a contact energy β Σij Gij Qij for each coincident pair; β has units of mass times length squared. It is an independent parameter of this coupling. In the Cartesian triplet basis, Σij Gij Qij is exactly the matrix −G for a symmetric trace-free G.

h(ν̄_A−ν̄_B) = −β Σ_r |f(r)|² [G_AA(r)−G_BB(r)]

The equation assumes that all other contributions are one-body or common scalar contacts. For a spatially uniform diagonal tide and the unperturbed native walk, the three uniform pair preparations remain exact eigenstates and the centroid is the line frequency. If the tide is uniform but tilted, the added contribution gives the exact initial energy variance β² Σ_(B≠A) G_BA² in an initially sharp native line. The first loss of survival probability after a sudden switch is this variance times t²/ℏ². At finite gradients and with other broadening mechanisms present, the centroid remains the observable specified above. A more general crystal may have independent couplings to diagonal and shear fields. A two-body anisotropy of the apparatus can mimic a tidal shift.

Two source arrangements that have the same central potential and acceleration

Place two equal spherical masses M at ±R along x, then at ±R along y, outside the detector. At the center both arrangements give potential −2GM/R and zero acceleration. Under the weak-field Newtonian law the Hessian is (2GM/R³)(I−3 eeᵀ), with e the source axis. Use the difference between the x-pair and y-pair centroids in each arrangement and subtract the two readings. In the point-sampling limit the result for this contact term is

(ν̄_x−ν̄_y)_X − (ν̄_x−ν̄_y)_Y = 12 GM β / (h R³).

For an extended packet use the envelope-averaged measured or modeled tensor in the previous equation. Holding both source configurations fixed in turn and interleaving the two preparations cancels source-independent pair anisotropy. A real instrument also needs local strain and magnetic measurements or reversals to control source-correlated two-body shifts. For example, with a second calibrated rank-two nuisance S, a data set with a single ratio S/G determines only one linear combination of its coupling and β. Applying an independent strain at fixed masses changes that ratio and gives a two-column calibration with full rank. Pure rotation of a single unmeasured nuisance with the masses cannot accomplish this.

What an extended mass can imitate

Suppose double occupancy changes the arrangement of a known mass m within a material cell. In state A put that mass equally at the two offsets ±ℓ e_A, relative to a common central reference. Its ordinary potential energy differs between x and y even if there is no intrinsic curvature term. For the matched source experiment with a central pair and t=ℓ/R<1, its exact double frequency difference obeys

h Δν_size = −(4GMm/R)[1/(1−t²) − 1/√(1+t²)].

To leading order this is precisely the contact formula with β_size=−mℓ²/2. All sufficiently distant weak source configurations measure their sum β_total. The next term in the rigid distribution above is a fractional correction 5t²/12 to its leading signal. Comparing R³Δν at R and 2R removes the point coefficient. At ℓ/R=0.1, the scaled finite-size signals differ by about 0.32% of the leading value. At ℓ/R=10⁻⁵ the same difference is about 3.1×10⁻¹¹. The calculation uses the exact finite-separation potential, with a stable expression for small t. Without a known mass profile and a specified higher-multipole response this distance test alone cannot identify an intrinsic coupling. The next chapter gives an explicit material model and an independent way to calibrate its mass distribution.

How large is a signal at a measured laboratory scale?

Stray and colleagues measured a vertical acceleration-gradient change of approximately 205 Eötvös with separated rubidium atom interferometers. One Eötvös is 10⁻⁹ s⁻². Their apparatus measured a baseline-averaged vertical component. For a sensitivity illustration suppose a separate experiment independently calibrates the required change in the diagonal difference to 205 Eötvös. Take β equal to the illustrative scale m₈₇Rb(1 μm)², about 1.44×10⁻³⁷ kg m². This scale is chosen for the example. Neither the published gradient nor the native walk determines it. Published gradiometer measurement · Atomic mass and physical constants

The predicted pair frequency change in that scenario is about 4.46×10⁻¹¹ Hz, or a phase of 2.8×10⁻¹⁰ radians in one second. Even an ideal full-contrast Ramsey measurement at quadrature would require about 1.3×10¹⁹ independent detected pairs for unit signal-to-noise at that interrogation time, before accounting for preparation, reversal or calibration noise. An artificial gradient can amplify a material test if the microscopic operator to which it couples is independently identified. Observing such a signal tests that interaction. Establishing gravitational coupling requires a gravitational source measurement as well.

The current theory determines the flat pair line, its spin state and its response to a specified perturbation. It permits both β=0 and β≠0 with identical flat pair spectra. Inferring β requires a pair readout in a calibrated tide, an independently determined material moment, or a microscopic law that relates them.

Can positive material mass carry the contact quadrupole?

Sections in this chapter

A material can redistribute mass when two particles meet. We construct two examples that preserve the entire unstrained quantum Hamiltonian and give different, independently calibratable responses to a tidal field. One resolves the three axes of a crystal. The other also describes mixing between spin states under an arbitrarily oriented tide.

Encoding the same hopping and collision

At each material site add a reference marker system with a positive mass m and ground state |r⟩. The three symmetric internal two-boson states |a⟩, for a=x,y,z, form a Cartesian basis. A local unitary Uₙ can send each input |a⟩|r⟩ to an orthonormal codeword. In the first example it leaves |a⟩ in place and switches the marker to configuration a. All other occupancy sectors can keep the reference configuration. Applying U=∏Uₙ to the whole lattice gives an isometric copy of every particle-number sector.

H_encoded = U [H_native ⊗ I + I ⊗ H_marker] U†
|ψ_encoded⟩ = U [|ψ⟩ ⊗ |r,r,…⟩]

With reference energy set to zero, H_encoded acting on this subspace reproduces H_native exactly. Onsite terms remain onsite and hopping still couples the same pairs of sites. The physical hopping now changes the appropriate marker configurations when a pair forms or breaks. All preparations and observables used for a flat comparison must be encoded consistently. A physical instrument could distinguish the constructions by observing the markers. Their kinetic costs, compensation energies, supporting structure and calibrated hopping are additional engineering inputs. This construction establishes existence of an isospectral Hamiltonian. It does not derive that Hamiltonian from the natural forces of an unspecified material.

For any matched envelope fₙ, a two-particle preparation Σₙ fₙ|n,n⟩|a⟩ has one-particle reduced density concentrated at each site with spin density proportional to the identity. Tracing over the other particle removes both the intersite coherence and the spin-axis label. Thus every common one-particle perturbation makes the same contribution to all three addition-energy centroids, as does a scalar contact. The expectation of a Hamiltonian in the normalized state after creation is its spectral centroid, including when a perturbation broadens the line. In a physical encoding the comparison needs matched preparation, identical initial support and control of any spin-dependent preparation energies.

Two positive masses on an axis

Give the marker mass m/2 at each of x±ℓeₐ when the local pair is in state a. Put the same total mass at the center in the reference state. Two equal masses remove the dipole in each individual configuration. In a smooth weak Newtonian potential Φ the additional marker energy relative to that reference is

δEₐ = (m/2)[Φ(x+ℓeₐ)+Φ(x−ℓeₐ)−2Φ(x)]
    = (mℓ²/2) ∂ₐ²Φ + O(mℓ⁴ ∂⁴Φ).

These formulas use acceleration-gradient units for the tide Eᵢⱼ=∂ᵢ∂ⱼΦ. Equal positive total mass is present before and after the preparation. The difference in the source mass density has Fourier amplitude m[cos(qₐℓ)−1]; its small-q coefficient gives the same second moment as the detector energy. Measuring the marker masses and their conditional separations, or measuring the difference mℓ² between transverse and axial moments of inertia of the rigid pair, calibrates this contribution without a gravitational fit. Attributing the inertial calibration to a gravitational source assumes that these material masses gravitate with the same weights. Binding and support energies require separate accounting at relativistic precision.

This realizes β=−mℓ²/2 in the convention δEₐ=−βEₐₐ. Since the three markers occupy disjoint, definite configurations, a gravitational potential diagonal in their positions has zero off-diagonal matrix elements between the encoded axes. The construction predicts the diagonal centroids and aligned splittings. A tide with nonzero Eₓᵧ can test the additional spin mixing of a fully tensorial response.

A positive orientation readout that also mixes spins

A fixed-radius rotor provides a different local isometry. Mark its two equal-mass ends so its orientation n is directed. Transfer the logical triplet into the orthonormal rotor functions ψₐ(n)=√(3/4π)nₐ with one common internal placeholder. Keeping a distinct spectator spin label for every a would remove the interference required here. The other site-occupancy sectors can retain the original marker. In the fixed-radius sector the leading energy is (mℓ²/2)nᵢEᵢⱼnⱼ. Integrating between these wave functions gives

⟨a|δH|b⟩ = (mℓ²/10)[δₐᵦ tr E + 2Eₐᵦ].

This follows from the uniform spherical average of nₐnᵦnᵢnⱼ, equal to (δₐᵦδᵢⱼ+δₐᵢδᵦⱼ+δₐⱼδᵦᵢ)/15. In vacuum the coefficient is β=−mℓ²/5, and a cross-polarized tide couples x to y. The diagonal centroids of the prepared codewords are exact expectations of the physical potential at quadratic order in the size. Projecting finite-time dynamics onto the three rotor states requires weak coupling compared with the gap to other angular states. The unprojected quadrupole can populate them.

There is a range bound for this specific class of fixed-radius readouts. A rotation-covariant, parity-even measurement of orientation on a Cartesian spin-one triplet has a positive density proportional to A nnᵀ+B(I−nnᵀ) per unit solid angle. Rotations around n and the unoriented mass distribution enforce this form. With solid-angle measure normalized to one, normalization requires A+2B=3 and positivity requires A,B≥0. For a tracefree tide the resulting coefficient of Eₐᵦ is mℓ²(A−B)/15. The range is −mℓ²/10 to +mℓ²/5. The rotor functions attain the upper endpoint. The discrete crystal-axis example has a different symmetry. Additional direct curvature operators and relativistic stresses are outside this bound.

A quantum recoil calibration for the scalar contact

One quantized uniform deformation q also gives an operational check on the three-dimensional pair state. Supply a harmonic support with mass M, stiffness K, and measured frequency ω=√(K/M). Let the three homogeneous hopping scales depend on q while preserving their material parities, E₀(q)=E₀⁰+ηq and u(q)=u₀+gq. The linear couplings are used within a fixed particle-number sector and within the range of a measured elastic response. The vacuum, a node particle, and each staggered protected pair have exactly invariant support subspaces because each component of the hopping annihilates the corresponding matter state for all q. Their conditional support Hamiltonians are harmonic oscillators with linear-force coefficients f=0, η and 2η+g.

Prepare the same centered support with zero mean momentum in each run, insert the excitation suddenly, then track the mean displacement. Quantum Heisenberg evolution gives

⟨q(t)⟩pair − 2⟨q(t)⟩one + ⟨q(t)⟩vac = −(g/K)[1−cos(ωt)] .

At half a mechanical period the differential displacement is −2g/K, including its sign. This prediction concerns the scalar collision-strain slope, which can be determined at imposed q. If the oscillator starts in its unshifted ground state and moves freely during a spectral measurement, the vertical centroid stays at the bare addition energy. Its zero-phonon line shifts by −f²/(2K) and the sidebands have Poisson mean f²/(2Kℏω). The difference between the pair zero-phonon line and twice the one-particle zero-phonon line is consequently u₀−[(2η+g)²−2η²]/(2K). Resolving the support motion or sidebands is essential to interpret the observable. This independent scalar calibration can accompany the mass-shape calibration; the tidal coefficient still needs an appropriate gravitational comparison.

Which native modes could measure a vacuum tide?

Sections in this chapter

In vacuum a gravitational field can stretch a freely falling separation in one direction and compress it in another. This is measured by the electric part of the Weyl curvature. A scalar curvature measurement alone misses the effect. We construct a pair of stopped wave packets with equal native energies, calculate their frequency difference in a specified tidal field, and derive the source obtained by varying the same action. Coupling an extended object's electric quadrupole to this tensor is standard gravitational effective theory. The choice of quadrupole for the native walk and the tests below are model constructions. Goldberger and Rothstein, Physical Review D (2006)

Preparing two stationary branches

Three scalar fields Φᴵ label the material sites. Their spacelike gradients have a positive Gram matrix Bᴵᴶ=gᵘᵛ∂ᵤΦᴵ∂ᵥΦᴶ. The oriented orthonormal spatial axes eᴵ are the gradient vectors multiplied by the positive inverse square root of B. The future timelike unit vector u is perpendicular to all three. This construction spans a physical rest frame while allowing a change of spacetime coordinates. The material labels and their unstrained spacing a are supplied. Plane-wave phases κᴵ are dimensionless and conjugate to the material site indices. Equivalently, if Φᴵ has units of reference length, project the phase gradient onto the material reciprocal coordinates by κᴵ=a(B⁻¹)ᴵᴶ∂Φᴶ·∂θ. We use the undeformed state for all numerical examples.

The positive-energy dispersion of the autonomous free walk is E₀+ε√(1−cos²κₓ cos²κᵧ cos²κ_z). Take one wave packet centered at κ=(π/2,0,0) and another at (0,π/2,0), each in its own positive spin band. Both carry energy E₀+ε and have zero group velocity at the center. This permits a co-located proper-frequency comparison with a common clock. A real preparation has finite momentum width and must control its spreading, phase readout, differential deformation and tidal gradients across its extent.

In this example an excitation carries a dimensionless trace-free quadrupole Q. In the material frame choose Qᴵᴶ=vᴵvᴶ−δᴵᴶv²/3 with vᴵ=sin κᴵ. This choice respects signed permutations of the material axes. These v's label a quadrupole and have no units of velocity. The x-prepared and y-prepared quadrupoles differ by diag(1,−1,0).

Putting the same coefficient in the clock and its source

Use signature (−,+,+,+), x⁰=ct, and define the sign of the curvature by R₀ᵢ₀ⱼ=∂ᵢ∂ⱼΦ/c² in a weak static vacuum Newtonian field. The tidal tensor in the material's orthonormal frame is ℰᴵᴶ=C(eᴵ,u,eᴶ,u), with units m⁻². Add energy λ Qᴵᴶℰᴵᴶ per quantum. The coefficient λ has SI units J m². In an action with proper number density n the term is −(λ/c)∫√(−g) n Qᴵᴶℰᴵᴶ d⁴x. The associated x-minus-y frequency difference in cycles per second is

Δν = (λ/h_P)(ℰₓₓ−ℰᵧᵧ),       h_P = Planck's constant.

Outside a spherical mass M, with x radial and y tangential, ℰ=GM diag(−2,1,1)/(c²r³). The predicted splitting is −3λGM/(h_P c²r³). A 90° interchange of these preparations reverses the sign. For a transverse plus-polarized gravitational wave moving along z, hₓₓ=−hᵧᵧ=h₊(t−z/c) and the difference is −λ ḧ₊/(h_P c²). For a sinusoid it scales as the square of the frequency. Either example has zero Ricci curvature in its vacuum domain. In a finite-duration observation the measured differential phase is 2π times the time integral of Δν. Packet overlap and readout bandwidth enter that comparison.

A full sinusoidal cycle gives zero phase if the preparations are held fixed. The same cancellation occurs over a complete burst with equal initial and final strain rates. For h₊=H cos(Ωt), exchanging the x and y preparations at one quarter and three quarters of one cycle reverses the sign of the clock response when the tide reverses. The resulting ideal phase is 4λHΩ/(ℏc²). Switching fields, response time and variation of the material strain are additional properties of a real readout.

All five components of the electric tide have stationary-band comparisons in this ansatz. Two axial differences give ℰₓₓ−ℰ_zz and ℰᵧᵧ−ℰ_zz. For each of xy, xz and yz take central phase +π/2 along the first axis and compare +π/2 versus −π/2 along the second, with zero phase on the remaining axis. Both rays remain at the positive band maximum and the chosen quadrupoles differ only off diagonal. The frequency difference is 4λℰᵢⱼ/h_P. Taken together these five differences determine λℰ in the material frame. An independently known tide is required to infer λ.

Varying the same term with respect to the metric gives a reciprocal source. At flat background write Aᵢⱼ=nQᵢⱼ, D=∂ᵢ∂ⱼAᵢⱼ and let ∂₀=(1/c)∂ₜ. The following are contravariant components. T⁰⁰ has units of energy per volume, cT⁰ⁱ is energy flux per area, and Tⁱʲ is spatial stress.

δT⁰⁰ = (λ/2) D
δT⁰ⁱ = −(λ/2) ∂₀∂ⱼAᵢⱼ
δTⁱʲ = (λ/2)[(∂₀²+∇²)Aᵢⱼ − ∂ᵢ∂ₖAⱼₖ − ∂ⱼ∂ₖAᵢₖ + δᵢⱼ D] .

These terms obey ∂ᵤδTᵘᵛ=0 identically and have zero spacetime trace. A compact preparation has zero change in integrated energy and momentum. At finite spatial wave number it contributes to the local source and to an external tidal measurement. The factor of two matters. A variation of the lapse alone couples to δT⁰⁰. A Newtonian perturbation with equal time and spatial potentials couples to δT⁰⁰+ΣᵢδTⁱⁱ=λD. The source formula follows by inserting the linearized Riemann and Ricci tensors into C₀ᵢ₀ⱼ and integrating twice by parts. The executable checks this variation for each independent metric component with general time-dependent probes. It also checks pure coordinate changes and conformal perturbations, to which the flat-background Weyl response vanishes.

Can the microscopic location of a bond energy fix the size?

A second, distinct model illustrates how to match a coefficient. Let an external scalar probe of gravitational-potential units Φ weight microscopic hopping energies by Φ/c². One material attaches half a bond energy to each endpoint. Another attaches it to the midpoint. Both have exactly the same homogeneous Hamiltonian and respond equally to a uniform probe. For a sinusoidal probe with dimensionless material wave number q, the endpoint-minus-midpoint matrix vertex, after dividing out Φ_q/c², is exactly

V(k,q) = [h(k+q/2)+h(k−q/2)]/2 − h(k).

Here h(k)=E₀I+ε d(k)·σ, with d=(sin kₓ cos kᵧ cos k_z, sin kᵧ cos k_z, sin k_z). The static long-wavelength difference, per localized packet in a slowly varying field, is εa² Mᵢⱼ∂ᵢ∂ⱼΦ/(8c²), where Mᵢⱼ=−⟨∂ᵢ∂ⱼ(d·σ)⟩ at fixed central spin. This is the matrix Hessian of the hopping operator. Differentiating only its eigenvalue loses the spin texture. At the positive x, y and z peaks the three M matrices are diag(1,1,1), diag(0,1,1) and diag(0,0,1). The ordering of spin-dependent substeps is observable in this probe even though the three energies agree.

In a static vacuum one possible covariant matching uses their trace-free parts in the Weyl action with coefficient εa²/8. The endpoint-minus-midpoint difference between x and y preparations is then εa²ℰₓₓ/8 in energy. This gives a scale: for a hypothetical ε/h_P=1 kHz, spacing 1 μm and a tidal acceleration gradient of 10⁻⁶ s⁻² along x, the splitting is about 1.39×10⁻³³ Hz. These inputs illustrate the scale of hopping energy alone. Material rest mass or other modes bring their own multipole moments and must be included in an experimental estimate.

The off-diagonal stationary comparison provides a direct model discriminator. At (π/2,+π/2,0) and (π/2,−π/2,0) the two central spins are opposite y eigenvectors. The bond-location tensors are identical, diag(0,1,1), and predict zero gap in a pure xy shear tide. The sin-product quadrupole above predicts 4λℰₓᵧ. The combinations involving z likewise give zero shear contrast for the bond candidate. One can produce an off-diagonal static tide by orienting the radial direction of a source between two material axes.

There is also a finite-wavelength check of the probe that avoids an extrapolation from tiny tides. With q=(2π/3,0,0), the exact endpoint-minus-midpoint matrix element is −ε/2 about the x peak and zero about the y peak. In each preparation both external states are in the same positive band and have equal unperturbed energies. A deliberately patterned modulation that implements the chosen bond weighting can test this form factor. Its calibration determines a response to that modulation. Identifying that response with gravity is a separate physical hypothesis.

Both the chosen Q and the bond-tagging completion leave the flat Hamiltonian intact. Measuring the full coefficient tensor would require several independent tidal geometries and prepared orientations, common-mode rejection, and independent accounting for the mass quadrupole of the apparatus. A single observed splitting fixes at most the coefficient combination to which that preparation is sensitive.

A held-out orientation and a reciprocal force

Use the same compact source at the same distance. Measure an x-minus-y packet contrast with the source on the x axis. Then compare two stationary packets of opposite xy sign with the source halfway between the x and y axes. In the sine-product model the second frequency difference is twice the first, since the radial diagonal difference is −3 and four times the oblique cross component is −6 in the same tidal units. For the bond-energy assignment the oblique difference vanishes. The ratio removes the source strength and the first model’s unknown overall coefficient when the axial response is nonzero. A change of mechanical load on rotating the source must be independently measured.

Cubic symmetry also permits independent coefficients for the diagonal trace-free part and for the off-diagonal part of the tensor. Each part transforms into itself under signed permutations of the material axes. For the two-coefficient sine-product model, the oblique-to-axial ratio is twice the shear coefficient divided by the diagonal coefficient. An axial measurement alone cannot fix it.

For a compact static distribution of orientation Aij with integral Mij, the change in the weak far-field potential from the pure Weyl term is −3Gλ Mij Ni Nj/(c²R³) to quadrupole order. Here N is the unit direction of the distant probe. Integrating the twice-differentiated source against the Newton potential gives the same energy for a distant test mass as coupling Mij to the tidal field of that mass. The calculation uses the spatial stress as well as the energy density and assumes a linearized gravitational field law.

What a pair of falling atom clouds measured

Sections in this chapter

Moving a lead source changes the gravitational acceleration at two nearby heights by different amounts. Stray and colleagues measured this difference with two clouds of rubidium-87 atoms separated vertically by one metre. A common sequence of Raman laser pulses interrogated both clouds. The instrument recovered the differential phase from their fluorescence readings. The result gives an independently measured tidal field against which a proposed material sensor could be calibrated. Stray et al., Nature (2022)

Nine time-bracketed source-mass contrasts fluctuate around the modeled 202 E. Their combined value is 200.8 ± 13.5 E.
Each point compares a distant source-mass visit with its two neighboring close visits. The combined uncertainty accounts for reuse of the same observations. Data from Stray and colleagues. Original measurement · Download the figure

Reconstructing the source modulation

The authors released 727 individual fitted gradient readings and a workbook containing the 68 displayed bins. The fits are one level above the underlying fluorescence shots. The source position is recorded as 0 or 550 mm. We reproduced the paper's binning from the individual fits. Its plotting routine drops the first visit, trims two readings at each end of the remaining visits and takes blocks of eight using its original end condition. In total 544 readings contribute to 37 near bins and 31 far bins. Subtracting the common mean of the far bins sets the zero of the graph. That subtraction cancels in a near-minus-far contrast. All 68 time stamps, measurement numbers, gradients and errors agree with the publisher's worksheet to its recorded numerical precision. Source workbook · Data and original analysis

ReductionMeasured gradient change
Difference of the two published bin means205.01 E
Time-interpolated contrast using the 19 plotted visits200.77 E
Difference of the two means using all 727 original fits, including the first visit and transition edges190.52 E
Authors' modeled source modulation202 E

One eötvös (E) is 10⁻⁹ s⁻². The paper reports 205 ± 13.1 E. Propagating the quoted bin errors assuming independent underlying bins gives 12.98 E for the direct difference. Estimating the error from the observed bin-to-bin scatter instead gives 16.90 E under the same independence assumption. Slow correlations can affect either estimate. The 190.52 E reduction shows the size of the change introduced by a different selection of readings.

The time-interpolated estimate compares each of the nine far visits with the two near visits immediately surrounding it. Linear interpolation to the far visit's mean bin time cancels an additive constant and linear drift in the indicated times. Combining the weights of shared near visits before propagating their errors yields 13.45 E under the independent-bin assumption. The result agrees with the modeled 202 E. The source readings enter all three reductions and their errors are correlated.

The accompanying figure shows each far visit compared with its time-interpolated pair of near visits. Whiskers propagate the corresponding bin errors. The diamond combines all nine contrasts with their shared near visits accounted for. The dashed line marks the independently modeled source signal. Data credit appears below. To regenerate the figure, run python3 plot_gradient.py with Matplotlib and Pillow installed.

From the interferometer phase to the tidal field

For a uniform vertical gradient the nominal differential-phase scale is (4π/λ) L T², with laser wavelength approximately 780 nm, baseline L=1 m and pulse interval T=85 ms. Thus 205.01 E corresponds to a 23.86 mrad phase modulation and a differential acceleration of 2.0501 × 10⁻⁷ m s⁻². In weak gravity the magnitude of the corresponding time-and-baseline-averaged curvature component is 2.281 × 10⁻²⁴ m⁻² after division by c². The sign of a component also depends on the gravity-gradient and Riemann conventions. The measurement samples the spatial interval between the clouds and the trajectories during each pair of laser-pulse intervals. Equating it to a pointwise tidal tensor requires knowledge of the variation of the field through the apparatus.

The data provide a field channel for a second experiment. For a clock whose energy depends on the orientation of a material axis in a tidal field, one could compare its two transition frequencies at a common location, alternate the source positions, and take the change in the frequency difference. A single measured vertical gradient leaves the transverse tensor components and any difference between the clock location and the gradiometer average to be calibrated. An independent record of mechanical strain is also needed if moving the source changes the support. These runs contain no such clock frequency difference. The modulated field and its measurement uncertainty therefore yield no numerical bound on the proposed material-clock coupling.

Data credit and replay

The bundled field_bins.csv reproduces the numeric values in the Figure1c worksheet, ordered by observation time, with descriptive column names. It is adapted from Stray et al., Nature 602, 590–594 (2022), under Creative Commons Attribution 4.0. The independent time interpolation and listed selection checks are calculations for this study. Run python3 field_data.py for the offline comparison. With --fetch, it verifies the publisher workbook (16,483 bytes) and independently rebuilds each bin from the deposited per-ellipse fit file (18,127 bytes). The script requests just the required ZIP member from the University of Birmingham's archive and verifies its SHA-256. University of Birmingham data record

Programs and transcript

The offline study archive contains five calculation programs, the 68 source-data bins, the figure, its plotting script and 17 native Tally assertions. Its replay checks the complete Tally transcript. The gravity-gradient experiment calibrates a field. The pair frequency comparison is a proposed measurement.

Complete Tally transcript
✓ the first staggered pair has the x half-turn spin intertwiner  (by cross-pairing plus and minus sides; derived)
✓ the second staggered pair has the y half-turn spin intertwiner  (by cross-pairing plus and minus sides; derived)
✓ the third staggered pair has the z half-turn spin intertwiner  (by cross-pairing plus and minus sides; derived)
✓ the uniform four-particle preparation has a definite contact probability and energy centroid  (by cross-pairing plus and minus sides; derived)
✓ the second pair broadens the energy spectrum  (by cross-pairing plus and minus sides; derived)
✓ the fourth energy moment resolves native and anisotropic hopping  (by cross-pairing plus and minus sides; derived)
✓ both tensors are trace free  (by cross-pairing plus and minus sides; derived)
✓ source rotation and the two pair channels give the matched double difference  (by cross-pairing plus and minus sides; derived)
✓ tilted tides have a fixed short-time pair variance  (by cross-pairing plus and minus sides; derived)
✓ an independent imposed strain separates the two response columns  (by cross-pairing plus and minus sides; derived)
✓ the finite source-mass benchmark gives a larger contrast than the point quadrupole  (by cross-pairing plus and minus sides; derived)
✓ a rotationally covariant triplet and a sharp axis marker give different moments at equal mass and radius  (by cross-pairing plus and minus sides; derived)
✓ pair minus twice the single half-period displacement isolates the interaction slope  (by cross-pairing plus and minus sides; derived)
✓ the measured differential centroid removes a common one-particle shift  (by cross-pairing plus and minus sides; derived)
✓ all 68 tabulated bins reproduce both signed sums at millieotvos precision  (by cross-pairing plus and minus sides; derived)
✓ the calibrated source-mass contrast is 205.01 Eotvos  (by cross-pairing plus and minus sides; derived)
✓ the revised near-minus-far estimator differs from the mass model by less than four Eotvos  (by cross-pairing plus and minus sides; derived)
Native Tally source
# Tidal pair spectroscopy. Native exact calculations on ratios and measured bins.
ratchet 16 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 eight=whole(8 trial)
let half=fraction(1 trial,2 trial)
let third=fraction(1 trial,3 trial)
let volume=whole(64 trial)
let u=three
fn xfactor(sx,sy,sz)
  return flip(sx*sy*sz)
end
fn yfactor(sy,sz)
  return flip(sy*sz)
end
check xfactor(flip(one),one,one)==one and yfactor(one,one)==flip(one) "the first staggered pair has the x half-turn spin intertwiner"
check xfactor(flip(one),flip(one),one)==flip(one) and yfactor(flip(one),one)==one "the second staggered pair has the y half-turn spin intertwiner"
check xfactor(one,flip(one),flip(one))==flip(one) and yfactor(flip(one),flip(one))==flip(one) "the third staggered pair has the z half-turn spin intertwiner"
let p4=share(two,volume+one)
let mean=(one+flip(p4))*two*u+p4*whole(6 trial)*u
let gap=four*u
let var=p4*(one+flip(p4))*gap*gap
check p4==fraction(2 trial,65 trial) and mean==fraction(414 trial,65 trial) "the uniform four-particle preparation has a definite contact probability and energy centroid"
check var==fraction(18144 trial,4225 trial) "the second pair broadens the energy spectrum"
fn fourth(sq_hop)
  return (one+flip(p4))*power(two*u,4 trial)+p4*power(whole(6 trial)*u,4 trial)+share(whole(128 trial)*u*u*sq_hop,volume+one)
end
let native=volume*(fraction(1 trial,8 trial)+fraction(1 trial,4 trial)+half)
let anisotropic=volume*(fraction(4 trial,8 trial)+fraction(9 trial,4 trial)+half)
check fourth(native)==fraction(356112 trial,65 trial) and fourth(anisotropic)==fraction(531216 trial,65 trial) "the fourth energy moment resolves native and anisotropic hopping"

let qparallel=flip(two*third)
let qperp=third
let source_parallel=flip(four)
let source_perp=two
let x=qparallel*source_parallel+two*qperp*source_perp
let y=qperp*source_parallel+qparallel*source_perp+qperp*source_perp
check qparallel+two*qperp==zero and source_parallel+two*source_perp==zero "both tensors are trace free"
check x==four and y==flip(two) and two*(x+flip(y))==whole(12 trial) "source rotation and the two pair channels give the matched double difference"
check half*half+fraction(1 trial,4 trial)*fraction(1 trial,4 trial)==fraction(5 trial,16 trial) "tilted tides have a fixed short-time pair variance"
fn det2(a,b,c,d)
  return a*d+flip(b*c)
end
check det2(three,two,flip(three),flip(two))==zero and det2(three,two,zero,one)==three "an independent imposed strain separates the two response columns"
let t=fraction(7 trial,24 trial)
let transverse=fraction(24 trial,25 trial)
let diff=share(one,one+flip(t*t))+flip(transverse)
let ratio=share(two*diff,three*t*t)
check transverse*transverse*(one+t*t)==one and ratio==fraction(672768 trial,645575 trial) "the finite source-mass benchmark gives a larger contrast than the point quadrupole"
let rotor=fraction(1 trial,5 trial)
check share(rotor,half)==fraction(2 trial,5 trial) "a rotationally covariant triplet and a sharp axis marker give different moments at equal mass and radius"
let e0_slope=two
let contact_slope=three
let spring=four
let pair_shift=flip(share(two*(two*e0_slope+contact_slope),spring))
let one_shift=flip(share(two*e0_slope,spring))
check pair_shift+flip(two*one_shift)==flip(fraction(3 trial,2 trial)) "pair minus twice the single half-period displacement isolates the interaction slope"
let common=whole(9 trial)
check common+four+flip(common+flip(two))==whole(6 trial) "the measured differential centroid removes a common one-particle shift"

# Source Data Fig 1c, gradients rounded to the nearest milli-Eotvos.
let near=zero
let far=zero
let near=near+whole(284308 trial)
let near=near+whole(223822 trial)
let near=near+whole(209937 trial)
let near=near+whole(124014 trial)
let far=far+whole(2751 trial)
let far=far+whole(7601 trial)
let far=far+flip(whole(16659 trial))
let far=far+whole(45334 trial)
let near=near+whole(160240 trial)
let near=near+whole(146019 trial)
let near=near+whole(81738 trial)
let near=near+whole(132319 trial)
let far=far+whole(2605 trial)
let far=far+flip(whole(37624 trial))
let far=far+flip(whole(91127 trial))
let far=far+flip(whole(16703 trial))
let near=near+whole(215545 trial)
let near=near+whole(232002 trial)
let near=near+whole(188119 trial)
let near=near+whole(196242 trial)
let far=far+flip(whole(66799 trial))
let far=far+flip(whole(2485 trial))
let far=far+whole(20055 trial)
let near=near+whole(205231 trial)
let near=near+whole(216320 trial)
let near=near+whole(309946 trial)
let near=near+whole(304794 trial)
let far=far+flip(whole(1408 trial))
let far=far+flip(whole(47705 trial))
let far=far+whole(36301 trial)
let near=near+whole(200586 trial)
let near=near+whole(209212 trial)
let near=near+whole(156815 trial)
let near=near+whole(224008 trial)
let far=far+flip(whole(5886 trial))
let far=far+flip(whole(162696 trial))
let far=far+flip(whole(79909 trial))
let near=near+whole(231889 trial)
let near=near+whole(267165 trial)
let near=near+whole(133068 trial)
let far=far+flip(whole(34767 trial))
let far=far+whole(50968 trial)
let far=far+whole(177684 trial)
let near=near+whole(108389 trial)
let near=near+whole(161885 trial)
let near=near+whole(340307 trial)
let far=far+flip(whole(11660 trial))
let far=far+flip(whole(19128 trial))
let far=far+whole(69949 trial)
let far=far+whole(130805 trial)
let near=near+whole(158922 trial)
let near=near+whole(129399 trial)
let near=near+whole(57228 trial)
let near=near+whole(165786 trial)
let far=far+flip(whole(29898 trial))
let far=far+flip(whole(27329 trial))
let far=far+flip(whole(15985 trial))
let far=far+flip(whole(75797 trial))
let near=near+whole(317671 trial)
let near=near+whole(259031 trial)
let near=near+whole(142629 trial)
let near=near+whole(222876 trial)
let far=far+whole(29996 trial)
let far=far+whole(132752 trial)
let far=far+whole(36763 trial)
let near=near+whole(346027 trial)
let near=near+whole(272471 trial)
let near=near+whole(249393 trial)
check near==whole(7585353 trial) and far==flip(one) "all 68 tabulated bins reproduce both signed sums at millieotvos precision"
let field_diff=share(near,whole(37000 trial))+flip(share(far,whole(31000 trial)))
check field_diff>fraction(205009 trial,1000 trial) and field_diff<fraction(205010 trial,1000 trial) "the calibrated source-mass contrast is 205.01 Eotvos"
check field_diff+flip(whole(202 trial))<whole(4 trial) "the revised near-minus-far estimator differs from the mass model by less than four Eotvos"
pair.py
"""Check the cubic onsite-pair classification and projective many-body energy moments."""
from collections import Counter, defaultdict
from fractions import Fraction
from itertools import product
from math import comb, factorial, prod

SPINS = ((1, 0, 0, -1), (1, 0, 0, 1), (0, 1, 1, 0))
K_AXES = ((2, 0, 0), (2, 2, 0), (0, 2, 2))


def spin_h(p, scales):
    sine, cosine = (0, 1, 0, -1), (1, 0, -1, 0)
    x, y, z = (j % 4 for j in p)
    dx = scales[0] * sine[x] * cosine[y] * cosine[z]
    dy = scales[1] * sine[y] * cosine[z]
    dz = scales[2] * sine[z]
    return ((dz, dx - 1j*dy), (dx + 1j*dy, -dz))


def two_h(left, right, v):
    return [sum(left[i][l]*v[2*l+j]+right[j][l]*v[2*i+l] for l in range(2))
            for i, j in product(range(2),repeat=2)]


def rank(matrix):
    a = [list(row) for row in matrix]
    pivot = 0
    for j in range(len(a[0])):
        idx = next((i for i in range(pivot,len(a)) if abs(a[i][j])>1e-8),None)
        if idx is None:
            continue
        a[idx], a[pivot] = a[pivot], a[idx]
        scale = a[pivot][j]
        a[pivot] = [x/scale for x in a[pivot]]
        for i in range(pivot+1,len(a)):
            factor = a[i][j]
            a[i] = [u-factor*v for u,v in zip(a[i],a[pivot])]
        pivot += 1
        if pivot==len(a):
            break
    return pivot


def classify(scales):
    grid = list(product(range(4), repeat=3))
    one = {k: spin_h(k, scales) for k in grid}
    found = {}
    for K in grid:
        gram = [[0j]*3 for _ in range(3)]
        for k in grid:
            other = tuple((j-l)%4 for j,l in zip(K,k))
            out = [two_h(one[k],one[other],v) for v in SPINS]
            for i,j in product(range(3),repeat=2):
                gram[i][j] += sum(x.conjugate()*y for x,y in zip(out[i],out[j]))
        dim = 3-rank(gram)
        if dim:
            assert dim==1
            nul, = [i for i in range(3) if gram[i][i]==0]
            found[K]=nul
    assert found=={k:i for i,k in enumerate(K_AXES)}


def compositions(total, size):
    if size==1:
        yield (total,)
        return
    for first in range(total+1):
        for rest in compositions(total-first,size-1):
            yield (first,)+rest


def moments(m, volume):
    mean = m+Fraction(4*m*(m-1),volume+1)
    var = Fraction(16*m*(m-1)*(volume-1)*(m+volume)*(m+volume+1),
                   (volume+1)**2*(volume+2)*(volume+3))
    return mean,var


def composition_check():
    for m in range(8):
        for volume in range(1,8):
            energies = [sum(l*(2*l-1) for l in state) for state in compositions(m,volume)]
            assert len(energies)==comb(volume+m-1,m)
            mean = Fraction(sum(energies),len(energies))
            var = Fraction(sum(x*x for x in energies),len(energies))-mean**2
            assert (mean,var)==moments(m,volume)


def parity_source(coords):
    """Polynomial amplitudes of [Σ exp(iK·x)(a↑†²−a↓†²)]² acting on vacuum."""
    creators = [(2*n+s,(-1)**(x+s)) for n,(x,_,_) in enumerate(coords) for s in (0,1)]
    state = defaultdict(int)
    for i,(mode,phase) in enumerate(creators):
        for j in range(i+1):
            other,other_phase = creators[j]
            key = (other,other,mode,mode)
            state[key] += phase*other_phase*(1 if i==j else 2)
    return state


def hop_table(coords, beta):
    """Full real-space Fourier stencil, scaled to hopping energy ε=8 on a four-cube."""
    sites = {x:i for i,x in enumerate(coords)}
    table = []
    for p in coords:
        for spin in (0,1):
            terms = []
            for d in product((-1,0,1), repeat=3):
                x,y,z = d
                if x*y*z:
                    target, amp = 1-spin,-1j*x*beta[0]
                elif x==0 and y*z:
                    target, amp = 1-spin,2*y*beta[1]*(1 if spin==0 else -1)
                elif x==0 and y==0 and z:
                    target, amp = spin,-4j*z*beta[2]*(1 if spin==0 else -1)
                else:
                    continue
                q = tuple((a+b)%4 for a,b in zip(p,d))
                terms.append((2*sites[q]+target,amp))
            table.append(terms)
    return table


def apply_hop(state, links):
    out = defaultdict(complex)
    for key,c in state.items():
        for p,multiplicity in Counter(key).items():
            rest = list(key)
            rest.remove(p)
            weight = c*multiplicity
            for q,v in links[p]:
                out[tuple(sorted((*rest,q)))] += weight*v
    return {k:v for k,v in out.items() if v}


def contact(key,u):
    return u*sum(n*(n-1)//2 for n in Counter(j//2 for j in key).values())


def norm(state):
    return sum(int(abs2(c))*prod(factorial(n) for n in Counter(key).values())
               for key,c in state.items())


def abs2(x):
    return x.real*x.real+x.imag*x.imag


def four_bosons():
    coords = list(product(range(4), repeat=3))
    volume, u = len(coords), 3
    state = parity_source(coords)
    weight = norm(state)
    assert weight==64*comb(volume+1,2)
    first = {k:c*contact(k,u) for k,c in state.items()}
    site_four = {k:c for k,c in state.items() if len({j//2 for j in k})==1}
    mean,var = moments(2,volume)
    assert Fraction(norm(first),weight)==u*u*(var+mean**2)
    for beta in [(1,1,1),(2,3,1)]:
        links = hop_table(coords,beta)
        assert not apply_hop(state,links)
        # H²ψ = K Vψ + V²ψ, supported on different site-occupancy parities.
        kinetic = apply_hop(first,links)
        diagonal = {k:c*contact(k,u) for k,c in first.items()}
        assert kinetic.keys().isdisjoint(diagonal)
        sigma2 = 8*beta[0]**2+16*beta[1]**2+32*beta[2]**2
        assert norm(apply_hop(site_four,links))==4*sigma2*norm(site_four)
        fourth = Fraction(norm(kinetic)+norm(diagonal),weight)
        predicted = Fraction((16*(volume-1)+2592)*u**4+128*u*u*sigma2,volume+1)
        assert fourth==predicted
        print("Four-boson fourth moment, scales", beta, ":", fourth)


def main():
    classify((1,1,1))
    classify((2,3,5))
    composition_check()
    four_bosons()
    print("Three pure onsite momenta, their spin triplets and all finite-Fock checks passed.")


if __name__=="__main__":
    main()
contact.py
"""Centroids, triplet curvature coupling and source-mass comparison, standard library."""
from cmath import exp
from fractions import Fraction as F
from math import cos, isclose, pi, sin, sqrt
from random import Random


def matmul(a,b):
    return [[sum(x*y for x,y in zip(row,col)) for col in zip(*b)] for row in a]


def kron(a,b):
    return [[a[i][k]*b[j][l] for k in range(len(a)) for l in range(len(b))]
            for i in range(len(a)) for j in range(len(b))]


def apply(m,v):
    return [sum(x*y for x,y in zip(row,v)) for row in m]


def inner(a,b):
    return sum(x.conjugate()*y for x,y in zip(a,b))


def check_spins_and_sources():
    pauli = [[[0,1],[1,0]],[[0,-1j],[1j,0]],[[1,0],[0,-1]]]
    identity = [[1,0],[0,1]]
    singlet = [0,1/sqrt(2),-1/sqrt(2),0]
    cart = [apply(kron(identity,s),singlet) for s in pauli]
    spins = []
    for s in pauli:
        left,right = kron(identity,s),kron(s,identity)
        spins.append([[(x+y)/2 for x,y in zip(a,b)] for a,b in zip(left,right)])
    tide = [[-3.,.5,.25],[.5,1.,-.75],[.25,-.75,2.]]
    operator = [[0j]*4 for _ in range(4)]
    for i in range(3):
        for j in range(3):
            block = matmul(spins[i],spins[j])
            for k in range(4):
                for l in range(4):
                    operator[k][l] += tide[i][j]*block[k][l]
    for i,psi in enumerate(cart):
        out = apply(operator,psi)
        mean = inner(psi,out).real
        assert abs(mean+tide[i][i])<1e-14
        assert abs(inner(out,out).real-mean*mean-sum(tide[i][j]**2 for j in range(3) if j!=i))<1e-14
        for j,bra in enumerate(cart):
            assert abs(inner(bra,out)+tide[j][i])<1e-14

    # Compare arbitrary spatial envelopes and momentum-dependent phases, tracing
    # position AND spin of the partner. The trial Hermitian matrix is fully nonlocal.
    rng = Random(31)
    envelope = [.5,.2j,.1+.7j,.3]
    norm = sqrt(inner(envelope,envelope).real)
    envelope = [x/norm for x in envelope]
    sites = len(envelope)
    d = 2*sites
    random_matrix = [[complex(rng.random(),rng.random()) for _ in range(d)] for _ in range(d)]
    field = [[(random_matrix[i][j]+random_matrix[j][i].conjugate())/2
              for j in range(d)] for i in range(d)]
    energies = []
    for i,psi in enumerate(cart):
        C = [[0j]*d for _ in range(d)]
        for site,f in enumerate(envelope):
            for first in range(2):
                for second in range(2):
                    C[2*site+first][2*site+second]=f*exp(1j*site*(i+1))*psi[2*first+second]
        rho = matmul(C,[[x.conjugate() for x in row] for row in zip(*C)])
        for p in range(d):
            for q in range(d):
                expected = abs(envelope[p//2])**2/2 if p==q else 0
                assert abs(rho[p][q]-expected)<1e-14
        E = 2*sum(field[p][q]*rho[q][p] for p in range(d) for q in range(d))
        energies.append(E)
    assert max(abs(E-energies[0]) for E in energies)<1e-14


def finite_size_ratio(t):
    # The ratio to the point quadrupole. Rationalize both cancellations.
    x = t*t
    r = sqrt(1+x)
    return 2*(3-x)/(3*(1-x)*r*(r+1-x))


def hessian_phi(point,axis,R=1.,GM=1.):
    out = [[0.]*3 for _ in range(3)]
    for sign in (-1,1):
        r = [position-(sign*R if i==axis else 0.) for i,position in enumerate(point)]
        length = sqrt(sum(x*x for x in r))
        for i in range(3):
            for j in range(3):
                out[i][j] += GM*((i==j)/length**3-3*r[i]*r[j]/length**5)
    return out


def checks():
    check_spins_and_sources()
    GX,GY = (hessian_phi([0.,0.,0.],i) for i in (0,1))
    assert -(GX[0][0]-GX[1][1])+(GY[0][0]-GY[1][1])==12.
    for t in [.1,.2,7/24]:
        # Direct potentials at actual probe endpoints; a common central reference cancels.
        def Phi(i,j):
            return -sum(1/sqrt(1+t*t-2*sign*t*(i==j)) for sign in (-1,1))
        double = (Phi(0,0)-Phi(0,1))-(Phi(1,0)-Phi(1,1))
        assert abs(double+6*t*t*finite_size_ratio(t))<3e-15
    small = F(7,24)
    exact = (1/(1-small**2)-F(24,25))*F(2,3)/small**2
    assert abs(float(exact)-finite_size_ratio(float(small)))<1e-14
    assert abs((finite_size_ratio(.001)-1)/1e-6-5/12)<1e-6
    difference = finite_size_ratio(.1)-finite_size_ratio(.05)
    assert .0031<difference<.0033
    # Compare two differential settings and one controllable independent shear.
    # Rotation alone co-rotates both columns and keeps the response rank one.
    def det(x,y):return x[0]*y[1]-x[1]*y[0]
    assert det((3,2),(-3,-2))==0 and det((3,2),(0,1))==3
    mass = 86.9091805291*1.66053906892e-27
    h = 6.62607015e-34
    frequency = mass*1e-12*205e-9/h
    phase = 2*pi*frequency
    trials = 1/(phase*phase)
    assert 4.45e-11<frequency<4.48e-11 and 1.25e19<trials<1.3e19
    print("Three equal one-particle marginals and tensor-line means/variances passed.")
    print("Exact size/point ratio at 7/24:",exact)
    print("Scaled size contrast at R and 2R (ell/R=0.1):",difference)
    print(f"Illustrative 205 E signal: {frequency:.5g} Hz, {phase:.5g} rad/s, {trials:.5g} ideal one-second pairs.")


if __name__ == "__main__":
    checks()
embedding.py
"""Independently check local marker encoding, a positive tidal readout, and support recoil."""
from cmath import exp as cexp
from itertools import product
from math import cos, exp, factorial, pi, sqrt


def check_encoding():
    # A finite onsite basis spanning local N=0,1,2,3. Other number sectors can
    # use the reference configuration identically. Tuple (N,internal index).
    labels = [(n,i) for n in range(4) for i in range(n+1)]
    def switch(site, pointer):
        n,i = site
        if n!=2:
            return pointer
        target=i+1
        return target if pointer==0 else 0 if pointer==target else pointer
    def U(state):
        return {(a,switch(a,p),b,switch(b,q)):v for (a,p,b,q),v in state.items()}
    def bare(state):
        result = {}
        def add(key, val):
            result[key] = result.get(key,0j)+val
        for (a,p,b,q),amp in state.items():
            n,i=a
            m,j=b
            # A Hermitian integer-valued test link, conserving total number.
            add((a,p,b,q),amp*(n*(n-1)+m*(m-1)+4*(p!=0)+4*(q!=0)))
            if n>0 and m<3:
                for ii in range(n):
                    for jj in range(m+2):
                        v=(1+i+ii)*(1+j+jj)
                        add(((n-1,ii),p,(m+1,jj),q),amp*v)
            if m>0 and n<3:
                for ii in range(n+2):
                    for jj in range(m):
                        v=(1+i+ii)*(1+j+jj)
                        add(((n+1,ii),p,(m-1,jj),q),amp*v)
        return result
    initial = {(a,0,b,0): complex(a[0]+b[1]+1,b[0]-a[1])
               for a,b in product(labels,repeat=2)}
    encoded=U(initial)
    assert U(encoded)==initial
    physical=U(bare(U(encoded)))
    assert physical==U(bare(initial))
    assert all(p==switch(a,0) and q==switch(b,0) for a,p,b,q in physical)
    assert any(p or q for a,p,b,q in physical)


def check_marginals():
    # Construct the full normalized two-particle arrays in first quantization.
    spins=((1,0,0,-1),(1,0,0,1),(0,1,1,0))
    env=[1/sqrt(6),1j/sqrt(6),2/sqrt(6)]
    for axis,spin in enumerate(spins):
        arr=[[0j]*6 for i in range(6)]
        for n,f in enumerate(env):
            for i,j in product(range(2),repeat=2):
                arr[2*n+i][2*n+j]=f*cexp(1j*axis*n)*spin[2*i+j]/sqrt(2)
        for i,j in product(range(6),repeat=2):
            val=sum(arr[i][t]*arr[j][t].conjugate() for t in range(6))
            target=abs(env[i//2])**2/2 if i==j else 0.
            assert abs(val-target)<1e-14


def check_tide():
    E=((3,.7,-.4),(.7,-1,.3),(-.4,.3,-2))
    dipole=(1.1,-.4,.9)
    mass,ell=2.,.43
    def quadratic(n):
        return sum(n[i]*E[i][j]*n[j] for i,j in product(range(3),repeat=2))
    def phi(x):
        return 2+sum(a*b for a,b in zip(x,dipole))+quadratic(x)/2
    for a in range(3):
        x=[ell*(i==a) for i in range(3)]
        shift=mass*(phi(x)/2+phi([-t for t in x])/2-phi((0,0,0)))
        assert abs(shift-mass*ell**2*E[a][a]/2)<1e-14
    # Positive 14-point spherical quadrature integrates all fourth powers exactly.
    axes=[(tuple(sign if i==a else 0 for i in range(3)),1/15)
          for a in range(3) for sign in (-1,1)]
    corners=[(tuple(t/sqrt(3) for t in signs),3/40) for signs in product((-1,1),repeat=3)]
    for A,B in ((3.,0.),(0.,1.5),(1.,1.),(.6,1.2)):
        for i,j in product(range(3),repeat=2):
            normalization=0.
            element=0.
            for n,w in axes+corners:
                response=B*(i==j)+(A-B)*n[i]*n[j]
                normalization+=w*response
                element+=w*response*mass*ell**2*quadratic(n)/2
            assert abs(normalization-(i==j))<1e-14
            assert abs(element-mass*ell**2*(A-B)*E[i][j]/15)<1e-14


def oscillator(force):
    # ℏ=1, M=2, K=2; direct oscillator-number-basis Schrödinger propagation.
    mass,stiffness=2.,2.
    omega=sqrt(stiffness/mass)
    x0=1/sqrt(2*mass*omega)
    levels=23
    w=[complex(j==0) for j in range(levels)]
    roots=[sqrt(j) for j in range(levels+1)]
    def rhs(state):
        out=[0j]*levels
        for j,c in enumerate(state):
            neighbors = (roots[j]*state[j-1] if j else 0j)
            if j+1<levels:
                neighbors+=roots[j+1]*state[j+1]
            out[j]=-1j*(omega*(j+.5)*c+force*x0*neighbors)
        return out
    def shifted(base,dx,t):
        return [v+t*d for v,d in zip(base,dx)]
    dt=pi/(900*omega)
    for _ in range(900):
        k1=rhs(w)
        k2=rhs(shifted(w,k1,dt/2))
        k3=rhs(shifted(w,k2,dt/2))
        k4=rhs(shifted(w,k3,dt))
        w=[v+dt*(a+2*b+2*c+d)/6 for v,a,b,c,d in zip(w,k1,k2,k3,k4)]
    assert abs(sum(abs(v)**2 for v in w)-1)<1e-11
    q=2*x0*sum(roots[j]*w[j-1].conjugate()*w[j] for j in range(1,levels)).real
    assert abs(q+2*force/stiffness)<1e-9
    # Bare/zero-phonon distinction using the full Franck–Condon sum in this regime.
    S=force**2/(2*stiffness*omega)
    probs=[exp(-S)*S**j/factorial(j) for j in range(30)]
    energies=[j*omega-force**2/(2*stiffness) for j in range(30)]
    assert abs(sum(probs)-1)<1e-14
    assert abs(sum(p*e for p,e in zip(probs,energies)))<1e-14
    return q


def main():
    check_encoding()
    check_marginals()
    check_tide()
    eta,g=.19,-.71
    vacuum,one,pair=[oscillator(f) for f in (0.,eta,2*eta+g)]
    recoil=pair-2*one+vacuum
    assert abs(recoil-(-2*g/2))<1e-9
    print("Local conditional encoding, matched marginals, positive rotor quadrature: passed")
    print("Half-period pair recoil minus two one-particle recoils:",recoil)


if __name__=="__main__":
    main()
metric.py
"""Cross-check the Weyl vertex against independent linearized curvature variations."""
from fractions import Fraction as F
from itertools import product
from math import cos, pi, sin

FOUR, THREE = range(4), range(3)
ETA = (-1, 1, 1, 1)


def tensor(function, indices=FOUR):
    return [[function(i, j) for j in indices] for i in indices]


def contract(a, b):
    return sum(x*y for row, col in zip(a, b) for x, y in zip(row, col))


def electric(h, momenta):
    """Electric Weyl of h_ab cos(p*x), at the origin; p is a lower-index covector."""
    def riemann(a, b, c, d):
        p = momenta
        return (-p[b]*p[c]*h[a][d] - p[d]*p[a]*h[b][c]
                + p[c]*p[a]*h[b][d] + p[d]*p[b]*h[a][c])/F(2)

    ricci = tensor(lambda i, j: sum(ETA[a]*riemann(a, i, a, j) for a in FOUR))
    scalar = sum(ETA[a]*ricci[a][a] for a in FOUR)
    def component(x, y):
        i, j = x+1, y+1
        return (riemann(0, i, 0, j) + ricci[i][j]/2
                - (i == j)*(ricci[0][0]/2+scalar/6))
    return tensor(component, THREE), ricci


def source(A, p):
    """Analytic metric source for lambda=1, with a matching Fourier mode of nQ."""
    k = p[1:]
    Ak = [sum(A[i][j]*k[j] for j in THREE) for i in THREE]
    kAk = sum(t*z for t,z in zip(k, Ak))
    k2 = sum(t*t for t in k)
    def component(mu, nu):
        if mu == nu == 0:
            return -kAk/F(2)
        if mu == 0 or nu == 0:
            return p[0]*Ak[max(mu, nu)-1]/F(2)
        i,j = mu-1, nu-1
        return (-(p[0]**2+k2)*A[i][j] + k[i]*Ak[j] + k[j]*Ak[i]
                - (i == j)*kAk)/F(2)
    return tensor(component)


def verify_metric():
    A = [[F(3),F(2),F(-1)], [F(2),F(-4),F(7,3)], [F(-1),F(7,3),F(1)]]
    checked = 0
    for p in [(2,3,-4,5), (-1,3,7,-2), (0,1,-2,3), (2,0,0,0), (0,0,0,0)]:
        T = source(A,p)
        assert all(sum(p[i]*T[i][j] for i in FOUR) == 0 for j in FOUR)
        assert sum(ETA[i]*T[i][i] for i in FOUR) == 0
        for mu in FOUR:
            for nu in range(mu,4):
                probe = tensor(lambda i,j: F((i,j) in ((mu,nu),(nu,mu))))
                E, _ = electric(probe,p)
                # Functional derivative comparison before restricting the metric.
                assert contract(T,probe)/2 == -contract(A,E)
                assert sum(E[i][i] for i in THREE) == 0
                checked += 1
        gauge = [1,-3,4,7]
        pure = tensor(lambda i,j: p[i]*gauge[j]+p[j]*gauge[i])
        conformal = tensor(lambda i,j: ETA[i]*(i == j))
        for probe in (pure, conformal):
            E, _ = electric(probe,p)
            assert all(x == 0 for row in E for x in row)

    # Static Newton potential Hessian diag(-2,1,1) and a TT plus wave with omega=3.
    flat_diag = tensor(lambda i,j: -2*(i == j))
    result = tensor(lambda i,j: F(0), THREE)
    ricci_sum = tensor(lambda i,j: F(0))
    for axis, value in enumerate((-2,1,1)):
        p = [0]*4
        p[axis+1] = 1
        E, ricci = electric(flat_diag,p)
        for i,j in product(THREE,repeat=2):
            result[i][j] -= value*E[i][j]
        for i,j in product(FOUR,repeat=2):
            ricci_sum[i][j] -= value*ricci[i][j]
    assert all(v==0 for row in ricci_sum for v in row)
    assert result == tensor(lambda i,j: (-2,1,1)[i]*(i==j), THREE)
    wave = tensor(lambda i,j: (i==j==1)-(i==j==2))
    E, ricci = electric(wave,(3,0,0,-3))
    assert all(v == 0 for row in ricci for v in row)
    assert E[0][0]-E[1][1] == 9
    print(f"{checked} independent metric variations, all Ward, trace and gauge tests passed.")
    print("Radial-minus-tangential and TT clock factors:", result[0][0]-result[1][1], E[0][0]-E[1][1])


def pauli(k):
    x,y,z = k
    return (sin(x)*cos(y)*cos(z), sin(y)*cos(z), sin(z))


def native_bonds():
    # Test the microscopic tagging by constructing the six-stage hopping Fourier coefficients
    # directly using a four-point discrete transform on each axis (maximum spatial range is one).
    grid = tuple(product(range(4),repeat=3))
    displacements = tuple(product((-1,0,1),repeat=3))
    from cmath import exp
    weights = {}
    for d in displacements:
        weights[d] = [sum(pauli(tuple(pi*g/2 for g in G))[i] *
                          exp(-.5j*pi*sum(g*r for g,r in zip(G,d))) for G in grid)/64
                      for i in THREE]
    for axis, expect in enumerate(((1,1,1),(0,1,1),(0,0,1))):
        k = tuple((pi/2 if i==axis else 0) for i in THREE)
        def band_weight(d):
            phase = sum(s*r for s,r in zip(k,d))
            return weights[d][axis]*exp(1j*phase)
        for i,j in product(THREE,repeat=2):
            hessian = sum(band_weight(d)*d[i]*d[j] for d in displacements)
            assert abs(hessian-((i==j)*expect[i])) < 3e-15
        q = (2*pi/3,0,0)
        direct = sum(band_weight(d)*(cos(sum(qi*di for qi,di in zip(q,d))/2)-1)
                     for d in displacements)
        endpoints = [pauli([s+sign*t/2 for s,t in zip(k,q)]) for sign in (-1,1)]
        vertex = (endpoints[0][axis]+endpoints[1][axis])/2-pauli(k)[axis]
        assert abs(direct-vertex) < 3e-15
        assert abs(vertex-(-.5 if axis==0 else 0)) < 3e-15
        assert all(spin[axis]>0 and all(abs(v)<1e-14 for j,v in enumerate(spin) if j!=axis)
                   for spin in endpoints)
    # All three off-diagonal contrasts are available at stationary positive band peaks.
    for i, j in ((0,1),(0,2),(1,2)):
        tensors, candidates = [], []
        for sign in (-1,1):
            k = tuple(pi/2 if d==i else sign*pi/2 if d==j else 0 for d in THREE)
            v, spin = tuple(map(sin,k)), pauli(k)
            assert abs(sum(z*z for z in spin)-1) < 1e-14
            tensors.append(tensor(lambda b,c: v[b]*v[c]-(b==c)*sum(x*x for x in v)/3, THREE))
            def second(b,c):
                return sum(sum(x*y for x,y in zip(spin,weights[d])) *
                           exp(1j*sum(x*y for x,y in zip(k,d))) *
                           d[b]*d[c] for d in displacements)
            candidates.append(tensor(second,THREE))
        delta = tensor(lambda x,y: tensors[1][x][y]-tensors[0][x][y], THREE)
        shear = tensor(lambda x,y: int((x,y) in ((i,j),(j,i))),THREE)
        assert abs(contract(delta,shear)-4) < 1e-14
        assert all(abs(candidates[1][x][y]-candidates[0][x][y])<3e-15 for x,y in product(THREE,repeat=2))
    turns = [0,pi/2,3*pi/2,2*pi]
    integrals = [sin(b)-sin(a) for a,b in zip(turns,turns[1:])]
    assert abs(sum(integrals)) < 1e-14
    assert abs(sum(z*s for z,s in zip(integrals,[1,-1,1]))-4) < 1e-14
    # A hypothetical one-micron band with epsilon/h=1 kHz.
    nu = 1000*(1e-6)**2*1e-6/(8*299792458**2)
    assert 1.38e-33 < nu < 1.40e-33
    print("Bond quadrupole diagonals (1,1,1), (0,1,1), (0,0,1); q vertex (−1/2,0,0).")
    print(f"Illustrative hopping-scale tide {nu:.6g} Hz")


if __name__ == "__main__":
    verify_metric()
    native_bonds()
field_data.py
"""Replay the source-mass calibration in Stray et al., Nature 602 (2022), figure 1c.

The bundled CSV contains the credited article's 68 binned gradient readings.
--fetch verifies all reported columns against the publisher's workbook and
independently reconstructs them from 727 per-ellipse readings in the data deposit.
"""
import argparse
import csv
from collections import defaultdict
from hashlib import sha256
from io import BytesIO, StringIO
from itertools import groupby
from math import hypot, isclose, pi, sqrt
from pathlib import Path
from statistics import mean, pstdev, variance
import struct
from urllib.request import Request, urlopen
import xml.etree.ElementTree as ET
from zipfile import ZipFile
from zlib import crc32, decompress

ROOT = Path(__file__).resolve().parent
WORKBOOK = ("https://media.springernature.com/full/springer-static/esm/"
            "art%3A10.1038%2Fs41586-021-04315-3/MediaObjects/41586_2021_4315_MOESM2_ESM.xlsx")
DEPOSIT = "https://edata.bham.ac.uk/740/2/QuantumSensingForGravityCartographyDataCode_1.zip"
MEMBER = "Data1/Data/Figure_1_Data/Figure1c_data/Figure1c_data_processed.csv"
WORKBOOK_SHA = "97821a80ec02ad9e323b9f1bd76a03c9fff2561871c9fbf5769f7a7a89ef4c64"
MEMBER_SHA = "2ea65f1fe0cdc6db6570bcd42674f3bf35235feb406e12781f6dd36b4e716175"
CSV_SHA = "518cfe472032a455c4ee0e01f2b61c41426341865b21e02a1b353544fd0b669c"
C = 299792458


def require_hash(data, wanted):
    if sha256(data).hexdigest() != wanted:
        raise ValueError("Source SHA-256 differs from the pinned release")


def table(data):
    return [tuple(map(float, row.values())) for row in csv.DictReader(StringIO(data.decode()))]


def workbook_rows():
    with urlopen(WORKBOOK, timeout=30) as reply:
        data = reply.read()
    require_hash(data, WORKBOOK_SHA)
    ns = "{http://schemas.openxmlformats.org/spreadsheetml/2006/main}"
    with ZipFile(BytesIO(data)) as book:
        sheet = ET.fromstring(book.read("xl/worksheets/sheet2.xml"))
    rows = []
    for row in sheet.iter(ns + "row"):
        cells = [c for c in row.findall(ns + "c") if c.find(ns + "v") is not None]
        if cells and cells[0].get("t") != "s":
            rows.append(tuple(float(c.findtext(ns + "v")) for c in cells))
    return sorted(rows, key=lambda row: row[1])


def ellipse_readings():
    # The central directory pins this member in the published 6.16 GB ZIP.
    # A range request obtains just its local header, name, extra field and body.
    offset, compressed_size = 544908628, 6552
    request = Request(DEPOSIT, headers={"Range": f"bytes={offset}-{offset+6750-1}"})
    with urlopen(request, timeout=30) as reply:
        if reply.status != 206 or not reply.headers["Content-Range"].startswith(f"bytes {offset}-"):
            raise ValueError("Data repository did not honor the ZIP member range")
        body = reply.read(6750)
    if body[:4] != b"PK\x03\x04":
        raise ValueError("Missing ZIP member header")
    fn_len, extra_len = struct.unpack_from("<HH", body, 26)
    assert body[30:30+fn_len].decode() == MEMBER
    start = 30 + fn_len + extra_len
    assert start + compressed_size <= len(body)
    data = decompress(body[start:start+compressed_size], -15)
    assert len(data) == 18127 and crc32(data) == 884282424
    require_hash(data, MEMBER_SHA)
    readings = []
    for r in csv.DictReader(StringIO(data.decode())):
        h, m, s = map(int, r["Time"].split(":"))
        readings.append((3600*h+60*m+s, float(r["Gradient (Eo)"]), int(r["Lead position (mm)"])))
    assert len(readings) == 727
    return readings


def reproduce_bins(readings):
    # Reimplement the deposit's Figure1c_code.py. Discard its initial far visit,
    # trim two records at either end of each later visit, and preserve its strict
    # end-exclusive test (even a final block of exactly eight is omitted).
    bins = []
    for run, (_, visit) in enumerate(groupby(readings, key=lambda x: x[2])):
        fit = list(visit)[2:-2]
        if not run:
            continue
        for start in range(0, len(fit)-8, 8):
            sample = fit[start:start+8]
            values = [g for _, g, _ in sample]
            bins.append((run, sample[0][0], mean(values), pstdev(values)/sqrt(8)))
    t0 = bins[0][1]
    ref = mean(row[2] for row in bins if row[0] % 2 == 0)
    return [(run, t-t0, g-ref, se) for run,t,g,se in bins]


def brackets(rows):
    visits = {}
    for run, record in groupby(rows, key=lambda x: int(x[0])):
        sample = list(record)
        visits[run] = (mean(x[1] for x in sample), mean(x[2] for x in sample),
                       sum(x[3]**2 for x in sample)/len(sample)**2)
    assert list(visits) == list(range(1,20))
    weights = defaultdict(float)
    for k in range(2, 19, 2):
        t_left, t_mid, t_right = [visits[j][0] for j in (k-1, k, k+1)]
        fraction = (t_mid-t_left)/(t_right-t_left)
        weights[k-1] += (1-fraction)/9
        weights[k] -= 1/9
        weights[k+1] += fraction/9
    assert abs(sum(weights.values())) < 1e-14
    assert abs(sum(w*visits[k][0] for k,w in weights.items())) < 1e-10
    value = sum(w*visits[k][1] for k,w in weights.items())
    se = sqrt(sum(w*w*visits[k][2] for k,w in weights.items()))
    return value,se


def main():
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("--fetch", action="store_true", help="repeat both independent source extractions")
    opt = parser.parse_args()
    data = (ROOT / "field_bins.csv").read_bytes()
    require_hash(data, CSV_SHA)
    rows = table(data)
    if opt.fetch:
        readings = ellipse_readings()
        for alternate in [workbook_rows(), reproduce_bins(readings)]:
            assert len(alternate)==len(rows)
            assert all(max(abs(x-y) for x,y in zip(a,b))<2e-8 for a,b in zip(alternate,rows))
        full = [[g for _,g,p in readings if p==setting] for setting in (0,550)]
        untrimmed = mean(full[0])-mean(full[1])
        assert isclose(untrimmed,190.51982694,abs_tol=1e-8)
        print(f"727 archived ellipse fits reproduce all 68 binned rows. Untrimmed contrast {untrimmed:.3f} E.")
    close = [r for r in rows if int(r[0])%2]
    away = [r for r in rows if int(r[0])%2==0]
    assert (len(close),len(away))==(37,31)
    value = mean(r[2] for r in close)-mean(r[2] for r in away)
    internal = sqrt(sum(sum(r[3]**2 for r in group)/len(group)**2 for group in (close,away)))
    scatter = sqrt(sum(variance(r[2] for r in group)/len(group) for group in (close,away)))
    drift, drift_se = brackets(rows)
    assert abs(value-205.00952377)<1e-7 and abs(internal-12.98458760)<1e-7
    assert abs(drift-200.76512984)<1e-7 and abs(drift_se-13.45017776)<1e-7
    phase = (4*pi/780e-9)*.085**2*1.0*(value*1e-9)
    curvature = (value*1e-9)/C**2
    print(f"Direct contrast {value:.3f} E. Propagated bin errors {internal:.3f} E, scatter SE {scatter:.3f} E.")
    print(f"Nine drift-cancelling contrasts {drift:.3f} ± {drift_se:.3f} E (conditional independent-bin SE).")
    print(f"Raman phase {1e3*phase:.3f} mrad, magnitude of averaged curvature modulation {curvature:.6g} m^-2.")


if __name__ == "__main__":
    main()
replay.py
"""Replay the tidal-pair 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 = "1fb281c0ef55314ec68de024ac27da152ff00739607cbbdc408eeee82ab5b193"
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 ("pair", "contact", "embedding", "metric", "field_data"):
        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 / "tidal.tly", work / "tidal.tly")
        result = subprocess.run([*python, str(tally / "tally.py"), "tidal.tly"], cwd=work,
                                stdout=subprocess.PIPE, check=True)
        actual = result.stdout.decode("utf-8").splitlines()
        expected = (ROOT / "tidal.out").read_text(encoding="utf-8").splitlines()
        if actual != expected or sum(line.startswith("✓") for line in actual) != 17:
            raise ValueError("Tally output differs from the 17 published checks")
    print("All five offline checks and the complete 17-assertion Tally transcript passed.")


if __name__ == "__main__":
    main()
plot_gradient.py
"""Regenerate the gradient-contrast figure with Matplotlib and Pillow.

Source: Stray et al., Nature 602, 590–594 (2022), doi:10.1038/s41586-021-04315-3,
figure 1c, CC BY 4.0. This independent reduction uses the accompanying field_bins.csv.
"""
from io import BytesIO
from itertools import groupby
from math import hypot, sqrt
from pathlib import Path
from statistics import mean

import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from PIL import Image

from field_data import brackets, table


def main():
    directory = Path(__file__).resolve().parent
    rows = table((directory/"field_bins.csv").read_bytes())
    visits = {}
    for run, group in groupby(rows, key=lambda x: int(x[0])):
        bins = list(group)
        visits[run] = (mean(r[1] for r in bins), mean(r[2] for r in bins),
                       sqrt(sum(r[3]**2 for r in bins))/len(bins))
    estimates = []
    for run in range(2, 19, 2):
        left, mid, right = [visits[j] for j in (run-1, run, run+1)]
        fraction = (mid[0]-left[0])/(right[0]-left[0])
        value = (1-fraction)*left[1]+fraction*right[1]-mid[1]
        error = hypot((1-fraction)*left[2], mid[2], fraction*right[2])
        estimates.append((value,error))
    pooled, pooled_error = brackets(rows)

    plt.rcParams.update({"font.family":"DejaVu Sans", "font.size":11,
                         "axes.labelcolor":"#29333a", "xtick.color":"#404950",
                         "ytick.color":"#404950", "savefig.facecolor":"white"})
    fig,ax=plt.subplots(figsize=(5.4,4.4))
    fig.subplots_adjust(left=.18, right=.97, top=.88, bottom=.16)
    levels = list(range(9,0,-1))
    points, errors = zip(*estimates)
    ax.set_xlim(65,345)
    ax.set_ylim(-1.6,9.65)
    ax.axvline(202, color="#a04d17", ls="--", lw=1.6, zorder=1)
    ax.text(202,1.022,"202 E source model", transform=ax.get_xaxis_transform(),
            ha="center", va="bottom", color="#874016", fontsize=10)
    ax.text(-.04,1.022,"Far visit",transform=ax.transAxes,
            ha="right",va="bottom",color="#404950",fontsize=10)
    ax.errorbar(points, levels, xerr=errors, fmt="o", color="#16536b", ms=5,
                ecolor="#46788b", elinewidth=1.6, capsize=3, capthick=1.5, zorder=3)
    ax.axhline(.1, color="#d2d7d9", lw=1.0, zorder=1)
    ax.errorbar(pooled,-.85,xerr=pooled_error,fmt="D",color="#15252d",
                ms=6,elinewidth=2.0,capsize=4,capthick=1.7,zorder=3)
    ax.text(pooled+pooled_error+8,-.85,f"{pooled:.1f} ± {pooled_error:.1f} E",
            va="center",ha="left",color="#15252d",fontsize=10)
    ax.set_yticks([*levels,-.85],[*map(str,range(2,19,2)),"Combined"])
    ax.set_xticks(range(100,301,50))
    ax.set_xlabel("Near-minus-far gravity gradient (E)",labelpad=7)
    ax.grid(axis="x",color="#e8ecee",linewidth=.75)
    for name in ("left","right","top"):
        ax.spines[name].set_visible(False)
    ax.spines["bottom"].set_color("#81898e")
    ax.tick_params(axis="y",length=0,pad=7)
    img=BytesIO()
    fig.savefig(img,format="png",dpi=165)
    plt.close(fig)
    img.seek(0)
    # A bounded palette retains the antialiased plot at small download size.
    with Image.open(img) as im:
        im.convert("RGB").quantize(colors=160).save(directory/"gradient-contrast.png",optimize=True)


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

Independent research by Anthony Michael Collado.
Pair spectroscopy and gravitational tides · 1 December 2026

Energy flow and momentum → · Study sources (ZIP) ↓