ultrametric-distance
Non-Archimedean distance metrics for hierarchical clustering and p-adic analysis
Profile →npx skills add majiayu000/claude-skill-registry --skill ultrametric-distance --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Ultrametric Distance Skill **Status**: ✅ Production Ready **Trit**: -1 (MINUS - validator/constrainer) **Principle**: d(x,z) ≤ max(d(x,y), d(y,z)) — Strong Triangle Inequality --- ## Overview **Ultrametric Distance** provides non-Archimedean distance functions where the strong triangle inequality holds. Essential for: 1. **Hierarchical clustering**: Natural tree structures emerge 2. **p-adic analysis**: Number-theoretic computations 3. **Phylogenetic trees**: Evolution distance metrics 4. **Version control**: Commit ancestry distances ## Core Property ``` Ultrametric Inequality: d(x, z) ≤ max(d(x, y), d(y, z)) Unlike Euclidean: d(x,z) ≤ d(x,y) + d(y,z) Ultrametric is STRONGER: max instead of sum ``` ## Key Insight In ultrametric space, ALL triangles are isoceles with the unequal side being the shortest. ## Python Implementation ```python import math from typing import List, Tuple, Callable def ultrametric_distance(x: List[float], y: List[float]) -> float: """Compute ultrametric (sup-norm) distance.""" return max(abs(a - b) for a, b in zip(x, y)) def p_adic_valuation(n: int, p: int) -> int: """Compute p-adic valuation v_p(n) = max k such that p^k | n.""" if n == 0: return float('i
- Overview
- Core Property
- Key Insight
- Python Implementation
- Hierarchical Clustering (UPGMA)
- Git Commit Distance
- Julia Implementation
- Integration with GF(3)
- Commands
- Properties
- SDF Interleaving
- Primary Chapter: 3. Variations on an Arithmetic Theme
- GF(3) Balanced Triad
- Connection Pattern
Verify p-adic distances python -c "from ultrametric import p_adic_distance; print(p_adic_distance(12, 20, 2))" Build UPGMA tree python -m ultrametric.upgma --input distances.csv --output tree.json Git commit distance git-ultrametric HEAD~5 main
What does the ultrametric-distance skill do?
Non-Archimedean distance metrics for hierarchical clustering and p-adic analysis
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill ultrametric-distance --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.