kwant.solvers.mumps – High performance sparse solver based on MUMPS

This solver uses MUMPS. (Only the sequential, single core version of MUMPS is used.) MUMPS is a very efficient direct sparse solver that can take advantage of memory beyond 3GiB for the solution of large problems. Furthermore, it offers a choice of several orderings of the input matrix some of which can speed up a calculation significantly.

Compared with the default solver, this module adds several options that may be used to fine-tune performance. Otherwise the interface is identical. These options can be set and queried with the following functions.

kwant.solvers.mumps.options(nrhs=None, ordering=None, sparse_rhs=None)[source]

Modify some options. Return the old options.

  • nrhs (number) – number of right hand sides that should be solved simultaneously. A value around 5-10 gives optimal performance on many machines. If memory is an issue, it can be set to 1, to minimize memory usage (at the cost of slower performance). Default value is 6.

  • ordering (string) –

    one of the ordering methods supported by the MUMPS solver (see kwant.linalg.mumps. The availability of certain orderings depends on the MUMPS installation.), or ‘kwant_decides’. If ordering=='kwant_decides', the ordering that typically gives the best performance is chosen from the available ones. One can also defer the choice of ordering to MUMPS by specifying ‘auto’, in some cases MUMPS however chooses poorly.

    The choice of ordering can significantly influence the performance and memory impact of the solve phase. Typically the nested dissection orderings ‘metis’ and ‘scotch’ are most suited for physical systems. Default is ‘kwant_decides’

  • sparse_rhs (True or False) – whether to use a sparse right hand side in the solve phase of MUMPS. Preliminary tests have not shown a significant performance increase when this feature is used, but this needs more looking into. Default value is False.


old_options – dictionary containing the previous options.

Return type



Thanks to this method returning the old options as a dictionary it is easy to change some options temporarily:

>>> saved_options = kwant.solvers.mumps.options(nrhs=12)
>>> some_code()
>>> kwant.solvers.mumps.options(**saved_options)

Set the options to default values. Return the old options.

Previous topic

kwant.solvers.sparse – Basic sparse matrix solver

Next topic

3.6. kwant.operator – Operators and Observables

This Page