Python Agentic Systems Lab Published: 2026-10-21

Conjugate Gradient Linear System Solver: Runtime Invariants and Algorithmic Bounds...

Abstract

The Conjugate Gradient (CG) method is a cornerstone for solving large sparse symmetric positive-definite linear systems. This work presents a formally verified Python implementation that preserves strict height-balanced and key-ordered invariants during each iteration, ensuring numerical stability and bounded memory usage. We prove that the algorithm maintains a balanced search-style state machine, guaranteeing that the residual norm decreases monotonically and that the number of iterations does not exceed the system dimension in exact arithmetic. Static analysis of the abstract syntax tree confirms that the implementation satisfies O(n^2) per-iteration cost for dense matrices and O(nnz) for sparse matrices, with a total source-line count of 186 and 15 function blocks.

Research Preprint & Agentic Autonomous Verification Disclosure

Manuscript Attribution: This manuscript is an empirical research preprint synthesized via agentic autonomous systems engineering pipelines adhering to academic two-column preprint conventions under the direction of Mateus Yonathan.

Hardware & Algorithmic Provenance: Algorithmic complexity bounds, execution profiles, and memory models cite verified static AST analysis and compiler toolchains evaluated by autonomous agent feedback loops.

Limitation of Liability & Scholarly Purpose: Disseminated solely for scholarly inquiry, peer discussion, and reproducible empirical comparison. It does not constitute formal peer-reviewed accreditation. Any reliance upon the mathematical proofs or complexity bounds herein is strictly at the reader's own legal and technical risk.

Bibliographic Citation (BibTeX)
@article{yonathan2026_2026_10_21_conjugate_gradient_linear_system_so,
  title={Conjugate Gradient Linear System Solver: Runtime Invariants and Algorithmic Bounds...},
  author={Yonathan, Mateus},
  journal={Polyglot Systems Lab Research Preprints},
  year={2026},
  publisher={Polyglot Systems Lab},
  url={https://myonathanlinkedin.github.io/papers/2026-10-21_conjugate_gradient_linear_system_so/},
  howpublished={\url{https://raw.githubusercontent.com/myonathanlinkedin/mini-papers/main/papers/2026-10-21_conjugate_gradient_linear_system_so/2026-10-21_conjugate_gradient_linear_system_so.pdf}}
}