tkwant.manybody.add_boundstates

tkwant.manybody.add_boundstates(solver, boundstate_psi, boundstate_tasks)[source]

Add a sequence of boundstates to the manybody solver

Parameters
  • solver (tkwant.manybody.WaveFunction) – Manybody solver to which the boundstates should be added.

  • boundstate_psi (dict of tkwant.onebody.WaveFunction) – Dictionary with all boundstate wavefunctions. A dict key must be unique and present only on one MPI rank. For load balancing the dictionary should be distributed over all MPI ranks.

  • boundstate_tasks (dict of tkwant.onebody.Task) –

    Each element in the dict represents a single boundstate state. An element must have at least the following attribute:

    • weight : float, weighting factor

    boundstate_tasks must include all boundstates stored in boundstate_psi (all keys must be identical) and must be the same on all MPI ranks. Moreover, the keys of the boundstates dicts (boundstate_tasks and boundstate_psi) must not be present in solver.

Notes

solver is modified in place. Only when the error “boundstate key=.. already present in solver” occurs, solver has not been modified. If any other exception is raised in this function however, there is no guarantee that the solver has not been modified.