quimb.tensor.belief_propagation.diis

Classes

ArrayInfo

Vectorizer

Object for mapping back and forth between any nested pytree of arrays

DIIS

Direct Inversion in the Iterative Subspace (DIIS) method (AKA Pulay

DIISPyscf

Thin wrapper around the PySCF DIIS implementation to handle arbitrary

Module Contents

class quimb.tensor.belief_propagation.diis.ArrayInfo(shape, size)
__slots__ = ('shape', 'size')
shape
size
__repr__()
class quimb.tensor.belief_propagation.diis.Vectorizer(tree=None, backend=None)

Object for mapping back and forth between any nested pytree of arrays or Tensors and a single flat vector.

Parameters:

tree (pytree of array, optional) – Any nested container of arrays, which will be flattened and packed into a single vector.

infos = None
d = None
ref_tree = None
backend = None
_concatenate = None
_reshape = None
setup(tree)
pack(tree)

Take arrays and pack their values into attribute .{name}, by default .vector.

unpack(vector)

Turn the single, flat vector into a sequence of arrays.

__repr__()
class quimb.tensor.belief_propagation.diis.DIIS(max_history=6, beta=1.0, rcond=1e-14)

Direct Inversion in the Iterative Subspace (DIIS) method (AKA Pulay mixing) [1] for converging fixed-point iterations.

[1] P. Pulay, Convergence acceleration of iterative sequences. The case of SCF iteration, 1980, Elsevier, https://doi.org/10.1016/0009-2614(80)80396-4.

Parameters:
  • max_history (int) – Maximum number of previous guesses to use in extrapolation.

  • beta (float) – Mixing parameter, 0.0 means only use input guesses, 1.0 means only use extrapolated guesses (original Pulay mixing). Default is 1.0.

  • rcond (float) – Cutoff for small singular values in the pseudo-inverse of the B matrix. Default is 1e-14.

max_history = 6
beta = 1.0
rcond = 1e-14
vectorizer
guesses = [None, None, None, None, None, None]
errors = [None, None, None, None, None, None]
lambdas = []
head = 5
backend = None
B = None
y = None
scalar = None
_extrapolate()
update(y)

Given new output y[i] (the result of f(x[i])), update the internal state and return the extrapolated next guess x[i+1].

Parameters:

y (pytree of array) – The output of the function f(x). Can be any arbitrary nested tree structure with arrays treated at leaves.

Returns:

xnext – The next guess x[i+1] to pass to the function f(x), with the same tree structure as y.

Return type:

pytree of array

class quimb.tensor.belief_propagation.diis.DIISPyscf(max_history=6)

Thin wrapper around the PySCF DIIS implementation to handle arbitrary pytrees of arrays, for testing purposes.

pdiis
vectorizer
update(y)