clifford.randomMV¶
- clifford.randomMV(layout: clifford._layout.Layout, min=-2.0, max=2.0, grades=None, mvClass=<class 'clifford._multivector.MultiVector'>, uniform=None, n=1, normed: bool = False, rng=None)[source]¶
n Random MultiVectors with given layout.
Coefficients are between min and max, and if grades is a list of integers, only those grades will be non-zero.
- Parameters
layout (Layout) – the layout
min (Number) – range of values from which to uniformly sample coefficients
max (Number) – range of values from which to uniformly sample coefficients
grades (int, List[int]) – grades which should have non-zero coefficients. If
None
, defaults to all grades. A single integer is treated as a list of one integers.uniform (Callable[[Number, Number, Tuple[int, ...]], np.ndarray]) – A function like np.random.uniform. Defaults to
rng.uniform
.n (int) – The number of samples to generate. If
n > 1
, this function returns a list instead of a single multivectornormed (bool) – If true, call
MultiVector.normal()
on each multivector. Note that this does not result in a uniform sampling of directions.rng – The random number state to use. Typical use would be to construct a generator with
numpy.random.default_rng()
.
Examples
>>> randomMV(layout, min=-2.0, max=2.0, grades=None, uniform=None, n=2)