I have a python code, which has nested for loop, for a huge matrix. Here rho0, alp0, bet0 are constant. and E is a symmetric matrix. How can i increase is the speed of for loop?
N = 20000
Q = np.zeros(shape=(N,N))
for i in tqdm(range(0,N)):
for j in range(0,N):
nom = rho0*alp0**E[i,j]*(1-alp0)**(M-E[i,j]);
dnom = nom + ( (1-rho0)*bet0**E[i,j]*(1-bet0)**(M-E[i,j]));
Q[i,j] = nom/dnom;