Commit cde87ba8 authored by mgassner's avatar mgassner
Browse files

minor changes

parent d6245306
...@@ -19,7 +19,7 @@ def create_2spin_matrix(model_name, param): ...@@ -19,7 +19,7 @@ def create_2spin_matrix(model_name, param):
#return (0.5 * (np.kron(sigma_p, sigma_m) + np.kron(sigma_m, sigma_p)) + #return (0.5 * (np.kron(sigma_p, sigma_m) + np.kron(sigma_m, sigma_p)) +
# param * np.kron(sigma_z, sigma_z)).astype('float64').tolist() # param * np.kron(sigma_z, sigma_z)).astype('float64').tolist()
return (0.5 * (np.kron(sigma_p, sigma_m) + np.kron(sigma_m, sigma_p)) + return (0.5 * (np.kron(sigma_p, sigma_m) + np.kron(sigma_m, sigma_p)) +
param * np.kron(sigma_z, sigma_z) + 1e-6 *(np.kron(sigma_z, sigma_0) + np.kron(sigma_0, sigma_z))).astype('float64') param * np.kron(sigma_z, sigma_z) + 0*1e-6 *(np.kron(sigma_z, sigma_0) + np.kron(sigma_0, sigma_z))).astype('float64')
elif model_name == 'tfim': elif model_name == 'tfim':
return ( np.kron(sigma_z, sigma_z) - 0.5*param*(np.kron(sigma_x, sigma_0) + np.kron(sigma_0, sigma_x))).astype('float64').tolist() return ( np.kron(sigma_z, sigma_z) - 0.5*param*(np.kron(sigma_x, sigma_0) + np.kron(sigma_0, sigma_x))).astype('float64').tolist()
else: else:
......
...@@ -73,7 +73,7 @@ def MI_vs_Entropy(model_name, number_spins, param_range): ...@@ -73,7 +73,7 @@ def MI_vs_Entropy(model_name, number_spins, param_range):
MI = compute_MI(sub_dim, number_spins, hamming_weight, gs, basis_states, spin_inversion=None, first_trace_spin=first_trace_spin) MI = compute_MI(sub_dim, number_spins, hamming_weight, gs, basis_states, spin_inversion=None, first_trace_spin=first_trace_spin)
MIs.append(MI) MIs.append(MI)
del model del model
print(Entropies)
data = { data = {
'Model': model_name, 'Model': model_name,
'Number_spins': number_spins, 'Number_spins': number_spins,
...@@ -81,9 +81,9 @@ def MI_vs_Entropy(model_name, number_spins, param_range): ...@@ -81,9 +81,9 @@ def MI_vs_Entropy(model_name, number_spins, param_range):
'Hamming_weight': hamming_weight, 'Hamming_weight': hamming_weight,
'Sub_dim': sub_dim, 'Sub_dim': sub_dim,
'Delta or h over J': params.tolist(), 'Delta or h over J': params.tolist(),
'Entropies half chain': Entropies, 'Entropies half chain': np.array(Entropies).tolist(),
'Entropies 4 spin': Entropies4, 'Entropies 4 spin': np.array(Entropies4).tolist(),
'Mutual Informations': MIs 'Mutual Informations': np.array(MIs).tolist()
} }
timestr = time.strftime("%Y%m%d-%H%M%S") timestr = time.strftime("%Y%m%d-%H%M%S")
...@@ -139,8 +139,8 @@ def MutInf(model_name, param, spin_range): ...@@ -139,8 +139,8 @@ def MutInf(model_name, param, spin_range):
'Hamming_weight': hamming_weight, 'Hamming_weight': hamming_weight,
'Sub_dim': sub_dim, 'Sub_dim': sub_dim,
'Delta or h over J': param, 'Delta or h over J': param,
'Entropies': Entropies, 'Entropies': np.array(Entropies).tolist(),
'Mutual Informations': MIs 'Mutual Informations': np.array(MIs).tolist()
} }
timestr = time.strftime("%Y%m%d-%H%M%S") timestr = time.strftime("%Y%m%d-%H%M%S")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment