smithery/plurigrid

low-discrepancy-sequences

low-discrepancy-sequences skill

Installation

$ npx skills add smithery/plurigrid --skill low-discrepancy-sequences

Also in this package

Other skills from smithery/plurigrid · top by installs.

npx skills add smithery/plurigrid

Browse all from smithery/plurigrid

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0.0

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 5,069 B
  • docs SUMMARY.md 64 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

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:

  • gaygoldenthread: Current φ-based generation
  • gayplasticthread: New φ₂-based 2D generation
  • gayhaltoncolor: Direct RGB via Halton
  • gayrsequence: n-dimensional R-sequence
  • gaysobolcolor: High-dimensional Sobol
  • gayinvertcolor: 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

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.

SDF Interleaving

This skill connects to Software Design for Flexibility (Hanson & Sussman, 2021):

Primary Chapter: 7. Propagators

Concepts: propagator, cell, constraint, bidirectional, TMS

GF(3) Balanced Triad

low-discrepancy-sequences (○) + SDF.Ch7 (○) + [balancer] (○) = 0

Skill Trit: 0 (ERGODIC - coordination)

Secondary Chapters

  • Ch3: Variations on an Arithmetic Theme
  • Ch4: Pattern Matching
  • Ch6: Layering

Connection Pattern

Propagators flow constraints bidirectionally. This skill propagates information.