The determinant of the (large) 1554 x 1554 matrix in Python

I need to calculate the determinants of a large matrix of quantities 1554,1554 with only precision in python. In doing so, I see a warning at runtime:

import numpy as np

from numpy import linalg as LA

a = np.random.random((1554, 1554))

b = np.random.random((1554, 1554))

c = np.dot(a,b)

det = LA.det(c)

RuntimeWarning: overflow found in det r = _umath_linalg.det (a, signature = signature)

Any ideas on how I can get around this problem? Many thanks!

Edit: This question is unique in that it specifically relates to calculating the determinant of a large matrix in double precision, although a possible answer is included here: Can I get a matrix determinant using Numpy?

+3
source share

Source: https://habr.com/ru/post/1671802/


All Articles