Skip to content

eig0

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

Source sparse_diag.hpp

function eig0(
    ops::OpSum,
    block::Block;
    precision::Real = 1e-12,
    maxiter::Int64 = 1000,
    force_complex::Bool = false,
    seed::Int64 = 42,
)
std::tuple<double, State> eig0(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
State groundstate

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, gs = eig0(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;
auto [e0, gs] = eig0(ops, block);