Commit 29a39373 authored by mgassner's avatar mgassner
Browse files

minor changes

parent bed55f39
......@@ -17,31 +17,39 @@ args = parser.parse_args()
def test_xxz():
model_name = 'xxz'
number_spins = 6
number_spins = 16
periodic = False
spin_inversion = None
param = -2.0
if param < -1.0:
hamming_weight = 0
else:
hamming_weight = number_spins // 2
model = spin_model(model_name=model_name, number_spins=number_spins, periodic=periodic,
param=param, hamming_weight=hamming_weight, use_symmetries=False ,spin_inversion=spin_inversion)
model.compute_ew_and_ev()
print('EIGENSTATE at h/J = ', param, 'is: ', model.eigenstates[:,0])
sub_dims = np.arange(1, number_spins)
number_spins = model.number_spins()
basis_states = model.basis.states
gs = model.eigenstates[:,0]
print('Number Spins: ', model.basis.number_spins)
print('States', model.basis.states)
for sub_dim in sub_dims:
print('Sub Dimension is ', sub_dim)
params = np.linspace(-1.2, 3.0, 41)
entropies = []
for param in params:
if param < -1.0:
hamming_weight = None
else:
hamming_weight = number_spins // 2
model = spin_model(model_name=model_name, number_spins=number_spins, periodic=periodic,
param=param, hamming_weight=hamming_weight, use_symmetries=False ,spin_inversion=spin_inversion)
model.compute_ew_and_ev()
print('EIGENSTATE at h/J = ', param, 'is: ', model.eigenstates[:,0])
basis_states = model.basis.states
gs = model.eigenstates[:,0]
print('Number Spins: ', model.basis.number_spins)
print('States', model.basis.states)
sub_dim = number_spins // 2
rhos = reduced_dm(sub_dim, number_spins, hamming_weight, gs, basis_states, spin_inversion)
print(rhos)
entropy = compute_entropy(rhos)
print(entropy)
print('-------------------------------------------')
entropies.append(entropy)
plt.figure(figsize=(12, 12))
plt.plot(params, entropies)
plt.legend()
plt.xlabel('Delta / J')
plt.ylabel('Bipartite Entanglement Entropy')
plt.title('Model:' + model_name + ' Number spins:' + str(number_spins))#, ' Periodic:' + str(periodic))
plt.grid(True)
plt.savefig('output/' + 'entropy' + timestr + '.jpg')
def test_area_law(number_spins, periodic, param_range):
model_name = 'xxz'
......@@ -116,4 +124,5 @@ if __name__ == "__main__":
param_range = args.param_range
number_spins = args.number_spins
periodic = args.periodic
test_area_law(number_spins, periodic, param_range)
#test_area_law(number_spins, periodic, param_range)
test_xxz()
\ No newline at end of file
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