mul

Contents

mul#

class brainunit.lax.mul(x, y, **kwargs)#

Elementwise multiplication: \(x \times y\).

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

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

Returns:

result – The product. The resulting unit is unit(x) * unit(y).

Return type:

saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex

Examples

>>> import saiunit as u
>>> import saiunit.lax as sulax
>>> import jax.numpy as jnp
>>> a = jnp.array([2.0, 3.0]) * u.meter
>>> b = jnp.array([4.0, 5.0]) * u.second
>>> result = sulax.mul(a, b)
>>> result.mantissa
Array([ 8., 15.], dtype=float32)