Tag Info

Time and memory required to diagonalize a 18000 by 18000 matrix using numpy in python

A 20000 by 20000 double-precision complex matrix requires $20000 \times 20000 \times 8 \times 2=6.4 \mbox{gigabytes}$ of RAM. The LAPACK routines ZHEEV that will do the work for you will store the ...
• 18.8k

What algorithm(s) do numpy and scipy use to calculate matrix inverses?

Documentation to numpy.linalg.inv and scipy.linalg.inv does not mention the algorithm used. Judging from the source, ...
Accepted

• 2,665
Accepted

Performing a random walk on a lattice that traps the particles

This can be solved much more efficiently if you recast the problem as finding the mean first passage time (MFPT) of a Markov chain for a given starting state. You can easily represent the random walk ...
• 3,994

Fast Automatic Differentiation for numpy?

Jax has the features you're looking for. See https://jax.readthedocs.io/en/latest/notebooks/quickstart.html
• 148

Moore-Penrose pseudoinverse of singular rank degenerate matrix

75k x 75k double-precision entries is 45 gigabytes. That fits in memory, but barely; you need to be careful. The linear algebra routines in most languages rely on Lapack as a backend, which is a ...
• 11.6k
Accepted

Implementing structured grid boundary conditions using NumPy arrays?

The Numpy function $roll$ performs periodic shift of an array. Using it, the explicit time step for your PDE in a periodic domain can be simply implemented like this: ...
• 2,575
Accepted

Fast nonzero indices per row/column for (sparse) 2D numpy array

Ideally you would have the matrix already in a sparse matrix data structure. But for this example we can do the conversion via ...
• 2,104