Generating Unimodular Matrix in Python for Solving Systems of Linear Equations - Muhammad Irfan Mustakim; Diny Syarifah Sany (CV.RIZANIA MEDIA PRATAMA, 2025)
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.