The package SLPexpressions overrides matrix to allow a table (a nested list) of Gates as an argument.
i1 : X = inputGate x; Y = inputGate y; |
i3 : A = matrix { apply(5,i->i*X) }
o3 = {{0, x, (2 * x), (3 * x), (4 * x)}}
o3 : GateMatrix
|
i4 : B = matrix { apply(4,i->Y^i) }
o4 = {{1, (y), (y * y), (y * y * y)}}
o4 : GateMatrix
|
i5 : C = transpose A * B
o5 = {{(0), (0), (0), (0)}, {(x), ((x * (y))), ((x * (y * y))), ((x * (y * y
------------------------------------------------------------------------
* y)))}, {((2 * x)), (((2 * x) * (y))), (((2 * x) * (y * y))), (((2 * x)
------------------------------------------------------------------------
* (y * y * y)))}, {((3 * x)), (((3 * x) * (y))), (((3 * x) * (y * y))),
------------------------------------------------------------------------
(((3 * x) * (y * y * y)))}, {((4 * x)), (((4 * x) * (y))), (((4 * x) *
------------------------------------------------------------------------
(y * y))), (((4 * x) * (y * y * y)))}}
o5 : GateMatrix
|
i6 : numrows C, numcols C o6 = (5, 4) o6 : Sequence |
The object GateMatrix is a type, with ancestor classes List < VisibleList < BasicList < Thing.