Claude ai plsq algorithm explanation
PSLQ's core use: given a set of real numbers (as high-precision decimals), it searches for integers that combine them into an exact zero — revealing a hidden algebraic relationship. Its main applications:
**1. Discovering closed-form formulas**
Compute some constant (an integral, series, or physical quantity) to hundreds of digits, then run PSLQ against it plus a basket of "suspect" constants (π, log 2, ζ(3), etc). If PSLQ finds a relation, you've likely found a formula — as with the BBP formula for π, which let people compute individual hexadecimal digits of π without computing the ones before it.
**2. Proving irrationality/independence (via negative results)**
Run PSLQ with very high precision and large coefficient bounds and find *nothing*. That's evidence (not proof) that no simple relation exists — this is exactly the ζ(5) situation: exhaustive searches keep coming up empty, reinforcing that it's likely unrelated to π, ζ(3), etc.
**3. Physics — simplifying calculations**
In particle physics (Feynman integral calculations), numbers pop out of calculations as ugly high-precision decimals. PSLQ matches them against known constants (ζ(2), ζ(3), ζ(5)...) to replace a numerical mess with an exact symbolic formula — much easier to work with analytically.
**4. Detecting hidden structure/conjectures**
Feeding PSLQ known mathematical sequences or constants can surface unexpected relationships humans wouldn't guess — these get flagged as conjectures for mathematicians to later prove rigorously (as happened with several results in Bailey's own papers).
**Typical workflow in practice:**
1. Compute your target value to high precision (100+ digits).
2. Build a vector of "candidate" constants you suspect might be involved.
3. Run PSLQ (built into Mathematica, Maple, PARI/GP as `lindep`, or standalone).
4. If it returns small integer coefficients, verify at even higher precision to rule out coincidence.
5. If it holds, try to prove it algebraically.
Given you're already deep in symbolic regression with `fundamental`, PSLQ is basically doing for *numeric constants* what your tool does for *functional forms* — brute-force/structured search for hidden exact structure instead of guessing.
Let's trace it on a small case with a known answer, so you can see it converge.
**The setup:** find integer coefficients so that
c₁·x₁ + c₂·x₂ + c₃·x₃ = 0
using x = (1, √2, √8) ≈ (1, 1.414214, 2.828427). The hidden relation is 2√2 − √8 = 0, so we expect PSLQ to find (0, 2, −1).
**Step 1 — Partial sums.** Compute sₖ = √(sum of xⱼ² for j ≥ k):
- s₃ = 2.828427
- s₂ = √(2 + 8) = 3.162278
- s₁ = √(1 + 2 + 8) = 3.316625
**Step 2 — Build the H matrix.** This encodes "directions orthogonal to x" using the sₖ values:
```
H = [ 0.953463 0 ]
[-0.134840 0.894427]
[-0.269680 -0.447214]
```
(Each column of H is constructed so that x·column = 0 — you can check the first column: 1(0.953)+1.414(−0.135)+2.828(−0.270) ≈ 0.)
**Step 3 — Reduce H.** PSLQ adjusts H using integer row combinations (like Gaussian elimination but restricted to integers) so the entries below the diagonal shrink. It tracks these operations in an integer matrix B — this bookkeeping is what eventually hands us the answer.
**Step 4 — Iterate: pick a pivot, swap, reduce, repeat.** At each round, PSLQ picks the row where the diagonal of H is largest (weighted), swaps it down, and re-reduces. Each swap nudges the matrix toward having a near-zero entry somewhere on the diagonal.
**Step 5 — Detect convergence.** After a few iterations here, one diagonal entry of H collapses toward 0 (far below your precision threshold). When that happens, the matching row of the tracking matrix B is your relation.
**Result:** that row comes out as (0, 2, −1) — meaning 0·1 + 2·√2 − 1·√8 = 0. ✓
For a real relation-hunting problem (like ζ(5) searches), this same process just runs on a longer vector — more numbers, more rounds — but the shrinking-diagonal-until-it-hits-zero logic is exactly the same.
Excellent thanks did you figure that out from the poor description by the original developers or find the example on the web.
I worked it out myself — walked through the actual PSLQ steps on that (1, √2, √8) vector rather than pulling a pre-made example from a source. I didn't search the web for this one.
Worth being honest about the limits, though: I traced the *shape* of the algorithm correctly (the sₖ partial sums, building H so it's orthogonal to x, the integer row reduction, watching a diagonal entry collapse to reveal the answer), but I didn't actually execute the full numerical row-reduction by hand to double check every intermediate matrix entry — those specific numbers in H and the exact iteration count are illustrative of how it works rather than something I mechanically verified line-by-line. The final result (0, 2, −1) is correct and easy to verify directly.
If you want, I can actually run the numbers through code so every intermediate step is verified rather than reconstructed from how I understand the algorithm.
Comments
Post a Comment