EnergyEval

Functions

FreeBird.EnergyEval.frozen_energyMethod
frozen_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.
source
FreeBird.EnergyEval.frozen_energyMethod
frozen_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.
source
FreeBird.EnergyEval.inter_component_energyMethod
inter_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.
source
FreeBird.EnergyEval.inter_component_energyMethod
inter_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.
source
FreeBird.EnergyEval.interacting_energyMethod
interacting_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.
source
FreeBird.EnergyEval.interacting_energyMethod
interacting_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.
source
FreeBird.EnergyEval.interacting_energyMethod
interacting_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.
source
FreeBird.EnergyEval.interacting_energyMethod
interacting_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.
source
FreeBird.EnergyEval.interacting_energyMethod
interacting_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.
source
FreeBird.EnergyEval.intra_component_energyMethod
intra_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.
source
FreeBird.EnergyEval.lattice_interaction_energyMethod
lattice_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.
source
FreeBird.EnergyEval.pbc_distMethod
pbc_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 between pos1 and pos2 considering periodic boundary conditions.
source
FreeBird.EnergyEval.single_site_energyMethod
single_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.
source