polymerist.maths.lattices.integral

Core tools for manipulating integer lattices in D-dimensions

Classes

CubicIntegerLattice

For representing an n-dimensional integer lattice, consisting of all n-tuples of integers with values constrained by side lengths in each dimension

Functions

generate_int_lattice(...)

Generate all D-D coordinates of points on a integer lattice with the sizes of all D dimensions given

nearest_int_coord_along_normal(...)

Takes an D-dimensional control point and an D-dimensional normal vector

Module Contents

polymerist.maths.lattices.integral.generate_int_lattice(*dims: Iterable[int]) numpy.ndarray[polymerist.genutils.typetools.numpytypes.Shape[polymerist.genutils.typetools.numpytypes.N, polymerist.genutils.typetools.numpytypes.D], int][source]

Generate all D-D coordinates of points on a integer lattice with the sizes of all D dimensions given

polymerist.maths.lattices.integral.nearest_int_coord_along_normal(point: numpy.ndarray[polymerist.genutils.typetools.numpytypes.Shape[polymerist.genutils.typetools.numpytypes.D], numbers.Number], normal: numpy.ndarray[polymerist.genutils.typetools.numpytypes.Shape[polymerist.genutils.typetools.numpytypes.D], numbers.Number]) numpy.ndarray[polymerist.genutils.typetools.numpytypes.Shape[polymerist.genutils.typetools.numpytypes.D], int][source]

Takes an D-dimensional control point and an D-dimensional normal vector Returns the integer-valued point nearest to the control point which lies in the normal direction relative to the control point

class polymerist.maths.lattices.integral.CubicIntegerLattice(counts_along_dims: numpy.ndarray[polymerist.genutils.typetools.numpytypes.Shape[polymerist.genutils.typetools.numpytypes.D], int])[source]

Bases: polymerist.maths.lattices.coordinates.Coordinates[int]

For representing an n-dimensional integer lattice, consisting of all n-tuples of integers with values constrained by side lengths in each dimension

counts_along_dims
counts_along_dims_as_str(multip_char: str = 'x') str[source]

Stringify the lattice sidelengths

property capacity: int

The maximum number of points that the lattice could contains

property lex_ordered_weights: numpy.ndarray[polymerist.genutils.typetools.numpytypes.Shape[polymerist.genutils.typetools.numpytypes.D], int]

Vector of the number of points corresponding Can be viewed as a linear transformation between indices and point coordinates when coords are placed in lexicographic order

property odd_even_idxs: tuple[numpy.ndarray[polymerist.genutils.typetools.numpytypes.Shape[polymerist.genutils.typetools.numpytypes.N], int], numpy.ndarray[polymerist.genutils.typetools.numpytypes.Shape[polymerist.genutils.typetools.numpytypes.N], int]]

Return two vectors of indices, corresponding to points in the “odd” and “even” non-neighboring sublattices, respectively

property odd_idxs: numpy.ndarray[polymerist.genutils.typetools.numpytypes.Shape[polymerist.genutils.typetools.numpytypes.N], int]

Indices of the point in the in “odd” sublattice

property even_idxs: numpy.ndarray[polymerist.genutils.typetools.numpytypes.Shape[polymerist.genutils.typetools.numpytypes.N], int]

Indices of the point in the in “even” sublattice

property odd_sublattice: numpy.ndarray[polymerist.genutils.typetools.numpytypes.Shape[polymerist.genutils.typetools.numpytypes.N, polymerist.genutils.typetools.numpytypes.D], int]

Returns points within the odd sublattice of the lattice points

odd_points
property even_sublattice: numpy.ndarray[polymerist.genutils.typetools.numpytypes.Shape[polymerist.genutils.typetools.numpytypes.N, polymerist.genutils.typetools.numpytypes.D], int]

Returns points within the even sublattice of the lattice points

even_points