numpy.linalg.LinAlgError: SVD did not converge for IMP

Dear developers and users,
I have some issues with calculating the scattering rate using the IMP mechanism. The complete output of AMSET is below. The transport calculation fails since the rate is nan for IMP. fine, agree with it!

Reason for nan: The calculated impurity concentration (N_i): is zero for -1E13 at 100 K and considerable value at other temperatures. So I expect nan for -1E13 at 100 in further calculation steps and some values for other temperatures.

  Inverse screening length (b) and impurity concentration (N_i):

    conc [cm-3]    temp [K]    b2 [a^-2]    N_i [cm-3]
  -------------  ----------  -----------  ------------
      -1.00e+13       100.0     4.13e-15     3.17e-107
      -1.00e+13       200.0     5.89e-09      2.00e+13
      -1.00e+13       300.0     3.93e-09      2.00e+13
      -1.00e+13       400.0     2.94e-09      2.00e+13
      -1.00e+13       500.0     2.36e-09      2.00e+13
       1.00e+13       100.0     1.18e-08      2.00e+13
       1.00e+13       200.0     5.89e-09      2.00e+13
       1.00e+13       300.0     3.93e-09      2.00e+13
       1.00e+13       400.0     2.94e-09      2.00e+13
       1.00e+13       500.0     2.36e-09      2.00e+13

But I get nan for all T and doping concentration

  Filling scattering rates [s⁻¹] outside FD cutoffs with:

    conc [cm-3]    temp [K]       ADP       IMP       PIE       POP
  -------------  ----------  --------  --------  --------  --------
      -1.00e+13       100.0  1.33e+14  1.00e-32  9.19e+11  3.88e+14
      -1.00e+13       200.0  2.65e+14       nan  1.84e+12  7.45e+14
      -1.00e+13       300.0  3.98e+14       nan  2.76e+12  1.11e+15
      -1.00e+13       400.0  5.30e+14       nan  3.68e+12  1.48e+15
      -1.00e+13       500.0  6.63e+14       nan  4.59e+12  1.85e+15
       1.00e+13       100.0  1.33e+14       nan  9.19e+11  3.88e+14
       1.00e+13       200.0  2.65e+14       nan  1.84e+12  7.45e+14
       1.00e+13       300.0  3.98e+14       nan  2.76e+12  1.11e+15
       1.00e+13       400.0  5.30e+14       nan  3.68e+12  1.48e+15
       1.00e+13       500.0  6.63e+14       nan  4.59e+12  1.85e+15

Here are a few questions about AMSET operations:

  1. Why the N_i [cm-3] (see above table) is always 2 times of conc [cm-3]?
  2. How N_i [cm-3] is calculated from input conc [cm-3]?
  3. Why does IMP turn to nan?

