APIs

Types

SymOrb.CompoundMethodType
CompoundMethod{M <: AbstrAtomicOrNothing, N <: AbstrAtomicOrNothing, O <: AbstrAtomicOrNothing}

A minimization method that combines up to three atomic minimization methods

SymOrb.GroupElementType

A group element of the symmetry group

Fields

  • σ::Permutation: The permutation of the particles
  • M::Rotation: The rotation of the particles
SymOrb.GroupElementMethod
GroupElement(el)::GroupElement

Create a GroupElement from the GAP result.

SymOrb.MinimizationResultType
MinimizationResult{T <: AbstractMethod}

The result of a minimization

Fields

  • initial::Vector: The initial path
  • fourier_coeff::Vector: The Fourier coefficients of the minimization result
  • gradient_norm::Float64: The norm of the gradient at the minimum
  • action_value::Float64: The value of the action at the minimum
  • converged::Bool: Whether the minimization converged
  • method::T: The minimization method used
SymOrb.ProblemType

The minimization problem to be solved

Fields

  • N::Int: The number of particles
  • dim::Int: The dimension of the space
  • F::Int: The number of Fourier series terms
  • steps::Int: The number of steps in the discretization of time [0,π]
  • G::SymmetryGroup: The symmetry group of the minimization problem
  • m::Vector{Float64}: The masses of the particles
  • f::M: The denominator of the potential
  • f_raw::String: The string representation of f
  • K::Matrix{Float64}: The kinetic energy matrix
  • dx_dA::Matrix{Float64}: The derivative of the path w.r.t. the Fourier coefficients
  • dA_dx::Matrix{Float64}: The derivative of the Fourier coefficients w.r.t. the path
  • A_to_x::Matrix{Float64}: The transformation matrix from Fourier coefficients to path
  • x_to_A::Matrix{Float64}: The transformation matrix from path to Fourier coefficients
  • Π::Matrix{Float64}: The projection matrix
  • R::Matrix{Float64}: The matrix that reconstructs the nth body
  • Ri::Matrix{Float64}: The matrix that removes the nth body
  • I_factors::Vector{Float64}: The integration factors
SymOrb.SymmetryGroupType

The symmetry group of the minimization problem

Fields

  • action_type::ActionType: The type of the action
  • kerT::Vector{GroupElement}: The kernel of τ, the action on O(2)
  • g::Vector{GroupElement}: The elements of the cyclic part of the symmetry group
  • H0::GroupElement: If the action is dihedral or brake, it's the generator of the first isotropy subspaces
  • H1::GroupElement: If the action is dihedral or brake, it's the generator of the second isotropy subspaces
Base.showMethod
Base.show(io::IO, method::AbstractAtomicMethod)

Pretty-print the minimization method in a more detailed way

Base.showMethod
 Base.show(io::IO, result::MinimizationResult)

Pretty-print the minimization result

Base.showMethod
Base.show(io::IO, method::AbstractCompoundMethod)
Base.show(io::IO, ::MIME"text/plain", method::AbstractCompoundMethod)

Pretty-print the compound minimization method

Base.showMethod
Base.show(io::IO, method::AbstractMethod)

Pretty-print the minimization method in a concise way

Base.showMethod
Base.show(io::IO, P::Problem)

Pretty-print the minimization problem

SymOrb.@atomic_methodMacro
atomic_method(type, struct_name, f_name)

Define a new atomic minimization method with the given type, struct_name and f_name.

Problem definition and minimization

SymOrb.initializeMethod
initialize(data::Dict)::Problem
initialize(filename::String)::Problem

Initialize the problem with the data given in the dictionary data or in the file filename.

SymOrb.find_orbitsFunction
find_orbits(P::Problem, method::AbstractMethod=OneMethod(BFGS());; starting_path_type::Symbol=:random, starting_path::Union{Path,Nothing}=nothing, show_steps=true, print_path=true,  print_path_folder::String="/.", options...)

Find number_of_orbits orbits using the given method and starting path.

Arguments

  • method::AbstractMethod=OneMethod(BFGS()): the minimization method to use. Defaults to BFGS for 200 steps.
  • number_of_orbits=Inf: the number of orbits to find. Defaults to infinity.

Keyword Arguments

  • starting_path_type::Symbol=:random: the type of starting path to use
  • starting_path::Union{Path,Nothing}=nothing: the starting path to use. If provided, starting_path_type is ignored
  • show_steps::Bool=true: whether to show the steps of the minimization.
  • print_path::Bool=true: whether to print the path to a file.
  • print_path_folder::String="./": the folder where to print the path.
  • options...: additional options to pass to the optimization method.
SymOrb.new_orbitMethod
new_orbit(p::Problem, starting_path::Vector, method::CompoundMethod; max_repetitions::Int=10, perturb::Bool=false, perturbation::Float64=1e-3, action_threshold::Float64=2.0, show_steps=true)::MinimizationResult

Find a new orbit using the given CompoundMethod and starting path.

It first executes the init method. Then it alternates the first method and the second method until the minimization converges, the action is below action_threshold or the maximum number of repetitions is reached.

To implement new optimization algorithms, define new methods for this function. New methods must accept 2 arguments, the starting path and the method to use, and a keyword argument show_steps. They must return a MinimizationResult.

Keyword Arguments

  • max_repetitions::Int=10: how many times to minimize using first and second method
  • perturb::Bool=false: whether to perturb the path if minimization fails
  • perturbation::Float64=1e-3: the strength of the perturbation to apply to the path
  • action_threshold::Float64=2.0: the threshold for the action value above which to continue minimization
  • show_steps::Bool=true: whether to show the steps of the minimization
