TRIVORTEX

The Code — 22 Sections

One physics kernel, three language mirrors, an in-document report engine — the layout of code/ and what every section does.

Files

FileConsole languageContents
trivortex_core.pyEnglish (default) the canonical document; identical physics in all three mirrors
trivortex_core_ru.pyRussian RU mirror — same 22-section structure
trivortex_core_en.pyEnglish EN mirror — same 22-section structure

Provenance: the files were renamed from the three mirrors share one title and one author (Isaev Iskhak Khamzatovich); the docstring headers keep the former name. The Julia twin is part of the companion history; a TRIVORTEX-branded Julia port is on the roadmap.

Section map

№SectionWhat it does
1Imports and Dependenciesnumpy/scipy/matplotlib stack, optional mpmath, font and DPI configuration.
2Constants and Global ConfigurationSI constants (G, ħ, k_B, c, e), RMT reference values, the Config class with all tunable parameters.
3Data StructuresResult containers: ChaplyginResults, RMTResults, TopologicalResults, AdvancedRMTResults, ChaosResults.
4Hamiltonian ConstructionL×L Hofstadter matrix with N_v embedded vortices: Peierls + AB phases, charge-weighted core potential, Hermitian symmetrization.
5Analytical Solution (Theorem 3.1)The closed form r_k(t), θ_k(t), the frequency ω and amplitude ε, and the Chaplygin combination C_Ch.
6Chaplygin Conservation VerificationSection-6 procedure: C_Ch(t) recorded along the closed form over [0, 100·T] with endpoint-drift diagnostic.
7Spectral Statistics (GUE/GOE/Poisson)Polynomial unfolding, ⟨r⟩ statistic, manual KS tests against GUE/GOE/Poisson CDFs, ensemble verdict.
8Zeta Zeros and Montgomery TestFirst 50 Riemann ζ-zeros as reference spectrum; Montgomery pair-correlation test against the model spectrum.
9Quantum Version with Topological QubitsQuantized vortex model: topological qubit states, braiding-style operations.
10Real System PresetsSun–Earth–Moon, α Centauri, Pluto–Charon–Nix: masses, distances, periods as ready configurations.
11High-Resolution Plot Generation300-dpi figures: analytical solution, spectra, phase diagrams.
12Report GenerationOne data model, seven formats: TXT, MD, HTML, CSV, JSON, DOCX, PDF report writers.
13Comprehensive Test FunctionsIn-document self-tests for the analytic and spectral layers.
14Interactive Menu15-mode console menu: verification suites, presets, reports, plots, cross-correlations.
15Main Entry PointThe interactive driver and banner.
16Berry Phase CalculationBerry phase along parameter loops in the vortex background (Section 6 NEW block).
17Chern Number ComputationFukui–Hatsugai–Suzuki lattice method for the Chern numbers.
18TKNN Hall ConductanceTopological transport from the Chern markers.
19Dirac Cone AnalysisLocating and fitting Dirac points in the band structure.
20Spectral Form FactorK(t) diagnostics with GUE ramp/plateau comparison.
21Number Variance and IPRΣ²(L) spectral rigidity and inverse-participation-ratio localization.
22Lyapunov Exponent + Permutation TestChaos diagnostics: largest Lyapunov exponent, permutation Z-score, KAM statistics.

Running the document

cd code
python3 trivortex_core_en.py

The document opens a menu — the main suites:

ModeWhat runsTypical output
1Full verificationthe whole analytic + spectral chain in one pass
2Chaplygin verification suiteC_Ch diagnostics across parameter ranges
3–4RMT statistics + Montgomery test⟨r⟩, KS verdicts, zeta-zero comparison
5Quantum suiteBerry phase, Chern numbers, Hall conductance over α-grid
6Real systemspresets of Section 10 printed and analysed
7–9Spectrum · theorem check · custom N_veigenvalues, closed-form residuals, generalized simulations
10–11Reports & plotsTXT/MD/HTML/CSV/JSON/DOCX/PDF bundle; 300-dpi figures
12–15Topological · advanced RMT · chaos · correlationsthe NEW blocks 16–22 in action

The report engine

Section 12 is unusual for a research script: it renders the same result object into seven formats, including RTF-based DOCX and PDF writers with no external dependencies beyond the standard library. The repository discipline is that every number in a report must be traceable to a parameter snapshot — the report header carries the title, the version and the configuration used, and the independent ladder (Verification) re-checks the core claims outside the document's own code path.

Interaction with the verification ladder. The core document and verification/trivortex/python/verify.py are deliberately independent: different code, same objects. If a refactor ever makes the document and the ladder disagree, the pytest suite (verification/tests/) will catch it at the reference values before either side drifts.