Error when using higher interpolation_factor

Dear developers,

I am testing the convergence of mobilities with interpolation_factor. For a interpolation_factor 30 I get the following error.

  Scattering process ended with error:
  Traceback (most recent call last):
    File "/amset/lib/python3.8/site-
 packages/amset/scattering/calculate.py", line 556, in
  scattering_worker
      rate = calculate_rate(
    File "/amset/lib/python3.8/site-
  packages/amset/scattering/calculate.py", line 679, in
  calculate_rate
      overlap = overlap_calculator.get_overlap(spin, b_idx, k,
  band_mask, k_primes)
    File "/amset/lib/python3.8/site-
  packages/amset/interpolation/wavefunction.py", line 112, in
  get_overlap
      overlap = _get_overlap_ncl(grid, data, v, self.data_shape[0])
    File "/amset/lib/python3.8/site-
  packages/numba/np/arrayobj.py", line 1613, in
  normalize_reshape_value
      raise ValueError("total size of new array must be unchanged")
  ValueError: total size of new array must be unchanged

  exiting


    ERROR: amset exiting on 14 Dec 2020 at 10:11
  Traceback (most recent call last):
    File "mob2.py", line 47, in <module>
      amset_data = runner.run()
    File "/amset/lib/python3.8/site-
  packages/amset/core/run.py", line 62, in run
      mem_usage, (amset_data, usage_stats) = memory_usage(
    File "/amset/lib/python3.8/site-
  packages/memory_profiler.py", line 336, in memory_usage
      returned = f(*args, **kw)
    File "/amset/lib/python3.8/site-
  packages/amset/core/run.py", line 117, in _run_wrapper
      amset_data, scattering_time = self._do_scattering(amset_data)
    File "/amset/lib/python3.8/site-
  packages/amset/core/run.py", line 271, in _do_scattering
      scatter.calculate_scattering_rates(), scatter.scatterer_labels
    File "/amset/lib/python3.8/site-
  packages/amset/scattering/calculate.py", line 359, in
  calculate_scattering_rates
      ) = self.calculate_band_rates(spin, b_idx)
    File "/amset/lib/python3.8/site-
  packages/amset/scattering/calculate.py", line 429, in
  calculate_band_rates
      ir_idx, elastic_rates[..., ir_idx] =
  self._get_rate_from_queue()
    File "/amset/lib/python3.8/site-
  packages/amset/scattering/calculate.py", line 497, in
  _get_rate_from_queue
      raise result[0]
  ValueError: total size of new array must be unchanged
,

I tired to increase the fd_tol , and cache_wavefunction: False but the error still persists. Also incresing the # of processors does not help.


also the convergence of mobility is very jumpy for interpolation factors 5,10,15,20,25. As shown in the image here:

https://drive.google.com/file/d/1M5eE-oE31WoqBkppuPKnlZmDtg5o5tWD/view?usp=sharing

Any thoughts will be helpful.

Best,
Alex

Hi Alex,

This is an unusual bug. Could you try (i) updating to the latest amset version, and (ii) if the error is still produced, can you paste the full amset log output?

I’m unable to view the attached image – it says access denied. However, there is no real reason that convergence should be smooth, so this is not something to worry about.

Best,
Alex

Thanks for the prompt response.

I will try with the latest version.

The convergence image should be viewable at the following.

https://drive.google.com/file/d/1M5eE-oE31WoqBkppuPKnlZmDtg5o5tWD/view?usp=sharing

What concerns me that even at a interpolation factor of 25 its hard to tell the actual mobility. Perhaps my starting DFT grid is not dense enough. :thinking:

But at very high DFT grid the wave-function file becomes too heavy to parse.

Thanks again.

Best
Alex

Just wanted to add - with the upgrade for the most part the error disappears.

in the latest version the error appears when using “cache_wavefunction: False” (see the pasted log below)… reverting back to cache_wavefunction: True; and increasing the fd_tol eliminated the error.

I have should mentioned this is somewhat big system (40 atoms).



  
         /$$$$$$  /$$      /$$  /$$$$$$  /$$$$$$$$ /$$$$$$$$
        /$$__  $$| $$$    /$$$ /$$__  $$| $$_____/|__  $$__/
       | $$  \ $$| $$$$  /$$$$| $$  \__/| $$         | $$
       | $$$$$$$$| $$ $$/$$ $$|  $$$$$$ | $$$$$      | $$
       | $$__  $$| $$  $$$| $$ \____  $$| $$__/      | $$
       | $$  | $$| $$\  $ | $$ /$$  \ $$| $$         | $$
       | $$  | $$| $$ \/  | $$|  $$$$$$/| $$$$$$$$   | $$
       |__/  |__/|__/     |__/ \______/ |________/   |__/
  
                                                    v0.4.3
  
      A. Ganose, J. Park, A. Faghaninia, R. Woods-Robinson,
      A. Jain, in prep.
  
  
  amset starting on 14 Dec 2020 at 18:57

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

  Run parameters:
    - scattering_type: ['IMP', 'ADP']
    - doping: [-1.e+12  1.e+12]
    - temperatures: [ 50 100 200 300 400 500]
    - soc: False
    - zero_weighted_kpoints: keep
    - interpolation_factor: 50
    - wavefunction_coefficients: wavefunction.h5
    - use_projections: False
    - free_carrier_screening: False
    - high_frequency_dielectric: 
        [[  1.69   0.00   0.00]
         [  0.00   2.25   0.00]
         [  0.00   0.00   1.12]]
    - static_dielectric: 
        [[  1.69   0.00   0.00]
         [  0.00   2.25   0.00]
         [  0.00   0.00   1.12]]
    - elastic_constant: 
        [[ 490.4    0.0    0.0    0.0    0.0    0.0]
         [   0.0  490.4    0.0    0.0    0.0    0.0]
         [   0.0    0.0  490.4    0.0    0.0    0.0]
         [   0.0    0.0    0.0  245.2    0.0    0.0]
         [   0.0    0.0    0.0    0.0  245.2    0.0]
         [   0.0    0.0    0.0    0.0    0.0  245.2]]
    - deformation_potential: deformation.h5
    - acceptor_charge: 1
    - donor_charge: 1
    - energy_cutoff: 1.0
    - fd_tol: 0.08
    - dos_estep: 0.01
    - symprec: 0.01
    - nworkers: -1
    - cache_wavefunction: False
    - calculate_mobility: True
    - separate_mobility: True
    - mobility_rates_only: False
    - file_format: yaml
    - write_input: True
    - write_mesh: True
    - print_log: True
    - write_log: True

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

  Structure information:
    - formula: P18H
    - # sites: 40
    - space group: Pma2

  Lattice:
    - a, b, c [angstrom]: 68.20, 3.30, 30.00
    - a, b, y [deg]: 90, 90, 90

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

  Input band structure information:
    - # bands: 120
    - # k-points: 51
    - Fermi level: -3.771 eV
    - spin polarized: False
    - metallic: False

  Band gap:
    - indirect band gap: 1.079 eV
    - direct band gap: 1.082 eV
    - direct k-point: [0.00, 0.00, 0.00]

  Valence band maximum:
    - energy: -3.908 eV
    - k-point: [0.00, 0.05, 0.00]
    - band indices: 96

  Conduction band minimum:
    - energy: -2.828 eV
    - k-point: [0.00, 0.00, 0.00]
    - band indices: 97

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

  Getting band interpolation coefficients
    - time: 0.2461 s

  Interpolation parameters:
    - k-point mesh: 9x195x21
    - energy cutoff: 1.0 eV

  Interpolating spin-up bands 87-108
    - time: 0.2518 s

  Generating tetrahedron mesh vertices
    - time: 0.2693 s

  Initializing tetrahedron band structure
    - time: 3.5484 s

  Initializing momentum relaxation time factor calculator

  Initializing wavefunction overlap calculator

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

  DOS parameters:
    - emin: -5.32 eV
    - emax: -1.01 eV
    - dos weight: 2
    - n points: 431

  Generating tetrahedral DOS:
    - time: 11.8476 s

  Intrinsic DOS Fermi level: -3.3679 eV

  DOS contains 18.483 electrons

  Calculated Fermi levels:

    conc [cm-3]    temp [K]    E_fermi [eV]
  -------------  ----------  --------------
      -1.00e+12        50.0         -2.9028
      -1.00e+12       100.0         -2.9785
      -1.00e+12       200.0         -3.1313
      -1.00e+12       300.0         -3.2854
      -1.00e+12       400.0         -3.3704
      -1.00e+12       500.0         -3.3732
       1.00e+12        50.0         -3.8372
       1.00e+12       100.0         -3.7628
       1.00e+12       200.0         -3.6118
       1.00e+12       300.0         -3.4590
       1.00e+12       400.0         -3.3752
       1.00e+12       500.0         -3.3735

  Calculated Fermi-Dirac cut-offs:
    - min: -4.101 eV
    - max: -2.577 eV

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

  Scattering mechanisms to be calculated: IMP, ADP

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

    conc [cm-3]    temp [K]    b2 [a^-2]    N_i [cm-3]
  -------------  ----------  -----------  ------------
      -1.00e+12        50.0     6.97e-09      1.00e+12
      -1.00e+12       100.0     3.49e-09      1.00e+12
      -1.00e+12       200.0     1.74e-09      1.00e+12
      -1.00e+12       300.0     1.16e-09      1.00e+12
      -1.00e+12       400.0     1.25e-08      1.44e+13
      -1.00e+12       500.0     2.50e-07      3.59e+14
       1.00e+12        50.0     6.97e-09      1.00e+12
       1.00e+12       100.0     3.49e-09      1.00e+12
       1.00e+12       200.0     1.74e-09      1.00e+12
       1.00e+12       300.0     1.16e-09      1.00e+12
       1.00e+12       400.0     1.25e-08      1.44e+13
       1.00e+12       500.0     2.50e-07      3.59e+14

  Initializing deformation potential interpolator

  Forking 28 processes to calculate scattering
    - time: 6.2712 s

  Scattering information:
    - # ir k-points: 5390

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

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

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

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

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

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

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

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

  Calculating rates for spin-up band 9
    - # k-points within Fermi-Dirac cut-offs: 4536

  Scattering process ended with error:
  Traceback (most recent call last):
    File "/amset/lib/python3.8/site-
  packages/amset/scattering/calculate.py", line 556, in 
  scattering_worker
      rate = calculate_rate(
    File "/amset/lib/python3.8/site-
  packages/amset/scattering/calculate.py", line 679, in 
  calculate_rate
      overlap = overlap_calculator.get_overlap(spin, b_idx, k, 
  band_mask, k_primes)
    File "/amset/lib/python3.8/site-
  packages/amset/interpolation/wavefunction.py", line 112, in 
  get_overlap
      overlap = _get_overlap_ncl(grid, data, v, self.data_shape[0])
    File "/amset/lib/python3.8/site-
  packages/numba/np/arrayobj.py", line 1613, in 
  normalize_reshape_value
      raise ValueError("total size of new array must be unchanged")
  ValueError: total size of new array must be unchanged
  
  exiting

  
    ERROR: amset exiting on 13 Dec 2020 at 22:05
  Traceback (most recent call last):
    File "mob50.py", line 46, in <module>
      amset_data = runner.run()
    File "/amset/lib/python3.8/site-
  packages/amset/core/run.py", line 62, in run
      mem_usage, (amset_data, usage_stats) = memory_usage(
    File "/amset/lib/python3.8/site-
  packages/memory_profiler.py", line 336, in memory_usage
      returned = f(*args, **kw)
    File "/amset/lib/python3.8/site-
  packages/amset/core/run.py", line 117, in _run_wrapper
      amset_data, scattering_time = self._do_scattering(amset_data)
    File "/amset/lib/python3.8/site-
  packages/amset/core/run.py", line 271, in _do_scattering
      scatter.calculate_scattering_rates(), scatter.scatterer_labels
    File "/amset/lib/python3.8/site-
  packages/amset/scattering/calculate.py", line 359, in 
  calculate_scattering_rates
      ) = self.calculate_band_rates(spin, b_idx)
    File "/amset/lib/python3.8/site-
  packages/amset/scattering/calculate.py", line 429, in 
  calculate_band_rates
      ir_idx, elastic_rates[..., ir_idx] = 
  self._get_rate_from_queue()
    File "/amset/lib/python3.8/site-
  packages/amset/scattering/calculate.py", line 497, in 
  _get_rate_from_queue
      raise result[0]
  ValueError: total size of new array must be unchanged

Thanks for the information. Can I check a few more things about your system?

  1. Are you using spin-orbit coupling in your DFT calculation?
  2. Are you including symmetry in your DFT calculation? It looks like the wavefunction file (wavefunction.h5) you are using already covers the full BZ already, not just the irreducible k-points. I think this could either be due to no symmetry your DFT calculation, or use of an old version of amset to extract the wavefunction coefficients. If your DFT calculation has no symmetry then this would explain why the WAVECAR is too heavy to parse. If not, I would try re-extracting the wavefunction coefficients using the latest amset version.

Just a note: I wouldn’t necessarily put a lot of faith in the 100 K mobilities. At that temperature quantum effects could be important, and the transport results will be extremely sensitive to the very fine details at the band edge, especially at 10$^{12}$ carriers. Unless you are using GW band structures then your results could be way off.

For your convergence I would probably look at 200 K and above, at which point the trend becomes much more reasonable.

Also, nice job on finding the convergence plotting script! I will add documentation on all the plotting tools soon.

1 Like

Hi Alex ,

Thanks for super-helpful pointers.
This was a non spin-orbit coupling DFT calculations, but I had set ISYM = 0 , to make vasp work. Using a better structure with full symmetry on makes all things better.

Thanks for the info about temperature sensitivity of mobilities - I will stick to above 200 K for my calculations.

Just want to pick your brain on one more things- Do you think it is OKAY to use amset for mobility predictions in 2D, and 1D (such as nano ribbons) materials if I have elastic properties. I am interesting in comparing mobiliies in 1D, 2D and 3D variants of a materials. Just wanted to know if there are any limitations of amset when it comes to low dimensional systems.

Thanks for developing this awesome code, and thank you for your valuable time.

Best,
Alex

Dear Alex,
when I am running the command amset deform read (undeformed) (deform1) (deform2) …
I am getting following error :
Reading bulk (undeformed) calculation
Reading deformation calculation in s1
Reading deformation calculation in s2
Reading deformation calculation in s3
Reading deformation calculation in s4
Reading deformation calculation in s5
Reading deformation calculation in s6
Reading deformation calculation in s7
Reading deformation calculation in s8
Reading deformation calculation in s9
Reading deformation calculation in s10

Spacegroup: R3̅m (166)

Found 10 strains:

  • [ 0.005 0.000 0.000 0.000 0.000 0.000]
  • [-0.005 0.000 0.000 0.000 0.000 0.000]
  • [ 0.000 0.005 0.000 0.000 0.000 0.000]
  • [ 0.000 -0.005 0.000 0.000 0.000 0.000]
  • [ 0.000 0.000 0.005 0.000 0.000 0.000]
  • [ 0.000 0.000 -0.005 0.000 0.000 0.000]
  • [ 0.000 0.000 0.000 0.005 0.000 0.000]
  • [ 0.000 0.000 0.000 -0.005 0.000 0.000]
  • [ 0.000 0.000 0.000 0.000 0.005 0.000]
  • [ 0.000 0.000 0.000 0.000 0.000 0.005]
    Traceback (most recent call last):
    File “/home/kanchana/.local/bin/amset”, line 8, in
    sys.exit(cli())
    File “/home/kanchana/.local/lib/python3.6/site-packages/click/core.py”, line 829, in call
    return self.main(*args, **kwargs)
    File “/home/kanchana/.local/lib/python3.6/site-packages/click/core.py”, line 782, in main
    rv = self.invoke(ctx)
    File “/home/kanchana/.local/lib/python3.6/site-packages/click/core.py”, line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/kanchana/.local/lib/python3.6/site-packages/click/core.py”, line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/kanchana/.local/lib/python3.6/site-packages/click/core.py”, line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/kanchana/.local/lib/python3.6/site-packages/click/core.py”, line 610, in invoke
    return callback(*args, **kwargs)
    File “/home/kanchana/.local/lib/python3.6/site-packages/amset/tools/deformation.py”, line 168, in read
    bulk_structure, strain_mapping, symprec=symprec
    File “/home/kanchana/.local/lib/python3.6/site-packages/amset/deformation/potentials.py”, line 69, in get_symmetrized_strain_mapping
    calc[“bandstructure”], symprec=symprec
    File “/home/kanchana/.local/lib/python3.6/site-packages/amset/electronic_structure/symmetry.py”, line 205, in expand_bandstructure
    return_mapping=True,
    File “/home/kanchana/.local/lib/python3.6/site-packages/amset/electronic_structure/symmetry.py”, line 122, in expand_kpoints
    structure, symprec=symprec, time_reversal=time_reversal
    File “/home/kanchana/.local/lib/python3.6/site-packages/amset/electronic_structure/symmetry.py”, line 177, in get_reciprocal_point_group_operations
    rotations = sga.get_symmetry_dataset()[“rotations”].transpose((0, 2, 1))
    TypeError: ‘NoneType’ object is not subscriptable

can you please comment on what could be the source of error ?

Thank you.