Commit e7810f94 authored by Adel Kara Slimane's avatar Adel Kara Slimane
Browse files

Add rst file to energy example in doc/

Add small comment improvements in quantum_dot.py
parent b7b016fe
Pipeline #34419 failed with stages
in 23 minutes and 6 seconds
......@@ -132,7 +132,7 @@ def main():
# Initialize the solver (to solve t-dep SEQ)
solver = tkwant.manybody.State(syst, tmax, occupation, params={'t0': t0, 'ε0': ε0, 'Δε': Δε}, error_op=energy_density_op)
# Have the system evolve forward in time, calculating the operator over the system
energy_current = []
energy_source = []
energy_density = []
......@@ -141,13 +141,14 @@ def main():
heat_current_right = []
energy_current_divergence = []
# Have the system evolve forward in time, calculate the operator's expectation values at each time step
start = timer.perf_counter()
for time in times:
# evolve scattering states in time
solver.evolve(time)
solver.refine_intervals(atol=1E-6, rtol=1E-6)
# ignore kwant's warnings
energy_current.append(solver.evaluate(energy_current_op))
energy_source.append(solver.evaluate(energy_source_op))
energy_density.append(solver.evaluate(energy_density_op))
......@@ -191,7 +192,7 @@ def main():
label = "$\\partial_t \\varepsilon_1 + I^E_{0,1} + I^E_{2,1}$", linestyle='None',
marker='.', markersize=6, markevery=4)
# The previous curve doesn't superimpose over the source one because the time step isn't small enough,
# making the time step smaller makes the calculation last longer unfrotunately.
# making the time step smaller makes the calculation last longer unfortunately.
plt.xlabel('time $[\\hbar / \\Gamma]$')
plt.ylabel('Energy flux $[\\Gamma^2 / \\hbar]$')
plt.legend()
......
:orphan:
.. _quantum_dot:
Quantum dot
===========
**tkwant features highlighted**
- Calculation of energy quantities: current, density, source, heat current
The code can be also found in
:download:`quantum_dot.py <quantum_dot.py>`.
.. jupyter-execute::
:hide-code:
# prevent problems with figures from the first code
import matplotlib.pyplot as plt
%matplotlib inline
.. jupyter-execute:: quantum_dot.py
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