"""Verify Eisenhart (1934) Type IV_2 ↔ Moon–Spencer paraboloidal mapping. Formulas from Eisenhart p.301 (7.6), (IV_2), φ_ij, checked against M&S Table 1.11. """ import sympy as sp a, b, x1, x2, x3 = sp.symbols('a b x1 x2 x3', real=True) # Eisenhart (7.6) xE = (x1 + x2 + x3 - a - b) / 2 yE2 = (a - x1) * (a - x2) * (a - x3) / (b - a) zE2 = (b - x1) * (b - x2) * (b - x3) / (a - b) # Surface identity implied by (7.6): LHS = 2x - x_i for xi in (x1, x2, x3): LHS = sp.simplify(yE2 / (a - xi) + zE2 / (b - xi)) assert sp.simplify(LHS - (2 * xE - xi)) == 0 print('PASS: (7.6) implies y^2/(a-x_i)+z^2/(b-x_i)=2x-x_i') # Map to M&S: a↔c, (x1,x2,x3)↔(μ,λ,ν) mu, nu, lam, c = sp.symbols('mu nu lambda c', positive=True) subs = {a: c, x1: mu, x2: lam, x3: nu} xMS2 = 4 * (mu - b) * (b - nu) * (b - lam) / (b - c) yMS2 = 4 * (mu - c) * (c - nu) * (lam - c) / (b - c) zMS = mu + nu + lam - b - c assert sp.simplify(xE.subs(subs) - zMS / 2) == 0 assert sp.simplify(4 * yE2.subs(subs) - yMS2) == 0 assert sp.simplify(4 * zE2.subs(subs) - xMS2) == 0 print('PASS: Cartesian map x_E=z_MS/2, 4 y_E^2=y_MS^2, 4 z_E^2=x_MS^2') # Scale factors (IV_2) def f(s): return 4 * (a - s) * (b - s) H = [ (x1 - x2) * (x1 - x3) / f(x1), (x2 - x1) * (x2 - x3) / f(x2), (x3 - x1) * (x3 - x2) / f(x3), ] Wm = (mu - b) * (mu - c) Wn = (b - nu) * (c - nu) Wl = (b - lam) * (lam - c) h2 = [ (mu - nu) * (mu - lam) / Wm, (lam - nu) * (mu - lam) / Wl, (mu - nu) * (lam - nu) / Wn, ] # H order (x1,x2,x3)=(μ,λ,ν) ↔ (h_μ, h_λ, h_ν) assert sp.simplify(H[0].subs(subs) - h2[0] / 4) == 0 assert sp.simplify(H[1].subs(subs) - h2[1] / 4) == 0 assert sp.simplify(H[2].subs(subs) - h2[2] / 4) == 0 print('PASS: H_i^2 = h_sigma^2 / 4 under the coordinate identification') # f vs W assert sp.simplify(f(mu).subs({a: c, b: b}) - 4 * Wm) == 0 assert sp.simplify(f(nu).subs({a: c, b: b}) - 4 * Wn) == 0 assert sp.simplify(f(lam).subs({a: c, b: b}) + 4 * Wl) == 0 print('PASS: f(μ)=4 W_μ, f(ν)=4 W_ν, f(λ)=-4 W_λ') # Eisenhart φ_ij vs M&S S_ij absolute values (factor 4; signed f on middle row) # φ_i1 = x_i^2/f(x_i). For μ: μ^2/(4 W_μ) vs S_μ1=μ^2/W_μ phi_mu = [mu**2 / f(mu), 1 / f(mu), mu / f(mu)] S_mu = [mu**2 / Wm, -1 / Wm, mu / Wm] # M&S row 1 for j in range(3): # φ = S / 4 up to the sign of column 2 if j == 1: assert sp.simplify(phi_mu[j].subs({a: c, b: b}) + S_mu[j] / 4) == 0 else: assert sp.simplify(phi_mu[j].subs({a: c, b: b}) - S_mu[j] / 4) == 0 print('PASS: Eisenhart φ_μj = (±) M&S S_μj / 4 (minus on column 2)') # Metric from φ: H^2 = det(φ)/cofactor(φ_i1) should recover (IV_2) # Build 3x3 φ matrix with f_i = f(x_i) xs = (x1, x2, x3) Phi = sp.Matrix([[xs[i]**2 / f(xs[i]), 1 / f(xs[i]), xs[i] / f(xs[i])] for i in range(3)]) detPhi = sp.simplify(Phi.det()) for i in range(3): cof = sp.simplify(Phi.cofactor(i, 0)) Hfrom = sp.simplify(detPhi / cof) assert sp.simplify(Hfrom - H[i]) == 0 print('PASS: H_i^2 = φ / φ^{i1} recovers (IV_2) from Eisenhart φ_ij on p.301') print('ALL EISENHART MAP CHECKS PASSED')