Skip to content

Commit

Permalink
merging chicago.m2 with eval_monodromy_demo.m2
Browse files Browse the repository at this point in the history
  • Loading branch information
rfabbri committed Jun 14, 2024
1 parent e79131c commit 5450d62
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
14 changes: 14 additions & 0 deletions tutorial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,18 @@ C = {
makeSLProgram(matrix{cameraParams},P3)
}

## Evaluate to check equation
- How can we evaluate the the equations on the system?
evaluate(F,x0||p0) only for F gatematrix, but we ony have gateSystem in Ex, not
gatematrix.

Usually one creates gateSystem from Gatematrix:
GS = gateSystem(GS)


(p,x)=fabricateChicago CC
evaluate(F,x||p)

(p0,x0) = fabricateChicago(CC)
evaluate(F,x0||p0)

23 changes: 20 additions & 3 deletions tutorial/ex-start.m2
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
-- Ex and Pro marked bellow mean Example (simple) and Pro (fast)


-- code for generating various evaluators
restart
needsPackage "SLPexpressions"
needsPackage "MonodromySolver"
-- "gateSystem" exists only in M2 v 1.14

-- Ex---------------------------------------------------------------------------
-- Pro doesn't use declareVariable
variables = declareVariable \ {x,y}
params = declareVariable \ {a,b,c,d,e,f}

-- Ex and Pro ------------------------------------------------------------------
GS = gateSystem(
matrix{params},
matrix{variables},
Expand All @@ -13,10 +21,17 @@ GS = gateSystem(
d*x+e*y+f}
}
)
-------------------------------------------------------------------------------

-- Ex and Pro ------------------------------------------------------------------
cameraVars = flatten entries vars GS
PH = parametricSegmentHomotopy GS

-- Pro only --------------------------------------------------------------------
-- setDefault(CorrectorTolerance=>1e-8)

-------------------------------------------------------------------------------

-- HxHt
h=cCode(
transpose(PH.GateHomotopy#"Hx"|PH.GateHomotopy#"Ht"),
Expand All @@ -26,6 +41,9 @@ h=cCode(
-- HxH
h=cCode(transpose(PH.GateHomotopy#"Hx"|PH.GateHomotopy#"H"),gateMatrix{cameraVars|{PH.GateHomotopy#"T"}|flatten entries PH#Parameters})

-- Maybe useful
-- cCode PH

-- Ex 1 --------------------------------------------------------------------------
-- monodromy needs an initial pair of parameter, solution
-- the command below won't work for most use cases
Expand Down Expand Up @@ -57,10 +75,9 @@ h=cCode(transpose(PH.GateHomotopy#"Hx"|PH.GateHomotopy#"H"),gateMatrix{cameraVar

-- Ex 3 -------------------------------------------------------------------
-- parameter point
-- V.BasePoint
V.BasePoint
-- corresponding solutions
-- points V.PartialSols
-------------------------------------------------------------------------------
points V.PartialSols

-- Pro 3 --------------------------------------------------------------
-- quality check
Expand Down

0 comments on commit 5450d62

Please sign in to comment.