diff --git a/INSTALL.rst b/INSTALL.rst index d1a34ec2503cb112c5b104af323b9ddaa2e10990..f1c298d9cba119e5bd8bc87931f2867ab2b4e11d 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -19,9 +19,10 @@ Prerequisites ============= Building Kwant requires - * `Python <https://www.python.org>`_ 3.4 or above (Kwant 1.1 is the last + * `Python <https://www.python.org/>`_ 3.4 or above (Kwant 1.1 is the last version to support Python 2), - * `SciPy <http://scipy.org>`_ 0.11 or newer, + * `NumPy <http://numpy.org/>`_ 1.8.1 or newer, + * `SciPy <http://scipy.org/>`_ 0.13.3 or newer, * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_, (For best performance we recommend the free `OpenBLAS <http://www.openblas.net/>`_ or the nonfree `MKL @@ -32,8 +33,8 @@ Building Kwant requires C++. The following software is highly recommended though not strictly required: - * `matplotlib <http://matplotlib.org/>`_ 1.2 or newer, for Kwant's - plotting module and the tutorial, + * `matplotlib <http://matplotlib.org/>`_ 1.3.1 or newer, for the module `kwant.plotter` and the tutorial, + * `SymPy <http://sympy.org/>`_ 0.7.6 or newer, for the subpackage `kwant.continuum`. * `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library that will in many cases speed up Kwant several times and reduce the memory footprint. (Kwant uses only the sequential, single core version diff --git a/kwant/physics/leads.py b/kwant/physics/leads.py index 89a325f368fddee22e74743d607987a4b02f7869..aadb568b5be2f3b265283d9dff65a8769fd5a3e9 100644 --- a/kwant/physics/leads.py +++ b/kwant/physics/leads.py @@ -25,20 +25,6 @@ dot = np.dot __all__ = ['selfenergy', 'modes', 'PropagatingModes', 'StabilizedModes'] -if np.__version__ >= '1.8': # skip coverage - complex_any = np.any -else: - def complex_any(array): - """Check if a complex array has nonzero entries. - - This function is needed due to a bug in numpy<1.8. - """ - # TODO: Remove separate checking of real and imaginary parts once we - # depend on numpy>=1.8 (it is present due to a bug in earlier - # versions). - return np.any(array.real) or np.any(array.imag) - - # TODO: Once Kwant depends on numpy >= 1.11, remove the fix with warnings.catch_warnings(): warnings.simplefilter("ignore") @@ -264,7 +250,7 @@ def setup_linsys(h_cell, h_hop, tol=1e6, stabilization=None): if stabilization is not None: stabilization = list(stabilization) - if not complex_any(h_hop): # skip coverage + if not np.any(h_hop): # skip coverage # Inter-cell hopping is zero. The current algorithm is not suited to # treat this extremely singular case. raise ValueError("Inter-cell hopping is exactly zero.") @@ -1062,7 +1048,7 @@ def modes(h_cell, h_hop, tol=1e6, stabilization=None, *, if h_cell.shape != (n, n): raise ValueError("Incompatible matrix sizes for h_cell and h_hop.") - if not complex_any(h_hop): + if not np.any(h_hop): wf = np.zeros((n, 0)) v = np.zeros((m, 0)) m = np.zeros((0, 0)) diff --git a/setup.py b/setup.py index c90f2eb489f1d30199cc210aad985849e9a7dba2..99808397ccd30a097cd36727b7ac11eb50dce76d 100755 --- a/setup.py +++ b/setup.py @@ -634,9 +634,9 @@ def main(): 'build_tut': build_tut, 'test': test}, ext_modules=exts, - install_requires=['numpy > 1.6.1', 'scipy >= 0.11.0', 'tinyarray'], + install_requires=['numpy >= 1.8.1', 'scipy >= 0.13.3', 'tinyarray'], extras_require={ - 'plotting': 'matplotlib >= 1.2', + 'plotting': 'matplotlib >= 1.3.1', # Ubuntu 16.04 is the oldest supported distro with python3-sympy 'continuum': 'sympy >= 0.7.6', },