fiblat project

fiblat module

Create n-dimensional lattices.

fiblat.cube_lattice(dim: int, num_points: int) → NDArray[float64]

Generate num_points points over the dim dimensional cube.

Generates num_points points spread roughly evenly over [0, 1]^dim.

Parameters:
  • dim (dimension of cube to generate points in)

  • num_points (the number of points to generate)

Examples

>>> cube_lattice(2, 4)
array([[0.125     , 0.11803399],
       [0.375     , 0.73606798],
       [0.625     , 0.35410197],
       [0.875     , 0.97213595]])
fiblat.sphere_lattice(dim: int, num_points: int) → NDArray[float64]

Generate num_points points over the dim - 1 dimensional hypersphere.

Generate a num_points length list of dim-dimensional tuples such that each element has an l2 norm of 1, and their nearest neighbor is roughly identical for each point.

Parameters:
  • dim (the dimension of points to sample, i.e. the length of tuples in the) – returned list

  • num_points (the number of points to generate)

Examples

>>> sphere_lattice(3, 4)
array([[ 0.44679483,  0.48772367,  0.75      ],
       [-0.96453846, -0.08464959,  0.25      ],
       [ 0.76840062, -0.58911839, -0.25      ],
       [-0.11521053,  0.65132675, -0.75      ]])

Indices and tables