netket.optimizer.solver.pinv_smooth(A, b, rcond=1e-14, rcond_smooth=1e-14, x0=None)[source]#

Solve the linear system by building a pseudo-inverse from the eigendecomposition obtained from jax.numpy.linalg.eigh().

The eigenvalues \(\lambda_i\) smaller than \(r_\textrm{cond} \lambda_\textrm{max}\) are truncated (where \(\lambda_\textrm{max}\) is the largest eigenvalue).

The eigenvalues are further smoothed with another filter, originally introduced in Medvidovic, Sels arXiv:2212.11289 (2022), given by the following equation



In general, we found that this custom implementation of the pseudo-inverse outperform jax’s pinv(). This might be because pinv() internally calls svd, while this solver internally uses eigh.

For that reason, we suggest you use this solver instead of pinv.

  • A – LinearOperator (matrix)

  • b – vector or Pytree

  • rcond – Cut-off ratio for small singular values of A. For the purposes of rank determination, singular values are treated as zero if they are smaller than rcond times the largest singular value of A.

  • rcond_smooth – regularization parameter used with a similar effect to rcond but with a softer curve. See \(\epsilon\) in the formula above.