Reporting
Reporting helps you understand what happened during a run and where time was spent.
Enable Reporting
To enable reporting, set produce_report to true in the polfed call:
vals, vecs, report = polfed(mat, x0, howmany, target; produce_report=true)
display_report(report)Example Report
A concrete example is often the easiest way to read the report. For example, with a small QSun test problem:
using Polfed
using Polfed.Models: qsun_hamiltonian
using LinearAlgebra
using Random
rng = MersenneTwister(1234)
L_loc = 6
L_grain = 2
g0 = 1.0
α = 0.5
mat = qsun_hamiltonian(L_loc, L_grain, g0, α; rng=rng, use_sparse=true)
x0 = rand(rng, size(mat, 1))
x0 ./= norm(x0)
howmany = 20
target = :middle
vals, vecs, report = polfed(mat, x0, howmany, target; produce_report=true)
display_report(report)on the webpage, this report can be rendered with the same terminal-style color structure:
The exact values will of course change with the Hamiltonian, random seed, howmany, target choice, and hardware. But the structure of the printed report stays the same. In an interactive terminal, display_report uses colors by default. If you redirect the report to a .txt file, it is useful to call display_report(report; use_colors=false) to avoid ANSI color codes.
What display_report Shows
- Spectral transformation summary: target strategy, targeted rescaled energy, targeted interval, interval width, polynomial type, polynomial order,
order_safety_factor, matrix multiplication count, parallel strategy, and whether automatic optimization was enabled (SpectralTransformReport). - Factorization summary: Lanczos/Block Lanczos type, block size, converged eigenpair counts, Lanczos and eigen residuals, and reserved vs used iterations (
FactorizationReport).
The difference between standard Lanczos and Block Lanczos is explained in Lanczos and Block Lanczos Factorization.
- Timing summary: walltime/CPU-time breakdown across mapping, reorthogonalization, convergence checking, and other operations (
BenchmarkReport). - Optional convergence table: per-check evolution of Krylov dimension, converged count, and residual.
- Optional benchmark details: full-run timing summary and optional memory reporting.
Selective Report Display
display_report(
report;
include_spectral_transform=true,
include_factorization=true,
include_benchmark=true,
show_convergence_details=false,
)include_spectral_transform=true: show spectral transformation block.include_factorization=true: show factorization block.include_benchmark=true: show benchmark/timing block.show_convergence_details=false: print per-check convergence table only when needed. Set it totruewhen studying convergence behavior or when a run does not converge and you want to identify why.
Logging Levels
Polfed.jl also offers different logging levels to better understand what is going on and if and when does the problem occur.
using Polfed
Polfed.Common.verbosity[] = 0 # silent
Polfed.Common.verbosity[] = 1 # warn
Polfed.Common.verbosity[] = 2 # info
Polfed.Common.verbosity[] = 3 # debugThese levels represent the following:
0(POLFED_SILENT_LEVEL): no logging.1(POLFED_WARN_LEVEL): WARN messages only (potential issues / suboptimal setup).2(POLFED_INFO_LEVEL): INFO + WARN (major run phases and setup diagnostics).3(POLFED_DEBUG_LEVEL): DEBUG + INFO + WARN (most detailed tracing, including debug-tagged progress events).
For full report/logging reference, see Reports, Logging, and Defaults.
Use higher levels when diagnosing convergence/setup issues.
This page was generated using Literate.jl.