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

evaluateH -- evaluate a homotopy and its derivatives

Description

These methods evaluate a homotopy and its derivatives at a given point.

evaluateH evaluates the homotopy itself, evaluateHx evaluates its Jacobian with respect to the variables, and evaluateHt evaluates the derivative with respect to the continuation parameter.

For a ParameterHomotopy, parameter values must also be supplied.

i1 : variables = declareVariable \ {x,y}

o1 = {x, y}

o1 : List
i2 : T = inputGate symbol T

o2 = T

o2 : InputGate
i3 : F = matrix{{x^2+y^2-1},{x*y}}

o3 = {{(((x * x) + (y * y)) + -1)}, {(x * y)}}

o3 : GateMatrix
i4 : G = matrix{{x^2-y-1},{x+y-1}}

o4 = {{(((x * x) + (-1 * y)) + -1)}, {((x + y) + -1)}}

o4 : GateMatrix
i5 : H = gateHomotopy((1-T)*F + T*G, matrix{{x,y}}, T)

o5 = GateHomotopy{...11...}

o5 : GateHomotopy
i6 : X0 = matrix{{.2},{0}}

o6 = | .2 |
     | 0  |

                2         1
o6 : Matrix RR    <-- RR
              53        53
i7 : evaluateH(H,X0,0.5)

o7 = | -.96 |
     | -.4  |

                2         1
o7 : Matrix RR    <-- RR
              53        53
i8 : evaluateHx(H,X0,0.5)

o8 = | .4 -.5 |
     | .5 .6  |

                2         2
o8 : Matrix RR    <-- RR
              53        53
i9 : evaluateHt(H,X0,0.5)

o9 = | 0   |
     | -.8 |

                2         1
o9 : Matrix RR    <-- RR
              53        53

For a ParameterHomotopy, parameter values must also be supplied.

i10 : variables = declareVariable \ {x,y}

o10 = {x, y}

o10 : List
i11 : params = declareVariable \ {a,b}

o11 = {a, b}

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

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

o12 : GateSystem
i13 : PH = parametricSegmentHomotopy F

o13 = GateParameterHomotopy{...2...}

o13 : GateParameterHomotopy
i14 : pStart = matrix{{1,2}}

o14 = | 1 2 |

               1       2
o14 : Matrix ZZ  <-- ZZ
i15 : pTarget = matrix{{2,1}}

o15 = | 2 1 |

               1       2
o15 : Matrix ZZ  <-- ZZ
i16 : pars = transpose(pStart | pTarget)

o16 = | 1 |
      | 2 |
      | 2 |
      | 1 |

               4       1
o16 : Matrix ZZ  <-- ZZ
i17 : X0 = matrix{{.5},{1}}

o17 = | .5 |
      | 1  |

                 2         1
o17 : Matrix RR    <-- RR
               53        53
i18 : evaluateH(PH,pars,X0,0.5)

o18 = | -.25  |
      | -.375 |

                 2         1
o18 : Matrix RR    <-- RR
               53        53
i19 : evaluateHx(PH,pars,X0,0.5)

o19 = | 1.5 .75 |
      | .75 2   |

                 2         2
o19 : Matrix RR    <-- RR
               53        53
i20 : evaluateHt(PH,pars,X0,0.5)

o20 = | .5 |
      | 1  |

                 2         1
o20 : Matrix RR    <-- RR
               53        53

After the parameter homotopy is specialized using specialize, For a ParameterHomotopy, parameter values must also be supplied.

i21 : H01 = specialize(PH, pars)

o21 = SpecializedParameterHomotopy{...2...}

o21 : SpecializedParameterHomotopy
i22 : evaluateH(H01,X0,0.5)

o22 = | -.25  |
      | -.375 |

                 2         1
o22 : Matrix RR    <-- RR
               53        53
i23 : evaluateHx(H01,X0,0.5)

o23 = | 1.5 .75 |
      | .75 2   |

                 2         2
o23 : Matrix RR    <-- RR
               53        53
i24 : evaluateHt(H01,X0,0.5)

o24 = | .5 |
      | 1  |

                 2         1
o24 : Matrix RR    <-- RR
               53        53

Ways to use evaluateH:

  • evaluateH(GateHomotopy,Matrix,Number)
  • evaluateH(Homotopy,Matrix,Number)
  • evaluateH(ParameterHomotopy,Matrix,Matrix,Number)
  • evaluateH(SpecializedParameterHomotopy,Matrix,Number)
  • evaluateH(GateParameterHomotopy,Matrix,Matrix,Number) -- evaluate (gate) parameter homotopy and its derivatives

For the programmer

The object evaluateH is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.26.06+ds/M2/Macaulay2/packages/NumericalAlgebraicGeometry/doc.m2:1027:0.