SymOrb.perform_optimizationMethod
perform_optimization(P::Problem, Γ0::Vector, method::NLSolveMethod)::Tuple{Vector, Int, Bool}
perform_optimization(P::Problem, Γ0::Vector, method::OptimMethod)::Tuple{Vector, Int, Bool}

Wrappers around the minimization libraries

Action computation

SymOrb.HUMethod
HU(Γ::Coefficients, [n::Int = steps+1])::AbstractMatrix

Compute the hessian of the potential at every time step along the path $x$

SymOrb.HU_t!Method
HU_t!(hessian::AbstractArray{T, 4},  x::AbstractArray{T, 2}, m::Vector, f::Function, df::Function, d2f::Function) where T

Compute the hessian of the potential for the configuration $x$. The hessian is stored in the array $hessian$.

SymOrb.HactionMethod
Haction(p::Problem, Γ::Vector{T})::Matrix{T}

Compute the Hessian of the constrained action for a given configuration $Γ$.

SymOrb.HkineticMethod
Hkinetic(Γ::Coefficients)::AbstractMatrix

Compute the Hessian of the kinetic part of the action for a given configuration $Γ$.

SymOrb.HpotentialMethod
Hpotential(p::Problem, Γ::Vector{T})

Compute the Hessian of the potential part of the action for a given configuration $Γ$.

SymOrb.K_energyMethod
K_energy(P::Problem, Γ::Vector{T}, n::Int)::Vector{T}

Compute the kinetic energy for a given configuration $Γ$ over $n$ points along the path.

SymOrb.UMethod

U(P, x::Array{T, 3})::Vector{T}

Compute the potential at every time step along the path $x$.

SymOrb.U_tMethod

U(P, x::Array{T, 3})::Vector{T}

Compute the potential for the configuration $x$ (fixed-time potential).

SymOrb.kineticMethod
kinetic(p::Problem, Γ::Vector{T})::T

Compute the kinetic part of the action for a given configuration $Γ$.

SymOrb.potentialMethod
potential(p::Problem, Γ::Vector{T})::T

Compute the potential part of the action for a given configuration $Γ$.

SymOrb.∇UMethod
∇U(Γ::Coefficients, [n::Int = steps+1])::AbstractVector

Compute the gradient of the potential at every time step along the path $x$.

SymOrb.∇U_t!Method
∇U_t!(grad::AbstractArray{T, 2}, x::AbstractArray{T, 2}, m::Vector, f::Function, df::Function) where T

Compute the gradient of the potential for the configuration$x$. The gradient is stored in the array $grad$.

SymOrb.∇actionMethod
∇action(p::Problem, Γ::Vector{T})::Vector{T}

Compute the gradient of the constrained action for a given configuration $Γ$.

SymOrb.∇kineticMethod
∇kinetic(p::Problem, Γ::Vector{T})::Vector{T}

Compute the gradient of the kinetic part of the action for a given configuration $Γ$.

SymOrb.∇potentialMethod
∇potential(p::Problem, Γ::Vector{T})::Vector{T}

Compute the gradient of the potential part of the action for a given configuration $Γ$.

Projectors and operators

Paths

SymOrb.build_pathMethod
build_path(P::Problem, Γ::Vector{T})::Array{T, 3}
build_path(P::Problem, Γ::Vector{T}, steps::Int64)::Array{T, 3}

Build the path from the Fourier coefficients Γ. If steps is provided, the path is built with steps steps. NOTE: If steps is provided, the function will compute the Jacobian of the path in terms of the Fourier coefficients. Otherwise, it will use the precomputed Jacobian.

SymOrb.circular_starting_pathMethod
circular_starting_path(dimensions)::Vector

Generate a circular starting path for the minimization problem.

SymOrb.extend_to_periodMethod
extend_to_period(P::Problem, x::Array{T, 3})::Array{T, 3}

Extend the path $x$ form the fundamental domain I = [0, π] to a full period.

SymOrb.extend_to_periodMethod
extend_to_period(P::Problem, f::T)::Array{T, 3}

Extend the function $f$ form the fundamental domain I = [0, π] to a full period.

SymOrb.fourier_coefficientsMethod
fourier_coefficients(P::Problem, x::Array{T, 3})::Vector{T}

Compute the Fourier coefficients of the path $x$.

SymOrb.get_starting_pathMethod
get_starting_path(path_type::Symbol, dimensions)::Vector

Generate the starting path for the minimization problem according to the given $path_type$.

SymOrb.perturbe_pathMethod

perturbe_path(Γ::Vector{T}, dims::NTuple{3, Int64}, λ=0.001)::Vector{T}

Perturb the given path Γby a factorλ`.

SymOrb.perturbed_circular_starting_pathFunction
perturbed_circular_starting_path(dimensions, λ::Float64=0.001)::Vector

Generate a perturbed circular starting path for the minimization problem.

SymOrb.print_path_to_fileFunction

printpathto_file(P::Problem, Γ::Vector, filename::String)::Nothing

Print the information about P and the Fourier coefficients of the path $Γ$ to the file named filename.

SymOrb.random_starting_pathMethod
random_starting_path(dimensions::NTuple{3, Int64})::Vector

Generate a random starting path for the minimization problem.

SymOrb.read_path_from_fileMethod
read_path_from_file(filename::String)::Tuple{Problem, Vector}

Read the Fourier coefficients of a path and the problem configuration from the file named filename.