EnergyEval
Functions
FreeBird.EnergyEval
— ModuleEnergyEval
Module for evaluating energy-related quantities for a system.
FreeBird.EnergyEval.frozen_energy
— Methodfrozen_energy(at::AbstractSystem, lj::LJParameters, list_num_par::Vector{Int}, frozen::Vector{Bool})
Calculate the energy of the frozen particles in the system using a single Lennard-Jones potential. The energy is calculated by summing the pairwise interactions between the frozen particles. Since the frozen particles do not move, the energy is typically only calculated once for a given system.
Arguments
at::AbstractSystem
: The system for which the energy is calculated.lj::LJParameters
: The Lennard-Jones parameters.list_num_par::Vector{Int}
: The number of particles in each component.frozen::Vector{Bool}
: A vector indicating whether each component is frozen.
Returns
energy
: The energy of the frozen particles in the system.
FreeBird.EnergyEval.frozen_energy
— Methodfrozen_energy(at::AbstractSystem, ljs::CompositeLJParameters{C}, list_num_par::Vector{Int}, frozen::Vector{Bool})
Calculate the energy of the frozen particles in the system using a composite Lennard-Jones potential. The energy is calculated by summing the pairwise interactions between the frozen particles. Since the frozen particles do not move, the energy is typically only calculated once for a given system.
Arguments
at::AbstractSystem
: The system for which the energy is calculated.ljs::CompositeLJParameters{C}
: The composite Lennard-Jones parameters.list_num_par::Vector{Int}
: The number of particles in each component.frozen::Vector{Bool}
: A vector indicating whether each component is frozen.
Returns
energy
: The energy of the frozen particles in the system.
FreeBird.EnergyEval.inter_component_energy
— Methodinter_component_energy(at1::AbstractSystem, at2::AbstractSystem, lj::LJParameters)
Compute the energy between two components of a system using the Lennard-Jones potential.
Arguments
at1::AbstractSystem
: The first component of the system.at2::AbstractSystem
: The second component of the system.lj::LJParameters
: The Lennard-Jones parameters.
Returns
energy
: The energy between the two components.
FreeBird.EnergyEval.inter_component_energy
— Methodinter_component_energy(lattice1::Vector{Bool}, lattice2::Vector{Bool}, lattice_neighbors::Vector{Vector{Vector{Int64}}}, h::GenericLatticeHamiltonian{N,U})
Compute the interaction energy between two lattice configurations using the Hamiltonian parameters.
Arguments
lattice1::Vector{Bool}
: The first lattice configuration.lattice2::Vector{Bool}
: The second lattice configuration.lattice_neighbors::Vector{Vector{Vector{Int64}}}
: The lattice neighbor list.h::GenericLatticeHamiltonian{N,U}
: The generic lattice Hamiltonian parameters.
Returns
e_interaction::U
: The interaction energy between the two lattice configurations.
FreeBird.EnergyEval.interacting_energy
— Methodinteracting_energy(at::AbstractSystem, lj::LJParameters, list_num_par::Vector{Int}, frozen::Vector{Bool})
Calculate the energy from interactions between free-free and free-frozen particles using the Lennard-Jones potential. The energy is calculated by summing the pairwise interactions between the free particles.
Arguments
at::AbstractSystem
: The system for which the energy is calculated.lj::LJParameters
: The Lennard-Jones parameters.list_num_par::Vector{Int}
: The number of particles in each component.frozen::Vector{Bool}
: A vector indicating whether each component is frozen.
Returns
energy
: The energy from interactions between particles.
FreeBird.EnergyEval.interacting_energy
— Methodinteracting_energy(at::AbstractSystem, lj::LJParameters)
Calculate the energy from interactions between particles using the Lennard-Jones potential. The energy is calculated by summing the pairwise interactions between the free particles.
Arguments
at::AbstractSystem
: The system for which the energy is calculated.lj::LJParameters
: The Lennard-Jones parameters.
Returns
energy
: The energy from interactions between particles.
FreeBird.EnergyEval.interacting_energy
— Methodinteracting_energy(at::AbstractSystem, ljs::CompositeLJParameters{C}, list_num_par::Vector{Int}, frozen::Vector{Bool})
Calculate the energy from interactions between free-free and free-frozen particles using the Lennard-Jones potential. The energy is calculated by summing the pairwise interactions between the free particles.
Arguments
at::AbstractSystem
: The system for which the energy is calculated.ljs::CompositeLJParameters{C}
: The composite Lennard-Jones parameters.list_num_par::Vector{Int}
: The number of particles in each component.frozen::Vector{Bool}
: A vector indicating whether each component is frozen.
Returns
energy
: The energy from interactions between particles.
FreeBird.EnergyEval.interacting_energy
— Methodinteracting_energy(lattice::MLattice{C,G}, h::MLatticeHamiltonian{C,N,U})
Compute the interaction energy of a multi-component lattice configuration using the Hamiltonian parameters.
Arguments
lattice::MLattice{C,G}
: The multi-component lattice configuration.h::MLatticeHamiltonian{C,N,U}
: The multi-component lattice Hamiltonian parameters.
Returns
e_interaction::Float64
: The interaction energy of the lattice configuration.
FreeBird.EnergyEval.interacting_energy
— Methodinteracting_energy(lattice::SLattice, h::GenericLatticeHamiltonian{N})
Compute the interaction energy of a lattice configuration using the Hamiltonian parameters.
Arguments
lattice::SLattice
: The lattice configuration.h::GenericLatticeHamiltonian{N,U}
: The generic lattice Hamiltonian parameters.
Returns
e_interaction::Float64
: The interaction energy of the lattice configuration.
FreeBird.EnergyEval.intra_component_energy
— Methodintra_component_energy(at::AbstractSystem, lj::LJParameters)
Compute the energy within a component of a system using the Lennard-Jones potential.
Arguments
at::AbstractSystem
: The component of the system.lj::LJParameters
: The Lennard-Jones parameters.
Returns
energy
: The energy within the component.
FreeBird.EnergyEval.lattice_interaction_energy
— Methodlattice_interaction_energy(lattice_occupations::Vector{Bool}, lattice_neighbors::Vector{Vector{Vector{Int64}}}, h::GenericLatticeHamiltonian{N,U})
Compute the interaction energy of a lattice configuration using the Hamiltonian parameters.
Arguments
lattice_occupations::Vector{Bool}
: The lattice occupation configuration.lattice_neighbors::Vector{Vector{Vector{Int64}}}
: The lattice neighbor list.h::GenericLatticeHamiltonian{N,U}
: The generic lattice Hamiltonian parameters.
Returns
e_interaction::U
: The interaction energy of the lattice configuration.
FreeBird.EnergyEval.pbc_dist
— Methodpbc_dist(pos1, pos2, at)
Compute the distance between two positions considering periodic boundary conditions. Currently only works for orthorhombic lattices.
Arguments
pos1::Union{SVector{T},Vector{T}}
: The first position.pos2::Union{SVector{T},Vector{T}}
: The second position.at::AbstractSystem
: The abstract system containing boundary conditions and bounding box.
Returns
d::Float64
: The distance betweenpos1
andpos2
considering periodic boundary conditions.
FreeBird.EnergyEval.single_site_energy
— Methodsingle_site_energy(index::Int, at::AbstractSystem, lj::LJParameters)
single_site_energy(index::Int, at::AbstractSystem, ljs::CompositeLJParameters{C}, list_num_par::Vector{Int})
Calculate the energy of a single site in the system using the Lennard-Jones potential. The energy is calculated by summing the pairwise interactions between the site and all other sites in the system.
Arguments
index::Int
: The index of the site for which the energy is calculated.at::AbstractSystem
: The system for which the energy is calculated.lj::LJParameters
: The Lennard-Jones parameters.ljs::CompositeLJParameters{C}
: The composite Lennard-Jones parameters.list_num_par::Vector{Int}
: The number of particles in each component.
Returns
energy
: The energy of the site.