To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit c6ee847d authored by mgassner's avatar mgassner
Browse files

minor changes

parent a013e625
...@@ -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-10 *(np.kron(sigma_z, sigma_0) + np.kron(sigma_0, sigma_z))).astype('float64') param * np.kron(sigma_z, sigma_z) + 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:
......
...@@ -48,7 +48,7 @@ def MI_vs_Entropy(model_name, number_spins, param_range): ...@@ -48,7 +48,7 @@ def MI_vs_Entropy(model_name, number_spins, param_range):
model_name = model_name model_name = model_name
number_spins = number_spins number_spins = number_spins
periodic = False periodic = True
params = np.linspace(param_range[0], param_range[1], int(param_range[2])) params = np.linspace(param_range[0], param_range[1], int(param_range[2]))
sub_dim = 4 sub_dim = 4
......
...@@ -30,7 +30,8 @@ def test_xxz(number_spins, param_range, periodic=False): ...@@ -30,7 +30,8 @@ def test_xxz(number_spins, param_range, periodic=False):
#print('Number Spins: ', model.basis.number_spins) #print('Number Spins: ', model.basis.number_spins)
#print('States', model.basis.states) #print('States', model.basis.states)
sub_dim = number_spins // 2 sub_dim = number_spins // 2
rhos = reduced_dm(sub_dim, number_spins, hamming_weight, gs, basis_states) first_trace_spin = number_spins // 4
rhos = reduced_dm(sub_dim, number_spins, hamming_weight, gs, basis_states, first_trace_spin=first_trace_spin)
entropy = compute_entropy(rhos) entropy = compute_entropy(rhos)
entropies.append(entropy) entropies.append(entropy)
......
Markdown is supported
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