Reference

DiagHamInterface.execute_diagham_scriptMethod
execute_diagham_script(execute; kwargs...)

Run a DiagHam executable. Kwargs are converted to CLI flags (_-). Single-char keys use -k, multi-char use --key. Boolean true adds flag, false omits.

The kwargs of Cmd() are supported.

source
DiagHamInterface.fix_fileendingMethod
fix_fileending(filename, ending)

Return filename ensuring it ends with ending.

If ending does not start with a dot, a dot is prepended. If ending is empty, the original filename is returned. The function is safe to call with full paths; it only checks the final characters of filename.

source
DiagHamInterface.format_with_precisionMethod
format_with_precision(x; atol=eps(float(T)), mode=:auto, maxdigits=20)

Format number x as a string with absolute precision atol. Mode :auto uses %f for [1e-3, 1e6), else %e. Use :f or :e to force format.

source
DiagHamInterface.install_diaghamMethod
install_diagham(; source_dir, build_dir=nothing, run_dir=nothing, configure_options=["--enable-fqhe","--enable-fti","--with-blas-libs=-lopenblas","--with-lapack-libs=","--enable-lapack"])

Checkout and build DiagHam from source. Returns the path to the build directory.

Parameters are keyword-only and intended to be easily overridden from tests or user code.

source
DiagHamInterface.read_matrix_from_txtMethod
read_matrix_from_txt(filename; sparsity=0.1)

Read Hamiltonian from DiagHam-format text file. Auto-detects real/complex. Returns dense matrix if non-zero fraction > sparsity, else sparse.

source
DiagHamInterface.write_matrix_elementsMethod
write_matrix_elements(label, indices, coeffs, file_name; dropband=false, full_single_particle=false)

Write matrix elements to DiagHam-format file with header and data rows. dropband=true removes band index for single-band data. full_single_particle=true keeps both band indices for one-body terms.

source
DiagHamInterface.write_to_txtMethod
write_to_txt(Ham, filename; atol)

Write Hamiltonian matrix to DiagHam-format text file (sparse coordinate format, 0-based indexing). Elements with abs(val) ≤ atol are omitted. Existing files are backed up.

source