Commit bc63427c authored by Kloss's avatar Kloss
Browse files

move examples in separate dir and symlink

parent 1d0a9f8d
......@@ -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)
......
......@@ -76,8 +76,8 @@ def main():
kwant.plot(syst)
# Create the solver
solver = tkwant.manybody.State(fsyst, tmax, params=params)
# solver.refine_intervals() # TODO: include, when doc has changed
# 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
========
.. 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