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

specialize -- specialize parameters

Description

This method specializes parameters by assigning them the values in p.

If G is a GateSystem that is defined with parameters, then the output is a GateSystem in which the parameters of G have been replaced by the values in p.

i1 : variables = declareVariable \ {x,y}

o1 = {x, y}

o1 : List
i2 : params = declareVariable \ {a,b}

o2 = {a, b}

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

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

o3 : GateSystem
i4 : F = specialize(Fab, point{{1,2}})

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

o4 : GateSystem
i5 : p0 = point{{0.1,0.2+ii}}

o5 = p0

o5 : Point
i6 : evaluate(F,p0)

o6 = | -1 -.959+.4ii |

                1         2
o6 : Matrix CC    <-- CC
              53        53
i7 : evaluateJacobian(F,p0)

o7 = | 0   0      |
     | .03 .4+2ii |

                2         2
o7 : Matrix CC    <-- CC
              53        53

If H is a ParameterHomotopy, then the output is a SpecializedParameterHomotopy, which can be passed to trackHomotopy.

i8 : variables = declareVariable \ {x,y}

o8 = {x, y}

o8 : List
i9 : params = declareVariable \ {a,b}

o9 = {a, b}

o9 : List
i10 : F = gateSystem(matrix{params}, matrix{variables}, matrix{{a*x*y-1},{x^3+y^2-b}})

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

o10 : GateSystem
i11 : PH = parametricSegmentHomotopy F;
i12 : parameters PH

o12 = {{A , A , B , B }}
         a   b   a   b

o12 : GateMatrix
i13 : (a0,b0) = (1,2); startSolution = point{{1,1}};
i15 : (a1,b1) = (2,1);
i16 : H01 = specialize(PH, matrix{{a0,b0,a1,b1}});
i17 : targetSolution = first trackHomotopy(H01,{startSolution})

o17 = targetSolution

o17 : Point
i18 : assert(norm evaluate(F,matrix{{a1,b1}},matrix targetSolution) < 0.0001)

Ways to use specialize:

  • specialize(GateSystem,AbstractPoint)
  • specialize(ParameterHomotopy,Matrix)

For the programmer

The object specialize is a method function.


The source of this document is in NumericalAlgebraicGeometry/doc.m2:1187:0.