eigval0
Computes the groud state energy of a Hermitian operator on a block by using an iterative Lanczos algorithm. This function is a shortcut for the eigvals_lanczos function. We refer to eigvals_lanczos for further details on the algorithm and the convergence criterion.
The algorithm can be run either on-the-fly (matrix-free) or using a sparse matrix in the compressed-sparse-row format (see CSRMatrix).
Sources: sparse_diag.hpp · sparse_diag.cpp
Definition
On-the-fly
Sparse matrix
Parameters
| Name | Description | Default |
|---|---|---|
| ops | OpSum or CSRMatrix defining a Hermitian operator | |
| block | block on which the operator is defined | |
| precision | accuracy of the computed ground state | 1e-12 |
| max_iterations | maximum number of iterations | 1000 |
| random_seed | random seed for setting up the initial vector | 42 |
Returns
| Type | Description |
|---|---|
| real number | lowest lying eigenvalue of ops |
Usage Example
int N = 8;
int nup = N / 2;
auto block = Spinhalf(N, nup);
// Define the nearest-neighbor Heisenberg model
auto ops = OpSum();
for (int i=0; i<N; ++i) {
ops += "J" * Op("SdotS", {i, (i+1) % N});
}
ops["J"] = 1.0;
// On-the-fly
double e0 = eigval0(ops, block);
// sparse matrix
auto spmat = csr_matrix(ops, block);
double e0s = eigval0(spmat, block);