lentil.field.multiply

lentil.field.multiply(x1, x2)[source]

Multiply fields element-wise.

Parameters
  • x1 (Field) – Fields to be multiplied. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

  • x2 (Field) – Fields to be multiplied. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

Returns

y – The product of x1 and x2, appropriately sized and offset.

Return type

Field

Notes

The output Field data and offset are computed according to the following rules:

  • If both operands are scalars, the result is 0 unless the operands share the same offset.

  • A single scalar operand is broadcast to the other operand’s shape and inherits the other operand’s offset. This enables default planar fields (data = 1+0j, offset = [0, 0]) to automatically grow in size when multiplied by a “real” field.