next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
SLPexpressions :: GateMatrix

GateMatrix -- a matrix of Gates

Description

An object of this type is a matrix with Gates as entries. Some algebraic operations (matrix multiplication, determinant, etc.) are defined for this type. It is provided, in part, for convenience of setting up involved evaluation circuits.

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

See also

Methods that use an object of class GateMatrix :

For the programmer

The object GateMatrix is a type, with ancestor classes List < VisibleList < BasicList < Thing.