Commit 2d921848 authored by Adel Kara Slimane's avatar Adel Kara Slimane
Browse files

Merge remote-tracking branch 'upstream/master' into energy-params

parents c39b1bc0 4361658f
Pipeline #33799 failed with stages
in 14 minutes and 30 seconds
......@@ -27,40 +27,52 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " epub3 to make an epub3"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
@echo " dummy to check syntax errors of document sources"
@echo " htmlfast to make standalone HTML files without examples"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " epub3 to make an epub3"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
@echo " dummy to check syntax errors of document sources"
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
.PHONY: clean
clean:
rm -rf $(BUILDDIR)/*
rm -rf source/reference/generated
rm -rf source/examples
rm -rf $(ROOT_DIR)/source/examples
.PHONY: htmlfast
htmlfast:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: html
html:
ln -s $(ROOT_DIR)/examples $(ROOT_DIR)/source/examples
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
......
......@@ -51,14 +51,14 @@ def main():
sites = [site.pos[0] for site in syst.sites]
density_operator = kwant.operator.Density(syst)
occupation = manybody.make_occupation()
occupation = manybody.lead_occupation()
spectra = kwant_spectrum.spectra(syst.leads)
boundaries = leads.automatic_boundary(spectra, tmax=400)
Interval = functools.partial(manybody.Interval, quadrature='gausslegendre')
Interval = functools.partial(manybody.Interval, quadrature='gausslegendre', order=10)
intervals = manybody.calc_intervals(spectra, occupation, interval_type=Interval)
intervals = manybody.split_intervals(intervals, 15)
tasks = manybody.calc_tasks(intervals, spectra, occupation)
psi_init = manybody.calc_initial_manybody_state(syst, tasks, boundaries)
psi_init = manybody.calc_initial_state(syst, tasks, boundaries)
wave_function = manybody.WaveFunction(psi_init, tasks)
......
......@@ -2,7 +2,6 @@ from math import sin, pi
import warnings
import time as timer
import matplotlib.pyplot as plt
from mpi4py import MPI
with warnings.catch_warnings():
warnings.simplefilter('ignore')
......@@ -11,7 +10,8 @@ with warnings.catch_warnings():
def am_master():
return MPI.COMM_WORLD.rank == 0
"""Return true for the MPI master rank"""
return tkwant.mpi.get_communicator().rank == 0
def plot_currents(times, current):
......@@ -40,13 +40,13 @@ def make_system(length):
lat = kwant.lattice.chain(norbs=1)
syst = kwant.Builder()
syst[map(lat, range(length + 2))] = 2
syst[map(lat, range(length + 2))] = 1
syst[lat.neighbors()] = -1
syst[lat(0)] = syst[lat(length)] = barrier
lead = kwant.Builder(kwant.TranslationalSymmetry((-1,)))
lead[lat(0)] = 2
lead[lat(0)] = 1
lead[lat.neighbors()] = -1
syst.attach_lead(lead)
......@@ -75,12 +75,9 @@ def main():
if am_master():
kwant.plot(syst)
# equal occupation for all lead
occupation = tkwant.manybody.make_occupation(chemical_potential)
# Create the solver
solver = tkwant.manybody.State(fsyst, tmax, occupation, params=params)
solver.refine_intervals(rtol=3E-1, atol=3E-1) # require only low accuracy
# TODO: remove refine=False when doc needs less time to build
solver = tkwant.manybody.State(fsyst, tmax, params=params, refine=False)
# observables
left_lead_interface = [(lat(length + 1), lat(length))]
......
Examples
========
Find below several example problems, highlighting different aspects of tkwant:
:ref:`closed_system`
:ref:`open_system`
:ref:`restarting`
:ref:`alternative_boundary_conditions`
:ref:`voltage_raise`
:ref:`AC_josephson_without_superconductivity`
:ref:`mach_zehnder`.
:ref:`1d_wire`
:ref:`1d_wire_wave_function`
:ref:`1d_wire_onsite`
Examples
========
.. toctree::
examples
......@@ -153,16 +153,16 @@ _ = plt.plot([-pi, pi], [chemical_potential] * 2, 'k--') # fermi energy
# we will only calculate the contribution from lead 0, under the
# assumption that the effect of the perturbation on the scattering
# states originating from other leads will be negligible
occupation = [None] * len(syst.leads)
occupation[0] = tkwant.manybody.make_occupation(chemical_potential, bands=0)
occupation = tkwant.manybody.lead_occupation(chemical_potential, bands=0)
occupations = [occupation, None, None, None]
spectra = kwant_spectrum.spectra(syst.leads)
Interval = ft.partial(manybody.Interval, order=15)
intervals = manybody.calc_intervals(spectra, occupation, interval_type=Interval)
intervals = manybody.calc_intervals(spectra, occupations, interval_type=Interval)
intervals = manybody.split_intervals(intervals, 28)
boundaries = tkwant.leads.automatic_boundary(spectra, tmax)
tasks = manybody.calc_tasks(intervals, spectra, occupation)
psi_init = manybody.calc_initial_manybody_state(syst, tasks, boundaries,
tasks = manybody.calc_tasks(intervals, spectra, occupations)
psi_init = manybody.calc_initial_state(syst, tasks, boundaries,
params={'syst_args': syst_args})
# do the actual tkwant simulation
......
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