Utilities

CellLists

A data structure to manage cell lists of particles in a cubic box.

WaveVectorList

A class storing list of q-vectors that are used to compute correlation functions in Fourier space (see e.g. StructureFactor or SelfISF).

set_logging_mode

Set the logging mode (STDERR, FILE, or SILENT) and optionally specify a file path (used only if the FILE mode is chosen).

class baggianalysis.core.CellLists(self: baggianalysis.core.CellLists, init_shifts: bool)None

Bases: pybind11_builtins.pybind11_object

A data structure to manage cell lists of particles in a cubic box.

The constructor takes one mandatory arguments.

Parameters

init_shifts (bool) – Initialise the cell shifts. Defaults to False.

add_particle(self: baggianalysis.core.CellLists, p: baggianalysis.core.Particle, next_idx: int)None

Add a particle to the cells.

Parameters
  • p (Particle) – The particle to be added.

  • next_idx (int) – The id used to index the particle internally. In most cases this is just the index of the particle.

get_cell(self: baggianalysis.core.CellLists, pos: glm::tvec3<scalar, P>) → glm::tvec3<scalar, P>

Return the cell corresponding to the given position.

Parameters

pos (numpy.ndarray) – The position whose corresponding cell should be returned.

Returns

The three integer coordinates of the cell corresponding to the given position.

Return type

np.ndarray

init_cells(self: baggianalysis.core.CellLists, particles: List[baggianalysis.core.Particle], box: glm::tvec3<scalar, P>, rc: float)None

Initial the cells data structures.

Parameters
  • particles (List(Particle)) – The particles that will be used to build the cells.

  • box (numpy.ndarray) – The sizes of the box edges.

  • rc (float) – The smallest size of the cells.

is_overlap(self: baggianalysis.core.CellLists, particles: List[baggianalysis.core.Particle], pos: glm::tvec3<scalar, P>, cutoff: float)bool

Check whether the given position is closer than the given cutoff to any particle indexed in the cells.

Parameters
  • particles (List(Particle)) – The particles used to build the cells

  • pos (numpy.ndarray) – The position to be checked.

  • cutoff (float) – The cutoff to be used in the computation.

Returns

True if there is an overlap, False otherwise.

Return type

bool

class baggianalysis.core.WaveVectorList(*args, **kwargs)

Bases: pybind11_builtins.pybind11_object

A class storing list of q-vectors that are used to compute correlation functions in Fourier space (see e.g. StructureFactor or SelfISF).

Overloaded function.

  1. __init__(self: baggianalysis.core.WaveVectorList, q_max: float, max_n_realisations: int, max_delta_q: float) -> None

Parameters
  • q_max (float) – The length of the largest q vector of interest.

  • max_n_realisations (int) – Given a length \(q\), this is the maximum number of q vectors that will be averaged over to compute \(F_s(q, t)\).

  • max_delta_q (float) – q-vectors that are separated by distances smaller than this value will be assigned to the same value of \(q\).

  1. __init__(self: baggianalysis.core.WaveVectorList, q_min: float, q_max: float, q_interval: float, max_n_realisations: int, max_delta_q: float) -> None

Parameters
  • q_min (float) – The length of the smallest q vector of interest.

  • q_max (float) – The length of the largest q vector of interest.

  • q_interval (float) – The distance between two neighbouring q-vectors in the final list. All the q-vectors in-between will be discarded.

  • max_n_realisations (int) – Given a length \(q\), this is the maximum number of q vectors that will be averaged over to compute \(F_s(q, t)\).

  • max_delta_q (float) – q-vectors that are separated by distances smaller than this value will be assigned to the same value of \(q\).

  1. __init__(self: baggianalysis.core.WaveVectorList, q_modules: List[float], max_n_realisations: int) -> None

Supply a list of q modules that will be used to initialise the list of q-vectors contained in this instance after initialisation. Note that the final q-vectors will depend on the box size of the system that will be used to initialise the instance, so that their modules will slightly differ from the ones contained in q_modules.

Parameters
  • q_modules (list(float)) – The q modules that will be included in the final q-vector list.

  • max_n_realisations (int) – Given a length \(q\), this is the maximum number of q vectors that will be averaged over to compute \(F_s(q, t)\).

init(self: baggianalysis.core.WaveVectorList, system: baggianalysis.core.System)None

Initialise the list of q-vectors using the box size of the given system.

Parameters

system (System) – The input system whose simulation box the q vectors will be based on.

q_modules(self: baggianalysis.core.WaveVectorList) → List[float]

A list of numbers storing the modules of the q vectors.

property q_vectors

A dictionary storing all the q vectors associated to this instance.

baggianalysis.core.set_logging_mode(mode: baggianalysis.core.LogMode, file_path: str = 'ba_log.txt')None

Set the logging mode (STDERR, FILE, or SILENT) and optionally specify a file path (used only if the FILE mode is chosen).