Skip to content

Commit

Permalink
Optimisations
Browse files Browse the repository at this point in the history
Forgot to push the actual code I used in the thesis. Here it is
  • Loading branch information
aethrvmn committed Sep 18, 2021
1 parent b9440c7 commit dff5b10
Show file tree
Hide file tree
Showing 24 changed files with 14 additions and 168 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@

__pycache__/chain.cpython-39.pyc
__pycache__/logchain.cpython-39.pyc
__pycache__
Binary file removed Figures/Fixed/eta100.png
Binary file not shown.
File renamed without changes
Binary file removed Figures/Fixed/near_singlet100.png
Binary file not shown.
Binary file removed Figures/Fixed/near_singlet1000.png
Binary file not shown.
Binary file modified Figures/Matrix/midrg1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Figures/Matrix/midrg10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Figures/Matrix/midrg13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Figures/Matrix/midrg5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Figures/Matrix/singlet-phase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Figures/distance.png
Binary file not shown.
Binary file removed Figures/frog.png
Binary file not shown.
Binary file modified Figures/rg.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Ongoing Thesis Project

The goal of this code is to model the RG transformation for the 1d Random Antiferromagnetic Heisenberg Quantum Spin Chain.

# WIP
Binary file added Thesis.pdf
Binary file not shown.
Binary file removed __pycache__/chain.cpython-37.pyc
Binary file not shown.
Binary file removed __pycache__/testchain.cpython-39.pyc
Binary file not shown.
9 changes: 2 additions & 7 deletions chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class Random_chain:

version = "v5"

def __init__(self, bond_number, ceiling):
def __init__(self, bond_number):
self.length = int(bond_number)
self.ceiling = ceiling
self.ceiling = 1
self.matrix_creator()
self.bonds()

Expand Down Expand Up @@ -73,9 +73,4 @@ def rescale(self): # Second Step of the RG
def renormalization(self): # Self-explanatory
self.decimate()
self.rescale()
return self

def parameters(self): # Different physical parameters that can be calculated
self.distance = int(np.abs(self.right_index[1]-self.left_index[0]))
self.system_energy = -(1/4)*np.sum(self.bond_matrix[self.bond_matrix > 0])
return self
21 changes: 7 additions & 14 deletions test.py → flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
from chain import Random_chain
from tqdm import tqdm

plt.ion

length = 1000
matrix = Random_chain(length,1)
matrix = Random_chain(length)
eta = []

for i in tqdm(range(int(length/2))):
Expand All @@ -15,24 +17,15 @@
range=np.arange(len(eta))
sum = []

for i in tqdm(range):
for i in range:
sum = np.append(sum, np.sum(eta[i:]))

plt.figure(1)
plt.plot(np.sort(sum/sum.max()), linewidth=1)
plt.plot(1-np.exp(-range), '--r', linewidth=1)
plt.ylim(0.9, 1.01)
plt.xlim(420, 500)
plt.yscale('log')
plt.yticks([1,1])
plt.ylabel('Value of $\eta$ near the random singlet phase (rescaled)')
plt.xlabel('Iteration step')
plt.savefig('Figures/Fixed/near_singlet1000.png')

plt.figure(2)
plt.plot(np.sort(sum/sum.max()), linewidth=1)
plt.plot(1-np.exp(-range), '--r', linewidth=1)
plt.ylabel('Value of $\eta$ during the SDRG (rescaled)')
plt.xlabel('Iteration step')
plt.yscale('log')
plt.savefig('Figures/Fixed/eta1000.png')
plt.savefig('Figures/Fixed/eta_distribution.png')

plt.show()
40 changes: 0 additions & 40 deletions flow100.py

This file was deleted.

6 changes: 3 additions & 3 deletions matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from tqdm import tqdm

length = 30
matrix = Random_chain(length,1)
matrix = Random_chain(length)

fig = plt.figure()

Expand All @@ -31,8 +31,8 @@
img = plt.imshow(matrix.bond_matrix, interpolation='nearest', cmap=cmap, norm=norm, animated=True)
ims.append([img])

img.figure.savefig('Figures/Matrix/singlet-phase.png', pad_inches=0, transparent=True)

ani = animation.ArtistAnimation(fig, ims, interval=200, blit=True, repeat_delay=10000)
ani.save('Figures/rg.gif')

img.figure.savefig('Figures/Matrix/singlet-phase.png', pad_inches=0, transparent=True)
plt.show()
58 changes: 0 additions & 58 deletions parameters.py

This file was deleted.

4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
scipy
numpy
matplotlib
tqdm
seaborn
statsmodels
PyQt5
38 changes: 0 additions & 38 deletions test2.py

This file was deleted.

0 comments on commit dff5b10

Please sign in to comment.