Skip to content

Commit

Permalink
Compute conductivity for different chain lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
abogdanenko committed Apr 24, 2015
1 parent 60f01d1 commit d53e520
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
54 changes: 54 additions & 0 deletions ConductivityLongChain.sage
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
class ConductivityLongChain(object):
"""
Computes chain conductivity for chains of different lengths
"""
def __init__(self, max_chain_len = 3):
self.max_chain_len = max_chain_len
self.lengths = range(2, self.max_chain_len + 1)

def ComputeTimeEvolution(self):
"""
Computes time evolution and conductivity for each chain length
"""
self.num_list = []

for n in self.lengths:
space = Space(chain_len = n)
num = NumericalComputation(space)
num.ComputeTimeEvolution()
self.num_list.append(num)

self.conductivity = [num.Conductivity() for num in num_list]

def PlotConductivity(self):
"""
Returns line plot of chain conductivity
"""
l = zip(self.lengths, self.conductivity)
legend_label = r'$\langle\rho_{1,1}^{\rm sink}\rangle$'
labelx = r'$n$'
labely = r'$C$'

plot_object = line(l,
ymin = 0,
ymax = 1,
xmin = 0,
color = 'red',
tick_formatter = 'latex',
axes_labels = [labelx, labely],
legend_label = legend_label)

plot_object.set_legend_options(back_color = 'white')

return plot_object

def ShowConductivity(self):
"""
Shows line plot of chain conductivity
"""
html('<h2>Chain conductivity</h2>')
show(self.PlotConductivity())
24 changes: 24 additions & 0 deletions conductivity_long_chain.worksheet
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div style = "color:white;background-color:green">
<h1>Lindblad evolution of JCH model with sink</h1>
</div>

{{{
load('main.sage')
}}}

<div style = "color:white;background-color:green">
<h2>Chain conductivity analysis for long chains</h2>
</div>

{{{
con = ConductivityLongChain(max_chain_len = 4)
}}}

{{{
%time
con.ComputeTimeEvolution()
}}}

{{{
con.ShowConductivity()
}}}
1 change: 1 addition & 0 deletions main.sage
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ load('NumericalComputationInteractive.sage')
load('NumericalComputationAnimation.sage')
load('NumericalComputation.sage')
load('Conductivity.sage')
load('ConductivityLongChain.sage')

# alias
SymbolicComputation = SymbolicComputationInteractive
Expand Down

0 comments on commit d53e520

Please sign in to comment.