Macaulay2 » Documentation
Packages » NumericalAlgebraicGeometry :: gateSystem
next | previous | forward | backward | up | index | toc

gateSystem -- a constructor for GateSystem

Synopsis

Description

GateMatrix M is expected to have 1 column. Matrices params and variables are expected to have 1 row. (Later addition: TO DO say something about less restritive syntax.)

i1 : variables = declareVariable \ {x,y}

o1 = {x, y}

o1 : List
i2 : F = gateSystem(matrix{variables}, matrix{{x*y-1},{x^3+y^2-2}})

o2 = gate system: 2 input(s) ---> 2 output(s)

o2 : GateSystem
i3 : evaluate(F,point{{0.1,0.2+ii}})

o3 = | -.98+.1ii -2.959+.4ii |

                1         2
o3 : Matrix CC    <-- CC
              53        53
i4 : evaluate(F,point{{1/2,1/3}})

o4 = | -5/6 -127/72 |

              1       2
o4 : Matrix QQ  <-- QQ
i5 : evaluate(F,point{{2_(ZZ/101),3}})

o5 = | 5 15 |

              ZZ 1       ZZ 2
o5 : Matrix (---)  <-- (---)
             101        101

Systems with parameters are allowed.

i6 : params = declareVariable \ {a,b}

o6 = {a, b}

o6 : List
i7 : Fab = gateSystem(matrix{params}, matrix{variables}, matrix{{a*x*y-1},{x^3+y^2-b}})

o7 = gate system: 2 input(s) ---> 2 output(s) (with 2 parameters)

o7 : GateSystem
i8 : evaluate(Fab,point{{1,2}},point{{0.1,0.2+ii}})

o8 = | -.98+.1ii -2.959+.4ii |

                1         2
o8 : Matrix CC    <-- CC
              53        53

Caveat

Note for developers: there is a version of the constructor that builds GateSystem from PolySystem. Its variant that takes the list of variables to treat as parameters is likely to disappear.

See also

Ways to use gateSystem :

For the programmer

The object gateSystem is a method function.