matrix_power#
- class saiunit.math.matrix_power(a, n, **kwargs)#
Raise a square matrix to the (integer) power n.
The resulting unit is
a.unit ** n.- Parameters:
- Returns:
out – The result of raising a to the power n. The resulting unit is
a.unit ** n.- Return type:
Array|ndarray|bool|number|bool|int|float|complex| saiunit.Quantity
Examples
>>> import saiunit as u >>> m = u.math.array([[1.0, 2.0], [3.0, 4.0]]) * u.meter >>> u.math.matrix_power(m, 2) # unit is meter ** 2