low-discrepancy-sequences

low-discrepancy-sequences skill

16 stars

Best use case

low-discrepancy-sequences is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

low-discrepancy-sequences skill

Teams using low-discrepancy-sequences should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/low-discrepancy-sequences/SKILL.md --create-dirs "https://raw.githubusercontent.com/plurigrid/asi/main/plugins/asi/skills/low-discrepancy-sequences/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/low-discrepancy-sequences/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How low-discrepancy-sequences Compares

Feature / Agentlow-discrepancy-sequencesStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

low-discrepancy-sequences skill

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Low-Discrepancy Sequences

Deterministic color generation via low-discrepancy sequences with bijective index recovery.

## Purpose

Extends beyond the golden angle (φ) with multiple low-discrepancy sequences for uniform color space coverage. All sequences maintain bijectivity: given a color and seed, you can recover the index n.

## Sequences Implemented

### 1. Golden Angle (φ)
- **Dimension**: 1D (hue only)
- **Uniformity**: Optimal for 1D
- **Source**: φ = (1 + √5)/2
- **Formula**: hue = (seed + n/φ) mod 1

### 2. Plastic Constant (φ₂)
- **Dimension**: 2D (hue + saturation)
- **Uniformity**: Optimal for 2D
- **Source**: φ₂ ≈ 1.324717... (root of x³ = x + 1)
- **Formula**: 
  - h = (seed + n/φ₂) mod 1
  - s = (seed + n/φ₂²) mod 1

### 3. Halton Sequence
- **Dimension**: nD (direct RGB or HSL)
- **Uniformity**: Good for any dimension
- **Source**: Prime bases (2, 3, 5, 7...)
- **Formula**: halton(n, base) = ∑ dᵢ/baseⁱ⁺¹

### 4. R-sequence (Recursive)
- **Dimension**: nD
- **Uniformity**: Near-optimal
- **Source**: φ_d (d-dimensional golden ratio)
- **Formula**: α_d = roots of x^(d+1) = x + 1

### 5. Kronecker Sequence
- **Dimension**: 1D
- **Uniformity**: Optimal (equidistributed)
- **Source**: Any irrational α
- **Formula**: {nα} mod 1

### 6. Sobol Sequence
- **Dimension**: nD (up to 1000+)
- **Uniformity**: Excellent for high dimensions
- **Source**: Direction numbers
- **Formula**: Gray code XOR with direction vectors

### 7. Pisot Sequence
- **Dimension**: nD
- **Uniformity**: Quasiperiodic
- **Source**: Pisot-Vijayaraghavan numbers (algebraic integers)
- **Formula**: θⁿ rounded to nearest integer

### 8. Continued Fractions
- **Dimension**: 1D
- **Uniformity**: Geodesic in hyperbolic geometry
- **Source**: Continued fraction expansion
- **Formula**: [a₀; a₁, a₂, ...] convergents

## Bijection Property

All sequences are **bijective on index**: Given (color, seed), you can recover n.

This enables:
- Reafference: "I generated color C at index n"
- Inverse queries: "What index produced this color?"
- Temporal reconstruction: "When did I see this color?"

## Integration with Gay.jl

These sequences extend the existing `gay-mcp` MCP server tools:
- `gay_golden_thread`: Current φ-based generation
- `gay_plastic_thread`: New φ₂-based 2D generation
- `gay_halton_color`: Direct RGB via Halton
- `gay_r_sequence`: n-dimensional R-sequence
- `gay_sobol_color`: High-dimensional Sobol
- `gay_invert_color`: Recover index from color

## Related Skills

- **gay-mcp**: Deterministic color generation foundation
- **reafference**: Self-recognition via prediction matching
- **golden-thread**: Original φ spiral implementation
- **phenomenal-bisect**: Temperature τ bisection using colors
- **crystal-family**: Crystallographic color assignments
- **bidirectional-awareness**: Skill graph visualization colors

## GF(3) Trit Assignment

**Trit**: 0 (ERGODIC)

Low-discrepancy sequences are infrastructure for uniform space coverage - neither generative (+1) nor analytical (-1), but foundational coordination (0).

## References

1. Niederreiter, H. (1992). *Random Number Generation and Quasi-Monte Carlo Methods*
2. Kuipers, L. & Niederreiter, H. (1974). *Uniform Distribution of Sequences*
3. Pisot, C. & Salem, R. (1963). *Algebraic Numbers and Fourier Analysis*
4. Arnoux, P. & Ito, S. (2001). Pisot substitutions and Rauzy fractals
5. Series, C. (1985). The geometry of Markoff numbers (continued fractions)

## Usage Example

```julia
using LowDiscrepancySequences

# Golden angle (current method)
color1 = golden_angle_color(69, seed=42)

# Plastic constant (2D: hue + saturation)
color2 = plastic_color(69, seed=42)

# Halton (direct RGB)
color3 = halton_color(69)

# R-sequence (3D)
color4 = r_sequence_color(69, dim=3, seed=42)

# Invert: recover index
n = invert_color(color2, method=:plastic, seed=42)
@assert n == 69
```

## Connections to Geodesics

Continued fractions provide **geodesic paths** in hyperbolic geometry (PSL(2,ℝ) action on ℍ²). This connects to:
- Geodesic skill representations (shortest execution paths)
- Hyperbolic geometry of skill space
- Non-backtracking paths (prime geodesics)

The Farey sequence F_n = {p/q : gcd(p,q)=1, 0≤p≤q≤n} gives rational approximations to irrationals via continued fractions, mirroring the discrete approximations to geodesic flows.

Related Skills

jepsen-testing

16
from plurigrid/asi

Jepsen-style correctness testing for distributed systems under faults (partitions, crashes, clock skew) using concurrent operation histories and formal checkers (linearizability/serializability and Elle-style anomalies). Use when designing, implementing, or running Jepsen tests, or interpreting histories/violations.

Deterministic Color Generation via Metadata Hashing

16
from plurigrid/asi

**Status**: ✅ Production Ready

cyton-dongle

16
from plurigrid/asi

Connect and stream from OpenBCI Cyton/Daisy via USB dongle, including first-time radio channel pairing

asi-transient-agenda

16
from plurigrid/asi

Org-agenda-like transient views for ASI skill orchestration via nbb/squint + Emacs hydra

Topological Superintelligence (TSI)

16
from plurigrid/asi

Compositional AI framework using GF(3) triadic balance and category-theoretic foundations.

zx-calculus

16
from plurigrid/asi

Coecke's ZX-calculus for quantum circuit reasoning via string diagrams with Z-spiders (green) and X-spiders (red)

zulip-cogen

16
from plurigrid/asi

Zulip Cogen Skill 🐸⚡

zls-integration

16
from plurigrid/asi

zls-integration skill

zig

16
from plurigrid/asi

zig skill

zig-syrup-bci

16
from plurigrid/asi

Multimodal BCI pipeline in Zig: DSI-24 EEG, fNIRS mBLL, eye tracking IVT, LSL sync, EDF read/write, GF(3) conservation

zig-programming

16
from plurigrid/asi

zig-programming skill

zeroth-bot

16
from plurigrid/asi

Zeroth Bot - 3D-printed open-source humanoid robot platform for sim-to-real and RL research. Affordable entry point for humanoid robotics.