Skip to content

johnjanik/simplex_amplitudedron

Repository files navigation

Computational Verification: Testing the Moufang Pivot

This repository contains Python code for computationally verifying the Associative Path Conjecture for octonionic amplitudes, as described in the paper:

From Dantzig to Octonions: Positive Geometry, the Simplex Method, and Exceptional Amplituhedra

Overview

The code tests whether the Sherman-Morrison matrix update formula—which underlies pivot operations in the simplex algorithm—is valid in the octonionic setting if and only if the relevant associator vanishes. This validates the theoretical claim that octonionic simplex pivots must proceed along associative geodesics in the positive Cayley plane.

Key Features

  1. Properly Parenthesized Sherman-Morrison Formula: Uses (u(σ⁻¹v†)) to respect non-associativity
  2. Sweep Algorithm Demonstration: Computes polygon area by tracking optimal vertex v(θ) as θ varies
  3. Dead-End Detection: Identifies vertices where all ascent directions are non-associative

Key Result

Metric Quaternionic (Associative) Generic Octonionic
Mean Error 1.52 × 10⁻¹⁵ 9.99 × 10⁰
Max Error 3.72 × 10⁻¹⁵ 2.90 × 10¹
Mean Associator 1.84 × 10⁻¹⁶ 0.96
Formula Valid? Yes No

The Sherman-Morrison formula works to machine precision in the associative case and fails by 16 orders of magnitude in the non-associative case.

Requirements

  • Python 3.7+
  • NumPy
pip install numpy

Files

File Description
run_verification.py Main verification script (standalone, all-in-one)
octonion_algebra_class.py Octonion algebra implementation (Cayley-Dickson)
octonion_matrix_operations.py Matrix operations over octonions
dieudonne_det.py Dieudonné determinant and matrix inverse
sherman_morrison_update.py Sherman-Morrison update formula
test_procedure.py Test procedure functions

Quick Start

Run the complete verification:

python run_verification.py

This will:

  1. Verify the octonion algebra implementation
  2. Run 100 scalar Sherman-Morrison tests (quaternionic case)
  3. Run 100 scalar Sherman-Morrison tests (generic octonionic case)
  4. Run 100 matrix Sherman-Morrison tests (quaternionic case)
  5. Run 100 matrix Sherman-Morrison tests (generic octonionic case)
  6. Test critical examples with imaginary octonion units
  7. Print summary statistics and conclusions

Understanding the Output

Algebra Verification

Verifying octonion algebra properties...
  |x*conj(x) - |x|^2| = 0.00e+00 (should be ~0)
  |x * x^(-1) - 1| = 2.82e-17 (should be ~0)
  Quaternionic associator norm = 4.44e-16 (should be ~0)
  Generic associator norm = 1.59e+01 (should be > 0)

This confirms:

  • The norm formula |x|² = x · x̄ is correctly implemented
  • Octonion inverses satisfy x · x⁻¹ = 1
  • Quaternionic subalgebras are associative (associator ≈ 0)
  • Generic octonions are non-associative (associator > 0)

Matrix Tests

The key validation is the matrix Sherman-Morrison test:

--- QUATERNIONIC (Associative) Case ---
Error - Mean: 1.77e-15, Max: 5.24e-15
Associator - Mean: 2.90e-16, Max: 1.00e-15

--- GENERIC OCTONIONIC (Non-Associative) Case ---
Error - Mean: 1.34e+01, Max: 3.34e+01
Associator - Mean: 1.06e+00, Max: 2.45e+00
Correlation (error vs associator): 0.609

Interpretation:

  • Quaternionic case: Error ~10⁻¹⁵ means the formula works to machine precision
  • Generic case: Error ~10¹ means the formula completely fails
  • Correlation 0.609: Positive correlation confirms non-associativity causes failure

Mathematical Background

The Sherman-Morrison Formula

For a matrix M = I + uv†, the inverse is:

M⁻¹ = I - u(1 + v†u)⁻¹v†

This formula requires associativity to derive. In octonions, (ab)c ≠ a(bc) in general, so the formula fails.

The Associator

The associator of three octonions measures non-associativity:

[a, b, c] = (ab)c - a(bc)
  • If [a, b, c] = 0 for all relevant triples → formula works
  • If [a, b, c] ≠ 0 → formula fails

Cayley-Dickson Construction

Octonions are constructed as pairs of quaternions:

