Skip to content

eigval0

Computes the groud state energy of an operator on a block.

Source sparse_diag.hpp

function eigval0(
    ops::OpSum,
    block::Block;
    precision::Real = 1e-12,
    maxiter::Integer = 1000,
    force_complex::Bool = false,
    seed::Integer = 42,
)
double eigval0(OpSum const &ops, Block const &block, double precision = 1e-12,
           int64_t max_iterations = 1000, bool force_complex = false,
           int64_t random_seed = 42);

Parameters

Name Description Default
ops OpSum defining the bonds of the 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
force_complex whether or not computation should be forced to have complex arithmetic false
random_seed random seed for setting up the initial vector 42

Returns

Type Description
real number lowest lying eigenvalue

Definition

Usage Example

let 
    N = 8
    nup = N รท 2
    block = Spinhalf(N, nup)

    # Define the nearest-neighbor Heisenberg model
    ops = OpSum()
    for i in 1:N
        ops += Op("HB", "J", [i, mod1(i+1, N)])
    end
    ops["J"] = 1.0

    e0 = eigval0(ops, block);
end
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 += Op("HB", "J", {i, (i+1) % N});
}
ops["J"] = 1.0;
double e0 = eigval0(ops, block);