-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLaguerre_fix.py
More file actions
28 lines (25 loc) · 1.32 KB
/
Laguerre_fix.py
File metadata and controls
28 lines (25 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Simulation of the mean density of states for the Laguerre alpha ensemble, for a general definition of this matrix ensemble look at [1]
import numpy as np
import matplotlib.pyplot as plt
import numpy.linalg as LA
import os
##### MAIN ####
n = 1000 # size of the matrix
trials = 1000 # number of trials
gamma_values = [0.8,0.4] # values of gamma
alpha_values = [1,10,50,100] # values of alpha
for gamma in gamma_values: # Limite N/beta
for alpha in alpha_values: # Limite N/M
eig = []
for k in range(trials): # esperimento vero e proprio
B = np.zeros((n, int(n/gamma)))
B[0,0] = np.sqrt(np.random.chisquare(2*alpha/gamma,1))
for kk in range(n-1): # Matrice B
B[kk+1,kk] = np.sqrt(np.random.chisquare(2*alpha,1))
B[kk+1,kk+1] = np.sqrt(np.random.chisquare(2*alpha/gamma,1))
J = np.dot(B, B.transpose())*gamma*0.5/alpha # Matrice J
eig = np.append(eig, LA.eigvalsh(J))
plt.hist(eig,bins= 300, density = 1, alpha = 0.7, color = 'r')
plt.title(r'$\alpha = %.0f, \, \gamma = %.3f$' %(alpha,gamma))
plt.show()
#[1] G. Mazzuca: On the mean Density of States of some matrices related to the beta ensembles and an application to the Toda lattice. arXiv e-print 2008.04604 (2020).