Getting Started
This page takes you from installation to a minimal working POLFED workflow.
Installation
Install from the Julia package manager:
import Pkg
Pkg.add("Polfed")Then load the package in your session:
using PolfedMinimal Working Example
The run below illustrates the full minimal pipeline:
- Build a matrix (here a real, symmetric many-body Quantum Sun Hamiltonian; see Quantum Sun (QSun)),
- Either construct one normalized initial state (vector input) or a normalized block of states (matrix input),
- Call
polfed.
using Polfed
using Polfed.Models: qsun_hamiltonian
using LinearAlgebra
# Problem setup
L_loc = 12
L_grain = 2
g0 = 1.0
α = 0.5
mat = qsun_hamiltonian(L_loc, L_grain, g0, α; use_sparse=true)
howmany = 100 # howmany eigenpairs to target
target = 0.0 # What part of the spectrum to target
# Vector input -> Lanczos factorization
x0_vec = rand(size(mat, 1)); x0_vec ./= norm(x0_vec)
vals_l, vecs_l = polfed(mat, x0_vec, howmany, target)
# Matrix input -> Block Lanczos factorization
x0_mat = rand(size(mat, 1), 4)
x0_mat = Matrix(qr(x0_mat).Q)
vals_b, vecs_b = polfed(mat, x0_mat, howmany, target)Interpretation:
x0_vecrequests standard Lanczos.x0_matrequests Block Lanczos with block size equal to column count.- Both entry modes are handled by the same
polfedinterface.
For a more detailed comparison, see Lanczos and Block Lanczos Factorization.
First Diagnostics
Reporting is the fastest way to understand runtime behavior:
vals, vecs, report = polfed(mat, x0_vec, howmany, target; produce_report=true)
display_report(report)The report shows polynomial order, matrix multiplications, convergence, factorization details, and timing split. See Report and display_report.
This page was generated using Literate.jl.