API Reference

HandyG.libhandyg_pathFunction
libhandyg_path() -> String

Return the filesystem path of the libhandyg shared library (provided by HandyG_jll).

source
HandyG.HandyGModule
HandyG

Julia bindings for the Fortran library handyG.

The main entrypoints are:

  • G, G!: scalar evaluation in superflat / flat / condensed form
  • G_batch!: batch evaluation for large workloads (fixed-depth column-major matrices)
  • inum: i0± prescription inputs (structure-of-arrays, allocation-free hot paths)

See docs/src/ for the user manual.

source
HandyG.INumType
INum{T<:Real}

Scalar value with an explicit i0± prescription (upstream handyG inum).

Fields:

  • c::Complex{T}: complex value
  • i0::Int8: +1 or -1

Construct with inum.

source
HandyG.INumMatType
INumMat{T}

Structure-of-arrays (SoA) representation of a matrix of inum values, intended for batch calls.

Fields:

  • c: StridedMatrix{Complex{T}}
  • i0: StridedMatrix{Int8}

Construct with inum.

source
HandyG.INumVecType
INumVec{T}

Structure-of-arrays (SoA) representation of a vector of inum values.

Fields:

  • c: StridedVector{Complex{T}}
  • i0: StridedVector{Int8}

Construct with inum.

source
HandyG.G!Method
G!(out::Ref{ComplexF64}, m::AbstractVector{<:Integer}, z, y) -> out

Convenience overload for condensed form that accepts any integer element type for m.

This method converts m to the C-ABI element type (Cint) using an internal thread-local scratch buffer. It may allocate only when the scratch buffer grows. For allocation-free hot paths, pass m::Vector{Cint}.

source
HandyG.G!Method
G!(out::Ref{ComplexF64}, args...) -> out
G!(out::StridedVector{ComplexF64}, args...) -> out

In-place evaluation.

  • If out is a Ref{ComplexF64}, evaluates a single GPL and writes to out[].
  • If out is a vector, dispatches to G_batch! for batched evaluation.
source
HandyG.GMethod
G(m::AbstractVector{<:Integer}, z, y) -> ComplexF64

Convenience overload for condensed form that accepts any integer element type for m.

This method converts m to the C-ABI element type (Cint) using an internal thread-local scratch buffer. It may allocate only when the scratch buffer grows. For allocation-free hot paths, pass m::Vector{Cint}.

source
HandyG.GMethod
G(g::StridedVector{Float64}) -> ComplexF64
G(g::StridedVector{ComplexF64}) -> ComplexF64
G(z::StridedVector, y) -> ComplexF64
G(m::StridedVector{Cint}, z::StridedVector, y) -> ComplexF64
G(z::INumVec, y::INum) -> ComplexF64
G(m::StridedVector{Cint}, z::INumVec, y::INum) -> ComplexF64

Evaluate a generalized polylogarithm using handyG.

Dispatch selects one of the upstream calling conventions:

  • superflat: G(g) where g = [z..., y]
  • flat: G(z, y)
  • condensed: G(m, z, y)

For explicit i0± prescriptions, use inum inputs.

source
HandyG.G_batch!Method
G_batch!(out, args..., len::AbstractVector{<:Integer}) -> out

Convenience overloads that accept any integer element type for len (and m in condensed form).

For len, these methods convert to Cint using an internal thread-local scratch buffer and may allocate only when the scratch buffer grows. For condensed batch m, a Matrix{Cint} is allocated for ABI compatibility.

For allocation-free hot paths, pass len::Vector{Cint} and (if applicable) m::Matrix{Cint}.

source
HandyG.G_batch!Method
G_batch!(out, g, len) -> out
G_batch!(out, z, y, len) -> out
G_batch!(out, m, z, y, len) -> out

Batched evaluation for many independent GPL calls.

Batch inputs use fixed-depth column-major matrices (depth_max, N) and a len::Vector{Cint} giving the active length of each column. Results are written to out::Vector{ComplexF64} of length N.

source
HandyG.clearcache!Method
clearcache!()
clearcache()

Clear handyG's internal caches.

The upstream authors recommend calling this between phase-space points in Monte Carlo workloads.

source
HandyG.inumMethod
inum(z::Complex{T}, i0::Integer=+1) where {T<:Real} -> INum{T}
inum(x::T, i0::Integer=+1) where {T<:Real} -> INum{T}
inum(c::StridedVector{Complex{T}}, i0::StridedVector{Int8}) where {T<:Real} -> INumVec{T}
inum(c::StridedMatrix{Complex{T}}, i0::StridedMatrix{Int8}) where {T<:Real} -> INumMat{T}

Create i0±-aware inputs (upstream handyG inum).

i0 should be Int8(+1) or Int8(-1). For complex values with non-zero imaginary part, upstream handyG treats the sign of imag(z) as the prescription regardless of i0.

source
HandyG.inumMethod
inum(c::StridedVector{Complex{T}}, i0::AbstractVector{<:Integer}) where {T<:Real} -> INumVec{T}

Convenience overload accepting any integer element type for i0.

This allocates a temporary Vector{Int8}. For allocation-free hot paths, pass i0::Vector{Int8}.

source
HandyG.inumMethod
inum(c::StridedMatrix{Complex{T}}, i0::AbstractMatrix{<:Integer}) where {T<:Real} -> INumMat{T}

Convenience overload accepting any integer element type for i0.

This allocates a temporary Matrix{Int8}. For allocation-free hot paths, pass i0::Matrix{Int8}.

source
HandyG.set_lidelta!Method
set_lidelta!(x::Float64)

Set the polylog series truncation threshold (Lidel in the upstream API).

source
HandyG.set_options!Method
set_options!(; mpldelta=nothing, lidelta=nothing, hoelder_circle=nothing)

Convenience wrapper to set multiple runtime options at once.

source