Macaulay2 » Documentation
Packages » SLPexpressions :: differentiating circuits
next | previous | forward | backward | up | index | toc

# differentiating circuits

The output of these commands is generally a circuit for evaluating the derivative of the second argument with respect to the first.

    i1 : declareVariable X; declareVariable Y;

    i3 : F = Y^2-X^3-X

    o3 = (((Y * Y) + (-1 * (X * X * X))) + (-1 * X))

    o3 : SumGate

    i4 : diff(X,F)

    o4 = (((0 + 0) + (0 + ((-1) * ((X * X) + (X * X) + (X * X))))) + (0 + (-1)))

    o4 : SumGate

    i5 : J = diff(gateMatrix{{X,Y}},gateMatrix{{F}})

    o5 = {{(((0 + 0) + (0 + ((-1) * ((X * X) + (X * X) + (X * X))))) + (0 +
         ------------------------------------------------------------------------
         (-1))), ((((Y) + (Y)) + (0 + ((-1) * (0 + 0 + 0)))) + (0 + 0))}}

    o5 : GateMatrix

    i6 : (numrows J, numcols J)

    o6 = (1, 2)

    o6 : Sequence

## See also

- InputGate -- the class of all gates
- GateMatrix -- a matrix of Gates

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/SLPexpressions/doc.m2:492:0.