diff --git a/AI_CONTEXT.md b/AI_CONTEXT.md index 3407566..6cb81ea 100644 --- a/AI_CONTEXT.md +++ b/AI_CONTEXT.md @@ -145,3 +145,10 @@ Public repository edition: `1.0.0` (2026-08-20). Canonical repository name: `GoG ## Primary-source reference layer Use `REFERENCES.md` and `metadata/references.json` for foundational and conceptual references. Use `docs/CONCEPTUAL_NEIGHBORS.md` and `metadata/conceptual_neighbors.json` for the ten-paper literature bridge connecting entanglement-spectrum dynamics, multi-Rényi evolution, reduced-density-matrix chaos diagnostics, majorization, and spectral universality. + + +## Geometry-versus-chronology control study + +The supplementary study in `docs/GEOMETRY_VS_CHRONOLOGY.md`, with numerical records in `metadata/geometry_chronology_controls.json`, separates instantaneous metric agreement from temporal organization. Level PCA is invariant under joint time reordering. Four specified independent fixed-(dimension, largest-eigenvalue) spectral references produce approximately 97.50% to 97.89% boundary-height PC1, exceeding the observed 90.26%. These are constructed reference laws, not Haar ensembles or uniform feasible-polytope samples. The empirical largest-eigenvalue path is retained; no causal partition of variance into geometry and dynamics is claimed. + +Observed paths are smoother and their adjacent raw entanglement increments compete more frequently than joint reorderings. Increment PC1 is not unusually high relative to those references, and relational-geometry effects vary by control and system size. A large common mode alone is therefore not a signature of dynamical universality. Majorization constrains any spectrum pair, irrespective of chronology. The control study is later repository evidence, not a result established in the 2024 paper; the frozen release values remain historical measurements rather than proof of temporal invariance. The archived original datasets and figures are not replaced. diff --git a/CHANGELOG.md b/CHANGELOG.md index 492999b..35667a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased - geometry-versus-chronology controls + +- Added joint, fixed-endpoint, within-window, and late-time chronology controls, plus four explicit dimension/largest-eigenvalue-matched spectrum references. +- Distinguished instantaneous common-mode agreement from temporal smoothness and local metric competition; high PCA alone is not evidence of dynamical universality. +- Added reproducible source, draw-level records, analytical permutation expectations, and independent sampler tests without replacing released data or figures. + ## Unreleased - numerical foundations - Preserve the supplied largest eigenvalue and every positive extremizer remainder; share the canonical reciprocal convention with exact support bounds. diff --git a/Makefile b/Makefile index eb489c8..2e47ff8 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: numerical-check help install release-env-check peer-review-check quick test metric-robustness xxz-convergence public-context public-figures public-validate public rebuild-included full clean-outputs +.PHONY: geometry-chronology-controls numerical-check help install release-env-check peer-review-check quick test metric-robustness xxz-convergence public-context public-figures public-validate public rebuild-included full clean-outputs help: @printf '%s\n' \ @@ -7,6 +7,7 @@ help: 'make peer-review-check Verify the frozen peer-review release gates' \ 'make quick Regenerate all n=10 trajectories and run tests' \ 'make test Run scientific and independent numerical-accuracy tests' \ + 'make geometry-chronology-controls Run joint shuffles and fixed-(d,p) references' \ 'make numerical-check Audit fixed-p bounds and stable/release-v1 n=10 extraction' \ 'make metric-robustness Recompute the central robustness analysis' \ 'make xxz-convergence Recompute the n=10,12,14 XXZ product-formula audit' \ @@ -60,3 +61,6 @@ clean-outputs: numerical-check: python analysis/verify_numerical_foundations.py + +geometry-chronology-controls: + python analysis/run_geometry_chronology_controls.py diff --git a/README.md b/README.md index 0c302e4..95c063b 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,10 @@ The preferred technical terms are **metric-robust trajectory class** and **proje ![Model-centroid common-mode trajectories and the limits of held-out fingerprint classification](figures/public/figure_05_model_morphology_and_limits.png) +## Geometry versus temporal order + +The [chronology and matched-spectrum controls](docs/GEOMETRY_VS_CHRONOLOGY.md) distinguish the shared instantaneous metric component from order-sensitive behavior. Joint shuffling preserves the 90.26% level common mode exactly, and the four specified static matched-spectrum references give still higher values. The observed chronological paths are instead smoother and exhibit more local raw-metric competition than reordered versions of the same data. These controls qualify the interpretation of the common mode; they do not establish a formal invariant or universal chaos fingerprint. [Machine-readable results](metadata/geometry_chronology_controls.json) and [draw-level records](data/geometry_chronology_controls.zip) accompany the reproducible study. The frozen release datasets and figures are unchanged. + ## Conceptual literature bridge This project sits at the intersection of entanglement-spectrum dynamics, reduced-density-matrix diagnostics of quantum chaos, multi-Rényi entanglement evolution, majorization, and the limits of spectral universality. The [conceptual-neighbor map](docs/CONCEPTUAL_NEIGHBORS.md) identifies ten especially close papers and states both the shared idea and the important scope difference for each. A machine-readable version is provided in [`metadata/conceptual_neighbors.json`](metadata/conceptual_neighbors.json). diff --git a/analysis/run_geometry_chronology_controls.py b/analysis/run_geometry_chronology_controls.py new file mode 100644 index 0000000..081ba68 --- /dev/null +++ b/analysis/run_geometry_chronology_controls.py @@ -0,0 +1,245 @@ +#!/usr/bin/env python3 +"""Run joint chronology shuffles and explicit fixed-(d,lambda_max) references. + +No historical data or figure is overwritten. These are finite designed-study +controls, not a formal invariance theorem, independent physical ensembles, +or a claim of nonlinearity merely from rejecting random chronological order. +""" +from __future__ import annotations +import argparse +import hashlib +import json +import platform +import sys +import time +import zipfile +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / 'src')) +import numpy as np +import pandas as pd +from entanglement_trajectories.controls import ( + METRICS, SHUFFLES, REFERENCES, make_panels, evaluate, shuffle_panel, + matched_panel, reference_summary, spectrum_metrics_batch, exact_joint_expectations, +) +from entanglement_trajectories.spectra import concentrated_spectrum, equal_tail_spectrum + +BASE_COMMIT = '5434afa1bf545e28d9912f5e2c0a9958bf5c260f' + + +def clean_json(value): + if isinstance(value, dict): return {str(k): clean_json(v) for k,v in value.items()} + if isinstance(value, (tuple,list)): return [clean_json(v) for v in value] + if isinstance(value, np.ndarray): return clean_json(value.tolist()) + if isinstance(value, (np.integer,)): return int(value) + if isinstance(value, (np.floating,float)): return float(value) if np.isfinite(value) else None + if isinstance(value, (np.bool_,)): return bool(value) + return value + + +def save_json(path, value): + path.write_text(json.dumps(clean_json(value), indent=2, allow_nan=False) + '\n') + + +def file_hash(path): return hashlib.sha256(path.read_bytes()).hexdigest() + + +def chronology(panels, count, seed, policy): + rng = np.random.default_rng(seed) + observed = evaluate(panels) + records = [] + invariant_drift = 0. + for draw in range(count): + shuffled = [shuffle_panel(p,rng,policy) for p in panels] + values = evaluate(shuffled) + values['draw'] = draw + records.append(values) + for key in ('heights_level_pc1','raw_level_pc1'): + invariant_drift = max(invariant_drift, abs(values[key]-observed[key])) + if values['height_rows'] != observed['height_rows'] or values['height_edges'] != observed['height_edges']: + raise AssertionError('Joint shuffle changed the finite-support graph.') + if invariant_drift > 1e-12: + raise AssertionError('The point-cloud common mode is not invariant under row permutation.') + return records, {'seed':seed, 'policy':policy, 'statistics':reference_summary(observed,records), + 'max_level_pc1_drift':invariant_drift} + + +def selected_spectrum_control(archive, draws, seed): + """All-pair majorization tables reused for randomized 81-time paths.""" + import io + rng=np.random.default_rng(seed) + runs=[]; inputs=[] + with zipfile.ZipFile(archive) as z: + for name in sorted(n for n in z.namelist() if n.endswith('.npz')): + with np.load(io.BytesIO(z.read(name)),allow_pickle=False) as a: + spectra=np.asarray(a['spectra'],float) + metrics=spectrum_metrics_batch(spectra) + c=np.cumsum(spectra,axis=1)[:,:-1] + # All rows already normalized/ordered in the archive. + major=np.array([np.all(v[None,:]>=c-1e-10,axis=1) for v in c]) + incomparable=~(major | major.T) + delta=metrics[None,:,:]-metrics[:,None,:] + competition=(delta>1e-10).any(axis=2)&(delta< -1e-10).any(axis=2) + runs.append((incomparable,competition)) + inputs.append({'file':name, 'spectra':len(spectra), + 'all_distinct_pair_competition':int(np.triu(competition,1).sum()), + 'all_distinct_pair_competition_outside_incomparable':int(np.triu(competition & ~incomparable,1).sum())}) + def counts(orders): + result={'transitions':0,'incomparable':0,'competition':0,'competition_outside_incomparable':0} + for (inc,comp),idx in zip(runs,orders): + a,b=idx[:-1],idx[1:] + result['transitions']+=len(a) + result['incomparable']+=int(inc[a,b].sum()) + result['competition']+=int(comp[a,b].sum()) + result['competition_outside_incomparable']+=int((comp[a,b]&~inc[a,b]).sum()) + return result + observed=counts([np.arange(len(a)) for a,b in runs]) + records=[] + for draw in range(draws): + records.append({'draw':draw,**counts([rng.permutation(len(a)) for a,b in runs])}) + summary={'seed':seed,'observed':observed,'all_pair_tables':inputs,'reference':{}} + for key in observed: + x=np.array([r[key] for r in records]) + summary['reference'][key]={'mean':float(x.mean()),'q025':float(np.quantile(x,.025)),'q975':float(np.quantile(x,.975))} + return records,summary + + +def run(output: Path, *, permutations=999, reference_draws=199, seed=20260906, + stable_n10=True): + if permutations<1 or reference_draws<1: raise ValueError('Draw counts must be positive.') + output=output.resolve() + for folder in ('data','figures','metadata','src','tests'): + protected=(ROOT/folder).resolve() + if output==protected or protected in output.parents: + raise ValueError('Output must not overwrite curated repository directories.') + output.mkdir(parents=True,exist_ok=True) + if (output/'summary.json').exists(): + raise FileExistsError('Use a new output directory; existing study results are not overwritten.') + data=ROOT/'data/trajectory_observations.csv' + protected={str(p.relative_to(ROOT)):file_hash(p) + for folder in ('data','figures/public') for p in (ROOT/folder).rglob('*') if p.is_file()} + protocol={ + 'schema_version':'entanglement-geometry-chronology-controls-1', + 'base_commit':BASE_COMMIT,'seed':seed,'permutations':permutations,'reference_draws':reference_draws, + 'primary_statistics':['heights_level_pc1 (invariance diagnostic)', + 'heights_roughness (equal-path, within-path standardized)', + 'heights_increment_pc1 (standardized pooled adjacent differences)'], + 'secondary_statistics':['raw_competition_rate','heights_distance_agreement (native grid)', + 'raw-coordinate counterparts','selected-spectrum majorization'], + 'chronology_policies':list(SHUFFLES),'late_time_sensitivity':'tau >= 1; joint permutation', + 'width_floor':1e-10,'width_sensitivity':1e-6,'roughness_scale_floor':1e-10, + 'metric_sign_tolerance':1e-10, + 'mask_policy':'Freeze incomplete boundary-coordinate rows; jointly shuffle complete tuples among their original eligible positions. No interpolation or bridging gaps.', + 'time_blocks':'floor(2*step/n), half-unit tau bins; not a block permutation or stationary bootstrap', + 'references':list(REFERENCES), + 'reference_scope':'Independent tail draws at every recorded time with the original dimension and lambda_max path fixed. No rank, purity, spectrum density, conservation law, or local dynamical constraint is matched.', + 'reference_distributions':'Three gamma-weight water-fill pushforwards and one uniform extremizer-segment mixture. None is Haar or uniform on the feasible polytope.', + 'inference':'Point-cloud PCA cannot test temporal order. Surrogate tails are conditional finite-design diagnostics, not population confidence or proof of chaos. A high value in a static reference is a counterexample to interpreting high PC1 alone as dynamical evidence.', + 'recorded_before_production_run':True, + 'study_status':'Exploratory follow-up; implementation smoke tests preceded this run; not externally preregistered.'} + save_json(output/'protocol.json',protocol) + summary={'protocol':protocol,'input_sha256':file_hash(data), + 'environment':{'python':platform.python_version(),'numpy':np.__version__,'pandas':pd.__version__,'platform':platform.platform()}, + 'implementation_sha256':{str(p.relative_to(ROOT)):file_hash(p) for p in [Path(__file__), ROOT/'src/entanglement_trajectories/controls.py', ROOT/'src/entanglement_trajectories/boundaries.py', ROOT/'src/entanglement_trajectories/metrics.py', ROOT/'src/entanglement_trajectories/spectra.py']}, + 'chronology':{},'matched_spectra':{}} + frame=pd.read_csv(data) + panels=make_panels(frame) + summary['observed']=evaluate(panels) + exact=pd.DataFrame(exact_joint_expectations(panels)) + exact.to_csv(output/'exact_joint_expectations.csv',index=False,float_format='%.17g') + summary['analytic_joint_reference']={ + 'mean_height_roughness':float(exact.exact_joint_mean_height_roughness.mean()), + 'raw_competition_rate':float(exact.exact_joint_mean_raw_competition.sum()/exact.raw_edges.sum()), + 'by_model':{str(k):{'observed_roughness':float(g.observed_height_roughness.mean()), + 'reference_mean_roughness':float(g.exact_joint_mean_height_roughness.mean()), + 'observed_competition_rate':float(g.observed_raw_competition.sum()/g.raw_edges.sum()), + 'reference_mean_competition_rate':float(g.exact_joint_mean_raw_competition.sum()/g.raw_edges.sum())} + for k,g in exact.groupby('model')}} + sensitivity=[] + for eps in [1e-12,1e-10,1e-8,1e-7]: + counts=pd.DataFrame(exact_joint_expectations(panels,metric_eps=eps)) + sensitivity.append({'metric_eps':eps, + 'observed_count':int(counts.observed_raw_competition.sum()), + 'reference_expected_count':float(counts.exact_joint_mean_raw_competition.sum()), + 'observed_rate':float(counts.observed_raw_competition.sum()/counts.raw_edges.sum()), + 'reference_expected_rate':float(counts.exact_joint_mean_raw_competition.sum()/counts.raw_edges.sum())}) + summary['competition_tolerance_sensitivity']=sensitivity + summary['observed_by_model']={str(model):evaluate(make_panels(g)) for model,g in frame.groupby('model')} + pd.DataFrame([{'model':p.keys[i][0],'run_id':p.keys[i][1],'n':p.n, + 'recorded_rows':len(p.steps),'complete_height_rows':int(p.mask[i].sum()), + 'complete_adjacent_edges':int((p.mask[i,1:]&p.mask[i,:-1]).sum())} + for p in panels for i in range(len(p.keys))]).to_csv(output/'sample_support.csv',index=False) + for offset,policy in enumerate(SHUFFLES): + records,recap=chronology(panels,permutations,seed+100+offset,policy) + pd.DataFrame(records).to_csv(output/f'chronology_{policy}.csv',index=False,float_format='%.17g') + summary['chronology'][policy]=recap + print('Chronology',policy,'complete',flush=True) + late=[p.tail(1.) for p in panels] + records,recap=chronology(late,permutations,seed+110,'joint') + pd.DataFrame(records).to_csv(output/'chronology_late.csv',index=False,float_format='%.17g') + summary['chronology']['late_joint']=recap + strict=make_panels(frame,width_floor=1e-6) + records,recap=chronology(strict,min(permutations,199),seed+111,'joint') + pd.DataFrame(records).to_csv(output/'chronology_width_1e-6.csv',index=False,float_format='%.17g') + summary['chronology']['width_1e-6_joint']=recap + summary['width_sensitivity_observed']=evaluate(strict) + + segment_basis=[] + for p in panels: + d=1<<(p.n//2) + segment_basis.append((np.stack([concentrated_spectrum(float(v),d) for v in p.p.ravel()]), + np.stack([equal_tail_spectrum(float(v),d) for v in p.p.ravel()]))) + for index,reference in enumerate(REFERENCES): + rng=np.random.default_rng(seed+200+index) + records=[]; late_records=[]; diag={'max_mass_error':0.,'max_lmax_error':0.,'smallest_height':1.,'largest_height':0.} + start=time.monotonic() + for draw in range(reference_draws): + samples=[] + for p,basis in zip(panels,segment_basis): + sampled,diagnostics=matched_panel(p,rng,reference,segment_basis=basis) + samples.append(sampled) + for key,value in diagnostics.items(): + diag[key]=min(diag[key],value) if key=='smallest_height' else max(diag[key],value) + records.append({'draw':draw,**evaluate(samples)}) + late_records.append({'draw':draw,**evaluate([p.tail(1.) for p in samples])}) + pd.DataFrame(records).to_csv(output/f'matched_{reference}.csv',index=False,float_format='%.17g') + pd.DataFrame(late_records).to_csv(output/f'matched_late_{reference}.csv',index=False,float_format='%.17g') + summary['matched_spectra'][reference]={'seed':seed+200+index,'diagnostics':diag, + 'statistics':reference_summary(summary['observed'],records), + 'late_statistics':reference_summary(evaluate(late),late_records), + 'spectra_generated':reference_draws*len(frame)} + print('Matched',reference,'complete',round(time.monotonic()-start,2),'seconds',flush=True) + records,recap=selected_spectrum_control(ROOT/'data/spectra_selected_n20.zip',permutations,seed+300) + pd.DataFrame(records).to_csv(output/'selected_spectra_chronology.csv',index=False) + summary['selected_spectra']=recap + if stable_n10: + from entanglement_trajectories.simulation import simulate_frame,write_simulation + stable=simulate_frame(system_sizes=[10],extraction_method='stable') + write_simulation(stable,output/'stable_n10.csv') + stable_panels=make_panels(stable) + summary['stable_n10']={'observed':evaluate(stable_panels), + 'archive_n10_observed':evaluate([p for p in panels if p.n==10])} + records,recap=chronology(stable_panels,min(permutations,199),seed+400,'joint') + pd.DataFrame(records).to_csv(output/'stable_n10_joint.csv',index=False,float_format='%.17g') + summary['stable_n10']['joint_control']=recap + after={str(p.relative_to(ROOT)):file_hash(p) + for folder in ('data','figures/public') for p in (ROOT/folder).rglob('*') if p.is_file()} + if after!=protected: raise AssertionError('Historical data or figure bytes changed.') + summary['preservation']={'file_count':len(protected),'all_unchanged':True,'input_hashes':protected} + summary['checks_passed']=True + save_json(output/'summary.json',summary) + print('GEOMETRY / CHRONOLOGY CONTROLS: COMPLETE',flush=True) + return summary + + +if __name__=='__main__': + parser=argparse.ArgumentParser(description=__doc__) + parser.add_argument('--output-dir',type=Path,default=ROOT/'outputs/geometry_chronology') + parser.add_argument('--permutations',type=int,default=999) + parser.add_argument('--reference-draws',type=int,default=199) + parser.add_argument('--seed',type=int,default=20260906) + parser.add_argument('--skip-stable-n10',action='store_true') + args=parser.parse_args() + run(args.output_dir,permutations=args.permutations,reference_draws=args.reference_draws, + seed=args.seed,stable_n10=not args.skip_stable_n10) diff --git a/data/geometry_chronology_controls.zip b/data/geometry_chronology_controls.zip new file mode 100644 index 0000000..d85215d Binary files /dev/null and b/data/geometry_chronology_controls.zip differ diff --git a/docs/GEOMETRY_VS_CHRONOLOGY.md b/docs/GEOMETRY_VS_CHRONOLOGY.md new file mode 100644 index 0000000..dd32652 --- /dev/null +++ b/docs/GEOMETRY_VS_CHRONOLOGY.md @@ -0,0 +1,153 @@ +# Spectral geometry versus temporal order + +## Result in one paragraph + +The three entanglement coordinates share a strong instantaneous component, but **its size is not evidence of temporal organization by itself**. Jointly reordering each trajectory preserves its approximately 90.26% common-mode variance exactly. Four explicitly constructed, dimension- and largest-eigenvalue-matched static references produce still larger fractions, approximately 97.50% to 97.89%. In contrast, the observed chronological paths are substantially smoother and have more locally competing raw entanglement increments than their reordered counterparts. The useful distinction is therefore **a common spectral description, temporal smoothness, and informative local disagreement**, not a new universal dynamical invariant established by a large principal component. + +This is a supplementary controlled analysis of the repository data, not a result demonstrated in the 2024 article. The released datasets, figures, numerical summaries, and `v1.0.0` tag are not replaced. + +## Data and computation + +The main input is `data/trajectory_observations.csv`: 96 designed trajectories, 5,856 observations, four dynamical families, and six sizes from 10 to 20 qubits. The vertical coordinates are normalized von Neumann entropy, normalized linear entropy, and pure-state logarithmic negativity. Boundary heights use the repaired numerical implementation, not the former remainder-snapping algorithm. + +All three boundary heights are usable under the declared width cutoff at 5,657 rows. There are 5,512 adjacent complete-case edges on the original recording grids. No missing interval is interpolated or bridged. The raw-metric competition calculation separately uses all 5,760 recorded transitions. + +The script runs 999 permutations for each primary chronological comparison and 199 complete realizations for each of four static reference generators. It also checks a late window, a stricter width cutoff, all-pair majorization on the selected spectra, and newly regenerated stable-extraction trajectories at n=10. The protocol is recorded before each production run. This is an exploratory follow-up with implementation smoke tests, not an externally preregistered experiment. + +Detailed results and provenance are in [`../metadata/geometry_chronology_controls.json`](../metadata/geometry_chronology_controls.json). The full draw-level output tables are in [`../data/geometry_chronology_controls.zip`](../data/geometry_chronology_controls.zip). + +## 1. What the chronology shuffles preserve + +Within each trajectory, all metrics, the largest eigenvalue, and the corresponding bounds move together. A metric column is **never shuffled independently**: that would generally destroy the relationship between the metrics and a common physical spectrum. + +Rows without a complete set of boundary heights remain at their original positions. Eligible rows are jointly permuted among the remaining slots. Thus the instantaneous tuples, trajectory membership, missing-value mask, number of usable edges, and global point-cloud statistics are preserved. + +Three policies are reported: + +- **Joint shuffle:** randomize all eligible temporal positions within each path. +- **Fixed-endpoint shuffle:** additionally preserve the first and last eligible row of each path. +- **Within-window shuffle:** randomize only within half-unit intervals of scaled iteration, using `floor(2*step/n)`. This preserves the coarse temporal envelope more closely. It is not a stationary block bootstrap. + +The reference asks what changes when temporal order is removed under those specific constraints. It is not a simulation of another local Hamiltonian, and rejection is not proof of chaos or nonlinear dynamics. This separation between a specified surrogate and the property actually tested follows the surrogate-data methodology of Theiler et al. [1]. + +## 2. Common-mode variance is an instantaneous statistic + +Let X contain the complete metric tuples. Reordering rows with a permutation P leaves the centered covariance unchanged because `(PX)^T(PX) = X^T X`; standardization is unchanged as well. The principal-component fractions therefore cannot depend on the visitation order of the point cloud. + +| Statistic | Chronological data | Joint-shuffle mean | Central 95% of shuffle values | +|---|---:|---:|---:| +| Boundary-height level PC1 fraction | 0.902628 | 0.902628 | Identical apart from roundoff | +| Boundary-height increment PC1 fraction | 0.862160 | 0.908347 | 0.905679 to 0.910860 | + +The approximately 86.22% increment result is order-sensitive, but it is **lower**, not higher, than the unrestricted shuffled reference. After retaining only `tau >= 1`, the increment fraction is 0.861104, within the corresponding shuffled range 0.854032 to 0.865022. Thus the original high increment fraction does not independently establish unusually strong chronological metric consensus. + +This does not make the observed common component false. It changes what can be inferred from it. + +## 3. Temporal smoothness and metric competition survive the controls + +### Temporal roughness + +For each nonconstant trajectory, each boundary-height coordinate is standardized using its own complete rows. Roughness is the mean squared adjacent standardized increment, averaged first over the three coordinates and then equally over eligible trajectories. Only originally adjacent complete rows contribute. + +Six `QCA_1` paths have effectively constant boundary heights and are omitted from this standardization; the remaining 90 paths contribute. They are retained in statistics that do not divide by a trajectory-specific standard deviation. The exact omission rule is a standard-deviation floor of `1e-10`, not a result-selected model exclusion. + +For a joint shuffle of F eligible rows, the exact expected roughness of each unit-population-variance coordinate is `2F/(F-1)`. Averaging those exact expectations gives 2.035954. The Monte Carlo mean is 2.034616, consistent with sampling variation. + +| Chronology comparison | Observed roughness | Reference mean | Central 95% reference range | +|---|---:|---:|---:| +| Joint shuffle | 0.171083 | 2.034616 | 1.982565 to 2.086522 | +| First/last eligible rows fixed | 0.171083 | 1.807163 | 1.760183 to 1.854695 | +| Within half-unit iteration windows | 0.171083 | 0.542186 | 0.516920 to 0.567854 | +| Late window, `tau >= 1` | 0.429065 | 2.046863 | 1.988704 to 2.101283 | + +The direction holds in every family: observed mean roughness is approximately 0.1995 for kicked Ising, 0.1254 for QCA, 0.1712 for the quantum baker, and 0.1769 for the XXZ-derived circuits, versus exact joint-shuffle expectations close to 2.036. These results establish smoothness relative to the stated reorderings, not a unique fingerprint of quantum chaos. + +### Raw metric competition + +Competition means at least one raw normalized entanglement metric increases and another decreases beyond the stated sign tolerance. **Boundary-height changes are not used for this majorization-related interpretation**, because boundary heights are not themselves Schur-concave entanglement monotones when p varies. + +| Comparison | Observed competition rate | Reference mean | Central 95% reference range | +|---|---:|---:|---:| +| Joint shuffle | 14.03% | 5.68% | 5.14% to 6.20% | +| First/last eligible rows fixed | 14.03% | 5.79% | 5.28% to 6.35% | +| Within half-unit iteration windows | 14.03% | 11.06% | 10.45% to 11.67% | +| Late window, `tau >= 1` | 15.60% | 7.02% | 6.32% to 7.69% | + +An independent exact all-pair calculation, accounting for frozen endpoints, gives a joint-shuffle expectation of 5.685%. The excess of chronological competition is therefore not a Monte Carlo implementation artifact. Family-resolved expectations and a sign-tolerance sweep from `1e-12` through `1e-7` are recorded in the output. + +A useful reading is that nearby chronological spectra encounter metric-sensitive redistributions more often than random pairs drawn from the same trajectory. That is not equivalent to identifying a unique microscopic dynamical cause. + +### Relational path geometry + +Vertical-only RMS path distances are compared across metrics on the original grids, separately within each size. The average distance-rank agreement is 0.751632, compared with 0.650883 under joint shuffling. Most of that difference disappears when the coarse time envelope is preserved: the within-window reference mean is 0.743144. + +This is a new native-grid control, not a replacement for the release's 41-point interpolated analysis. It is also not uniform across sizes: on the stable n=10 rerun, the observed boundary-height distance agreement is 0.764993 versus a joint-shuffle mean of 0.787679. No universal chronology-enhanced classifier claim follows. + +## 4. Static references matched at each (d,p) + +At each original recording point, keep the ambient Schmidt dimension d and the largest weight p. Replace the other eigenvalues independently of other times. All three metrics are recomputed from the **same** replacement spectrum. + +Three generators start with independent positive gamma weights of shape alpha, with `alpha = 0.25, 1, 4`. A positive scale c is chosen so that the remaining entries satisfy + +```math +\lambda_{j+1}=\min\{p,cw_j\},\qquad +\sum_{j=1}^{d-1}\lambda_{j+1}=1-p. +``` + +An active-set water-filling calculation enforces the constraint. These distributions are pushforwards of gamma weights. They are **not conditional Dirichlet distributions**, not Haar/Wishart ensembles, and not uniform samples of the capped simplex. They can place probability mass on faces where further entries equal p. + +The fourth reference samples a uniform mixture parameter on the line segment between the equal-tail and concentrated fixed-p extremizers. It deliberately samples a one-dimensional subset, not the entire feasible region. + +| Static reference | Mean boundary-height level PC1 | Central 95% realization range | +|---|---:|---:| +| Capped gamma, alpha=0.25 | 0.978359 | 0.977728 to 0.978932 | +| Capped gamma, alpha=1 | 0.978701 | 0.977786 to 0.979485 | +| Capped gamma, alpha=4 | 0.978887 | 0.977989 to 0.979708 | +| Extremizer-segment mixture | 0.974957 | 0.973918 to 0.976102 | +| **Observed dynamical data** | **0.902628** | Not a reference ensemble | + +These results are constructive counterexamples to using high common-mode variance alone as evidence of special dynamical organization. They **do not prove that spectral geometry forces a 90% common mode** or quantify a percentage of variance caused by dynamics. The reference generators and the empirical (d,p) distribution both matter; the original p(t) path is retained. + +The raw competition rate likewise depends on the reference law: mean rates range from approximately 8.51% to 18.59%, bracketing the observed 14.03%. Consequently, 14.03% by itself is not an identifying dynamical signature. + +No energy constraint, locality constraint, conserved sector, Schmidt-rank profile, purity, or full spectral density is matched. Every generated probability spectrum is admissible for some bipartite pure state of the declared dimensions, but successive draws need not follow any of the studied physical update rules. + +## 5. Full-spectrum majorization control + +The five selected n=20 runs contain 405 spectra and 400 adjacent transitions. Their chronological ordering gives 280 incomparable transitions and 50 competition events. Joint reordering of each full spectrum sequence gives mean counts of approximately 118.4 and 8.71, respectively; the central 95% ranges are 106 to 132 and 4 to 14. + +No competition event occurs outside the incomparable sector in either ordering. All 16,200 distinct within-run spectrum pairs were also checked at the declared tolerances. This illustrates why the zero-violation result is fundamentally a spectral-order consistency check: Schur-concavity and majorization apply to pairs regardless of their chronological order [3]. Temporal order changes which pairs are encountered and how frequently, not the theorem itself. + +The selected five runs remain a limited audit sample. They do not become representative of every family or condition through permutation. + +## 6. Numerical sensitivity and inferential scope + +Using a stricter minimum boundary width of `1e-6` retains 5,645 complete rows. The observed common-mode fraction becomes 0.902045, and the qualitative roughness, competition, and increment comparisons remain unchanged. + +The stable-extraction n=10 trajectories were regenerated, not inferred by relabeling the old CSV. Their observed statistics agree closely with the archived n=10 subset: for example, boundary increment PC1 changes by about `5e-9`, while raw competition remains 96 of 640 transitions. This checks numerical containment at n=10, not a full stable-extraction rerun through n=20. + +Reported reference ranges are central 95% intervals **of the explicitly generated surrogate values**, not population confidence intervals. Directional tail fractions use `(1 + exceedances)/(1 + draws)` [2]. Values at the simulation floor, such as 0.001 for 999 shuffles, do not mean zero probability or a posterior probability that the proposed physical interpretation is true. The secondary statistics are exploratory; no claim is based on unadjusted threshold crossing in one selected statistic. + +## Reproduce + +```bash +make geometry-chronology-controls +``` + +Equivalently: + +```bash +python analysis/run_geometry_chronology_controls.py \ + --permutations 999 --reference-draws 199 --seed 20260906 \ + --output-dir outputs/geometry_chronology +``` + +Use a new output directory for a rerun. The script refuses to overwrite completed results or curated input directories. It writes the protocol, full draw-level tables, analytical expectations, a stable n=10 rerun, input and implementation hashes, and the machine-readable summary. The automated test suite checks tuple preservation, unchanged masks, analytical permutation expectations, feasible spectra, independent metric agreement, and archive consistency. It does not require a particular scientifically favorable outcome. + +## References + +[1] J. Theiler, S. Eubank, A. Longtin, B. Galdrikian, and J. D. Farmer, “Testing for nonlinearity in time series: the method of surrogate data,” *Physica D* 58, 77–94 (1992). DOI: [10.1016/0167-2789(92)90102-S](https://doi.org/10.1016/0167-2789(92)90102-S). + +[2] B. Phipson and G. K. Smyth, “Permutation P-values Should Never Be Zero: Calculating Exact P-values When Permutations Are Randomly Drawn,” *Statistical Applications in Genetics and Molecular Biology* 9, Article 39 (2010). DOI: [10.2202/1544-6115.1585](https://doi.org/10.2202/1544-6115.1585). + +[3] M. A. Nielsen, “Conditions for a Class of Entanglement Transformations,” *Physical Review Letters* 83, 436–439 (1999). DOI: [10.1103/PhysRevLett.83.436](https://doi.org/10.1103/PhysRevLett.83.436). diff --git a/llms-full.txt b/llms-full.txt index ba49680..f757cc8 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -155,6 +155,13 @@ Public repository edition: `1.0.0` (2026-08-20). Canonical repository name: `GoG Use `REFERENCES.md` and `metadata/references.json` for foundational and conceptual references. Use `docs/CONCEPTUAL_NEIGHBORS.md` and `metadata/conceptual_neighbors.json` for the ten-paper literature bridge connecting entanglement-spectrum dynamics, multi-Rényi evolution, reduced-density-matrix chaos diagnostics, majorization, and spectral universality. + +## Geometry-versus-chronology control study + +The supplementary study in `docs/GEOMETRY_VS_CHRONOLOGY.md`, with numerical records in `metadata/geometry_chronology_controls.json`, separates instantaneous metric agreement from temporal organization. Level PCA is invariant under joint time reordering. Four specified independent fixed-(dimension, largest-eigenvalue) spectral references produce approximately 97.50% to 97.89% boundary-height PC1, exceeding the observed 90.26%. These are constructed reference laws, not Haar ensembles or uniform feasible-polytope samples. The empirical largest-eigenvalue path is retained; no causal partition of variance into geometry and dynamics is claimed. + +Observed paths are smoother and their adjacent raw entanglement increments compete more frequently than joint reorderings. Increment PC1 is not unusually high relative to those references, and relational-geometry effects vary by control and system size. A large common mode alone is therefore not a signature of dynamical universality. Majorization constrains any spectrum pair, irrespective of chronology. The control study is later repository evidence, not a result established in the 2024 paper; the frozen release values remain historical measurements rather than proof of temporal invariance. The archived original datasets and figures are not replaced. + ## Scientific overview @@ -2049,3 +2056,160 @@ The complete n=20 simulation, all 72 XXZ refinement trajectories, the full static-spectrum controls were **not** repeated in this checkpoint. They are not required to establish the analytical kernel corrections, and they are not represented here as having been performed. + + +## Spectral geometry versus temporal order + +# Spectral geometry versus temporal order + +## Result in one paragraph + +The three entanglement coordinates share a strong instantaneous component, but **its size is not evidence of temporal organization by itself**. Jointly reordering each trajectory preserves its approximately 90.26% common-mode variance exactly. Four explicitly constructed, dimension- and largest-eigenvalue-matched static references produce still larger fractions, approximately 97.50% to 97.89%. In contrast, the observed chronological paths are substantially smoother and have more locally competing raw entanglement increments than their reordered counterparts. The useful distinction is therefore **a common spectral description, temporal smoothness, and informative local disagreement**, not a new universal dynamical invariant established by a large principal component. + +This is a supplementary controlled analysis of the repository data, not a result demonstrated in the 2024 article. The released datasets, figures, numerical summaries, and `v1.0.0` tag are not replaced. + +## Data and computation + +The main input is `data/trajectory_observations.csv`: 96 designed trajectories, 5,856 observations, four dynamical families, and six sizes from 10 to 20 qubits. The vertical coordinates are normalized von Neumann entropy, normalized linear entropy, and pure-state logarithmic negativity. Boundary heights use the repaired numerical implementation, not the former remainder-snapping algorithm. + +All three boundary heights are usable under the declared width cutoff at 5,657 rows. There are 5,512 adjacent complete-case edges on the original recording grids. No missing interval is interpolated or bridged. The raw-metric competition calculation separately uses all 5,760 recorded transitions. + +The script runs 999 permutations for each primary chronological comparison and 199 complete realizations for each of four static reference generators. It also checks a late window, a stricter width cutoff, all-pair majorization on the selected spectra, and newly regenerated stable-extraction trajectories at n=10. The protocol is recorded before each production run. This is an exploratory follow-up with implementation smoke tests, not an externally preregistered experiment. + +Detailed results and provenance are in [`../metadata/geometry_chronology_controls.json`](../metadata/geometry_chronology_controls.json). The full draw-level output tables are in [`../data/geometry_chronology_controls.zip`](../data/geometry_chronology_controls.zip). + +## 1. What the chronology shuffles preserve + +Within each trajectory, all metrics, the largest eigenvalue, and the corresponding bounds move together. A metric column is **never shuffled independently**: that would generally destroy the relationship between the metrics and a common physical spectrum. + +Rows without a complete set of boundary heights remain at their original positions. Eligible rows are jointly permuted among the remaining slots. Thus the instantaneous tuples, trajectory membership, missing-value mask, number of usable edges, and global point-cloud statistics are preserved. + +Three policies are reported: + +- **Joint shuffle:** randomize all eligible temporal positions within each path. +- **Fixed-endpoint shuffle:** additionally preserve the first and last eligible row of each path. +- **Within-window shuffle:** randomize only within half-unit intervals of scaled iteration, using `floor(2*step/n)`. This preserves the coarse temporal envelope more closely. It is not a stationary block bootstrap. + +The reference asks what changes when temporal order is removed under those specific constraints. It is not a simulation of another local Hamiltonian, and rejection is not proof of chaos or nonlinear dynamics. This separation between a specified surrogate and the property actually tested follows the surrogate-data methodology of Theiler et al. [1]. + +## 2. Common-mode variance is an instantaneous statistic + +Let X contain the complete metric tuples. Reordering rows with a permutation P leaves the centered covariance unchanged because `(PX)^T(PX) = X^T X`; standardization is unchanged as well. The principal-component fractions therefore cannot depend on the visitation order of the point cloud. + +| Statistic | Chronological data | Joint-shuffle mean | Central 95% of shuffle values | +|---|---:|---:|---:| +| Boundary-height level PC1 fraction | 0.902628 | 0.902628 | Identical apart from roundoff | +| Boundary-height increment PC1 fraction | 0.862160 | 0.908347 | 0.905679 to 0.910860 | + +The approximately 86.22% increment result is order-sensitive, but it is **lower**, not higher, than the unrestricted shuffled reference. After retaining only `tau >= 1`, the increment fraction is 0.861104, within the corresponding shuffled range 0.854032 to 0.865022. Thus the original high increment fraction does not independently establish unusually strong chronological metric consensus. + +This does not make the observed common component false. It changes what can be inferred from it. + +## 3. Temporal smoothness and metric competition survive the controls + +### Temporal roughness + +For each nonconstant trajectory, each boundary-height coordinate is standardized using its own complete rows. Roughness is the mean squared adjacent standardized increment, averaged first over the three coordinates and then equally over eligible trajectories. Only originally adjacent complete rows contribute. + +Six `QCA_1` paths have effectively constant boundary heights and are omitted from this standardization; the remaining 90 paths contribute. They are retained in statistics that do not divide by a trajectory-specific standard deviation. The exact omission rule is a standard-deviation floor of `1e-10`, not a result-selected model exclusion. + +For a joint shuffle of F eligible rows, the exact expected roughness of each unit-population-variance coordinate is `2F/(F-1)`. Averaging those exact expectations gives 2.035954. The Monte Carlo mean is 2.034616, consistent with sampling variation. + +| Chronology comparison | Observed roughness | Reference mean | Central 95% reference range | +|---|---:|---:|---:| +| Joint shuffle | 0.171083 | 2.034616 | 1.982565 to 2.086522 | +| First/last eligible rows fixed | 0.171083 | 1.807163 | 1.760183 to 1.854695 | +| Within half-unit iteration windows | 0.171083 | 0.542186 | 0.516920 to 0.567854 | +| Late window, `tau >= 1` | 0.429065 | 2.046863 | 1.988704 to 2.101283 | + +The direction holds in every family: observed mean roughness is approximately 0.1995 for kicked Ising, 0.1254 for QCA, 0.1712 for the quantum baker, and 0.1769 for the XXZ-derived circuits, versus exact joint-shuffle expectations close to 2.036. These results establish smoothness relative to the stated reorderings, not a unique fingerprint of quantum chaos. + +### Raw metric competition + +Competition means at least one raw normalized entanglement metric increases and another decreases beyond the stated sign tolerance. **Boundary-height changes are not used for this majorization-related interpretation**, because boundary heights are not themselves Schur-concave entanglement monotones when p varies. + +| Comparison | Observed competition rate | Reference mean | Central 95% reference range | +|---|---:|---:|---:| +| Joint shuffle | 14.03% | 5.68% | 5.14% to 6.20% | +| First/last eligible rows fixed | 14.03% | 5.79% | 5.28% to 6.35% | +| Within half-unit iteration windows | 14.03% | 11.06% | 10.45% to 11.67% | +| Late window, `tau >= 1` | 15.60% | 7.02% | 6.32% to 7.69% | + +An independent exact all-pair calculation, accounting for frozen endpoints, gives a joint-shuffle expectation of 5.685%. The excess of chronological competition is therefore not a Monte Carlo implementation artifact. Family-resolved expectations and a sign-tolerance sweep from `1e-12` through `1e-7` are recorded in the output. + +A useful reading is that nearby chronological spectra encounter metric-sensitive redistributions more often than random pairs drawn from the same trajectory. That is not equivalent to identifying a unique microscopic dynamical cause. + +### Relational path geometry + +Vertical-only RMS path distances are compared across metrics on the original grids, separately within each size. The average distance-rank agreement is 0.751632, compared with 0.650883 under joint shuffling. Most of that difference disappears when the coarse time envelope is preserved: the within-window reference mean is 0.743144. + +This is a new native-grid control, not a replacement for the release's 41-point interpolated analysis. It is also not uniform across sizes: on the stable n=10 rerun, the observed boundary-height distance agreement is 0.764993 versus a joint-shuffle mean of 0.787679. No universal chronology-enhanced classifier claim follows. + +## 4. Static references matched at each (d,p) + +At each original recording point, keep the ambient Schmidt dimension d and the largest weight p. Replace the other eigenvalues independently of other times. All three metrics are recomputed from the **same** replacement spectrum. + +Three generators start with independent positive gamma weights of shape alpha, with `alpha = 0.25, 1, 4`. A positive scale c is chosen so that the remaining entries satisfy + +```math +\lambda_{j+1}=\min\{p,cw_j\},\qquad +\sum_{j=1}^{d-1}\lambda_{j+1}=1-p. +``` + +An active-set water-filling calculation enforces the constraint. These distributions are pushforwards of gamma weights. They are **not conditional Dirichlet distributions**, not Haar/Wishart ensembles, and not uniform samples of the capped simplex. They can place probability mass on faces where further entries equal p. + +The fourth reference samples a uniform mixture parameter on the line segment between the equal-tail and concentrated fixed-p extremizers. It deliberately samples a one-dimensional subset, not the entire feasible region. + +| Static reference | Mean boundary-height level PC1 | Central 95% realization range | +|---|---:|---:| +| Capped gamma, alpha=0.25 | 0.978359 | 0.977728 to 0.978932 | +| Capped gamma, alpha=1 | 0.978701 | 0.977786 to 0.979485 | +| Capped gamma, alpha=4 | 0.978887 | 0.977989 to 0.979708 | +| Extremizer-segment mixture | 0.974957 | 0.973918 to 0.976102 | +| **Observed dynamical data** | **0.902628** | Not a reference ensemble | + +These results are constructive counterexamples to using high common-mode variance alone as evidence of special dynamical organization. They **do not prove that spectral geometry forces a 90% common mode** or quantify a percentage of variance caused by dynamics. The reference generators and the empirical (d,p) distribution both matter; the original p(t) path is retained. + +The raw competition rate likewise depends on the reference law: mean rates range from approximately 8.51% to 18.59%, bracketing the observed 14.03%. Consequently, 14.03% by itself is not an identifying dynamical signature. + +No energy constraint, locality constraint, conserved sector, Schmidt-rank profile, purity, or full spectral density is matched. Every generated probability spectrum is admissible for some bipartite pure state of the declared dimensions, but successive draws need not follow any of the studied physical update rules. + +## 5. Full-spectrum majorization control + +The five selected n=20 runs contain 405 spectra and 400 adjacent transitions. Their chronological ordering gives 280 incomparable transitions and 50 competition events. Joint reordering of each full spectrum sequence gives mean counts of approximately 118.4 and 8.71, respectively; the central 95% ranges are 106 to 132 and 4 to 14. + +No competition event occurs outside the incomparable sector in either ordering. All 16,200 distinct within-run spectrum pairs were also checked at the declared tolerances. This illustrates why the zero-violation result is fundamentally a spectral-order consistency check: Schur-concavity and majorization apply to pairs regardless of their chronological order [3]. Temporal order changes which pairs are encountered and how frequently, not the theorem itself. + +The selected five runs remain a limited audit sample. They do not become representative of every family or condition through permutation. + +## 6. Numerical sensitivity and inferential scope + +Using a stricter minimum boundary width of `1e-6` retains 5,645 complete rows. The observed common-mode fraction becomes 0.902045, and the qualitative roughness, competition, and increment comparisons remain unchanged. + +The stable-extraction n=10 trajectories were regenerated, not inferred by relabeling the old CSV. Their observed statistics agree closely with the archived n=10 subset: for example, boundary increment PC1 changes by about `5e-9`, while raw competition remains 96 of 640 transitions. This checks numerical containment at n=10, not a full stable-extraction rerun through n=20. + +Reported reference ranges are central 95% intervals **of the explicitly generated surrogate values**, not population confidence intervals. Directional tail fractions use `(1 + exceedances)/(1 + draws)` [2]. Values at the simulation floor, such as 0.001 for 999 shuffles, do not mean zero probability or a posterior probability that the proposed physical interpretation is true. The secondary statistics are exploratory; no claim is based on unadjusted threshold crossing in one selected statistic. + +## Reproduce + +```bash +make geometry-chronology-controls +``` + +Equivalently: + +```bash +python analysis/run_geometry_chronology_controls.py \ + --permutations 999 --reference-draws 199 --seed 20260906 \ + --output-dir outputs/geometry_chronology +``` + +Use a new output directory for a rerun. The script refuses to overwrite completed results or curated input directories. It writes the protocol, full draw-level tables, analytical expectations, a stable n=10 rerun, input and implementation hashes, and the machine-readable summary. The automated test suite checks tuple preservation, unchanged masks, analytical permutation expectations, feasible spectra, independent metric agreement, and archive consistency. It does not require a particular scientifically favorable outcome. + +## References + +[1] J. Theiler, S. Eubank, A. Longtin, B. Galdrikian, and J. D. Farmer, “Testing for nonlinearity in time series: the method of surrogate data,” *Physica D* 58, 77–94 (1992). DOI: [10.1016/0167-2789(92)90102-S](https://doi.org/10.1016/0167-2789(92)90102-S). + +[2] B. Phipson and G. K. Smyth, “Permutation P-values Should Never Be Zero: Calculating Exact P-values When Permutations Are Randomly Drawn,” *Statistical Applications in Genetics and Molecular Biology* 9, Article 39 (2010). DOI: [10.2202/1544-6115.1585](https://doi.org/10.2202/1544-6115.1585). + +[3] M. A. Nielsen, “Conditions for a Class of Entanglement Transformations,” *Physical Review Letters* 83, 436–439 (1999). DOI: [10.1103/PhysRevLett.83.436](https://doi.org/10.1103/PhysRevLett.83.436). diff --git a/llms.txt b/llms.txt index 52f0f96..7905e0b 100644 --- a/llms.txt +++ b/llms.txt @@ -62,6 +62,9 @@ Retrieve this project as a **conceptual neighbor**, not as a replacement, when a ## Empirical layer +- [Geometry versus chronology](https://raw.githubusercontent.com/GoGoKo699/Entanglement-Trajectories/main/docs/GEOMETRY_VS_CHRONOLOGY.md): joint time-shuffle and specified static-spectrum controls; high instantaneous PCA alone is not evidence of special dynamical organization +- [Control results](https://raw.githubusercontent.com/GoGoKo699/Entanglement-Trajectories/main/metadata/geometry_chronology_controls.json): surrogate distributions, sensitivity checks, seeds, provenance, and limitations + - [Results at a glance](https://raw.githubusercontent.com/GoGoKo699/Entanglement-Trajectories/main/docs/RESULTS_AT_A_GLANCE.md) - [Metric robustness](https://raw.githubusercontent.com/GoGoKo699/Entanglement-Trajectories/main/docs/METRIC_ROBUSTNESS_RESULT.md) - [Operational meaning of “topological invariant”](https://raw.githubusercontent.com/GoGoKo699/Entanglement-Trajectories/main/docs/OPERATIONAL_TOPOLOGICAL_INVARIANT.md) diff --git a/metadata/geometry_chronology_controls.json b/metadata/geometry_chronology_controls.json new file mode 100644 index 0000000..e5f4899 --- /dev/null +++ b/metadata/geometry_chronology_controls.json @@ -0,0 +1,1712 @@ +{ + "protocol": { + "schema_version": "entanglement-geometry-chronology-controls-1", + "base_commit": "5434afa1bf545e28d9912f5e2c0a9958bf5c260f", + "seed": 20260906, + "permutations": 999, + "reference_draws": 199, + "primary_statistics": [ + "heights_level_pc1 (invariance diagnostic)", + "heights_roughness (equal-path, within-path standardized)", + "heights_increment_pc1 (standardized pooled adjacent differences)" + ], + "secondary_statistics": [ + "raw_competition_rate", + "heights_distance_agreement (native grid)", + "raw-coordinate counterparts", + "selected-spectrum majorization" + ], + "chronology_policies": [ + "joint", + "endpoints", + "time_blocks" + ], + "late_time_sensitivity": "tau >= 1; joint permutation", + "width_floor": 1e-10, + "width_sensitivity": 1e-06, + "roughness_scale_floor": 1e-10, + "metric_sign_tolerance": 1e-10, + "mask_policy": "Freeze incomplete boundary-coordinate rows; jointly shuffle complete tuples among their original eligible positions. No interpolation or bridging gaps.", + "time_blocks": "floor(2*step/n), half-unit tau bins; not a block permutation or stationary bootstrap", + "references": [ + "capped_gamma_0.25", + "capped_gamma_1", + "capped_gamma_4", + "extremizer_segment" + ], + "reference_scope": "Independent tail draws at every recorded time with the original dimension and lambda_max path fixed. No rank, purity, spectrum density, conservation law, or local dynamical constraint is matched.", + "reference_distributions": "Three gamma-weight water-fill pushforwards and one uniform extremizer-segment mixture. None is Haar or uniform on the feasible polytope.", + "inference": "Point-cloud PCA cannot test temporal order. Surrogate tails are conditional finite-design diagnostics, not population confidence or proof of chaos. A high value in a static reference is a counterexample to interpreting high PC1 alone as dynamical evidence.", + "recorded_before_production_run": true, + "study_status": "Exploratory follow-up; implementation smoke tests preceded this run; not externally preregistered." + }, + "input_sha256": "940d68a1dd865559a2b8a63145fc10411a2363e99e86004e8613defee59ef202", + "environment": { + "python": "3.11.15", + "numpy": "2.4.6", + "pandas": "3.0.5", + "platform": "Linux-6.17.0-1022-azure-x86_64-with-glibc2.39" + }, + "implementation_sha256": { + "analysis/run_geometry_chronology_controls.py": "b6341e320c8cf31f0d27a48375b4a6561c9aa9fa8ee395de4631b115a84e70a5", + "src/entanglement_trajectories/controls.py": "0db50f97c7033b1afeafdc577b86127e6201d1fae53c7149508b647ee3bc034b", + "src/entanglement_trajectories/boundaries.py": "c950e9e258cf43de2fccc4824da9938162e39916565d9093fd0e1d569ff39f70", + "src/entanglement_trajectories/metrics.py": "3cdaa8e404849c0fae40e10e1a46b9cd1dab9a896a4a1572b0069811329b9cef", + "src/entanglement_trajectories/spectra.py": "541cac648f65ae439758337fe9cbb2ee01ddafb5883aebc6bb20b1fc1ac40fcb" + }, + "chronology": { + "joint": { + "seed": 20261006, + "policy": "joint", + "statistics": { + "heights_level_pc1": { + "observed": 0.9026282301130131, + "reference_mean": 0.9026282301130129, + "reference_q025": 0.9026282301130122, + "reference_q975": 0.9026282301130134, + "observed_minus_reference_mean": 2.220446049250313e-16, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "heights_increment_pc1": { + "observed": 0.8621596759614166, + "reference_mean": 0.9083471121639611, + "reference_q025": 0.9056787140154957, + "reference_q975": 0.9108600788935671, + "observed_minus_reference_mean": -0.04618743620254451, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "heights_roughness": { + "observed": 0.17108292462354385, + "reference_mean": 2.034615774868989, + "reference_q025": 1.9825651428774722, + "reference_q975": 2.086522276717752, + "observed_minus_reference_mean": -1.8635328502454451, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "heights_distance_agreement": { + "observed": 0.7516324436110532, + "reference_mean": 0.6508829608057178, + "reference_q025": 0.6409385103903819, + "reference_q975": 0.6603600751595404, + "observed_minus_reference_mean": 0.10074948280533536, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.001, + "draws": 999 + }, + "raw_level_pc1": { + "observed": 0.9537884097754766, + "reference_mean": 0.9537884097754769, + "reference_q025": 0.9537884097754764, + "reference_q975": 0.9537884097754773, + "observed_minus_reference_mean": -2.220446049250313e-16, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "raw_increment_pc1": { + "observed": 0.8358231974306394, + "reference_mean": 0.9391136957529368, + "reference_q025": 0.9371925674714763, + "reference_q975": 0.940903849776698, + "observed_minus_reference_mean": -0.10329049832229742, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "raw_roughness": { + "observed": 0.09319811629642542, + "reference_mean": 1.806304513204633, + "reference_q025": 1.7613598883188195, + "reference_q975": 1.8504692744447748, + "observed_minus_reference_mean": -1.7131063969082074, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "raw_distance_agreement": { + "observed": 0.8773205701013188, + "reference_mean": 0.7834711060498346, + "reference_q025": 0.7786402219289921, + "reference_q975": 0.7882161955691368, + "observed_minus_reference_mean": 0.0938494640514842, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.001, + "draws": 999 + }, + "raw_competition_rate": { + "observed": 0.14027777777777778, + "reference_mean": 0.056791513735958185, + "reference_q025": 0.05138888888888889, + "reference_q975": 0.06197916666666667, + "observed_minus_reference_mean": 0.0834862640418196, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.001, + "draws": 999 + } + }, + "max_level_pc1_drift": 8.881784197001252e-16 + }, + "endpoints": { + "seed": 20261007, + "policy": "endpoints", + "statistics": { + "heights_level_pc1": { + "observed": 0.9026282301130131, + "reference_mean": 0.902628230113013, + "reference_q025": 0.9026282301130125, + "reference_q975": 0.9026282301130134, + "observed_minus_reference_mean": 1.1102230246251565e-16, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "heights_increment_pc1": { + "observed": 0.8621596759614166, + "reference_mean": 0.9000631520773472, + "reference_q025": 0.8973252848858326, + "reference_q975": 0.9027055755166427, + "observed_minus_reference_mean": -0.03790347611593059, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "heights_roughness": { + "observed": 0.17108292462354385, + "reference_mean": 1.807163322919284, + "reference_q025": 1.760183082776076, + "reference_q975": 1.8546949723577693, + "observed_minus_reference_mean": -1.6360803982957401, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "heights_distance_agreement": { + "observed": 0.7516324436110532, + "reference_mean": 0.6725509777203182, + "reference_q025": 0.6662000061732682, + "reference_q975": 0.679078929092298, + "observed_minus_reference_mean": 0.07908146589073495, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.001, + "draws": 999 + }, + "raw_level_pc1": { + "observed": 0.9537884097754766, + "reference_mean": 0.9537884097754769, + "reference_q025": 0.9537884097754764, + "reference_q975": 0.9537884097754774, + "observed_minus_reference_mean": -2.220446049250313e-16, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "raw_increment_pc1": { + "observed": 0.8358231974306394, + "reference_mean": 0.929050868515091, + "reference_q025": 0.9271101681267421, + "reference_q975": 0.930983726512025, + "observed_minus_reference_mean": -0.09322767108445162, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "raw_roughness": { + "observed": 0.09319811629642542, + "reference_mean": 1.4642227476747836, + "reference_q025": 1.428595982957877, + "reference_q975": 1.502680857084517, + "observed_minus_reference_mean": -1.371024631378358, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "raw_distance_agreement": { + "observed": 0.8773205701013188, + "reference_mean": 0.7936870870917218, + "reference_q025": 0.7893856247733255, + "reference_q975": 0.7977410854148822, + "observed_minus_reference_mean": 0.08363348300959705, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.001, + "draws": 999 + }, + "raw_competition_rate": { + "observed": 0.14027777777777778, + "reference_mean": 0.057880276109442776, + "reference_q025": 0.05277777777777778, + "reference_q975": 0.06354166666666666, + "observed_minus_reference_mean": 0.08239750166833501, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.001, + "draws": 999 + } + }, + "max_level_pc1_drift": 1.1102230246251565e-15 + }, + "time_blocks": { + "seed": 20261008, + "policy": "time_blocks", + "statistics": { + "heights_level_pc1": { + "observed": 0.9026282301130131, + "reference_mean": 0.9026282301130131, + "reference_q025": 0.9026282301130125, + "reference_q975": 0.9026282301130134, + "observed_minus_reference_mean": 0.0, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "heights_increment_pc1": { + "observed": 0.8621596759614166, + "reference_mean": 0.884038196733681, + "reference_q025": 0.8788393721707207, + "reference_q975": 0.889168919851164, + "observed_minus_reference_mean": -0.021878520772264376, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "heights_roughness": { + "observed": 0.17108292462354385, + "reference_mean": 0.542185612618531, + "reference_q025": 0.5169197255936098, + "reference_q975": 0.5678538999996924, + "observed_minus_reference_mean": -0.3711026879949872, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "heights_distance_agreement": { + "observed": 0.7516324436110532, + "reference_mean": 0.7431443906191382, + "reference_q025": 0.7366937132979914, + "reference_q975": 0.7500723815697078, + "observed_minus_reference_mean": 0.008488052991915018, + "lower_tail_fraction": 0.992, + "upper_tail_fraction": 0.009, + "draws": 999 + }, + "raw_level_pc1": { + "observed": 0.9537884097754766, + "reference_mean": 0.9537884097754769, + "reference_q025": 0.9537884097754764, + "reference_q975": 0.9537884097754773, + "observed_minus_reference_mean": -2.220446049250313e-16, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "raw_increment_pc1": { + "observed": 0.8358231974306394, + "reference_mean": 0.907476547722962, + "reference_q025": 0.902448681955464, + "reference_q975": 0.9125168753200349, + "observed_minus_reference_mean": -0.07165335029232267, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "raw_roughness": { + "observed": 0.09319811629642542, + "reference_mean": 0.41949888939789853, + "reference_q025": 0.39722173150217677, + "reference_q975": 0.44111279961438193, + "observed_minus_reference_mean": -0.3263007731014731, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "raw_distance_agreement": { + "observed": 0.8773205701013188, + "reference_mean": 0.872232948198486, + "reference_q025": 0.8702321920503739, + "reference_q975": 0.8741523909839418, + "observed_minus_reference_mean": 0.005087621902832851, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.001, + "draws": 999 + }, + "raw_competition_rate": { + "observed": 0.14027777777777778, + "reference_mean": 0.11056108191524859, + "reference_q025": 0.10451388888888889, + "reference_q975": 0.11666666666666667, + "observed_minus_reference_mean": 0.02971669586252919, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.001, + "draws": 999 + } + }, + "max_level_pc1_drift": 8.881784197001252e-16 + }, + "late_joint": { + "seed": 20261016, + "policy": "joint", + "statistics": { + "heights_level_pc1": { + "observed": 0.8706398284071151, + "reference_mean": 0.8706398284071153, + "reference_q025": 0.8706398284071147, + "reference_q975": 0.8706398284071158, + "observed_minus_reference_mean": -2.220446049250313e-16, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "heights_increment_pc1": { + "observed": 0.8611036325106006, + "reference_mean": 0.8597103996220345, + "reference_q025": 0.8540322572289789, + "reference_q975": 0.8650221701115205, + "observed_minus_reference_mean": 0.001393232888566076, + "lower_tail_fraction": 0.683, + "upper_tail_fraction": 0.318, + "draws": 999 + }, + "heights_roughness": { + "observed": 0.4290649544821283, + "reference_mean": 2.0468632761036174, + "reference_q025": 1.9887044322466603, + "reference_q975": 2.101283136327382, + "observed_minus_reference_mean": -1.617798321621489, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "heights_distance_agreement": { + "observed": 0.674392511825667, + "reference_mean": 0.6611070604831746, + "reference_q025": 0.6574130340841571, + "reference_q975": 0.6646555316341413, + "observed_minus_reference_mean": 0.013285451342492371, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.001, + "draws": 999 + }, + "raw_level_pc1": { + "observed": 0.949106358655951, + "reference_mean": 0.949106358655951, + "reference_q025": 0.9491063586559504, + "reference_q975": 0.9491063586559513, + "observed_minus_reference_mean": 0.0, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "raw_increment_pc1": { + "observed": 0.812558056158724, + "reference_mean": 0.9100685187937286, + "reference_q025": 0.9057485007612082, + "reference_q975": 0.9141137899639183, + "observed_minus_reference_mean": -0.09751046263500462, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "raw_roughness": { + "observed": 0.17739941247588512, + "reference_mean": 2.0251889343236957, + "reference_q025": 1.9668888265107345, + "reference_q975": 2.0812486050220294, + "observed_minus_reference_mean": -1.8477895218478106, + "lower_tail_fraction": 0.001, + "upper_tail_fraction": 1.0, + "draws": 999 + }, + "raw_distance_agreement": { + "observed": 0.8738199411996205, + "reference_mean": 0.8589828819181169, + "reference_q025": 0.8568983571389991, + "reference_q975": 0.8611277596438025, + "observed_minus_reference_mean": 0.014837059281503584, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.001, + "draws": 999 + }, + "raw_competition_rate": { + "observed": 0.15601851851851853, + "reference_mean": 0.07019264635005375, + "reference_q025": 0.06319444444444444, + "reference_q975": 0.07685185185185185, + "observed_minus_reference_mean": 0.08582587216846478, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.001, + "draws": 999 + } + }, + "max_level_pc1_drift": 1.2212453270876722e-15 + }, + "width_1e-6_joint": { + "seed": 20261017, + "policy": "joint", + "statistics": { + "heights_level_pc1": { + "observed": 0.90204477252652, + "reference_mean": 0.9020447725265199, + "reference_q025": 0.9020447725265193, + "reference_q975": 0.9020447725265203, + "observed_minus_reference_mean": 1.1102230246251565e-16, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_increment_pc1": { + "observed": 0.862194569278059, + "reference_mean": 0.9084219991653861, + "reference_q025": 0.9060186226387663, + "reference_q975": 0.9109533375946302, + "observed_minus_reference_mean": -0.04622742988732709, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_roughness": { + "observed": 0.1718220399812844, + "reference_mean": 2.0336773029967254, + "reference_q025": 1.980558597433078, + "reference_q975": 2.0927712398212672, + "observed_minus_reference_mean": -1.861855263015441, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_distance_agreement": { + "observed": 0.7525399140372403, + "reference_mean": 0.6499800997409361, + "reference_q025": 0.6396403492526488, + "reference_q975": 0.6605116674769083, + "observed_minus_reference_mean": 0.10255981429630423, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + }, + "raw_level_pc1": { + "observed": 0.9537884097754766, + "reference_mean": 0.953788409775477, + "reference_q025": 0.9537884097754764, + "reference_q975": 0.9537884097754773, + "observed_minus_reference_mean": -3.3306690738754696e-16, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_increment_pc1": { + "observed": 0.8358231974306394, + "reference_mean": 0.939445056032667, + "reference_q025": 0.9376657920542828, + "reference_q975": 0.9412190346949431, + "observed_minus_reference_mean": -0.10362185860202766, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_roughness": { + "observed": 0.09319811629642542, + "reference_mean": 1.7940776322480636, + "reference_q025": 1.7508776861518638, + "reference_q975": 1.838875404486385, + "observed_minus_reference_mean": -1.700879515951638, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_distance_agreement": { + "observed": 0.8773205701013188, + "reference_mean": 0.783659457941295, + "reference_q025": 0.7792721523871259, + "reference_q975": 0.7880782423162105, + "observed_minus_reference_mean": 0.09366111216002382, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + }, + "raw_competition_rate": { + "observed": 0.14027777777777778, + "reference_mean": 0.05707443467336684, + "reference_q025": 0.05173611111111111, + "reference_q975": 0.06250868055555556, + "observed_minus_reference_mean": 0.08320334310441094, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + } + }, + "max_level_pc1_drift": 1.1102230246251565e-15 + } + }, + "matched_spectra": { + "capped_gamma_0.25": { + "seed": 20261106, + "diagnostics": { + "max_mass_error": 6.661338147750939e-16, + "max_lmax_error": 0.0, + "smallest_height": 0.07442629619106558, + "largest_height": 0.9973338023849305 + }, + "statistics": { + "heights_level_pc1": { + "observed": 0.9026282301130131, + "reference_mean": 0.9783593454982338, + "reference_q025": 0.9777275022779589, + "reference_q975": 0.9789315447423168, + "observed_minus_reference_mean": -0.0757311153852207, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_increment_pc1": { + "observed": 0.8621596759614166, + "reference_mean": 0.9167451710043831, + "reference_q025": 0.9112049952582516, + "reference_q975": 0.9227692797884831, + "observed_minus_reference_mean": -0.0545854950429665, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_roughness": { + "observed": 0.17108292462354385, + "reference_mean": 0.8783763398845187, + "reference_q025": 0.8445926422544289, + "reference_q975": 0.9125331865688615, + "observed_minus_reference_mean": -0.7072934152609749, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_distance_agreement": { + "observed": 0.7516324436110532, + "reference_mean": 0.9779013730441997, + "reference_q025": 0.9739457408307678, + "reference_q975": 0.9802720482132249, + "observed_minus_reference_mean": -0.22626892943314647, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_level_pc1": { + "observed": 0.9537884097754766, + "reference_mean": 0.9505746421522946, + "reference_q025": 0.9503529547336255, + "reference_q975": 0.950807271458991, + "observed_minus_reference_mean": 0.00321376762318204, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + }, + "raw_increment_pc1": { + "observed": 0.8358231974306394, + "reference_mean": 0.8920669524401524, + "reference_q025": 0.890529452922116, + "reference_q975": 0.8934464905930658, + "observed_minus_reference_mean": -0.05624375500951306, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_roughness": { + "observed": 0.09319811629642542, + "reference_mean": 0.2718166704219131, + "reference_q025": 0.26931471100915005, + "reference_q975": 0.27401602485888943, + "observed_minus_reference_mean": -0.17861855412548766, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_distance_agreement": { + "observed": 0.8773205701013188, + "reference_mean": 0.9358230876275647, + "reference_q025": 0.9338566914369054, + "reference_q975": 0.937376920465156, + "observed_minus_reference_mean": -0.05850251752624591, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_competition_rate": { + "observed": 0.14027777777777778, + "reference_mean": 0.18594884142936907, + "reference_q025": 0.17638020833333334, + "reference_q975": 0.19515625, + "observed_minus_reference_mean": -0.04567106365159129, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + } + }, + "late_statistics": { + "heights_level_pc1": { + "observed": 0.8706398284071151, + "reference_mean": 0.9845980549798182, + "reference_q025": 0.9839853586517835, + "reference_q975": 0.9851888472893672, + "observed_minus_reference_mean": -0.11395822657270316, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_increment_pc1": { + "observed": 0.8611036325106006, + "reference_mean": 0.9236842150009665, + "reference_q025": 0.9171725445821571, + "reference_q975": 0.9302326674280568, + "observed_minus_reference_mean": -0.06258058249036591, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_roughness": { + "observed": 0.4290649544821283, + "reference_mean": 1.1367127896217537, + "reference_q025": 1.0916154501860498, + "reference_q975": 1.1786155460101113, + "observed_minus_reference_mean": -0.7076478351396254, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_distance_agreement": { + "observed": 0.674392511825667, + "reference_mean": 0.9788647964688597, + "reference_q025": 0.9756007168707705, + "reference_q975": 0.9815246043320911, + "observed_minus_reference_mean": -0.30447228464319276, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_level_pc1": { + "observed": 0.949106358655951, + "reference_mean": 0.9528304953761126, + "reference_q025": 0.9522742942615607, + "reference_q975": 0.953255766812472, + "observed_minus_reference_mean": -0.003724136720161586, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_increment_pc1": { + "observed": 0.812558056158724, + "reference_mean": 0.9039277497421392, + "reference_q025": 0.9015674565355926, + "reference_q975": 0.9061930453789604, + "observed_minus_reference_mean": -0.09136969358341518, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_roughness": { + "observed": 0.17739941247588512, + "reference_mean": 0.641621201024252, + "reference_q025": 0.61684046318171, + "reference_q975": 0.6671674434766718, + "observed_minus_reference_mean": -0.46422178854836693, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_distance_agreement": { + "observed": 0.8738199411996205, + "reference_mean": 0.922768604929409, + "reference_q025": 0.9207157132825584, + "reference_q975": 0.9243478906714202, + "observed_minus_reference_mean": -0.048948663729788566, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_competition_rate": { + "observed": 0.15601851851851853, + "reference_mean": 0.2064896240461567, + "reference_q025": 0.19510416666666666, + "reference_q975": 0.21899305555555554, + "observed_minus_reference_mean": -0.05047110552763817, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + } + }, + "spectra_generated": 1165344 + }, + "capped_gamma_1": { + "seed": 20261107, + "diagnostics": { + "max_mass_error": 6.661338147750939e-16, + "max_lmax_error": 0.0, + "smallest_height": 0.31567832257841477, + "largest_height": 0.9992338937861152 + }, + "statistics": { + "heights_level_pc1": { + "observed": 0.9026282301130131, + "reference_mean": 0.9787013730389433, + "reference_q025": 0.9777862343286654, + "reference_q975": 0.9794848106754939, + "observed_minus_reference_mean": -0.07607314292593026, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_increment_pc1": { + "observed": 0.8621596759614166, + "reference_mean": 0.9242323770843636, + "reference_q025": 0.9182793413555176, + "reference_q975": 0.9298885246660518, + "observed_minus_reference_mean": -0.06207270112294694, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_roughness": { + "observed": 0.17108292462354385, + "reference_mean": 0.8945294095912818, + "reference_q025": 0.8561926184958676, + "reference_q975": 0.9273531254688794, + "observed_minus_reference_mean": -0.723446484967738, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_distance_agreement": { + "observed": 0.7516324436110532, + "reference_mean": 0.9807973376927774, + "reference_q025": 0.9766812895957284, + "reference_q975": 0.9836189048622206, + "observed_minus_reference_mean": -0.22916489408172425, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_level_pc1": { + "observed": 0.9537884097754766, + "reference_mean": 0.9475678821429637, + "reference_q025": 0.9474906034175046, + "reference_q975": 0.9476449117574985, + "observed_minus_reference_mean": 0.006220527632512907, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + }, + "raw_increment_pc1": { + "observed": 0.8358231974306394, + "reference_mean": 0.8936932934640706, + "reference_q025": 0.8933132663536192, + "reference_q975": 0.8941027770600248, + "observed_minus_reference_mean": -0.057870096033431184, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_roughness": { + "observed": 0.09319811629642542, + "reference_mean": 0.2661210554689326, + "reference_q025": 0.2653014177218141, + "reference_q975": 0.2669506708511553, + "observed_minus_reference_mean": -0.17292293917250717, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_distance_agreement": { + "observed": 0.8773205701013188, + "reference_mean": 0.9434620378322849, + "reference_q025": 0.9427590650585304, + "reference_q975": 0.9442513368983959, + "observed_minus_reference_mean": -0.06614146773096607, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_competition_rate": { + "observed": 0.14027777777777778, + "reference_mean": 0.13943240508096036, + "reference_q025": 0.1317361111111111, + "reference_q975": 0.147578125, + "observed_minus_reference_mean": 0.0008453726968174202, + "lower_tail_fraction": 0.585, + "upper_tail_fraction": 0.445, + "draws": 199 + } + }, + "late_statistics": { + "heights_level_pc1": { + "observed": 0.8706398284071151, + "reference_mean": 0.9836830628958891, + "reference_q025": 0.9829011589687949, + "reference_q975": 0.9843725155754873, + "observed_minus_reference_mean": -0.11304323448877407, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_increment_pc1": { + "observed": 0.8611036325106006, + "reference_mean": 0.9320969325344831, + "reference_q025": 0.925473416363077, + "reference_q975": 0.9383890708274406, + "observed_minus_reference_mean": -0.07099330002388249, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_roughness": { + "observed": 0.4290649544821283, + "reference_mean": 1.127239771954583, + "reference_q025": 1.0766663230725588, + "reference_q975": 1.1735916381963465, + "observed_minus_reference_mean": -0.6981748174724547, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_distance_agreement": { + "observed": 0.674392511825667, + "reference_mean": 0.9843350798796479, + "reference_q025": 0.9804508993680118, + "reference_q975": 0.9869551319150252, + "observed_minus_reference_mean": -0.3099425680539809, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_level_pc1": { + "observed": 0.949106358655951, + "reference_mean": 0.9625810572673555, + "reference_q025": 0.9624330161600861, + "reference_q975": 0.9627174214263872, + "observed_minus_reference_mean": -0.01347469861140449, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_increment_pc1": { + "observed": 0.812558056158724, + "reference_mean": 0.9184191952715312, + "reference_q025": 0.9175717428559633, + "reference_q975": 0.9192632690442282, + "observed_minus_reference_mean": -0.10586113911280715, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_roughness": { + "observed": 0.17739941247588512, + "reference_mean": 0.547647619717132, + "reference_q025": 0.5259482640460194, + "reference_q975": 0.5701056813940089, + "observed_minus_reference_mean": -0.37024820724124696, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_distance_agreement": { + "observed": 0.8738199411996205, + "reference_mean": 0.9409374542070105, + "reference_q025": 0.9403080460834473, + "reference_q975": 0.9415782345996252, + "observed_minus_reference_mean": -0.06711751300739, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_competition_rate": { + "observed": 0.15601851851851853, + "reference_mean": 0.1632002605620696, + "reference_q025": 0.15344907407407407, + "reference_q975": 0.1733912037037037, + "observed_minus_reference_mean": -0.00718174204355107, + "lower_tail_fraction": 0.09, + "upper_tail_fraction": 0.92, + "draws": 199 + } + }, + "spectra_generated": 1165344 + }, + "capped_gamma_4": { + "seed": 20261108, + "diagnostics": { + "max_mass_error": 7.771561172376096e-16, + "max_lmax_error": 0.0, + "smallest_height": 0.6264771227083619, + "largest_height": 0.9998063810120815 + }, + "statistics": { + "heights_level_pc1": { + "observed": 0.9026282301130131, + "reference_mean": 0.9788871355582855, + "reference_q025": 0.9779891979894452, + "reference_q975": 0.9797077527004878, + "observed_minus_reference_mean": -0.07625890544527247, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_increment_pc1": { + "observed": 0.8621596759614166, + "reference_mean": 0.9424031136133209, + "reference_q025": 0.936485295136349, + "reference_q975": 0.9476728756859625, + "observed_minus_reference_mean": -0.08024343765190423, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_roughness": { + "observed": 0.17108292462354385, + "reference_mean": 0.918954322342814, + "reference_q025": 0.8859238779133874, + "reference_q975": 0.9508885867039378, + "observed_minus_reference_mean": -0.7478713977192701, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_distance_agreement": { + "observed": 0.7516324436110532, + "reference_mean": 0.9798787092394167, + "reference_q025": 0.9744046654474463, + "reference_q975": 0.9839798674290655, + "observed_minus_reference_mean": -0.22824626562836348, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_level_pc1": { + "observed": 0.9537884097754766, + "reference_mean": 0.9457399619724167, + "reference_q025": 0.9457151805500168, + "reference_q975": 0.9457591597834888, + "observed_minus_reference_mean": 0.00804844780305991, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + }, + "raw_increment_pc1": { + "observed": 0.8358231974306394, + "reference_mean": 0.8927981584565154, + "reference_q025": 0.8926787980532479, + "reference_q975": 0.892916086624585, + "observed_minus_reference_mean": -0.05697496102587607, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_roughness": { + "observed": 0.09319811629642542, + "reference_mean": 0.2657991266035627, + "reference_q025": 0.2655439402037531, + "reference_q975": 0.26601012536667334, + "observed_minus_reference_mean": -0.17260101030713726, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_distance_agreement": { + "observed": 0.8773205701013188, + "reference_mean": 0.9411077445084379, + "reference_q025": 0.9408114182312044, + "reference_q975": 0.941412694554406, + "observed_minus_reference_mean": -0.06378717440711912, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_competition_rate": { + "observed": 0.14027777777777778, + "reference_mean": 0.08509561697375768, + "reference_q025": 0.07777777777777778, + "reference_q975": 0.09114583333333333, + "observed_minus_reference_mean": 0.055182160804020094, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + } + }, + "late_statistics": { + "heights_level_pc1": { + "observed": 0.8706398284071151, + "reference_mean": 0.9827520500725151, + "reference_q025": 0.9819036328250569, + "reference_q975": 0.9835550968959713, + "observed_minus_reference_mean": -0.11211222166540002, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_increment_pc1": { + "observed": 0.8611036325106006, + "reference_mean": 0.9481796640795495, + "reference_q025": 0.9421780292175835, + "reference_q975": 0.953459139730884, + "observed_minus_reference_mean": -0.08707603156894883, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_roughness": { + "observed": 0.4290649544821283, + "reference_mean": 1.1397705305150032, + "reference_q025": 1.1031062500972895, + "reference_q975": 1.1826893881551526, + "observed_minus_reference_mean": -0.7107055760328749, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_distance_agreement": { + "observed": 0.674392511825667, + "reference_mean": 0.9848503752179888, + "reference_q025": 0.9809810287751465, + "reference_q975": 0.9880462570703213, + "observed_minus_reference_mean": -0.31045786339232184, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_level_pc1": { + "observed": 0.949106358655951, + "reference_mean": 0.9637584917552919, + "reference_q025": 0.9637213175855407, + "reference_q975": 0.9637899924164094, + "observed_minus_reference_mean": -0.01465213309934088, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_increment_pc1": { + "observed": 0.812558056158724, + "reference_mean": 0.9201997174895322, + "reference_q025": 0.9199850894534748, + "reference_q975": 0.9204153486911244, + "observed_minus_reference_mean": -0.10764166133080821, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_roughness": { + "observed": 0.17739941247588512, + "reference_mean": 0.39572648957086204, + "reference_q025": 0.3860185028203412, + "reference_q975": 0.4067987943447153, + "observed_minus_reference_mean": -0.21832707709497692, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_distance_agreement": { + "observed": 0.8738199411996205, + "reference_mean": 0.9418248266124007, + "reference_q025": 0.9416314404549699, + "reference_q975": 0.9420473451088425, + "observed_minus_reference_mean": -0.06800488541278027, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_competition_rate": { + "observed": 0.15601851851851853, + "reference_mean": 0.1044819002419505, + "reference_q025": 0.0962962962962963, + "reference_q975": 0.11320601851851851, + "observed_minus_reference_mean": 0.051536618276568025, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + } + }, + "spectra_generated": 1165344 + }, + "extremizer_segment": { + "seed": 20261109, + "diagnostics": { + "max_mass_error": 1.5543122344752192e-15, + "max_lmax_error": 1.1102230246251565e-16, + "smallest_height": 1.264743247063604e-06, + "largest_height": 0.9999999999970572 + }, + "statistics": { + "heights_level_pc1": { + "observed": 0.9026282301130131, + "reference_mean": 0.9749568502809879, + "reference_q025": 0.9739182723656048, + "reference_q975": 0.9761022053493954, + "observed_minus_reference_mean": -0.07232862016797481, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_increment_pc1": { + "observed": 0.8621596759614166, + "reference_mean": 0.9812393613854467, + "reference_q025": 0.9800417268846712, + "reference_q975": 0.9826181133029077, + "observed_minus_reference_mean": -0.11907968542403002, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_roughness": { + "observed": 0.17108292462354385, + "reference_mean": 2.026165374228838, + "reference_q025": 1.9743141793542835, + "reference_q975": 2.0879082239740794, + "observed_minus_reference_mean": -1.855082449605294, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_distance_agreement": { + "observed": 0.7516324436110532, + "reference_mean": 0.8569770416853427, + "reference_q025": 0.8280384247362857, + "reference_q975": 0.8884899414311181, + "observed_minus_reference_mean": -0.10534459807428953, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_level_pc1": { + "observed": 0.9537884097754766, + "reference_mean": 0.9243445306086217, + "reference_q025": 0.9226854414513384, + "reference_q975": 0.9258926414345007, + "observed_minus_reference_mean": 0.02944387916685498, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + }, + "raw_increment_pc1": { + "observed": 0.8358231974306394, + "reference_mean": 0.8570853889390966, + "reference_q025": 0.8525244351856927, + "reference_q975": 0.8615057127403866, + "observed_minus_reference_mean": -0.021262191508457207, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_roughness": { + "observed": 0.09319811629642542, + "reference_mean": 0.676602102498207, + "reference_q025": 0.6540198363058839, + "reference_q975": 0.6998292808220401, + "observed_minus_reference_mean": -0.5834039862017816, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_distance_agreement": { + "observed": 0.8773205701013188, + "reference_mean": 0.8798504835991738, + "reference_q025": 0.8676056400521642, + "reference_q975": 0.890261727280444, + "observed_minus_reference_mean": -0.0025299134978550297, + "lower_tail_fraction": 0.335, + "upper_tail_fraction": 0.67, + "draws": 199 + }, + "raw_competition_rate": { + "observed": 0.14027777777777778, + "reference_mean": 0.11163630653266331, + "reference_q025": 0.10485243055555556, + "reference_q975": 0.11980902777777777, + "observed_minus_reference_mean": 0.028641471245114472, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + } + }, + "late_statistics": { + "heights_level_pc1": { + "observed": 0.8706398284071151, + "reference_mean": 0.9755504937358874, + "reference_q025": 0.9743074999592278, + "reference_q975": 0.9769650901173501, + "observed_minus_reference_mean": -0.10491066532877236, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_increment_pc1": { + "observed": 0.8611036325106006, + "reference_mean": 0.9815130011392061, + "reference_q025": 0.9800554402919321, + "reference_q975": 0.9829791601909339, + "observed_minus_reference_mean": -0.12040936862860552, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_roughness": { + "observed": 0.4290649544821283, + "reference_mean": 2.0426285536799864, + "reference_q025": 1.9811772039515168, + "reference_q975": 2.106256632038041, + "observed_minus_reference_mean": -1.613563599197858, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_distance_agreement": { + "observed": 0.674392511825667, + "reference_mean": 0.85062631140749, + "reference_q025": 0.82304336335085, + "reference_q975": 0.8786983471074382, + "observed_minus_reference_mean": -0.17623379958182306, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_level_pc1": { + "observed": 0.949106358655951, + "reference_mean": 0.9127961999969035, + "reference_q025": 0.9092965009156285, + "reference_q975": 0.9155829604876646, + "observed_minus_reference_mean": 0.03631015865904752, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + }, + "raw_increment_pc1": { + "observed": 0.812558056158724, + "reference_mean": 0.8751130950125265, + "reference_q025": 0.8702495158270225, + "reference_q975": 0.8799340215200567, + "observed_minus_reference_mean": -0.06255503885380254, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_roughness": { + "observed": 0.17739941247588512, + "reference_mean": 1.4531512988463526, + "reference_q025": 1.4013517787979983, + "reference_q975": 1.5037842622242128, + "observed_minus_reference_mean": -1.2757518863704675, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_distance_agreement": { + "observed": 0.8738199411996205, + "reference_mean": 0.8776429915238936, + "reference_q025": 0.8639067527837582, + "reference_q975": 0.8923319327731093, + "observed_minus_reference_mean": -0.003823050324273103, + "lower_tail_fraction": 0.29, + "upper_tail_fraction": 0.715, + "draws": 199 + }, + "raw_competition_rate": { + "observed": 0.15601851851851853, + "reference_mean": 0.09321259073143495, + "reference_q025": 0.08606481481481482, + "reference_q975": 0.1025462962962963, + "observed_minus_reference_mean": 0.06280592778708358, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + } + }, + "spectra_generated": 1165344 + } + }, + "observed": { + "heights_level_pc1": 0.9026282301130131, + "heights_increment_pc1": 0.8621596759614166, + "heights_roughness": 0.17108292462354385, + "heights_roughness_paths": 90, + "heights_distance_agreement": 0.7516324436110532, + "raw_level_pc1": 0.9537884097754766, + "raw_increment_pc1": 0.8358231974306394, + "raw_roughness": 0.09319811629642542, + "raw_roughness_paths": 96, + "raw_distance_agreement": 0.8773205701013188, + "raw_competition_rate": 0.14027777777777778, + "raw_competition_count": 808, + "raw_edges": 5760, + "height_rows": 5657, + "height_edges": 5512 + }, + "analytic_joint_reference": { + "mean_height_roughness": 2.035953855284806, + "raw_competition_rate": 0.05685354071103242, + "by_model": { + "kicked_ising": { + "observed_roughness": 0.19946384192957567, + "reference_mean_roughness": 2.0359050634436318, + "observed_competition_rate": 0.09930555555555555, + "reference_mean_competition_rate": 0.04467854387125221 + }, + "qca": { + "observed_roughness": 0.12543277071569076, + "reference_mean_roughness": 2.0361490226495045, + "observed_competition_rate": 0.04513888888888889, + "reference_mean_competition_rate": 0.013140435992277806 + }, + "quantum_baker": { + "observed_roughness": 0.17115480496691546, + "reference_mean_roughness": 2.0359050634436318, + "observed_competition_rate": 0.17152777777777778, + "reference_mean_competition_rate": 0.06407910328483246 + }, + "random_field_xxz": { + "observed_roughness": 0.1768677424050303, + "reference_mean_roughness": 2.0359050634436318, + "observed_competition_rate": 0.24513888888888888, + "reference_mean_competition_rate": 0.10551607969576719 + } + } + }, + "competition_tolerance_sensitivity": [ + { + "metric_eps": 1e-12, + "observed_count": 808, + "reference_expected_count": 327.47639449554674, + "observed_rate": 0.14027777777777778, + "reference_expected_rate": 0.05685354071103242 + }, + { + "metric_eps": 1e-10, + "observed_count": 808, + "reference_expected_count": 327.47639449554674, + "observed_rate": 0.14027777777777778, + "reference_expected_rate": 0.05685354071103242 + }, + { + "metric_eps": 1e-08, + "observed_count": 807, + "reference_expected_count": 327.4232254814622, + "observed_rate": 0.14010416666666667, + "reference_expected_rate": 0.056844309979420526 + }, + { + "metric_eps": 1e-07, + "observed_count": 806, + "reference_expected_count": 327.3982254814622, + "observed_rate": 0.13993055555555556, + "reference_expected_rate": 0.05683996970164274 + } + ], + "observed_by_model": { + "kicked_ising": { + "heights_level_pc1": 0.8371321828176791, + "heights_increment_pc1": 0.8556816761990915, + "heights_roughness": 0.19946384192957567, + "heights_roughness_paths": 24, + "heights_distance_agreement": 0.2761904761904762, + "raw_level_pc1": 0.9351578097278961, + "raw_increment_pc1": 0.9044975290278802, + "raw_roughness": 0.07832495211991093, + "raw_roughness_paths": 24, + "raw_distance_agreement": 0.8920634920634919, + "raw_competition_rate": 0.09930555555555555, + "raw_competition_count": 143, + "raw_edges": 1440, + "height_rows": 1440, + "height_edges": 1416 + }, + "qca": { + "heights_level_pc1": 0.9558807345278605, + "heights_increment_pc1": 0.8471132712268165, + "heights_roughness": 0.12543277071569076, + "heights_roughness_paths": 18, + "heights_distance_agreement": 0.8063492063492063, + "raw_level_pc1": 0.9431857287255786, + "raw_increment_pc1": 0.7990550642116304, + "raw_roughness": 0.10984771651887337, + "raw_roughness_paths": 24, + "raw_distance_agreement": 0.9428571428571426, + "raw_competition_rate": 0.04513888888888889, + "raw_competition_count": 65, + "raw_edges": 1440, + "height_rows": 1337, + "height_edges": 1264 + }, + "quantum_baker": { + "heights_level_pc1": 0.9187702135124445, + "heights_increment_pc1": 0.9079744053565549, + "heights_roughness": 0.17115480496691546, + "heights_roughness_paths": 24, + "heights_distance_agreement": 0.9333333333333331, + "raw_level_pc1": 0.9532703343406975, + "raw_increment_pc1": 0.9361298292931127, + "raw_roughness": 0.0909883562695299, + "raw_roughness_paths": 24, + "raw_distance_agreement": 0.8857142857142856, + "raw_competition_rate": 0.17152777777777778, + "raw_competition_count": 247, + "raw_edges": 1440, + "height_rows": 1440, + "height_edges": 1416 + }, + "random_field_xxz": { + "heights_level_pc1": 0.8590519412366074, + "heights_increment_pc1": 0.8984633338782141, + "heights_roughness": 0.1768677424050303, + "heights_roughness_paths": 24, + "heights_distance_agreement": 0.7206349206349206, + "raw_level_pc1": 0.9623151406057439, + "raw_increment_pc1": 0.9019873775469938, + "raw_roughness": 0.09363144027738746, + "raw_roughness_paths": 24, + "raw_distance_agreement": 0.8825396825396824, + "raw_competition_rate": 0.24513888888888888, + "raw_competition_count": 353, + "raw_edges": 1440, + "height_rows": 1440, + "height_edges": 1416 + } + }, + "width_sensitivity_observed": { + "heights_level_pc1": 0.90204477252652, + "heights_increment_pc1": 0.862194569278059, + "heights_roughness": 0.1718220399812844, + "heights_roughness_paths": 90, + "heights_distance_agreement": 0.7525399140372403, + "raw_level_pc1": 0.9537884097754766, + "raw_increment_pc1": 0.8358231974306394, + "raw_roughness": 0.09319811629642542, + "raw_roughness_paths": 96, + "raw_distance_agreement": 0.8773205701013188, + "raw_competition_rate": 0.14027777777777778, + "raw_competition_count": 808, + "raw_edges": 5760, + "height_rows": 5645, + "height_edges": 5500 + }, + "selected_spectra": { + "seed": 20261206, + "observed": { + "transitions": 400, + "incomparable": 280, + "competition": 50, + "competition_outside_incomparable": 0 + }, + "all_pair_tables": [ + { + "file": "spectra_kicked_ising_KI_3_n20.npz", + "spectra": 81, + "all_distinct_pair_competition": 0, + "all_distinct_pair_competition_outside_incomparable": 0 + }, + { + "file": "spectra_kicked_ising_KI_4_n20.npz", + "spectra": 81, + "all_distinct_pair_competition": 40, + "all_distinct_pair_competition_outside_incomparable": 0 + }, + { + "file": "spectra_qca_QCA_2_n20.npz", + "spectra": 81, + "all_distinct_pair_competition": 119, + "all_distinct_pair_competition_outside_incomparable": 0 + }, + { + "file": "spectra_random_field_xxz_XXZ_2_n20.npz", + "spectra": 81, + "all_distinct_pair_competition": 0, + "all_distinct_pair_competition_outside_incomparable": 0 + }, + { + "file": "spectra_random_field_xxz_XXZ_4_n20.npz", + "spectra": 81, + "all_distinct_pair_competition": 186, + "all_distinct_pair_competition_outside_incomparable": 0 + } + ], + "reference": { + "transitions": { + "mean": 400.0, + "q025": 400.0, + "q975": 400.0 + }, + "incomparable": { + "mean": 118.41141141141141, + "q025": 106.0, + "q975": 132.0 + }, + "competition": { + "mean": 8.70870870870871, + "q025": 4.0, + "q975": 14.0 + }, + "competition_outside_incomparable": { + "mean": 0.0, + "q025": 0.0, + "q975": 0.0 + } + } + }, + "stable_n10": { + "observed": { + "heights_level_pc1": 0.9514192210112755, + "heights_increment_pc1": 0.912952511627848, + "heights_roughness": 0.2710640643141967, + "heights_roughness_paths": 15, + "heights_distance_agreement": 0.7649929393244902, + "raw_level_pc1": 0.9737224400390723, + "raw_increment_pc1": 0.8586260453307197, + "raw_roughness": 0.16125697035971134, + "raw_roughness_paths": 16, + "raw_distance_agreement": 0.8752459661550573, + "raw_competition_rate": 0.15, + "raw_competition_count": 96, + "raw_edges": 640, + "height_rows": 625, + "height_edges": 602 + }, + "archive_n10_observed": { + "heights_level_pc1": 0.9514192209596694, + "heights_increment_pc1": 0.9129525165728088, + "heights_roughness": 0.27106406461255894, + "heights_roughness_paths": 15, + "heights_distance_agreement": 0.7649929393244902, + "raw_level_pc1": 0.9737224409664478, + "raw_increment_pc1": 0.8586260462928518, + "raw_roughness": 0.16125697060579372, + "raw_roughness_paths": 16, + "raw_distance_agreement": 0.8752459661550573, + "raw_competition_rate": 0.15, + "raw_competition_count": 96, + "raw_edges": 640, + "height_rows": 625, + "height_edges": 602 + }, + "joint_control": { + "seed": 20261306, + "policy": "joint", + "statistics": { + "heights_level_pc1": { + "observed": 0.9514192210112755, + "reference_mean": 0.9514192210112754, + "reference_q025": 0.951419221011275, + "reference_q975": 0.9514192210112759, + "observed_minus_reference_mean": 1.1102230246251565e-16, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_increment_pc1": { + "observed": 0.912952511627848, + "reference_mean": 0.9606022134228971, + "reference_q025": 0.9562360681152754, + "reference_q975": 0.964413017819296, + "observed_minus_reference_mean": -0.047649701795049126, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_roughness": { + "observed": 0.2710640643141967, + "reference_mean": 2.057305635679391, + "reference_q025": 1.9185968506567195, + "reference_q975": 2.186824505500131, + "observed_minus_reference_mean": -1.7862415713651942, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "heights_distance_agreement": { + "observed": 0.7649929393244902, + "reference_mean": 0.7876793393548293, + "reference_q025": 0.7512214968632079, + "reference_q975": 0.8190528277426674, + "observed_minus_reference_mean": -0.02268640003033906, + "lower_tail_fraction": 0.08, + "upper_tail_fraction": 0.925, + "draws": 199 + }, + "raw_level_pc1": { + "observed": 0.9737224400390723, + "reference_mean": 0.9737224400390722, + "reference_q025": 0.9737224400390717, + "reference_q975": 0.9737224400390726, + "observed_minus_reference_mean": 1.1102230246251565e-16, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_increment_pc1": { + "observed": 0.8586260453307197, + "reference_mean": 0.9733343202648685, + "reference_q025": 0.9706875810592576, + "reference_q975": 0.9757463501825172, + "observed_minus_reference_mean": -0.11470827493414881, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_roughness": { + "observed": 0.16125697035971134, + "reference_mean": 1.7382593614042523, + "reference_q025": 1.6216416013636477, + "reference_q975": 1.859356386715182, + "observed_minus_reference_mean": -1.577002391044541, + "lower_tail_fraction": 0.005, + "upper_tail_fraction": 1.0, + "draws": 199 + }, + "raw_distance_agreement": { + "observed": 0.8752459661550573, + "reference_mean": 0.8108431362079283, + "reference_q025": 0.7911223001597334, + "reference_q975": 0.8290620876449755, + "observed_minus_reference_mean": 0.06440282994712909, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + }, + "raw_competition_rate": { + "observed": 0.15, + "reference_mean": 0.07307631909547739, + "reference_q025": 0.056171875, + "reference_q975": 0.090625, + "observed_minus_reference_mean": 0.0769236809045226, + "lower_tail_fraction": 1.0, + "upper_tail_fraction": 0.005, + "draws": 199 + } + }, + "max_level_pc1_drift": 5.551115123125783e-16 + } + }, + "preservation": { + "file_count": 23, + "all_unchanged": true, + "input_hashes": { + "data/public_analysis_inputs.zip": "f50591d2a8129ec88484ee33414e11da552260c2d0e9bbfa25c27adf6083e5c2", + "data/trajectory_observations.csv": "940d68a1dd865559a2b8a63145fc10411a2363e99e86004e8613defee59ef202", + "data/spectra_selected_n20.zip": "1193202290b488cf3621b2c816be6a338166dadd916ee210d92d2f6559047fb8", + "data/README.md": "72210e79e78f4e87919e97bbae4fd86af06bc5f941599f4907e49408b8fedbc9", + "data/xxz_convergence_n10_n12_n14.zip": "0b579066f7a69699c730210d6b062189b70101928f92da71b9825a206b344d0f", + "figures/public/figure_04_majorization_and_metric_competition.png": "5e33fdee62c10498dc7fd9016514ccad4b6cbbe8c4434d6479fbd56391e9c6fa", + "figures/public/social_preview.png": "4f43546c75f66a42b53d0b867fd7c33af10a2b876304a243505394f9d8b61638", + "figures/public/figure_01_one_spectrum_many_lenses.png": "f90be29cb3dec5431a7af00bb6dc09fe67097e11673aa3a0e3c8a003badc98ed", + "figures/public/figure_03_metric_robustness_hierarchy.png": "42648c9eb8c669cd8d09d9d6403e5efbe099ab20fb74c70de3875cddee167f5b", + "figures/public/figure_02_exact_metric_arenas.png": "0c9cc3c670beb84b6ac387f58c95bf061d45fa3f0b1ca618cd9170b6cd291d32", + "figures/public/figure_05_model_morphology_and_limits.png": "ff640c3499f0c5cd8296d42ceb54a27471caa0f8cac5ff55fb3d0be7140dd18d", + "figures/public/data/figure_02_exact_metric_arenas_boundaries.csv": "387b527a578ec06d2ac6ab5b683969b7b07c49ea50d036f6595e66cf59e659eb", + "figures/public/data/figure_02_exact_metric_arenas_points_n20.csv": "f77705d5422ae8656d4d5324464409e472e1573cc44d15986725cb8c49add9f1", + "figures/public/data/figure_05_common_mode_model_centroids_n20.csv": "ff7834903219e5fb0fffbbd150045ce9e281b81eb4e302fc6026e737f1540fd5", + "figures/public/data/figure_03_coarse_fine_stability.csv": "219e58e974f66f68d327e4ac658fcf784cd4e6721866e96564615fa3ea28f7a3", + "figures/public/data/figure_01_concept.json": "ec3a037e5049027b0a72f1b2d9e18510876b4a7bebeb180287797dac32c56031", + "figures/public/data/public_figure_input_provenance.json": "11952c2a356e5c1afde1d7753252c34680abe5df5a34b55057118454540898f0", + "figures/public/data/figure_03_metric_pair_robustness_by_size.csv": "f8eb06515f3b19e416e6e33b861b123cb4074945884e8ecb16c3e1b8558b5b8f", + "figures/public/data/figure_03_common_mode.csv": "7e1106cb7255013cb29eca258635e18cf06e1356bca6d50c02a78b751543a9ab", + "figures/public/data/figure_04_competition_by_model.csv": "1dee8875c5a32bc6a7e3f007f689ddb3536e4768c2d0e8b28aa5366b9db114ca", + "figures/public/data/figure_05_classification_summary.csv": "2baa2cb6b216f270adb2261426ab650ad568e7f713f649072c23cd47030f1882", + "figures/public/data/figure_04_incomparable_spectra_metric_values.csv": "9f740e6cc28345d8ce62537331d0f6a94e54deaa6311877008ec3d56dc3060a6", + "figures/public/data/figure_04_majorization_event_fractions.csv": "2c142e331752e48a6c7eec4a44b1db653094d5fd763624fb868686acf14d8882" + } + }, + "checks_passed": true +} diff --git a/scripts/build_llms_full.py b/scripts/build_llms_full.py index 62be30f..0de9122 100644 --- a/scripts/build_llms_full.py +++ b/scripts/build_llms_full.py @@ -26,6 +26,7 @@ ("Canonical release environment", "docs/RELEASE_ENVIRONMENT.md"), ("Reproducibility", "docs/REPRODUCIBILITY.md"), ("Current numerical foundations", "docs/NUMERICAL_FOUNDATIONS.md"), + ("Spectral geometry versus temporal order", "docs/GEOMETRY_VS_CHRONOLOGY.md"), ) HEADER = """# Entanglement Trajectories - full machine-readable context diff --git a/src/entanglement_trajectories/controls.py b/src/entanglement_trajectories/controls.py new file mode 100644 index 0000000..11c1e40 --- /dev/null +++ b/src/entanglement_trajectories/controls.py @@ -0,0 +1,361 @@ +"""Geometry-versus-chronology controls for fixed-cut entanglement data. + +Joint shuffles preserve valid instantaneous metric tuples. Matched-spectrum +references are explicitly constructed distributions, not Haar ensembles or +uniform draws from the fixed-largest-eigenvalue polytope. No source data are +modified and no new dynamics are simulated by these controls. +""" +from __future__ import annotations + +from dataclasses import dataclass +import math +from typing import Literal + +import numpy as np + +from .boundaries import metric_bounds_fixed_lmax +from .spectra import concentrated_spectrum, equal_tail_spectrum + +METRICS = ("half_vn", "half_linear", "half_logneg") +METRIC_IDS = ("vn", "linear", "logneg") +SHUFFLES = ("joint", "endpoints", "time_blocks") +REFERENCES = ("capped_gamma_0.25", "capped_gamma_1", "capped_gamma_4", "extremizer_segment") + + +@dataclass +class Panel: + """One size, on its original recording grid; axes path, time, metric.""" + n: int + keys: tuple[tuple[str, str], ...] + steps: np.ndarray + p: np.ndarray + raw: np.ndarray + lower: np.ndarray + width: np.ndarray + heights: np.ndarray + mask: np.ndarray + + def tail(self, tau_min: float) -> "Panel": + keep = self.steps / self.n >= tau_min + if np.count_nonzero(keep) < 3: + raise ValueError("The time window has fewer than three samples.") + return Panel(self.n, self.keys, self.steps[keep], self.p[:, keep], + self.raw[:, keep], self.lower[:, keep], self.width[:, keep], + self.heights[:, keep], self.mask[:, keep]) + + +def make_panels(frame, *, width_floor: float = 1e-10) -> list[Panel]: + """Build aligned panels without interpolation, clipping heights, or gap filling.""" + from .dataset import validate_canonical_frame + validate_canonical_frame(frame) + if not np.isfinite(width_floor) or width_floor < 1e-10: + raise ValueError("width_floor must be finite and at least 1e-10.") + panels = [] + for n, rows in frame.groupby("n", sort=True): + groups = list(rows.groupby(["model", "run_id"], sort=True)) + ordered = [g.sort_values("step") for _, g in groups] + steps = ordered[0]["step"].to_numpy(int) + if any(not np.array_equal(g["step"], steps) for g in ordered): + raise ValueError("Paths of one size must share the original recording grid.") + if np.any(np.diff(steps) != 1): + raise ValueError("This control requires consecutive integer recording steps.") + p = np.stack([g.half_lambda_max.to_numpy(float) for g in ordered]) + raw = np.stack([g[list(METRICS)].to_numpy(float) for g in ordered]) + d = 1 << (int(n) // 2) + if np.any(p < 1/d - 1e-12) or np.any(p > 1 + 1e-12): + raise ValueError("Invalid largest eigenvalue.") + p = np.clip(p, 1/d, 1.0) + lower, upper = [], [] + for metric in METRIC_IDS: + b = metric_bounds_fixed_lmax(metric, p, d, normalized=True) + lower.append(b.lower); upper.append(b.upper) + lower = np.stack(lower, axis=-1); width = np.stack(upper, axis=-1) - lower + mask = np.all(np.isfinite(raw) & (width > width_floor), axis=-1) + heights = np.full_like(raw, np.nan) + np.divide(raw - lower, width, out=heights, where=mask[..., None]) + panels.append(Panel(int(n), tuple(k for k, _ in groups), steps, p, + raw, lower, width, heights, mask)) + return panels + + +def common_fraction(values: np.ndarray) -> float: + """PC1 share of the correlation matrix, excluding incomplete rows.""" + x = np.asarray(values, float).reshape(-1, 3) + x = x[np.isfinite(x).all(axis=1)] + if len(x) < 3: + return float("nan") + z = x - x.mean(axis=0) + scale = np.linalg.norm(z, axis=0) + if np.any(scale <= 1e-14): + return float("nan") + z /= scale + return float(np.linalg.eigvalsh(z.T @ z)[-1] / 3.0) + + +def roughness_per_path(values: np.ndarray, *, scale_floor: float = 1e-10) -> np.ndarray: + """Mean squared adjacent increments after within-path standardization. + + Each trajectory is weighted once, and all three vertical coordinates have + unit within-path population variance. No edge bridges a missing sample. + A path is omitted if any of its metric standard deviations is <= scale_floor. + """ + x = np.asarray(values, float) + valid = np.isfinite(x).all(axis=-1) + count = valid.sum(axis=1) + means = np.where(valid[..., None], x, 0.).sum(axis=1) / np.maximum(count[:, None], 1) + z = np.where(valid[..., None], x - means[:, None], 0.0) + sd = np.sqrt((z*z).sum(axis=1) / np.maximum(count[:, None], 1)) + eligible = (count >= 3) & (sd > scale_floor).all(axis=1) + z /= np.where(sd > 0, sd, 1)[:, None, :] + edges = valid[:, 1:] & valid[:, :-1] + difference = np.diff(z, axis=1) + numerator = ((difference*difference) * edges[..., None]).sum(axis=(1, 2)) + out = numerator / np.maximum(3*edges.sum(axis=1), 1) + out[~eligible | (edges.sum(axis=1) == 0)] = np.nan + return out + + +def distance_agreement(values: np.ndarray) -> float: + """Mean cross-metric Spearman agreement of vertical path RMS distances. + + Uses native grids within each size. This differs from the release's + common 41-point interpolation grid, so its values are a new control, not + replacements for the archived path-distance summaries. + """ + from scipy.stats import rankdata + x = np.asarray(values, float) + valid = np.isfinite(x).all(axis=-1).astype(float) + x = np.where(valid[..., None].astype(bool), x, 0.) + overlap = valid @ valid.T + num = np.einsum('itk,jt->ijk', x*x, valid) + num = num + num.transpose(1, 0, 2) - 2*np.einsum('itk,jtk->ijk', x, x) + upper = np.triu_indices(len(x), 1) + keep = overlap[upper] >= 3 + distances = np.sqrt(np.maximum(num[upper][keep], 0) / overlap[upper][keep, None]) + if len(distances) < 3: + return float("nan") + ranks = rankdata(distances, axis=0) + ranks -= ranks.mean(axis=0) + norms = np.linalg.norm(ranks, axis=0) + if np.any(norms == 0): + return float("nan") + ranks /= norms + correlation = ranks.T @ ranks + return float(correlation[np.triu_indices(3, 1)].mean()) + + +def evaluate(panels: list[Panel], *, metric_eps: float = 1e-10) -> dict[str, float]: + """Summarize point-cloud, chronology and raw-direction statistics separately.""" + out = {} + for name in ("heights", "raw"): + arrays = [getattr(p, name) for p in panels] + levels = np.concatenate([x.reshape(-1, 3) for x in arrays]) + differences = np.concatenate([np.diff(x, axis=1).reshape(-1, 3) for x in arrays]) + rough = np.concatenate([roughness_per_path(x) for x in arrays]) + out[f"{name}_level_pc1"] = common_fraction(levels) + out[f"{name}_increment_pc1"] = common_fraction(differences) + out[f"{name}_roughness"] = float(np.nanmean(rough)) + out[f"{name}_roughness_paths"] = int(np.isfinite(rough).sum()) + out[f"{name}_distance_agreement"] = float(np.nanmean([distance_agreement(x) for x in arrays])) + # Boundary heights are not Schur-concave entanglement measures. Direction + # competition and majorization are tested only on raw entanglement metrics. + delta = np.concatenate([np.diff(p.raw, axis=1).reshape(-1, 3) for p in panels]) + competition = (delta > metric_eps).any(axis=1) & (delta < -metric_eps).any(axis=1) + out["raw_competition_rate"] = float(competition.mean()) + out["raw_competition_count"] = int(competition.sum()) + out["raw_edges"] = len(delta) + out["height_rows"] = sum(int(p.mask.sum()) for p in panels) + out["height_edges"] = sum(int((p.mask[:, 1:] & p.mask[:, :-1]).sum()) for p in panels) + return out + + +def shuffle_panel(panel: Panel, rng: np.random.Generator, + policy: Literal["joint", "endpoints", "time_blocks"] = "joint") -> Panel: + """Shuffle complete instantaneous tuples within each path; masks stay fixed. + + Rows lacking a complete set of boundary heights are held at their original + positions. All metrics, p and bounds move together. 'endpoints' additionally + holds the first/last eligible rows fixed. 'time_blocks' shuffles within + predeclared half-unit tau bins to retain the slow temporal envelope. + """ + if policy not in SHUFFLES: + raise ValueError(f"Unknown shuffle policy: {policy}") + indices = np.broadcast_to(np.arange(len(panel.steps)), panel.mask.shape).copy() + for j, mask in enumerate(panel.mask): + eligible = np.flatnonzero(mask) + if policy == "endpoints": + eligible = eligible[1:-1] + if policy == "time_blocks": + bins = (2*panel.steps[eligible]) // panel.n + parts = [eligible[bins == b] for b in np.unique(bins)] + else: + parts = [eligible] + for part in parts: + indices[j, part] = rng.permutation(part) + row = np.arange(len(indices))[:, None] + def perm(x): return x[row, indices] + return Panel(panel.n, panel.keys, panel.steps.copy(), perm(panel.p), perm(panel.raw), + perm(panel.lower), perm(panel.width), perm(panel.heights), panel.mask.copy()) + + +def capped_weights(weights: np.ndarray, p: np.ndarray) -> np.ndarray: + """Return tails t_i=min(p,c*w_i) summing to 1-p by active-set water filling. + + This construction is a pushforward of positive weights, NOT a conditional + Dirichlet draw and NOT uniform on the capped simplex. It can have atoms on + faces where additional entries equal p. These facts must accompany results. + """ + w = np.asarray(weights, float).copy() + p = np.asarray(p, float) + if w.ndim != 2 or p.shape != (len(w),) or w.shape[1] < 1: + raise ValueError("weights must have shape (rows,d-1); p must have shape (rows,).") + d = w.shape[1] + 1 + if not np.isfinite(w).all() or (w <= 0).any(): + raise ValueError("Weights must be finite and strictly positive.") + if not np.isfinite(p).all() or (p < 1/d).any() or (p > 1).any(): + raise ValueError("p must lie in [1/d,1].") + result = np.zeros_like(w) + for _ in range(d): + remaining = np.maximum(0., (1-p) - result.sum(axis=1)) + mass = w.sum(axis=1) + proposal = np.divide(remaining, mass, out=np.zeros_like(mass), where=mass > 0)[:, None]*w + saturated = proposal > p[:, None] + done = ~saturated.any(axis=1) + result[done] += proposal[done] + w[done] = 0 + if done.all(): + break + result[saturated] = np.broadcast_to(p[:, None], w.shape)[saturated] + w[saturated] = 0 + else: + raise ArithmeticError("Capped-weight active set failed to terminate.") + if not np.allclose(result.sum(axis=1), 1-p, atol=2e-13, rtol=0): + raise ArithmeticError("Capped tails have incorrect mass.") + if np.any(result < 0) or np.any(result > p[:, None] + 2e-13): + raise ArithmeticError("Capped tails violate the largest-value constraint.") + return result + + +def sample_matched_spectra(p: np.ndarray, d: int, rng: np.random.Generator, + reference: str, *, segment_basis=None) -> np.ndarray: + """Independent spectra with declared ambient d and identical largest value p.""" + if reference not in REFERENCES: + raise ValueError(f"Unknown reference generator: {reference}") + p = np.asarray(p, float).reshape(-1) + if d < 2 or (p < 1/d).any() or (p > 1).any(): + raise ValueError("Invalid dimension or p.") + if reference == "extremizer_segment": + if segment_basis is None: + c = np.stack([concentrated_spectrum(float(v), d) for v in p]) + u = np.stack([equal_tail_spectrum(float(v), d) for v in p]) + else: + c, u = segment_basis + mix = rng.random((len(p), 1)) + out = (1-mix)*c + mix*u + else: + alpha = float(reference.rsplit("_", 1)[1]) + weights = rng.gamma(alpha, 1., (len(p), d-1)) + # The declared alpha >= 0.25 makes underflow extraordinarily unlikely; + # never silently turn an underflow into an exact support statement. + if (weights <= 0).any(): + raise ArithmeticError("Gamma weight underflow; choose another seed or higher precision.") + out = np.column_stack([p, capped_weights(weights, p)]) + if not np.allclose(out.sum(axis=1), 1., atol=3e-13, rtol=0): + raise ArithmeticError("Matched spectrum normalization failure.") + if not np.allclose(out.max(axis=1), p, atol=3e-13, rtol=0): + raise ArithmeticError("Matched spectrum largest-value failure.") + return out + + +def spectrum_metrics_batch(spectra: np.ndarray) -> np.ndarray: + """The same three normalized spectral functionals, evaluated in batches.""" + from scipy.special import xlogy + x = np.asarray(spectra, float) + if x.ndim != 2 or x.shape[1] < 2 or not np.isfinite(x).all() or (x < 0).any(): + raise ValueError("Invalid batch of spectra.") + if not np.allclose(x.sum(axis=1), 1, atol=3e-12, rtol=0): + raise ValueError("Spectra must be normalized.") + d = x.shape[1] + vn = -xlogy(x, x).sum(axis=1)/math.log(d) + linear = (x*(1-x)).sum(axis=1) * d/(d-1) + logneg = 2*np.log(np.sqrt(x).sum(axis=1))/math.log(d) + return np.column_stack([vn, linear, logneg]) + + +def matched_panel(panel: Panel, rng: np.random.Generator, reference: str, + *, segment_basis=None) -> tuple[Panel, dict[str, float]]: + d = 1 << (panel.n // 2) + values = sample_matched_spectra(panel.p.ravel(), d, rng, reference, + segment_basis=segment_basis) + raw = spectrum_metrics_batch(values).reshape(panel.raw.shape) + heights = np.full_like(raw, np.nan) + np.divide(raw-panel.lower, panel.width, out=heights, where=panel.mask[..., None]) + result = Panel(panel.n, panel.keys, panel.steps.copy(), panel.p.copy(), raw, + panel.lower, panel.width, heights, panel.mask.copy()) + diagnostics = {"max_mass_error": float(np.max(np.abs(values.sum(axis=1)-1))), + "max_lmax_error": float(np.max(np.abs(values.max(axis=1)-panel.p.ravel()))), + "smallest_height": float(np.nanmin(heights)), + "largest_height": float(np.nanmax(heights))} + return result, diagnostics + + +def reference_summary(observed: dict, records: list[dict]) -> dict: + """Reference quantiles and add-one directional tail fractions. + + For fixed designed trajectories these are conditional surrogate summaries, + not population p-values or a probability that a physical theory is true. + """ + output = {} + for metric, value in observed.items(): + if not metric.endswith(("pc1", "roughness", "agreement", "rate")): + continue + samples = np.array([r[metric] for r in records], float) + samples = samples[np.isfinite(samples)] + if not len(samples): + continue + tol = 1e-12 + output[metric] = {"observed": value, "reference_mean": float(samples.mean()), + "reference_q025": float(np.quantile(samples, .025)), + "reference_q975": float(np.quantile(samples, .975)), + "observed_minus_reference_mean": float(value - samples.mean()), + "lower_tail_fraction": float((1+np.count_nonzero(samples <= value+tol))/(len(samples)+1)), + "upper_tail_fraction": float((1+np.count_nonzero(samples >= value-tol))/(len(samples)+1)), + "draws": len(samples)} + return output + + +def exact_joint_expectations(panels: list[Panel], *, metric_eps: float = 1e-10) -> list[dict]: + """Analytical joint-shuffle means, independently of Monte Carlo draws. + + Distinct eligible endpoints are a uniform ordered pair from F rows. + A unit-population-variance coordinate therefore has expected squared + increment 2F/(F-1). Raw metric competition is averaged over the exact + pair table, including edges with one or two frozen endpoints. + """ + records = [] + for p in panels: + roughness = roughness_per_path(p.heights) + for i, key in enumerate(p.keys): + mask = p.mask[i] + eligible = np.flatnonzero(mask) + count = len(eligible) + x = p.raw[i] + delta = x[None, :, :] - x[:, None, :] + competition = (delta > metric_eps).any(axis=2) & (delta < -metric_eps).any(axis=2) + expected = 0. + for j in range(len(mask)-1): + if mask[j] and mask[j+1]: + expected += competition[np.ix_(eligible, eligible)].sum() / (count*(count-1)) + elif mask[j]: + expected += competition[eligible, j+1].mean() + elif mask[j+1]: + expected += competition[j, eligible].mean() + else: + expected += float(competition[j, j+1]) + records.append({'model':key[0], 'run_id':key[1], 'n':p.n, + 'eligible_rows':count, 'raw_edges':len(mask)-1, + 'observed_height_roughness':float(roughness[i]), + 'exact_joint_mean_height_roughness':2*count/(count-1) if np.isfinite(roughness[i]) else float('nan'), + 'observed_raw_competition':int(competition[np.arange(len(mask)-1),np.arange(1,len(mask))].sum()), + 'exact_joint_mean_raw_competition':float(expected)}) + return records diff --git a/tests/test_controls.py b/tests/test_controls.py new file mode 100644 index 0000000..f7492b1 --- /dev/null +++ b/tests/test_controls.py @@ -0,0 +1,208 @@ +"""Structural null invariants and numerical sampler checks, not target-result fitting.""" +import importlib.util +import json +from pathlib import Path + +import numpy as np +import pytest + +from entanglement_trajectories.controls import ( + Panel, REFERENCES, SHUFFLES, capped_weights, common_fraction, + distance_agreement, evaluate, matched_panel, reference_summary, + roughness_per_path, sample_matched_spectra, shuffle_panel, spectrum_metrics_batch, +) +from entanglement_trajectories.metrics import von_neumann_entropy,linear_entropy,log_negativity_pure + + +def panel(): + rng=np.random.default_rng(914) + raw=rng.random((4,21,3)) + mask=np.ones((4,21),bool);mask[0,[0,5,6]]=False;mask[2,[9,20]]=False + heights=np.where(mask[...,None],raw,np.nan) + return Panel(10,tuple(('model',str(i)) for i in range(4)),np.arange(21), + np.full((4,21),.5),raw,np.zeros_like(raw),np.ones_like(raw),heights,mask) + + +@pytest.mark.parametrize('policy',SHUFFLES) +def test_joint_shuffle_preserves_tuples_masks_and_point_cloud(policy): + p=panel();q=shuffle_panel(p,np.random.default_rng(813),policy) + assert np.array_equal(p.mask,q.mask) + for i in range(4): + assert sorted(map(tuple,p.raw[i]))==sorted(map(tuple,q.raw[i])) + assert np.array_equal(p.raw[i,~p.mask[i]],q.raw[i,~p.mask[i]]) + if policy=='endpoints': + endpoints=np.flatnonzero(p.mask[i])[[0,-1]] + assert np.array_equal(p.raw[i,endpoints],q.raw[i,endpoints]) + if policy=='time_blocks': + for b in np.unique(2*p.steps//p.n): + select=(2*p.steps//p.n)==b + assert sorted(map(tuple,p.raw[i,select]))==sorted(map(tuple,q.raw[i,select])) + assert common_fraction(q.heights)==pytest.approx(common_fraction(p.heights),abs=2e-14) + assert common_fraction(q.raw)==pytest.approx(common_fraction(p.raw),abs=2e-14) + assert not np.array_equal(p.raw,q.raw) + + +def test_no_gap_bridge_in_roughness(): + x=np.array([[[0.,0.,0.],[1.,2.,3.],[np.nan]*3,[10.,20.,30.]]]) + y=x[np.isfinite(x).all(axis=-1)] + sd=y.std(axis=0) + expected=np.mean((np.array([1.,2.,3.])/sd)**2) + assert roughness_per_path(x)[0]==pytest.approx(expected) + + +def test_smooth_sequence_is_rougher_when_jointly_shuffled(): + x=np.linspace(0.,1.,30) + y=np.stack([x,x**2,np.sqrt(x)],axis=-1)[None,:,:] + observed=roughness_per_path(y)[0] + randomized=roughness_per_path(y[:,np.random.default_rng(222).permutation(30)])[0] + assert observed=0).all() + np.testing.assert_allclose(x.max(axis=1),p,atol=3e-13,rtol=0) + np.testing.assert_allclose(x.sum(axis=1),1,atol=3e-13,rtol=0) + np.testing.assert_allclose(x[0],1/d,atol=3e-13,rtol=0) + np.testing.assert_allclose(x[-1],np.r_[1,np.zeros(d-1)],atol=3e-13,rtol=0) + + +@pytest.mark.parametrize('alpha',[.25,1,4]) +def test_capped_weight_characterization(alpha): + rng=np.random.default_rng(28) + w=rng.gamma(alpha,1,(9,31)); p=np.linspace(.04,.75,9) + tails=capped_weights(w,p) + for i in range(len(p)): + free=tails[i] < p[i]-1e-12 + ratios=tails[i,free]/w[i,free] + np.testing.assert_allclose(ratios,ratios[0],atol=2e-13,rtol=2e-13) + np.testing.assert_allclose(tails[i],np.minimum(p[i],ratios[0]*w[i]),atol=2e-13) + + +@pytest.mark.parametrize('reference',REFERENCES) +def test_batch_metric_matches_package_functions(reference): + x=sample_matched_spectra(np.array([1/32,.125,.4,.99,1-1e-14,1.]),32,np.random.default_rng(502),reference) + actual=spectrum_metrics_batch(x) + expected=np.array([[von_neumann_entropy(v,normalized=True),linear_entropy(v,normalized=True), + log_negativity_pure(v,normalized=True)] for v in x]) + np.testing.assert_allclose(actual,expected,atol=3e-13,rtol=0) + + +@pytest.mark.parametrize('bad',[np.nan,-.1,1.1]) +def test_invalid_p_rejected(bad): + with pytest.raises(ValueError): capped_weights(np.ones((1,3)),np.array([bad])) + + +def test_conditional_summary_never_reports_zero_tail_fraction(): + out=reference_summary({'heights_roughness':.1},[{'heights_roughness':2.},{'heights_roughness':3.}]) + assert out['heights_roughness']['lower_tail_fraction']==pytest.approx(1/3) + assert out['heights_roughness']['upper_tail_fraction']==1. + + +def test_masks_keep_same_number_of_eligible_edges(): + p=panel();q=shuffle_panel(p,np.random.default_rng(521)) + a=evaluate([p]);b=evaluate([q]) + assert a['height_rows']==b['height_rows'] + assert a['height_edges']==b['height_edges'] + assert a['raw_level_pc1']==pytest.approx(b['raw_level_pc1'],abs=2e-14) + assert a['heights_level_pc1']==pytest.approx(b['heights_level_pc1'],abs=2e-14) + + +def test_partial_missing_rows_excluded_jointly_in_roughness(): + x=np.array([[[0.,0.,0.],[1.,2.,3.],[500.,np.nan,900.],[10.,20.,30.]]]) + expected=x.copy();expected[0,2]=np.nan + np.testing.assert_allclose(roughness_per_path(x),roughness_per_path(expected),atol=2e-14) + + +def test_analytical_joint_expectations_match_complete_permutation_enumeration(): + from itertools import permutations + from entanglement_trajectories.controls import exact_joint_expectations + raw=np.array([[[0.,0.,0.],[.1,.3,.5],[.8,.4,.6],[.5,.9,.1],[.3,.6,.9]]]) + mask=np.array([[False,True,True,True,True]]) + p=Panel(2,(('model','test'),),np.arange(5),np.full((1,5),.8), + raw,np.zeros_like(raw),np.ones_like(raw),np.where(mask[...,None],raw,np.nan),mask) + exact=exact_joint_expectations([p])[0] + rough=[];comp=[] + for perm in permutations(range(1,5)): + idx=np.r_[0,perm] + v=p.raw[:,idx];h=p.heights[:,idx] + rough.append(roughness_per_path(h)[0]) + d=np.diff(v,axis=1)[0] + comp.append(((d>1e-10).any(axis=1)&(d< -1e-10).any(axis=1)).sum()) + assert np.mean(rough)==pytest.approx(exact['exact_joint_mean_height_roughness'],abs=2e-14) + assert np.mean(comp)==pytest.approx(exact['exact_joint_mean_raw_competition'],abs=2e-14) + + +def test_archived_control_results_match_draw_tables_and_sources(): + import hashlib + import io + import zipfile + import pandas as pd + root=Path(__file__).resolve().parents[1] + summary_path=root/'metadata/geometry_chronology_controls.json' + summary=json.loads(summary_path.read_text()) + assert (root/'docs/GEOMETRY_VS_CHRONOLOGY.md').is_file() + assert summary['input_sha256']==hashlib.sha256((root/'data/trajectory_observations.csv').read_bytes()).hexdigest() + for name,digest in summary['implementation_sha256'].items(): + assert hashlib.sha256((root/name).read_bytes()).hexdigest()==digest + with zipfile.ZipFile(root/'data/geometry_chronology_controls.zip') as z: + assert z.testzip() is None + assert json.loads(z.read('summary.json'))==summary + assert all(not Path(name).is_absolute() and '..' not in Path(name).parts for name in z.namelist()) + lookup={'joint':'chronology_joint.csv','endpoints':'chronology_endpoints.csv', + 'time_blocks':'chronology_time_blocks.csv','late_joint':'chronology_late.csv', + 'width_1e-6_joint':'chronology_width_1e-6.csv'} + for key,name in lookup.items(): + stored=summary['chronology'][key]['statistics'] + observed={metric:r['observed'] for metric,r in stored.items()} + draw=pd.read_csv(io.BytesIO(z.read(name))) + recalculated=reference_summary(observed,draw.to_dict('records')) + for metric,fields in stored.items(): + for field,value in fields.items(): + assert recalculated[metric][field]==pytest.approx(value,abs=2e-12) + for key,record in summary['matched_spectra'].items(): + draw=pd.read_csv(io.BytesIO(z.read(f'matched_{key}.csv'))) + recalculated=reference_summary(summary['observed'],draw.to_dict('records')) + for metric,fields in record['statistics'].items(): + for field,value in fields.items(): + assert recalculated[metric][field]==pytest.approx(value,abs=2e-12) + + +def test_control_cli_small_reproduction(tmp_path): + import subprocess + import sys + root=Path(__file__).resolve().parents[1] + out=tmp_path/'control_smoke' + completed=subprocess.run([sys.executable,str(root/'analysis/run_geometry_chronology_controls.py'), + '--output-dir',str(out),'--permutations','2','--reference-draws','1','--skip-stable-n10'], + cwd=root,check=True,capture_output=True,text=True) + summary=json.loads((out/'summary.json').read_text()) + assert summary['checks_passed'] is True + assert summary['preservation']['all_unchanged'] is True + assert set(summary['matched_spectra'])==set(REFERENCES) + assert summary['chronology']['joint']['max_level_pc1_drift']<1e-12 + assert 'COMPLETE' in completed.stdout