Reference

TwistedBoundaryConditions.calculate_optimal_tbcMethod
calculate_optimal_tbc(Ns::Int, basis_vectors::AbstractVector{<:AbstractVector{T}}; search_range::Int=3, identity_weight::Float64=1e-4) where {T<:Real}

Generalized optimal TBC calculator for arbitrary dimension D.

Arguments

  • Ns: Total number of sites.
  • basis_vectors: List of D basis vectors (e.g., [[1.0, 0.0], [-0.5, 0.866]]).
  • search_range: Range for integers in the twist matrix.
source
TwistedBoundaryConditions.generate_unimodular_matricesMethod
generate_unimodular_matrices(dim::Int, limit::Int)

Generates DxD integer matrices with determinant 1. Entries are within range [-limit, limit]. WARNING: The number of matrices grows as (2*limit+1)^(D^2). Keep limit small (1 or 2).

source
TwistedBoundaryConditions.lll_reductionMethod
lll_reduction(basis::AbstractVector{AbstractVector{T}}; delta=0.75) where {T<:Real}

Performs LLL lattice reduction to find a basis with short, nearly orthogonal vectors. Essential for defining a meaningful aspect ratio in D > 2.

source