tensorial.geometry package#
Submodules#
tensorial.geometry.distances module#
- tensorial.geometry.distances.Edges#
alias of
Edge
- class tensorial.geometry.distances.NeighbourFinder[source]#
Bases:
ABC
tensorial.geometry.jax_neighbours module#
- class tensorial.geometry.jax_neighbours.NeighbourFinder[source]#
Bases:
Module,NeighbourFinder- estimate_neighbours(positions)[source]#
Estimate the number of neighbours per particle
- Parameters:
positions (
Union[Array,ndarray,bool,number,bool,int,float,complex,TypedNdArray])- Return type:
int
- class tensorial.geometry.jax_neighbours.NeighbourList(neighbours, cell_indices, actual_max_neighbours=-1, finder=None)[source]#
Bases:
Module,NeighbourList- Parameters:
neighbours (
Union[Array,ndarray,bool,number,bool,int,float,complex,TypedNdArray])cell_indices (
Union[Array,ndarray,bool,number,bool,int,float,complex,TypedNdArray])actual_max_neighbours (
Array)finder (
NeighbourFinder)
- actual_max_neighbours: int#
- cell_indices: Array#
- property did_overflow: bool#
Returns True if the list could not accommodate all the neighbours. The actual number needed is stored in actual_max_neighbours
- property max_neighbours: int#
Get the maximum number of neighbours in this list
- neighbours: Array#
- property num_particles: int#
Get the number of neighbours in this list
- class tensorial.geometry.jax_neighbours.OpenBoundary(cutoff, include_self=False)[source]#
Bases:
NeighbourFinder- Parameters:
cutoff (
Number)
- estimate_neighbours(positions)[source]#
Estimate the number of neighbours per particle
- Parameters:
positions (
Union[Array,ndarray,bool,number,bool,int,float,complex,TypedNdArray])- Return type:
int
- class tensorial.geometry.jax_neighbours.PeriodicBoundary(cell, cutoff, pbc=None, *, max_cell_multiples=10000, include_self=False, include_images=True)[source]#
Bases:
NeighbourFinder- Parameters:
cell (
Union[Float[Array, '3 3'],Float[ndarray, '3 3']])cutoff (
Number)pbc (
Optional[Union[tuple[bool,bool,bool],Bool[Array, '3'],Bool[ndarray, '3'],Bool[TypedNdArray, '3']]])max_cell_multiples (
int)
- estimate_neighbours(positions)[source]#
Estimate the number of neighbours per particle
- Parameters:
positions (
Union[Array,ndarray,bool,number,bool,int,float,complex,TypedNdArray])- Return type:
int
- tensorial.geometry.jax_neighbours.generate_positions(cell, positions, cell_shifts)[source]#
- Parameters:
cell (
Array)positions (
Array)cell_shifts (
Array)
- Return type:
Array
- tensorial.geometry.jax_neighbours.get_cell_list(cell, cutoff, pbc=(True, True, True), max_cell_multiples=10000)[source]#
- Parameters:
cell (
Union[Float[Array, '3 3'],Float[ndarray, '3 3']])cutoff (
Number)pbc (
Optional[Union[tuple[bool,bool,bool],Bool[Array, '3'],Bool[ndarray, '3'],Bool[TypedNdArray, '3']]])max_cell_multiples (
int)
- Return type:
tuple[Array,Array]
- tensorial.geometry.jax_neighbours.neighbour_finder(cutoff, cell=None, pbc=None, include_self=False, **kwargs)[source]#
- Parameters:
cutoff (
Number)cell (
Optional[Union[Float[Array, '3 3'],Float[ndarray, '3 3']]])pbc (
Optional[Union[tuple[bool,bool,bool],Bool[Array, '3'],Bool[ndarray, '3'],Bool[TypedNdArray, '3']]])include_self (
bool)
- Return type:
- tensorial.geometry.jax_neighbours.neighbours_mask_aabb(centre, neighbours, cutoff)[source]#
Get the indices of all points that are within a cutoff sphere centred on centre with a radius cutoff using the Axis Aligned Bounding Box method
- Parameters:
centre (
Union[Array,ndarray,bool,number,bool,int,float,complex,TypedNdArray])neighbours (
Union[Array,ndarray,bool,number,bool,int,float,complex,TypedNdArray])cutoff (
float)
- Return type:
Array
- tensorial.geometry.jax_neighbours.neighbours_mask_direct(centre, neighbours, cutoff)[source]#
Get the indices of all points that are within a cutoff sphere centred on
centrewith a radiuscutoffby calculating all distance vector norms and masking those within the cutoff- Parameters:
centre (
Union[Array,ndarray,bool,number,bool,int,float,complex,TypedNdArray])neighbours (
Union[Array,ndarray,bool,number,bool,int,float,complex,TypedNdArray])cutoff (
float)
- Return type:
Array
tensorial.geometry.np_neighbours module#
- class tensorial.geometry.np_neighbours.OpenBoundary(cutoff, include_self=False)[source]#
Bases:
NeighbourFinder- Parameters:
cutoff (
Number)include_self (
bool)
- class tensorial.geometry.np_neighbours.PeriodicBoundary(cell, cutoff, pbc, *, include_self=False, include_images=True)[source]#
Bases:
NeighbourFinder- Parameters:
cell¶ – the unit cell
cutoff¶ – the cutoff radius that defines if an atom is a neighbour or not
pbc¶ – specifies which unit cell vectors are to be considered periodic
include_self¶ – include an atom as its own neighbour within the central unit cell
include_images¶ – include images of an atom in periodic repetitions of the central unit cell as neighbours
cell (
Union[Float[Array, '3 3'],Float[ndarray, '3 3']])cutoff (
Number)pbc (
Union[tuple[bool,bool,bool],Bool[Array, '3'],Bool[ndarray, '3'],Bool[TypedNdArray, '3']])
- tensorial.geometry.np_neighbours.neighbour_finder(cutoff, cell=None, pbc=None, include_self=False, **kwargs)[source]#
- Parameters:
cutoff (
Number)cell (
Optional[Union[Float[Array, '3 3'],Float[ndarray, '3 3']]])pbc (
Optional[Union[tuple[bool,bool,bool],Bool[Array, '3'],Bool[ndarray, '3'],Bool[TypedNdArray, '3']]])include_self (
bool)
- Return type:
tensorial.geometry.unit_cells module#
- tensorial.geometry.unit_cells.cell_volume(cell)[source]#
- Parameters:
cell (
Union[Float[Array, '3 3'],Float[ndarray, '3 3']])- Return type:
Array
- tensorial.geometry.unit_cells.get_cell_multiple_range(cell, cell_vector, cutoff)[source]#
- Parameters:
cell (
Union[Array,ndarray,bool,number,bool,int,float,complex,TypedNdArray])cell_vector (
int)cutoff (
float)
- Return type:
tuple[int,int]
- tensorial.geometry.unit_cells.get_cell_multiple_ranges(cell, cutoff, pbc=(True, True, True))[source]#
- Parameters:
cell (
Union[Float[Array, '3 3'],Float[ndarray, '3 3']])cutoff (
float)pbc (
Optional[Union[tuple[bool,bool,bool],Bool[Array, '3'],Bool[ndarray, '3'],Bool[TypedNdArray, '3']]])
- Return type:
tuple[tuple[int,int],tuple[int,int],tuple[int,int]]
- tensorial.geometry.unit_cells.get_edge_vectors(positions, edges, cell)[source]#
- Parameters:
positions (
Union[Array,ndarray,bool,number,bool,int,float,complex,TypedNdArray])edges (
Edge)cell (
Union[Float[Array, '3 3'],Float[ndarray, '3 3']])
- Return type:
Union[Array,ndarray,bool,number,bool,int,float,complex,TypedNdArray]
- tensorial.geometry.unit_cells.get_max_cell_vector_repetitions(cell, cell_vector, cutoff)[source]#
Given a unit cell defined by three vectors this will return the number of multiples of the vector indexed by cell_vector that are needed to reach the edge of a sphere with radius
cutoff. This tells you what multiple of cell vectors you need to go up to (when rounded up to the nearest integer) in order to fully cover all points in the sphere, in teh given cell vector direction.- Parameters:
cell (
Union[Float[Array, '3 3'],Float[ndarray, '3 3']])cell_vector (
int)cutoff (
float)
- Return type:
float
Module contents#
- tensorial.geometry.Edges#
alias of
Edge
- class tensorial.geometry.NeighbourFinder[source]#
Bases:
ABC
- class tensorial.geometry.NeighbourList[source]#
Bases:
ABCAn interface that represents a neighbour list
- abstract property max_neighbours: int#
Get the maximum number of neighbours in this list
- abstract property num_particles: int#
Get the number of neighbours in this list
- class tensorial.geometry.OpenBoundary(cutoff, include_self=False)[source]#
Bases:
NeighbourFinder- Parameters:
cutoff (
Number)include_self (
bool)
- class tensorial.geometry.PeriodicBoundary(cell, cutoff, pbc, *, include_self=False, include_images=True)[source]#
Bases:
NeighbourFinder- Parameters:
cell¶ – the unit cell
cutoff¶ – the cutoff radius that defines if an atom is a neighbour or not
pbc¶ – specifies which unit cell vectors are to be considered periodic
include_self¶ – include an atom as its own neighbour within the central unit cell
include_images¶ – include images of an atom in periodic repetitions of the central unit cell as neighbours
cell (
Union[Float[Array, '3 3'],Float[ndarray, '3 3']])cutoff (
Number)pbc (
Union[tuple[bool,bool,bool],Bool[Array, '3'],Bool[ndarray, '3'],Bool[TypedNdArray, '3']])
- tensorial.geometry.neighbour_finder(cutoff, cell=None, pbc=None, include_self=False, **kwargs)[source]#
- Parameters:
cutoff (
Number)cell (
Optional[Union[Float[Array, '3 3'],Float[ndarray, '3 3']]])pbc (
Optional[Union[tuple[bool,bool,bool],Bool[Array, '3'],Bool[ndarray, '3'],Bool[TypedNdArray, '3']]])include_self (
bool)
- Return type: