|
| 1 | +# `homotopy_constraint_verification_with_independence_test.py` documentation |
| 2 | + |
| 3 | +## Location |
| 4 | +- Script: `experiments/homotopy_constraint_verification_with_independence_test.py` |
| 5 | + |
| 6 | +## Purpose |
| 7 | +This script performs two empirical checks over standard basis tensors: |
| 8 | +1. linear independence of non-zero face images for each fixed face map, |
| 9 | +2. horn-constraint equivalence between combinatorial missing indices and direct face-zero constraints. |
| 10 | + |
| 11 | +## Algorithm |
| 12 | +### Step 1: Linear independence check |
| 13 | +For each tested `shape` and face index `i` in `0..dimen(shape_tensor)`: |
| 14 | +1. Enumerate basis tensors `E_m`. |
| 15 | +2. Compute `face(E_m, i)`. |
| 16 | +3. Keep non-zero face images and flatten them to vectors. |
| 17 | +4. Form a matrix of those vectors. |
| 18 | +5. Compare matrix rank to number of vectors. |
| 19 | +- Equal: reports independent. |
| 20 | +- Not equal: reports dependent. |
| 21 | + |
| 22 | +### Step 2: Constraint equivalence check |
| 23 | +For each tested `shape` and horn index `j` in `0..dimen(shape_tensor)`: |
| 24 | +1. Compute `expected_indices = compute_missing_indices_dask(shape, j)`. |
| 25 | +2. Enumerate all basis indices `m`. |
| 26 | +3. For every face index `i != j`, collect indices where `face(E_m, i)` is zero. |
| 27 | +4. Intersect those sets across all `i != j`. |
| 28 | +5. Compare the intersection with `expected_indices`. |
| 29 | + |
| 30 | +## Outputs |
| 31 | +The script prints: |
| 32 | +- section headers for both steps, |
| 33 | +- per-case counts and rank results in Step 1, |
| 34 | +- per-case combinatorial/constraint counts in Step 2, |
| 35 | +- pass/fail status per case, |
| 36 | +- final summary lines for each step. |
| 37 | + |
| 38 | +## Logging |
| 39 | +- No file logger is configured. |
| 40 | +- All reporting is written to standard output. |
| 41 | + |
| 42 | +## Run |
| 43 | +From repository root, either use editable install: |
| 44 | + |
| 45 | +```powershell |
| 46 | +.\.venv\Scripts\python.exe experiments\homotopy_constraint_verification_with_independence_test.py |
| 47 | +``` |
| 48 | + |
| 49 | +Or run with explicit source path: |
| 50 | + |
| 51 | +```powershell |
| 52 | +$env:PYTHONPATH = 'src' |
| 53 | +.\.venv\Scripts\python.exe experiments\homotopy_constraint_verification_with_independence_test.py |
| 54 | +``` |
0 commit comments