(a, b) · (c, d) = (ac - d̄b, da + bc̄)

where a, b, c, d are quaternions and denotes conjugation.

Reproducing Results

To reproduce the exact results from the paper, use the same random seed:

import numpy as np
np.random.seed(42)

This is already set in run_verification.py.

Running Individual Tests

from run_verification import *

# Test single quaternionic case
u = [random_quaternionic_octonion() for _ in range(2)]
v = [random_quaternionic_octonion() for _ in range(2)]
error, assoc = sherman_morrison_matrix_test(u, v)
print(f"Error: {error}, Associator: {assoc}")

# Test single generic octonionic case
u = [random_octonion() for _ in range(2)]
v = [random_octonion() for _ in range(2)]
error, assoc = sherman_morrison_matrix_test(u, v)
print(f"Error: {error}, Associator: {assoc}")

Custom Number of Tests

# Run 1000 tests instead of 100
errors, assocs = run_matrix_tests(generic=True, num_tests=1000)
print(f"Mean error: {np.mean(errors):.2e}")
print(f"Correlation: {np.corrcoef(errors, assocs)[0,1]:.3f}")

Extending the Code

Testing Other Subalgebras

The code tests quaternionic octonions (first 4 components). To test other subalgebras:

def random_complex_octonion():
    """Octonion in a complex subalgebra."""
    return Octonion(
        Quaternion(random_complex(), zero_complex()),
        zero_quaternion()
    )

Testing Larger Matrices

The current implementation tests 2×2 matrices. For larger matrices, you would need to:

  1. Extend octonion_matrix_mult to n×n
  2. Implement a general octonionic matrix inverse (non-trivial due to non-associativity)
  3. Adapt the Sherman-Morrison test accordingly

Sweep Algorithm

The code demonstrates the sweep algorithm for computing geometric quantities:

Algorithm:
1. Parameterize Morse functions h_θ for θ ∈ [0, 2π]
2. Track optimal vertex v(θ) as θ varies continuously
3. Compute residues at each critical angle θ_c where v(θ) jumps
4. Sum residues to get the canonical form (area/volume)

Example Output

Polygon vertices: [(0, 0), (2, 0), (2, 1), (0, 2)]
Found 4 critical angles (pivots):
  θ_1 = 0.0000 rad (0.0°): v1 → v2
  θ_2 = 1.1071 rad (63.4°): v2 → v3
  θ_3 = 3.1416 rad (180.0°): v3 → v0
  θ_4 = 4.7124 rad (270.0°): v0 → v1

Area by sweep algorithm: 3.0000
Area by direct formula:  3.0000
Match: True

Complexity: O(n) pivots vs O(2^n) triangulation cells

Dead-End Detection

The code identifies "octonionic dead ends"—vertices where all ascent directions are non-associative:

from run_verification import detect_dead_ends, OctonionicVertex

# Create vertices with octonionic coordinates
vertices = [...]  # List of OctonionicVertex objects

# Detect dead ends
dead_ends = detect_dead_ends(vertices)
for de in dead_ends:
    print(f"Vertex {de['vertex_index']}: {de['num_ascent_directions']} blocked")

Interpretation: Dead ends represent potential physical anomalies or forbidden scattering channels in 10D/11D theories. For physical kinematic data, we conjecture that the associative subgraph is connected.

Theoretical Context

This code validates Conjecture 7.8 (Associative Path Conjecture) from the paper:

In the positive Cayley plane OP²⁺, the only admissible edges for the octonionic simplex algorithm are the lines (geodesics) of the geometry. Two vertices are connected by an edge if and only if they are collinear in OP², which enforces that the local algebra is associative.

The computational verification shows that:

  1. Pivot operations (Sherman-Morrison updates) require associativity
  2. Non-associativity causes catastrophic failure (16 orders of magnitude)
  3. The associator norm predicts failure (correlation ρ ≈ 0.6)

Citation

If you use this code in your research, please cite:

@article{janik2024dantzig,
  title={From Dantzig to Octonions: Positive Geometry, the Simplex Method, and Exceptional Amplituhedra},
  author={Janik, John A.},
  year={2024}
}

License

This code is provided for research and educational purposes. See LICENSE file for details.

Contact

For questions or issues, please open a GitHub issue or contact:

Acknowledgments

During the preparation of this work, generative AI (Claude) was used to assist in code development and documentation. The author has reviewed and validated all computational results.

About

simplex amplitudedron verification code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages