Generating Unimodular Matrix in Python for Solving Systems of Linear Equations
DOI:
https://doi.org/10.69533/8k7k9p54Keywords:
Unimodular Matrix, Systems of Linear Equations, Python, NumPy, DeterminantsAbstract
Linear equation systems with integer solutions are widely used in modern computing fields such as cryptography and optimization, but conventional methods often produce inaccurate decimal solutions. To address this issue, this research developed a Python program based on NumPy that can efficiently generate unimodular matrices. The method involves three main stages: initializing an upper triangular matrix with diagonal elements of ±1, filling non-diagonal elements with random integers, and transforming the matrix through elementary row operations. Test results show that the program successfully generates unimodular matrices of sizes 4×4 to 9×9 with perfect accuracy (determinant exactly ±1), an average computation time of 0.5 seconds for a 4×4 matrix, and efficient memory usage (under 20 MB). The solutions to the linear equations are always exact integers, meeting the requirements for high-precision computation. This implementation not only provides a practical solution for integer linear equation systems but also opens up opportunities for applications in cryptographic algorithm development and optimization techniques that require absolute precision. The findings of this research confirm that numerical computation approaches can produce both accurate and efficient mathematical solutions.
Downloads
References
H. d. R. C. Anton, Aljabar Linear Elementer Versi Aplikasi Edisi Kedelapan, Jakarta: Penerbit Erlangga, 2004.
R. Hanson, "Integer Matrices Whose Inverses Contain Only Integers," The Two-Year, vol. 13, no. 1, pp. 18-21., 1982.
C. R. e. a. Harris, "Array programming with NumPy," Nature, vol. 585, pp. 357-362, 2020.
V. L. C. F. Golub Gene H, "Matrix Computations (5th Edition)," Johns Hopkins University Press., 2021.
V. L. Boyd Stephen, "Matrix Methods in Machine Learning," SIAM Review, pp. 64(3), 455-478, 2022.
T. R. W. M. Hastie Trevor, "Sparse Matrix Factorization for Statistical Learning," Journal of Machine Learning Research, pp. 24(1), 1-45, 2023.
"KAJIAN KONSEPTUAL MATRIKS SEBAGAI STRUKTUR DASAR DALAM ALJABAR LINEAR".
D. F. M. Anggraeni, "Dekomposisi Matriks dalam Sistem Rekomendasi Berbasis Machine Learning," Jurnal Ilmu Komputer dan Matematika, pp. 8(1), 12-25, 2020.
T. Hidayat, Komputasi Matriks dengan Python, Semarang: UNDIP Press, 2023.
W. Noviana, Matriks dan Transformasi Linear., Surabaya: Unesa Press, 2023.
R. F. d. D. A. T. Hidayat, "Implementasi NumPy untuk Analisis Matriks Transportasi," Jurnal Ilmu Komputer, vol. 4, no. 2, pp. 33-40, 2023.
B. Santoso, Aljabar Linear dan Matriks: Teori & Aplikasi, Bandung: ITB, 2023.
N. F. Rahmat Hidayat, "Teori Matriks untuk Pengolahan Citra Digital," Jurnal Komputasi dan Visual, pp. 6(1), 22-36, 2023.
G. Strang, "Linear Algebra for Data Science," MIT Press, 2023.
B. Santoso, "Pemodelan Rute dengan Matriks Adgacency," J. Teknol. Inf., vol. 5, no. 1, pp. 22-30, 2024.
S. Rahayu, "Analisis Eigenvector Centrality untuk Jaringan Jalan," J. Ilmu Komp, vol. 7, no. 1, pp. 22-30, 2023..
L. &. P. R. Zhang, "Efficient Generation of Unimodular Matrices for Machine Learning," IEEE Transactions on Computers, vol. 71, no. 8, pp. 1450-1461., 2022.
J. P. Aumasson, "Post-Quantum Lattice-Based Cryptography with Unimodular Matrices.," Proceedings of CRYPTO, pp. 112-128., 2023.
C. R. e. a. Harris, "NumPy: Advanced Matrix Operations for Scientific Computing," Nature Computational Science, vol. 3, no. 5, pp. 401-410., 2023.
Y. &. K. P. Zhang, "Python-Based Framework for Exact Linear Algebra Computations," Proceedings of ACM SIGMOD, pp. 1457-1470., 2023.
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Muhammad Irfan Mustakim, Diny Syarifah Sany (Author)

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.