pyblock.numerical¶
pyblock.numerical.davidson¶
Davidson diagonalization algorithm.
-
exception
pyblock.numerical.davidson.
DavidsonError
¶ Bases:
Exception
-
class
pyblock.numerical.davidson.
Matrix
(arr)¶ Bases:
object
General interface of Matrix for Davidson algorithm.
-
apply
(other, result)¶ Perform \(\hat{H}|\psi\rangle\).
- Args:
- other : Vector
- Input vector.
- result : Vector
- Output vector.
-
diag
()¶ Diagonal elements.
-
diag_norm
()¶
-
-
class
pyblock.numerical.davidson.
Vector
(arr, factor=1.0)¶ Bases:
object
General interface of Vector for Davidson algorithm
-
clear_copy
()¶ Return a deep copy of this object, but all the matrix elements are set to zero.
-
copy
()¶ Return a deep copy of this object.
-
deallocate
()¶ Deallocate the memory associated with this object. This is no-op for numpy.ndarray backend used here.
-
dot
(other)¶ Dot product.
-
normalize
()¶ Normalization.
-
precondition
(ld, diag)¶ Apply precondition on this object.
- Args:
- ld : float
- Eigenvalue.
- diag : numpy.ndarray
- Diagonal elements of Hamiltonian, stored in 1D array.
-
ref
¶
-
-
pyblock.numerical.davidson.
davidson
(a, b, k, max_iter=500, conv_thold=5e-06, deflation_min_size=2, deflation_max_size=30, iprint=False, mpi=False)¶ Davidson diagonalization.
- Args:
- a : Matrix
- The matrix to diagonalize.
- b : list(Vector)
- The initial guesses for eigenvectors.
- Kwargs:
- max_iter : int
- Maximal number of davidson iteration.
- conv_thold : float
- Convergence threshold for squared norm of eigenvector.
- deflation_min_size : int
- Sub-space size after deflation.
- deflation_max_size : int
- Maximal sub-space size before deflation.
- iprint : bool
- Indicate whether davidson iteration information should be printed.
- Returns:
- ld : list(float)
- List of eigenvalues.
- b : list(Vector)
- List of eigenvectors.
-
pyblock.numerical.davidson.
olsen_precondition
(q, c, ld, diag)¶ Olsen precondition.