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
| File | Console language | Contents |
|---|---|---|
| trivortex_core.py | English (default) | the canonical document; identical physics in all three mirrors |
| trivortex_core_ru.py | Russian | RU mirror — same 22-section structure |
| trivortex_core_en.py | English | 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
| № | Section | What it does |
|---|---|---|
| 1 | Imports and Dependencies | numpy/scipy/matplotlib stack, optional mpmath, font and DPI configuration. |
| 2 | Constants and Global Configuration | SI constants (G, ħ, k_B, c, e), RMT reference values, the Config class with all tunable parameters. |
| 3 | Data Structures | Result containers: ChaplyginResults, RMTResults, TopologicalResults, AdvancedRMTResults, ChaosResults. |
| 4 | Hamiltonian Construction | L×L Hofstadter matrix with N_v embedded vortices: Peierls + AB phases, charge-weighted core potential, Hermitian symmetrization. |
| 5 | Analytical Solution (Theorem 3.1) | The closed form r_k(t), θ_k(t), the frequency ω and amplitude ε, and the Chaplygin combination C_Ch. |
| 6 | Chaplygin Conservation Verification | Section-6 procedure: C_Ch(t) recorded along the closed form over [0, 100·T] with endpoint-drift diagnostic. |
| 7 | Spectral Statistics (GUE/GOE/Poisson) | Polynomial unfolding, ⟨r⟩ statistic, manual KS tests against GUE/GOE/Poisson CDFs, ensemble verdict. |
| 8 | Zeta Zeros and Montgomery Test | First 50 Riemann ζ-zeros as reference spectrum; Montgomery pair-correlation test against the model spectrum. |
| 9 | Quantum Version with Topological Qubits | Quantized vortex model: topological qubit states, braiding-style operations. |
| 10 | Real System Presets | Sun–Earth–Moon, α Centauri, Pluto–Charon–Nix: masses, distances, periods as ready configurations. |
| 11 | High-Resolution Plot Generation | 300-dpi figures: analytical solution, spectra, phase diagrams. |
| 12 | Report Generation | One data model, seven formats: TXT, MD, HTML, CSV, JSON, DOCX, PDF report writers. |
| 13 | Comprehensive Test Functions | In-document self-tests for the analytic and spectral layers. |
| 14 | Interactive Menu | 15-mode console menu: verification suites, presets, reports, plots, cross-correlations. |
| 15 | Main Entry Point | The interactive driver and banner. |
| 16 | Berry Phase Calculation | Berry phase along parameter loops in the vortex background (Section 6 NEW block). |
| 17 | Chern Number Computation | Fukui–Hatsugai–Suzuki lattice method for the Chern numbers. |
| 18 | TKNN Hall Conductance | Topological transport from the Chern markers. |
| 19 | Dirac Cone Analysis | Locating and fitting Dirac points in the band structure. |
| 20 | Spectral Form Factor | K(t) diagnostics with GUE ramp/plateau comparison. |
| 21 | Number Variance and IPR | Σ²(L) spectral rigidity and inverse-participation-ratio localization. |
| 22 | Lyapunov Exponent + Permutation Test | Chaos 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:
| Mode | What runs | Typical output |
|---|---|---|
| 1 | Full verification | the whole analytic + spectral chain in one pass |
| 2 | Chaplygin verification suite | C_Ch diagnostics across parameter ranges |
| 3–4 | RMT statistics + Montgomery test | ⟨r⟩, KS verdicts, zeta-zero comparison |
| 5 | Quantum suite | Berry phase, Chern numbers, Hall conductance over α-grid |
| 6 | Real systems | presets of Section 10 printed and analysed |
| 7–9 | Spectrum · theorem check · custom N_v | eigenvalues, closed-form residuals, generalized simulations |
| 10–11 | Reports & plots | TXT/MD/HTML/CSV/JSON/DOCX/PDF bundle; 300-dpi figures |
| 12–15 | Topological · advanced RMT · chaos · correlations | the 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.