tkwant issueshttps://gitlab.kwant-project.org/kwant/tkwant/-/issues2023-09-13T14:53:21Zhttps://gitlab.kwant-project.org/kwant/tkwant/-/issues/9New setup.py causes incomplete installation2023-09-13T14:53:21ZDaniel HauckNew setup.py causes incomplete installationThe new setup process looks much cleaner now, but sadly it causes an incomplete installation for me.
**Steps to reproduce**
1. Create fresh virtualenv
2. Run `pip install .`
**Result**
```shell
> find $VENV/lib/python3.9/site-package...The new setup process looks much cleaner now, but sadly it causes an incomplete installation for me.
**Steps to reproduce**
1. Create fresh virtualenv
2. Run `pip install .`
**Result**
```shell
> find $VENV/lib/python3.9/site-packages/tkwant
$VENV/lib/python3.9/site-packages/tkwant
$VENV/lib/python3.9/site-packages/tkwant/onebody
$VENV/lib/python3.9/site-packages/tkwant/onebody/kernels.cpython-39-x86_64-linux-gnu.so
$VENV/lib/python3.9/site-packages/tkwant/onebody/solvers.cpython-39-x86_64-linux-gnu.so
```https://gitlab.kwant-project.org/kwant/tkwant/-/issues/8Scipy import in setup.py breaks simple pip install2023-08-11T12:23:17ZDaniel HauckScipy import in setup.py breaks simple pip installDue to the unused `import scipy.integrate` in `setup.py` it is required to have scipy installed *before* starting to install twkant.
This is also an issue, when a package depends on twkant as simple listing scipy and tkwant as dependenc...Due to the unused `import scipy.integrate` in `setup.py` it is required to have scipy installed *before* starting to install twkant.
This is also an issue, when a package depends on twkant as simple listing scipy and tkwant as dependencies does not work, because setup.py is run before installing everything to collect information about the package.https://gitlab.kwant-project.org/kwant/tkwant/-/issues/7problem with boundaries2023-02-14T21:52:06ZKlossproblem with boundariesimport tkwant
import kwant
import kwantspectrum
import functools
import numpy as np
import scipy
import cmath
import sys
import pickle
import logging
#tkwant.logging.level = logging.INFO # possible levels (increasing verbosity): WAR...import tkwant
import kwant
import kwantspectrum
import functools
import numpy as np
import scipy
import cmath
import sys
import pickle
import logging
#tkwant.logging.level = logging.INFO # possible levels (increasing verbosity): WARNING, INFO, DEBUG
u = 0
dim = 12
nsweep = 4
# --- MPI helper routines
def am_master():
"""Return true for the MPI master rank"""
return tkwant.mpi.get_communicator().rank == 0
def print_master(*args, **kwargs):
if am_master():
print(*args, **kwargs)
sys.stdout.flush()
# --- Non-interacting Kwant system
def gaussian(time, t0=40, A=1.57, sigma=24):
return A * (1 + scipy.special.erf((time - t0) / sigma))
# time dependent coupling with gaussian pulse
def coupling_nn(site1, site2, time):
return - cmath.exp(- 1j * gaussian(time))
def make_system(L=400):
# system building
lat = kwant.lattice.square(a=1, norbs=1)
syst = kwant.Builder()
# central scattering region
syst[(lat(x, 0) for x in range(L))] = 1
syst[lat.neighbors()] = -1
# time dependent coupling between two sites in the center
syst[lat(L // 2, 0), lat(L // 2 - 1, 0)] = coupling_nn
# add leads
sym = kwant.TranslationalSymmetry((-1, 0))
lead_left = kwant.Builder(sym)
lead_left[lat(0, 0)] = 1
lead_left[lat.neighbors()] = -1
syst.attach_lead(lead_left)
syst.attach_lead(lead_left.reversed())
return syst, lat
syst, lat = make_system()
syst = syst.finalized()
idx = tkwant.system.siteId(syst, lat)
sites = [site.pos[0] for site in syst.sites]
times = [40, 80, 120, 160]
# calculate the spectrum E(k) for all leads
spectra = kwantspectrum.spectra(syst.leads)
# set the chemical potential in the leads
occupations = tkwant.manybody.lead_occupation(chemical_potential=-1)
emin, emax = tkwant.manybody.calc_energy_cutoffs(occupations)
# define boundary conditions
bdr = tkwant.leads.automatic_boundary(spectra, tmax=max(times), emin=emin, emax=emax)https://gitlab.kwant-project.org/kwant/tkwant/-/issues/3environment.yml does not contain kwant-spectrum, which is a required dependency2020-06-28T17:57:43ZJoseph Westonenvironment.yml does not contain kwant-spectrum, which is a required dependencyThis is needed to get a working development environmentThis is needed to get a working development environmenthttps://gitlab.kwant-project.org/kwant/tkwant/-/issues/2explicitly specify number of orbitals when creating site families (lattices)2020-06-28T17:56:18ZJoseph Westonexplicitly specify number of orbitals when creating site families (lattices)It is now deprecated to create kwant site families (lattices) without specifying the number of orbitals
This is mostly a concern for the tests, but there may be also places in tkwant itself where we need to fix this.It is now deprecated to create kwant site families (lattices) without specifying the number of orbitals
This is mostly a concern for the tests, but there may be also places in tkwant itself where we need to fix this.https://gitlab.kwant-project.org/kwant/tkwant/-/issues/1[Fedora][Install] setup.py not detecting already installed mpi4py python module2019-04-24T15:45:06ZAdel Kara Slimane[Fedora][Install] setup.py not detecting already installed mpi4py python moduleHello,
I am writing you about some troubles getting tkwant to install on a Fedora 29 distribution.
Basically, running
```shell
$ sudo python3 setup.py install
```
works till this error happens
```shell
Searching for mpi4py>=2.0
Reading...Hello,
I am writing you about some troubles getting tkwant to install on a Fedora 29 distribution.
Basically, running
```shell
$ sudo python3 setup.py install
```
works till this error happens
```shell
Searching for mpi4py>=2.0
Reading https://pypi.org/simple/mpi4py/
Downloading https://files.pythonhosted.org/packages/55/a2/c827b196070e161357b49287fa46d69f25641930fd5f854722319d431843/mpi4py-3.0.1.tar.gz#sha256=6549a5b81931303baf6600fa2e3bc04d8bd1d5c82f3c21379d0d64a9abcca851
Best match: mpi4py 3.0.1
Processing mpi4py-3.0.1.tar.gz
Writing /tmp/easy_install-q8ufhczb/mpi4py-3.0.1/setup.cfg
Running mpi4py-3.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-q8ufhczb/mpi4py-3.0.1/egg-dist-tmp-zgw26_11
/usr/bin/ld: cannot find -llmpe
collect2: error: ld returned 1 exit status
/usr/bin/ld: cannot find -lvt-mpi
collect2: error: ld returned 1 exit status
/usr/bin/ld: cannot find -lvt.mpi
collect2: error: ld returned 1 exit status
/usr/bin/ld: cannot find -lvt-mpi
collect2: error: ld returned 1 exit status
/usr/bin/ld: cannot find -lvt.mpi
collect2: error: ld returned 1 exit status
/usr/bin/ld: cannot find -lvt-hyb
collect2: error: ld returned 1 exit status
/usr/bin/ld: cannot find -lvt.ompi
collect2: error: ld returned 1 exit status
_configtest.c:2:10: fatal error: mpi.h: No such file or directory
#include <mpi.h>
^~~~~~~
compilation terminated.
```
Apparently two things are happening
- The install script didn't detect an mpi4py install, thus tries to install it himself.
- The install process of the downloaded mpi4py fails because of a lacking C library.
Although I have installed mpi4py, mpich and openmpi with the distro package manager (dnf). The script didn't detect them: there are two python packages for mpi4py, the mpich-based `python3-mpi4py-mpich` package and the openmpi-based `python3-mpi4py-openmpi`. The install script seems to detect neither of them and I can't find a fix by myself.
I can import mpi4py on my shell if I load a module first (it was written [here](https://pypi.org/project/mpi4py/))
```shell
$ module load mpi/openmpi-x86_64
$ python3 -c "import mpi4py"
```
or
```shell
$ module load mpi/mpich-x86_64
$ python3 -c "import mpi4py"
```
Another fix I can do, that would probably work, is to add for example mpich's folder to the environement for the C compiler to find it when installing mpi4py over the install I already have. Because in C, to include `mpi.h` I should do `#include <mpich-x86_64/mpi.h>`
If you have any suggestion I'd be happy to try!
Thank you.