예제 #1
0
            path_entity = simulation + '/' + entity + '/'

            if os.path.isdir(path_entity):
                print(entity)

                simulated_matrix = np.load(path_entity + 'sim_fc.npy')
                J = np.loadtxt(path_entity + 'J_ij.csv', delimiter=',')
                critical_temperature = np.loadtxt(path_entity + 'ctem.csv',
                                                  delimiter=',')
                ctemp_sim.append(critical_temperature)
                susceptibility_sim.append(
                    np.loadtxt(path_entity + 'susc.csv', delimiter=','))

                c, r = correlation_function(simulated_matrix, J)

                index_ct = find_nearest(ts, critical_temperature)
                dimensionality = dim(c, r, index_ct)
                if not np.isinf(r[-1]):
                    dimensionality_sim.append(dimensionality)
        dimensionality_exp.append(dimensionality_sim)

fig, ax = plt.subplots(figsize=(10, 7))

colors = ['blue', 'green', 'red', 'black', 'cyan']

parts = plt.violinplot(dimensionality_exp,
                       positions=np.array(sizes_),
                       showmeans=True,
                       showmedians=False)

cont = 0
예제 #2
0
import matplotlib.pyplot as plt
from generalize_ising_model.ising_utils import corrfun, dim, find_nearest

mat = scipy.io.loadmat(
    '/home/brainlab/Desktop/Rudas/Scripts/ising/dimentionality/wd1/full.mat')

corr = mat['Corr_all']
J = mat['J_count_MS_Det']
tc_subs = np.squeeze(mat['tc_subs'])
temp = np.squeeze(mat['temp'])

print('Starting')
corr_fun, r_all = corrfun(corr, J)

print(corr_fun.shape)

sub = corr_fun.shape[0]

d = []
for i in range(sub):
    print('Sub ' + str(i + 1))
    corr_func = corr_fun[i, :, :]
    idx_ct = find_nearest(temp, tc_subs[i])
    d.append(dim(corr_func, r_all[i, :], idx_ct))

print(d)
plt.scatter(np.linspace(0, len(d), num=len(d)), d)
plt.show()

print('Hola Mundo')