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 ...@@ -27,40 +27,52 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help .PHONY: help
help: help:
@echo "Please use \`make <target>' where <target> is one of" @echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files" @echo " htmlfast to make standalone HTML files without examples"
@echo " dirhtml to make HTML files named index.html in directories" @echo " html to make standalone HTML files"
@echo " singlehtml to make a single large HTML file" @echo " dirhtml to make HTML files named index.html in directories"
@echo " pickle to make pickle files" @echo " singlehtml to make a single large HTML file"
@echo " json to make JSON files" @echo " pickle to make pickle files"
@echo " htmlhelp to make HTML files and a HTML help project" @echo " json to make JSON files"
@echo " qthelp to make HTML files and a qthelp project" @echo " htmlhelp to make HTML files and a HTML help project"
@echo " applehelp to make an Apple Help Book" @echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project" @echo " applehelp to make an Apple Help Book"
@echo " epub to make an epub" @echo " devhelp to make HTML files and a Devhelp project"
@echo " epub3 to make an epub3" @echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " epub3 to make an epub3"
@echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " man to make manual pages" @echo " text to make text files"
@echo " texinfo to make Texinfo files" @echo " man to make manual pages"
@echo " info to make Texinfo files and run them through makeinfo" @echo " texinfo to make Texinfo files"
@echo " gettext to make PO message catalogs" @echo " info to make Texinfo files and run them through makeinfo"
@echo " changes to make an overview of all changed/added/deprecated items" @echo " gettext to make PO message catalogs"
@echo " xml to make Docutils-native XML files" @echo " changes to make an overview of all changed/added/deprecated items"
@echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " xml to make Docutils-native XML files"
@echo " linkcheck to check all external links for integrity" @echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " linkcheck to check all external links for integrity"
@echo " coverage to run coverage check of the documentation (if enabled)" @echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " dummy to check syntax errors of document sources" @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 .PHONY: clean
clean: clean:
rm -rf $(BUILDDIR)/* rm -rf $(BUILDDIR)/*
rm -rf source/reference/generated 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 .PHONY: html
html: html:
ln -s $(ROOT_DIR)/examples $(ROOT_DIR)/source/examples
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo @echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html." @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
......
...@@ -51,14 +51,14 @@ def main(): ...@@ -51,14 +51,14 @@ def main():
sites = [site.pos[0] for site in syst.sites] sites = [site.pos[0] for site in syst.sites]
density_operator = kwant.operator.Density(syst) density_operator = kwant.operator.Density(syst)
occupation = manybody.make_occupation() occupation = manybody.lead_occupation()
spectra = kwant_spectrum.spectra(syst.leads) spectra = kwant_spectrum.spectra(syst.leads)
boundaries = leads.automatic_boundary(spectra, tmax=400) 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.calc_intervals(spectra, occupation, interval_type=Interval)
intervals = manybody.split_intervals(intervals, 15) intervals = manybody.split_intervals(intervals, 15)
tasks = manybody.calc_tasks(intervals, spectra, occupation) 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) wave_function = manybody.WaveFunction(psi_init, tasks)
......
...@@ -76,8 +76,8 @@ def main(): ...@@ -76,8 +76,8 @@ def main():
kwant.plot(syst) kwant.plot(syst)
# Create the solver # Create the solver
solver = tkwant.manybody.State(fsyst, tmax, params=params) # TODO: remove refine=False when doc needs less time to build
# solver.refine_intervals() # TODO: include, when doc has changed solver = tkwant.manybody.State(fsyst, tmax, params=params, refine=False)
# observables # observables
left_lead_interface = [(lat(length + 1), lat(length))] 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 ...@@ -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 # we will only calculate the contribution from lead 0, under the
# assumption that the effect of the perturbation on the scattering # assumption that the effect of the perturbation on the scattering
# states originating from other leads will be negligible # states originating from other leads will be negligible
occupation = [None] * len(syst.leads) occupation = tkwant.manybody.lead_occupation(chemical_potential, bands=0)
occupation[0] = tkwant.manybody.make_occupation(chemical_potential, bands=0) occupations = [occupation, None, None, None]
spectra = kwant_spectrum.spectra(syst.leads) spectra = kwant_spectrum.spectra(syst.leads)
Interval = ft.partial(manybody.Interval, order=15) 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) intervals = manybody.split_intervals(intervals, 28)
boundaries = tkwant.leads.automatic_boundary(spectra, tmax) boundaries = tkwant.leads.automatic_boundary(spectra, tmax)
tasks = manybody.calc_tasks(intervals, spectra, occupation) tasks = manybody.calc_tasks(intervals, spectra, occupations)
psi_init = manybody.calc_initial_manybody_state(syst, tasks, boundaries, psi_init = manybody.calc_initial_state(syst, tasks, boundaries,
params={'syst_args': syst_args}) params={'syst_args': syst_args})
# do the actual tkwant simulation # 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