EnergyEval

Functions

FreeBird.EnergyEval.frozen_energyMethod
frozen_energy(at::AbstractSystem, cps::CompositeParameterSets{C,P}, list_num_par::Vector{Int}, frozen::Vector{Bool})

Calculate the energy of the frozen particles in the system using a multi-component potential (CompositeParameterSets). I.e., the components interact with each other using different parameters. 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.
  • cps::CompositeParameterSets{C,P}: The composite potential 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, pot::SingleComponentPotential{S}, list_num_par::Vector{Int}, frozen::Vector{Bool}) where {S}

Calculate the energy of the frozen particles in the system using a single-component potential. I.e., the components interact with each other using the same parameters. 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.
  • pot::SingleComponentPotential{S}: The single-component potential.
  • 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, pot::SingleComponentPotential{Pairwise})

Compute the energy between two components of a system using a specified pairwise potential.

Arguments

  • at1::AbstractSystem: The first component of the system.
  • at2::AbstractSystem: The second component of the system.
  • pot::SingleComponentPotential{Pairwise}: The potential used to compute the energy.

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, pot::SingleComponentPotential{S}, list_num_par::Vector{Int}, frozen::Vector{Bool})

Calculate the energy from interactions between free-free and free-frozen particles using a single-component potential. I.e., the components interact with each other using the same parameters. The energy is calculated by summing the pairwise interactions between the free particles.

Arguments

  • at::AbstractSystem: The system for which the energy is calculated.
  • pot::SingleComponentPotential{S}: The single-component potential.
  • 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, 
                        pot::CompositeParameterSets{C,GuptaParameters},
                        list_num_par::Vector{Int}
                        ) where C

Calculate the energy from interactions between particles using the Gupta potential for a multi-component system.

source
FreeBird.EnergyEval.interacting_energyMethod
interacting_energy(at::AbstractSystem, cps::CompositeParameterSets{C,P}, list_num_par::Vector{Int}, frozen::Vector{Bool}, surface::AbstractSystem)

Calculate the energy from interactions between free-free and free-frozen particles using a multi-component potential (CompositeParameterSets). The energy is calculated by summing the pairwise interactions between the free particles and the surface.

Arguments

  • at::AbstractSystem: The system for which the energy is calculated.
  • cps::CompositeParameterSets{C,P}: The composite potential parameters.
  • list_num_par::Vector{Int}: The number of particles in each component.
  • frozen::Vector{Bool}: A vector indicating whether each component is frozen.
  • surface::AbstractSystem: An optional surface system to consider in the energy calculation. See LJSurfaceWalkers.

Returns

  • energy: The energy from interactions between particles and the surface.
source
FreeBird.EnergyEval.interacting_energyMethod
interacting_energy(at::AbstractSystem, cps::CompositeParameterSets{C,P}, list_num_par::Vector{Int}, frozen::Vector{Bool})

Calculate the energy from interactions between free-free and free-frozen particles using a multi-component potential (CompositeParameterSets). The energy is calculated by summing the pairwise interactions between the free particles.

Arguments

  • at::AbstractSystem: The system for which the energy is calculated.
  • cps::CompositeParameterSets{C,P}: The composite potential 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, pot::SingleComponentPotential{S})

Calculate the energy from interactions between particles using the a single-component 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.
  • pot::SingleComponentPotential{S}: The single-component potential.

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, pot::SingleComponentPotential{Pairwise})

Compute the energy within a component of a system using a specified pairwise potential.

Arguments

  • at::AbstractSystem: The component of the system.
  • pot::SingleComponentPotential{Pairwise}: The potential used to compute the energy.

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, pot::SingleComponentPotential{Pairwise})
single_site_energy(index::Int, at::AbstractSystem, cps::CompositeParameterSets{C,P}, list_num_par::Vector{Int})
single_site_energy(index::Int, at::AbstractSystem, cps::CompositeParameterSets{C,P}, list_num_par::Vector{Int}, surface::AbstractSystem)

Calculate the energy of a single site in the system using a pairwise 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.
  • pot::SingleComponentPotential{Pairwise}: The single-component pairwise potential.
  • cps::CompositeParameterSets{C,P}: The composite potential parameters. The unpacked type P must be Pairwise.
  • list_num_par::Vector{Int}: The number of particles in each component.
  • surface::AbstractSystem: An optional surface system to consider in the energy calculation. See LJSurfaceWalkers.

Returns

  • energy: The energy of the site.
source