kron

Contents

kron#

class brainunit.math.kron(a, b, **kwargs)#

Compute the Kronecker product of two arrays or quantities.

The resulting unit is a.unit * b.unit.

Parameters:
  • a (Array | ndarray | bool | number | bool | int | float | complex | saiunit.Quantity) – First input.

  • b (Array | ndarray | bool | number | bool | int | float | complex | saiunit.Quantity) – Second input.

Returns:

output – Kronecker product of a and b. The resulting unit is a.unit * b.unit.

Return type:

Array | saiunit.Quantity

Examples

>>> import saiunit as u
>>> a = u.math.array([1.0, 2.0]) * u.meter
>>> b = u.math.array([3.0, 4.0]) * u.second
>>> u.math.kron(a, b)  # unit is meter * second