The complete output:

         /$$$$$$  /$$      /$$  /$$$$$$  /$$$$$$$$ /$$$$$$$$
        /$$__  $$| $$$    /$$$ /$$__  $$| $$_____/|__  $$__/
       | $$  \ $$| $$$$  /$$$$| $$  \__/| $$         | $$
       | $$$$$$$$| $$ $$/$$ $$|  $$$$$$ | $$$$$      | $$
       | $$__  $$| $$  $$$| $$ \____  $$| $$__/      | $$
       | $$  | $$| $$\  $ | $$ /$$  \ $$| $$         | $$
       | $$  | $$| $$ \/  | $$|  $$$$$$/| $$$$$$$$   | $$
       |__/  |__/|__/     |__/ \______/ |________/   |__/

                                                    v0.4.22

      Ganose, A. M., Park, J., Faghaninia, A., Woods-Robinson,
      R., Persson, K. A., Jain, A. Efficient calculation of
      carrier scattering rates from first principles.
      Nat. Commun. 12, 2222 (2021)


  amset starting on 19 Feb 2025 at 07:45


  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SETTINGS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Run parameters:
    - scattering_type: auto
    - doping: [-1.e+13  1.e+13]
    - temperatures: [100. 200. 300. 400. 500.]
    - scissor: 0.0
    - bandgap: 2.75
    - soc: False
    - zero_weighted_kpoints: prefer
    - interpolation_factor: 50
    - wavefunction_coefficients: wavefunction.h5
    - use_projections: False
    - unity_overlap: False
    - free_carrier_screening: False
    - high_frequency_dielectric:
        [[  2.32   0.00   0.00]
         [  0.00   2.32   0.00]
         [  0.00   0.00   1.27]]
    - static_dielectric:
        [[  6.85   0.00   0.00]
         [  0.00   6.85   0.00]
         [  0.00   0.00   1.29]]
    - elastic_constant:
        [[   6.2    2.2   -0.1    0.0    0.0    0.0]
         [   2.2    6.2   -0.1    0.0   -0.0    0.0]
         [   0.1    0.1    0.2    0.0    0.0    0.0]
         [   0.0    0.0    0.0    2.0    0.0    0.0]
         [   0.0    0.0    0.0    0.0   -0.1    0.0]
         [   0.0    0.0    0.0    0.0    0.0   -0.1]]
    - deformation_potential: deformation.h5
    - piezoelectric_constant:
        [[ 0.0000  0.0000  0.0000  0.0141  0.0000  0.0009]
         [ 0.0141 -0.0141  0.0000  0.0000  0.0009  0.0000]
         [-0.0056 -0.0056 -0.0027  0.0000  0.0000  0.0000]]
    - defect_charge: 1
    - compensation_factor: 2
    - pop_frequency: 2.06
    - energy_cutoff: 1.5
    - fd_tol: 0.05
    - dos_estep: 0.01
    - symprec: 0.01
    - nworkers: -1
    - cache_wavefunction: True
    - calculate_mobility: True
    - separate_mobility: True
    - mobility_rates_only: False
    - file_format: json
    - write_input: False
    - write_mesh: True
    - print_log: True
    - write_log: True


  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ STRUCTURE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Structure information:
    - formula: PbIBr
    - # sites: 3
    - space group: P3m1

  Lattice:
    - a, b, c [angstrom]: 4.49, 4.49, 24.49
    - a, b, y [deg]: 90, 90, 120


  ~~~~~~~~~~~~~~~~~~~~~~~~~~ BAND STRUCTURE ~~~~~~~~~~~~~~~~~~~~~~~~~

  Input band structure information:
    - # bands: 20
    - # k-points: 16
    - Fermi level: -4.227 eV
    - spin polarized: False
    - metallic: False

  Band gap:
    - indirect band gap: 2.771 eV
    - direct band gap: 3.061 eV
    - direct k-point: [0.00, 0.00, 0.00]

  Valence band maximum:
    - energy: -4.452 eV
    - k-point: [0.18, 0.09, -0.00]
    - band indices: 14

  Conduction band minimum:
    - energy: -1.681 eV
    - k-point: [0.00, 0.00, 0.00]
    - band indices: 15


  ~~~~~~~~~~~~~~~~~~~~~~~~~~ INTERPOLATION ~~~~~~~~~~~~~~~~~~~~~~~~~~

  Getting band interpolation coefficients
    - time: 0.0311 s

  Interpolation parameters:
    - k-point mesh: 51x51x9
    - energy cutoff: 1.5 eV

  Interpolating spin-up bands 9-17
    - time: 0.2811 s

  bandgap set to 2.750 eV, applying scissor of -0.001 eV

  Generating tetrahedron mesh vertices
    - time: 0.1163 s

  Initializing tetrahedron band structure
    - time: 0.6736 s

  Initializing momentum relaxation time factor calculator

  Initializing wavefunction overlap calculator

  Desymmetrizing k-point mesh
    - Found initial mesh: 11.000 x 11.000 x 1.000
    - Integer mesh: 11 x 11 x 1
    - Using 12 symmetry operations

  Desymmetrizing wavefunction coefficients
    - time: 0.1465 s


  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DOS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  DOS parameters:
    - emin: -7.19 eV
    - emax: 0.37 eV
    - dos weight: 2
    - n points: 756

  Generating tetrahedral DOS:
    - time: 3.3582 s

  Intrinsic DOS Fermi level: -3.0562 eV

  DOS contains 11.983 electrons

  Calculated Fermi levels:

    conc [cm-3]    temp [K]    E_fermi [eV]
  -------------  ----------  --------------
      -1.00e+13       100.0         -4.1643
      -1.00e+13       200.0         -1.9114
      -1.00e+13       300.0         -2.0404
      -1.00e+13       400.0         -2.1727
      -1.00e+13       500.0         -2.3075
       1.00e+13       100.0         -4.2923
       1.00e+13       200.0         -4.1371
       1.00e+13       300.0         -3.9775
       1.00e+13       400.0         -3.8153
       1.00e+13       500.0         -3.6513

  Calculated Fermi-Dirac cut-offs:
    - min: -4.658 eV
    - max: -1.415 eV


  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SCATTERING ~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Examining material properties to determine possible scattering
  mechanisms

  Scattering mechanisms to be calculated: ADP, IMP, PIE, POP

  Initializing deformation potential interpolator

  Inverse screening length (b) and impurity concentration (N_i):

    conc [cm-3]    temp [K]    b2 [a^-2]    N_i [cm-3]
  -------------  ----------  -----------  ------------
      -1.00e+13       100.0     4.13e-15     3.17e-107
      -1.00e+13       200.0     5.89e-09      2.00e+13
      -1.00e+13       300.0     3.93e-09      2.00e+13
      -1.00e+13       400.0     2.94e-09      2.00e+13
      -1.00e+13       500.0     2.36e-09      2.00e+13
       1.00e+13       100.0     1.18e-08      2.00e+13
       1.00e+13       200.0     5.89e-09      2.00e+13
       1.00e+13       300.0     3.93e-09      2.00e+13
       1.00e+13       400.0     2.94e-09      2.00e+13
       1.00e+13       500.0     2.36e-09      2.00e+13

  Initializing POP scattering
    - average N_po: 2.5718
    - w_po: 12.94 2pi THz
    - hbar.omega: 0.0085 eV

  Forking 80 processes to calculate scattering
    - time: 1.5018 s

  Scattering information:
    - # ir k-points: 11705

  Calculating rates for spin-up band 1
    - # k-points within Fermi-Dirac cut-offs: 0
    - time: 0.0271 s

  Calculating rates for spin-up band 2
    - # k-points within Fermi-Dirac cut-offs: 0
    - time: 0.0145 s

  Calculating rates for spin-up band 3
    - # k-points within Fermi-Dirac cut-offs: 0
    - time: 0.0134 s

  Calculating rates for spin-up band 4
    - # k-points within Fermi-Dirac cut-offs: 0
    - time: 0.0127 s

  Calculating rates for spin-up band 5
    - # k-points within Fermi-Dirac cut-offs: 0
    - time: 0.0135 s

  Calculating rates for spin-up band 6
    - # k-points within Fermi-Dirac cut-offs: 18972
    - time: 221.7924 s

  Calculating rates for spin-up band 7
    - # k-points within Fermi-Dirac cut-offs: 1089
    - time: 5.8023 s

  Calculating rates for spin-up band 8
    - # k-points within Fermi-Dirac cut-offs: 0
    - time: 0.0080 s

  Calculating rates for spin-up band 9
    - # k-points within Fermi-Dirac cut-offs: 0
    - time: 0.0076 s

  Interpolating missing scattering rates
    - time: 0.1609 s

  Filling scattering rates [s⁻¹] outside FD cutoffs with:

    conc [cm-3]    temp [K]       ADP       IMP       PIE       POP
  -------------  ----------  --------  --------  --------  --------
      -1.00e+13       100.0  1.33e+14  1.00e-32  9.19e+11  3.88e+14
      -1.00e+13       200.0  2.65e+14       nan  1.84e+12  7.45e+14
      -1.00e+13       300.0  3.98e+14       nan  2.76e+12  1.11e+15
      -1.00e+13       400.0  5.30e+14       nan  3.68e+12  1.48e+15
      -1.00e+13       500.0  6.63e+14       nan  4.59e+12  1.85e+15
       1.00e+13       100.0  1.33e+14       nan  9.19e+11  3.88e+14
       1.00e+13       200.0  2.65e+14       nan  1.84e+12  7.45e+14
       1.00e+13       300.0  3.98e+14       nan  2.76e+12  1.11e+15
       1.00e+13       400.0  5.30e+14       nan  3.68e+12  1.48e+15
       1.00e+13       500.0  6.63e+14       nan  4.59e+12  1.85e+15


  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TRANSPORT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Calculating conductivity, Seebeck, and electronic thermal
  conductivity


    ERROR: amset exiting on 19 Feb 2025 at 07:49
  Traceback (most recent call last):
    File "/home/mv27lepe/.local/bin/amset", line 10, in <module>
      sys.exit(cli())
               ^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/click/core.py", line 1161, in __call__
      return self.main(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/click/core.py", line 1082, in main
      rv = self.invoke(ctx)
           ^^^^^^^^^^^^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/click/core.py", line 1697, in invoke
      return _process_result(sub_ctx.command.invoke(sub_ctx))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/click/core.py", line 1443, in invoke
      return ctx.invoke(self.callback, **ctx.params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/click/core.py", line 788, in invoke
      return __callback(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/amset/tools/run.py", line 139, in run
      runner.run()
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/amset/core/run.py", line 65, in run
      mem_usage, (amset_data, usage_stats) = memory_usage(
                                             ^^^^^^^^^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/memory_profiler.py", line 379, in memory_usage
      returned = f(*args, **kw)
                 ^^^^^^^^^^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/amset/core/run.py", line 124, in _run_wrapper
      amset_data, timing = self._do_fd_tol(amset_data, directory,
  prefix, timing)

  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/amset/core/run.py", line 135, in _do_fd_tol
      amset_data, transport_time = self._do_transport(amset_data)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/amset/core/run.py", line 282, in _do_transport
      transport_properties = solve_boltzman_transport_equation(
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/amset/core/transport.py", line 39, in
  solve_boltzman_transport_equation
      sigma, seebeck, kappa = _calculate_transport_properties(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/amset/core/transport.py", line 186, in
  _calculate_transport_properties
      sigma[n, t], seebeck[n, t], kappa[n, t], _ =
  calc_Onsager_coefficients(

  ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/mv27lepe/.local/lib/python3.11/site-
  packages/BoltzTraP2/bandlib.py", line 539, in
  calc_Onsager_coefficients
      pL11 = np.linalg.pinv(L11[iT, imu])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/cluster/stages/2024.0/spack-0.22/opt/spack/linux-rocky8-
  cascadelake/gcc-11.4.0/python-3.11.7-
  qfpdtq2pisspwunkuc4fqloxqo2ltw6j/lib/python3.11/site-
  packages/numpy/linalg/linalg.py", line 2022, in pinv
      u, s, vt = svd(a, full_matrices=False, hermitian=hermitian)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/cluster/stages/2024.0/spack-0.22/opt/spack/linux-rocky8-
  cascadelake/gcc-11.4.0/python-3.11.7-
  qfpdtq2pisspwunkuc4fqloxqo2ltw6j/lib/python3.11/site-
  packages/numpy/linalg/linalg.py", line 1681, in svd
      u, s, vh = gufunc(a, signature=signature, extobj=extobj)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/cluster/stages/2024.0/spack-0.22/opt/spack/linux-rocky8-
  cascadelake/gcc-11.4.0/python-3.11.7-
  qfpdtq2pisspwunkuc4fqloxqo2ltw6j/lib/python3.11/site-
  packages/numpy/linalg/linalg.py", line 121, in
  _raise_linalgerror_svd_nonconvergence
      raise LinAlgError("SVD did not converge")
  numpy.linalg.LinAlgError: SVD did not converge

any comment and suggestion is highly appreciated

Thank you

Best regards,
Muthu