kwant issueshttps://gitlab.kwant-project.org/kwant/kwant/-/issues2023-04-19T21:01:55Zhttps://gitlab.kwant-project.org/kwant/kwant/-/issues/424Wrong example in `kwant.kpm.conductivity` docstring2023-04-19T21:01:55ZDániel VarjasWrong example in `kwant.kpm.conductivity` docstringThe example given in the docstring of `kwant.kpm.conductivity` gives nonsense result. Should use the example in the [tutorial](https://kwant-project.org/doc/dev/tutorial/kpm) instead. The tutorial example uses KPM vectors deep in the bul...The example given in the docstring of `kwant.kpm.conductivity` gives nonsense result. Should use the example in the [tutorial](https://kwant-project.org/doc/dev/tutorial/kpm) instead. The tutorial example uses KPM vectors deep in the bulk, while the docstring example uses random vectors everywhere, giving a poorly averaged result with the default 10 random vectors.https://gitlab.kwant-project.org/kwant/kwant/-/issues/400Missing imaginary unit from the definition of the source operator2021-01-26T20:39:46ZJakub ZeleznyMissing imaginary unit from the definition of the source operatorAs far as I can say, in the documentation for the Source operator, an imaginary unit is missing in the definition: the expression given in the documentation should be multiplied by i. This should be there because otherwise the commutator...As far as I can say, in the documentation for the Source operator, an imaginary unit is missing in the definition: the expression given in the documentation should be multiplied by i. This should be there because otherwise the commutator would not be Hermitian. In the source code the commutator is in fact multiplied by i, if I'm understanding it correctly.
I also don't understand why is a Hermitian conjugate of the H_i taken for the definition of the source operator. Shouldn't the Hamiltonian matrix be Hermitian?https://gitlab.kwant-project.org/kwant/kwant/-/issues/388Incorrect array shape in magnetic_gauge2020-09-23T17:08:23ZAnton AkhmerovIncorrect array shape in magnetic_gaugeIn [these lines](https://gitlab.kwant-project.org/kwant/kwant/-/blob/master/kwant/physics/gauge.py#L687-688) if the list is empty, a numpy array is created with an incorrect shape, and the assignment fails.In [these lines](https://gitlab.kwant-project.org/kwant/kwant/-/blob/master/kwant/physics/gauge.py#L687-688) if the list is empty, a numpy array is created with an incorrect shape, and the assignment fails.https://gitlab.kwant-project.org/kwant/kwant/-/issues/377Kwant does not release the GIL when calling Mumps2020-05-07T15:30:45ZJoseph WestonKwant does not release the GIL when calling MumpsTitle is pretty self-explanatory.
The fix should just be applying [`with nogil`](https://cython.readthedocs.io/en/latest/src/userguide/external_C_code.html#nogil) to [this line](https://gitlab.kwant-project.org/kwant/kwant/-/blob/master...Title is pretty self-explanatory.
The fix should just be applying [`with nogil`](https://cython.readthedocs.io/en/latest/src/userguide/external_C_code.html#nogil) to [this line](https://gitlab.kwant-project.org/kwant/kwant/-/blob/master/kwant/linalg/_mumps.pyx#L151).
Only thing to watch out for is if this gives degraded performance on very small systems.https://gitlab.kwant-project.org/kwant/kwant/-/issues/376Add a dos method to PropagatingModes2020-04-18T10:00:23ZAnton AkhmerovAdd a dos method to PropagatingModesIt's mostly a convenience method for summing all inverse velocities with a proper prefactor.It's mostly a convenience method for summing all inverse velocities with a proper prefactor.https://gitlab.kwant-project.org/kwant/kwant/-/issues/363Improve instructions for setting up a development environment2020-03-19T01:03:56ZJoseph WestonImprove instructions for setting up a development environmentThe instructions for setting up a dev environment are scattered across 2 pages: [Setting up for Development](https://kwant-project.org/contribute#setting-up-for-development) and [Building and Installting from Source](https://kwant-projec...The instructions for setting up a dev environment are scattered across 2 pages: [Setting up for Development](https://kwant-project.org/contribute#setting-up-for-development) and [Building and Installting from Source](https://kwant-project.org/doc/1/pre/install#building-and-installing-from-source)
Neither of those places mention that the simplest ways to get set up are:
+ Conda: `conda env create -f docker/kwant-latest.yml && conda activate kwant-latest`
+ Docker: `docker build -t kwant docker/Docker.conda && docker run kwant`
These instructions could also be recommended for running the latest development version of Kwant (unless we finally squash #339(
We can of course keep the esoteric instructions for people who do not want to use the Conda package manager/Docker, but IMO we should not forget that most people do not have strong opinions about what package manager to use (e.g. Debian vs Conda); they just want the simplest way to get everything working.https://gitlab.kwant-project.org/kwant/kwant/-/issues/362update documentation building instructions2020-03-19T02:38:09ZJoseph Westonupdate documentation building instructions#360 points out that our documentation is not super easy to follow.
IMO we should not even mention building PDF documentation, as HTML documentation can meet 99% of people's needs.#360 points out that our documentation is not super easy to follow.
IMO we should not even mention building PDF documentation, as HTML documentation can meet 99% of people's needs.https://gitlab.kwant-project.org/kwant/kwant/-/issues/341Discretizer doesn't work with numpy arrays in locals2019-12-20T10:01:48ZDániel VarjasDiscretizer doesn't work with numpy arrays in localsHere is a minimal example, where discretizer fails with a numpy array in `locals`. This is relevant for more complicated cases, where the matrix coefficient can't be easily expressed in terms of Pauli matrices, like higher spin matrices....Here is a minimal example, where discretizer fails with a numpy array in `locals`. This is relevant for more complicated cases, where the matrix coefficient can't be easily expressed in terms of Pauli matrices, like higher spin matrices.
```python
sz = np.diag([1, -1])
subs={'sz': sz}
ham="""
Bz * sz
"""
kwant.continuum.discretize(ham, locals=subs, coords=['x', 'y'])
```
The problem is, it calls `sympy.sympify` on every value in `locals` which returns an `ImmutableDenseNDimArray` which doesn't have the same interface as other `sympy` expressions. A solution is to pass `sympy.Matrix(sz)` instead. This is inconvenient and not clear from the docs or the error message why this error occurs.
The solution is simple, one needs to test for numpy arrays and cast them to sympy matrices separately. I implemented it in this `qsymm` [MR](https://gitlab.kwant-project.org/qt/qsymm/merge_requests/14) which uses a copy of `kwant.continuum.common`, so porting that solution here would be straightforward.https://gitlab.kwant-project.org/kwant/kwant/-/issues/340Use sphinx directives in docstrings to denote when a feature was added / depr...2019-11-28T14:19:51ZJoseph WestonUse sphinx directives in docstrings to denote when a feature was added / deprecatedI often find it useful when browsing the documentation to know when a particular feature was added / deprecated.
Sphinx has [directives](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-versionadded)...I often find it useful when browsing the documentation to know when a particular feature was added / deprecated.
Sphinx has [directives](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-versionadded) for marking this.
We would essentially need to look over the "whatsnew" files and annotate the docstrings of the corresponding functionality with `.. versionadded`.https://gitlab.kwant-project.org/kwant/kwant/-/issues/325Update the QSymm test suite to specify shape and format to empty models2019-11-04T12:02:35ZJoseph WestonUpdate the QSymm test suite to specify shape and format to empty modelsWhen running the test suite with the latest Qsymm I get the following DeprecationWarnings:
```
...
kwant/tests/test_qsymm.py::test_real_space_basis
kwant/tests/test_qsymm.py::test_real_space_basis
/home/jbw/.local/miniconda/envs/kwant...When running the test suite with the latest Qsymm I get the following DeprecationWarnings:
```
...
kwant/tests/test_qsymm.py::test_real_space_basis
kwant/tests/test_qsymm.py::test_real_space_basis
/home/jbw/.local/miniconda/envs/kwant-latest/lib/python3.6/site-packages/qsymm/model.py:225: DeprecationWarning: Provide `shape` and `format` when initializing empty Model.
warn('Provide `shape` and `format` when initializing empty Model.', DeprecationWarning)
```
WeKwant 1.5https://gitlab.kwant-project.org/kwant/kwant/-/issues/259Switch discrete symmetry types to Enum2019-02-09T22:04:35ZAnton AkhmerovSwitch discrete symmetry types to EnumThe following discussion from !257 should be addressed:
- [ ] @anton-akhmerov started a [discussion](https://gitlab.kwant-project.org/kwant/kwant/merge_requests/257#note_21139): (+1 comment)
> @jbweston I'm wondering if we should ...The following discussion from !257 should be addressed:
- [ ] @anton-akhmerov started a [discussion](https://gitlab.kwant-project.org/kwant/kwant/merge_requests/257#note_21139): (+1 comment)
> @jbweston I'm wondering if we should make symmetries also an `Enum` class (probably outside of this MR).futurehttps://gitlab.kwant-project.org/kwant/kwant/-/issues/234Improve html representation of discretizer's builders2019-11-28T14:39:32ZAnton AkhmerovImprove html representation of discretizer's buildersHere is what we have now (as of v1.4.0a1):
![image](/uploads/b4f8ed42c49384a463b71d57586befe7/image.png)
Several improvements come to mind:
- It's already an html representation, we could sparingly apply a couple of tags
- We should me...Here is what we have now (as of v1.4.0a1):
![image](/uploads/b4f8ed42c49384a463b71d57586befe7/image.png)
Several improvements come to mind:
- It's already an html representation, we could sparingly apply a couple of tags
- We should mention that this is a template builder produced by discretization
- We should hide the internal names and expose the parameters that this builder expects, as well as the number of d.o.f.Kwant 1.4.xhttps://gitlab.kwant-project.org/kwant/kwant/-/issues/216Implement resistance matrix2019-02-09T22:09:32ZAnton AkhmerovImplement resistance matrixVery frequently the users need to compute different multi-terminal resistances ($`σ_{xy}`$ for example).
This requires either performing an inverse (either of a subblock or a pseudoinverse) of the conductance matrix.
Additionally we no...Very frequently the users need to compute different multi-terminal resistances ($`σ_{xy}`$ for example).
This requires either performing an inverse (either of a subblock or a pseudoinverse) of the conductance matrix.
Additionally we now offer an easy way to compute the scattering in presence of Andreev reflection, but our conductance matrix does not treat the Andreev reflections properly.futurehttps://gitlab.kwant-project.org/kwant/kwant/-/issues/136plotter.spectrum: better compute bands2020-10-22T08:30:47ZAnton Akhmerovplotter.spectrum: better compute bandsThere are several things we could consider:
* Allowing to select a sub-range of bands and to use sparse diagonalization (appropriate for large unit cells of a lead or spectra of closed systems).
* Do a better job resolving level crossing...There are several things we could consider:
* Allowing to select a sub-range of bands and to use sparse diagonalization (appropriate for large unit cells of a lead or spectra of closed systems).
* Do a better job resolving level crossings once we depend on Debian stretch (see the [blog post](https://quantumtinkerer.tudelft.nl/blog/connecting-the-dots/) outlining the algorithm). This one especially leads to better quality plots.
* Perhaps utilize conservation laws if present (both for computation and representation of the bands).Kwant 1.5Anton AkhmerovAnton Akhmerov