eig0
Computes the groud state energy and the ground state of a Hermitian operator on a block by using an iterative Lanczos algorithm. This function is a shortcut for the eigs_lanczos function. We refer to eigs_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
sparse_diag.jl
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 |
| State | groundstate |
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
auto [e0, gs] = eig0(ops, block);
// sparse matrix
auto spmat = csr_matrix(ops, block);
auto [e0s, gss] = eig0(spmat, block);
let
N = 8
nup = N รท 2
block = Spinhalf(N, nup)
# Define the nearest-neighbor Heisenberg model
ops = OpSum()
for i in 1:N
ops += "J" * Op("SdotS", [i, mod1(i+1, N)])
end
ops["J"] = 1.0
# on-the-fly
e0, gs = eig0(ops, block);
# sparse matrix
spmat = csr_matrix(ops, block)
e0, gs = eig0(spmat, block);
end