API

FewBodyPhysics.Utils.ψ₀Method
ψ₀(r::Vector{Float64}, c₀::Vector{Float64}, basis_fns::Vector{<:GaussianBase})

Evaluates the ground state wavefunction ψ₀ at position r.

source
FewBodyPhysics.Sampling.corputFunction
corput(n::Int, b::Int=2)

Computes the n-th number in the van der Corput sequence in base b using digit reversal. Follows the standard definition: qₙ = ∑ dₖ(n) * b^(-k-1)

source
FewBodyPhysics.Sampling.generate_bijMethod
generate_bij(method::Symbol, i::Int, n_terms::Int, b1::Float64) -> Vector{Float64}

Generate a bij vector using the specified sampling method. Supported methods: :quasirandom, :psudorandom

source
FewBodyPhysics.Coordinates.ParticleSystemType
struct ParticleSystem

A structure representing a system of particles with associated masses and coordinate transformations.

Fields

  • masses::Vector{Float64}: A vector containing the masses of the particles in the system. Must contain at least two elements.
  • J::Matrix{Float64}: The Jacobi transformation matrix for the particle system, computed based on the masses.
  • U::Matrix{Float64}: An auxiliary transformation matrix for the particle system, computed based on the masses.
  • scale::Union{Symbol,Nothing}: An optional symbol indicating the scale of the system (e.g., :atomic, :molecular, :nuclear). Defaults to nothing.

Constructor

  • ParticleSystem(masses::Vector{Float64}; scale::Union{Symbol,Nothing}=nothing): Creates a new ParticleSystem instance. The masses vector must contain at least two elements. The scale parameter is optional and can be used to specify the scale of the system. The Jacobi and auxiliary transformation matrices (J and U) are computed internally using the jacobi_transform function.
source
FewBodyPhysics.Coordinates.default_b0Method
default_b0(scale::Union{Symbol,Nothing}) -> Float64

Returns a default value for the parameter b0 based on the provided scale.

Arguments

  • scale::Union{Symbol,Nothing}: A symbol representing the scale type or nothing.
    • :atomic: Returns 1.0, corresponding to the Bohr radius in atomic units.
    • :molecular: Returns 3.0, representing a typical molecular bond length.
    • :nuclear: Returns 0.03, approximately 1 femtometer in atomic units.
    • nothing: Returns 1.0 as a fallback default.
source
FewBodyPhysics.Coordinates.jacobi_transformMethod
jacobi_transform(masses::Vector{Float64})::Tuple{Matrix{Float64}, Matrix{Float64}}

Computes the Jacobi transformation matrix J and its pseudoinverse U for a given vector of masses.

Arguments

  • masses::Vector{Float64}: A vector of masses for the system. Must contain at least two masses.

Returns

  • Tuple{Matrix{Float64}, Matrix{Float64}}: A tuple containing:
    • J::Matrix{Float64}: The Jacobi transformation matrix.
    • U::Matrix{Float64}: The pseudoinverse of the Jacobi transformation matrix.

Details

The Jacobi transformation is used to convert the coordinates of a system of particles into a set of relative coordinates. The transformation matrix J is constructed based on the masses of the particles, and its pseudoinverse U is computed using the pinv function.

Constraints

  • The input vector masses must have a length of at least 2. An assertion is raised if this condition is not met.
source
FewBodyPhysics.Coordinates.shift_vectorsFunction
shift_vectors(a::Matrix{Float64}, b::Matrix{Float64}, mat::Union{Nothing, Matrix{Float64}}=nothing) -> Float64

Compute a weighted sum of dot products between columns of two matrices a and b, optionally using a weighting matrix mat.

Arguments

  • a::Matrix{Float64}: A matrix where each column represents a vector.
  • b::Matrix{Float64}: A matrix where each column represents a vector. Must have the same number of columns as a.
  • mat::Union{Nothing, Matrix{Float64}}: An optional square weighting matrix. If nothing is provided, the identity matrix is used.

Returns

  • Float64: The computed weighted sum of dot products.

Constraints

  • The number of columns in a and b must be the same.
  • If mat is provided, it must be a square matrix with dimensions equal to the number of columns in a and b.
source
FewBodyPhysics.Coordinates.transform_listMethod
transform_list(α::Vector{Float64})::Vector{Matrix{Float64}}

Transforms a vector of Float64 values into a vector of Matrix{Float64} objects. Each element of the input vector α is wrapped into a 1x1 matrix and returned as an element of the resulting vector.

Arguments

  • α::Vector{Float64}: A vector of Float64 values to be transformed.

Returns

  • Vector{Matrix{Float64}}: A vector where each element is a 1x1 matrix containing the corresponding value from the input vector α.
source