Skip to content

The scaling function is checked against what Eq. (24) says it is - #154

Merged
sotashimozono merged 4 commits into
mainfrom
feat/validate-scaling-function
Sep 14, 2026
Merged

sotashimozono merged 4 commits into
mainfrom
feat/validate-scaling-function

Conversation

@sotashimozono

Copy link
Copy Markdown
Member

f reaches InfiniteRandomnessEntanglementPBC as a number, so the relation can
only ask that it be positive. The callable is still visible one layer up, in
finite_size_entropy_report, and Eq. (24) states f through an expansion,

f(v) = Σₖ Aₖ sin((2k-1)πv),   Σₖ Aₖ(2k-1)π = 1

from which two properties follow without knowing a single coefficient. Every
basis function is symmetric about v = 1/2, since sin((2k-1)π(1-v)) equals
sin((2k-1)πv) for odd 2k-1, so any admissible f is. And the normalisation
IS f'(0) = 1, which is what "tends to v as v → 0" means.

Both are checked now. The second is the one that mattered. An f off by a
constant shifts ln[L f] by ln of that constant, and c₁′ is a free
non-universal constant that absorbs it, so the wrong scaling function was
reported as a pass with a wrong constant rather than as a failure. Passing
the chord (L/π)sin(πℓ/L) itself, rather than the dimensionless sin(πv)/π, is
the way in.

What this does not do

The form is not checked and cannot be from here. The higher harmonics are the
entire difference between Eq. (24) and the conformal case, and separating them
needs a disorder average this package does not compute. The only form pinned
remains the one-harmonic reduction, which is CFTEntanglementPBC exactly.

So the load-bearing test is the one asserting a two-harmonic f is accepted:
(1/π - 0.06) sin(πv) + 0.02 sin(3πv), normalised the same way and demonstrably
a different function. A check that admitted only sin(πv)/π would refuse the
physics the relation exists for, and would have passed every other test here.

The @experimental note is rewritten to say which half is closed, rather than
claiming the whole thing is unsettled.

Scope

Validated only where it is read: c̃ present, f present, bc isa PBC. An f
that no row consumes is not refused for being present, and there is a test for
each of those two ways of not being read.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

sotashimozono and others added 2 commits September 14, 2026 10:24
`f` reaches `InfiniteRandomnessEntanglementPBC` as a number, so the relation can
only ask that it be positive. The callable is still visible in
`finite_size_entropy_report`, and Eq. (24) states `f` through an expansion,
`f(v) = Σₖ Aₖ sin((2k-1)πv)` under `Σₖ Aₖ(2k-1)π = 1`, from which two properties
follow without knowing a coefficient: every basis function is symmetric about
`v = 1/2`, so an admissible `f` is; and the normalisation IS `f'(0) = 1`.

Both are now checked. The second is the one that mattered: an `f` off by a
constant shifts `ln[L f]` by `ln` of that constant, which `c₁′` absorbs, so the
wrong scaling function was reported as a PASS with a wrong non-universal
constant rather than as a failure. Passing the chord `(L/π)sin(πℓ/L)` itself,
rather than the dimensionless `sin(πv)/π`, is the way in.

The form is still unchecked and this does not pretend otherwise. The higher
harmonics are the entire difference between this and the conformal case, and
separating them needs a disorder average that is not computed here. So the test
that matters most is the one asserting a two-harmonic `f` is ACCEPTED: a check
that admitted only `sin(πv)/π` would refuse the physics the relation exists for.
The `@experimental` note now says which half is closed.

Validated only where it is read, so an `f` no row consumes is not refused for
being present.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The comments restated the docstring and the error messages restated the comments.
Kept the two that say something the code does not: why a two-harmonic f must be
accepted, and that a constant factor lands in c₁′ rather than in the residual.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Inserting `_check_scaling_function` before `function finite_size_entropy_report`
put it inside the gap the docstring was spanning, so the docstring bound to the
helper and the report lost its own. Nothing about the code changed and no test of
the behaviour noticed; `test_docs_crossrefs` did, because an `@ref` to the report
then pointed at a name with no rendered docstring.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📚 Docs preview: https://qatlashub.github.io/AbstractQAtlas.jl/previews/PR154/

(updates on each push to this PR)

Six review agents converged on the same defect and found two more. The check as
written could refuse an `f` that was never going to be used, refuse an `f` that
was correct, and accept one that was wrong.

REFUSED WHAT IT NEVER READ. The guard ran once before any region was inspected,
so it fired whenever `c̃`, `f` and PBC were present. A bag holding only a whole
ring, which has no cuts, would take a normalisation failure and die on it, having
never been going to evaluate `f` at all. The comment above the guard asserted the
opposite in as many words.

REFUSED A CORRECT `f`. The slope was probed at `v = 1e-5`, but `f` is read at
`ℓ/N`, so nothing below `1/N` is ever asked of it. An `f` fitted from a disorder
average on a chain of a few hundred sites is entitled to be undefined there, and
was refused for a value it would never see.

ACCEPTED A WRONG `f`. Symmetry was sampled at 0.1, 0.25 and 0.4, all multiples of
1/20, so `sin(20πv)` and `sin(40πv)` vanish at every one of them and at their
reflections. Those are even harmonics, which Eq. (24) excludes, and a pair of them
tuned to cancel in `f'(0)` passed both checks while being 20% asymmetric elsewhere.

All three go away by asking on the grid. Symmetry is checked at each `ℓ/N` that
feeds a row, so a component the check cannot see cannot reach a row either, and
the check happens where and only where `f` is consumed. `f'(0)` comes from `f(1/N)`
and `f(2/N)` by Richardson, error falling as `N^-4`, which are points `f` must
support because they are the grid. The tolerance is loose deliberately: it
separates an order-unity factor from the estimate's own truncation, and tightening
it would refuse a strongly non-conformal `f` on a ring too short to resolve it.

Also: a non-real or non-finite `f` now says so, instead of being reported as an
asymmetry between two NaNs or reaching the kernel and failing on `isless`. Split
into `_check_symmetry_at` and `_check_normalisation`, which name what they check
rather than claiming to validate the function.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sotashimozono
sotashimozono merged commit a4861aa into main Sep 14, 2026
26 checks passed
@sotashimozono
sotashimozono deleted the feat/validate-scaling-function branch September 14, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant