Box#

class discopy.tensor.Box(name, dom, cod, data=None, z=0, **params)[source]#

Bases: discopy.frobenius.Box, Diagram

A tensor box is a frobenius box with an array as data.

Parameters
  • name (str) – The name of the box.

  • dom (T) – The domain of the box, i.e. its input dimension.

  • cod (T) – The codomain of the box, i.e. its output dimension.

  • data – The array inside the tensor box.

  • dtype – The datatype for the entries of the array.