Proudfoot-Speyer degenerations

This tutorial contains detailed explanations to the source code of the paper ## Proudfoot-Speyer degenerations for solving scattering equations of Barbara Betti, Borovik Viktoriia and Simon Telen.

To use our package download the folder ProudfootSpeyerHomotopy.zip. Open your project in the directory containing this folder and in the Julia package manager run activate ProudfootSpeyerHomotopy and instantiate.

[2]:
using Pkg;
Pkg.activate("ProudfootSpeyerHomotopy")
  Activating project at `~/Desktop/ProudfootSpeyerHomotopy`
[3]:
Pkg.instantiate()

Now the package is ready to use.

[4]:
using ProudfootSpeyerHomotopy
[ Info: Precompiling ProudfootSpeyerHomotopy [b971b1de-5951-4477-ad69-3e9f0b4e1964]

The following function returns the universal Gröbner basis for the reciprocal linear space \(\mathcal{R}_L\), given a matrix \(L\) representing a hyperplane arrangement. We illustrate its usage with the matrix \(L\) from Example 1.1. The output is a list of Gröbner basis elements and the variables involved in these polynomials.

[5]:
L = [0 0 2 2; 1 0 -1 -2; 0 1 -2 -1]
GB, y = get_Groebner_basis(L)
[5]:
(Any[y₀*y₃*y₂ - y₁*y₀*y₂ + y₁*y₀*y₃ - y₁*y₃*y₂], HomotopyContinuation.ModelKit.Variable[y₀, y₁, y₂, y₃])

For each element of the Gröbner basis, we can compute its Gröbner degeneration with respect to some weight \(\omega \in \mathbb{R}^{n+1}\). The input to weight_deformation_for_poly should include a polynomial, its variables, a weight \(\omega\), and a variable representing the degeneration parameter. The following appears in Example 4.2.

[6]:
using HomotopyContinuation
@var t;
weight_deformation_for_poly(GB[1], y, [4,3,2,1], t)
[6]:
$$ -y₁*y₀*y₂ + t*y₁*y₀*y₃ + t^2*y₀*y₃*y₂ - t^3*y₁*y₃*y₂ $$

The following function, solve_start_system, computes the solutions to the start system \(G(y)\) in the \(y\)-coordinate space, as described in Section 4. We illustrate its usage with the matrix \(L\) from Example 2.6.

[7]:
L =  [1 0 0 0; 1 1 0 1; 0 0 1 1]
d,n = size(L).-(1,1);
A0 = randn(ComplexF64,d,n+1);       #we choose a generic matrix for the start system

w = [4,3,2,1];                  #we pick an order on the ground set to construct a broken circuit ring

The reciprocal linear space is given by the quadric \(y₃y₂ + y₁y₃ -y₁y₂\).

[8]:
GB, y = get_Groebner_basis(L)
[8]:
(Any[-y₁*y₂ + y₁*y₃ + y₃*y₂], Variable[y₀, y₁, y₂, y₃])

The term \(y_1y_2\) is the leading term with respect to the chosen w. The corresponding Stanley-Reisner ideal has 2 prime components \((y_2)\) and \((y_1)\).

[9]:
weight_deformation_for_poly(GB[1], y, w, t)
[9]:
$$ -y₁*y₂ + t*y₁*y₃ + t^2*y₃*y₂ $$

Two solutions to the start system are lying on the coordinate hyperplanes \(y_2 = 0\) and \(y_1 = 0\), respectively.

[10]:
solve_start_system(A0, L, w)
[10]:
2-element Vector{Any}:
 ComplexF64[-0.11895092252516362 + 0.776006867368025im, 0.10587931490393554 + 0.013678190516356104im, 0.0 + 0.0im, 0.6028620497537855 - 0.09393533187471383im]
 ComplexF64[0.053479740954963495 + 0.7851667938396949im, 0.0 + 0.0im, -0.14300572752280596 - 0.030763513785741936im, 0.5967088998532751 - 0.05651973204116929im]

The following function provides the core functionality of the package. It computes the solutions to the scattering equations for the hyperplane arrangement \(\mathcal{A}\), defined by the matrix \(L\), using the Proudfoot-Speyer homotopy algorithm, as explained in Section 4. It returns a vector of solutions in the initial \(x\) coordinates. The following is Example 2.6. Among the two solutions on \(\mathcal{R}_L\), only one is a non-boundary solution. We translate this solution to \(x\) coordinates by solving the linear system \(Ax - b = 1/y\).

[11]:
L =  [1 0 0 0; 1 1 0 1; 0 0 1 1];
u = randn(ComplexF64,size(L,2));     #choose a generic data vector u
solve_PS(L, u)
Number of solutions on the reciprocal space: 2  Number of solutions in the open stratum: 1
[11]:
1-element Vector{Any}:
 ComplexF64[0.5088527690876499 + 3.963023081177803im, -1.4318578943493199 - 4.496503031160026im]

The function provides an option to specify a matrix \(A_0\) and a weight \(\omega\) for the start system \(G(y)\). All solutions, including boundary solutions with 0 coordinates, can be returned by setting the optional return_boundary parameter to true. These solutions will be returned in \(y\) coordinates.

[12]:
using LinearAlgebra
L =  [1 0 0 0; 1 1 0 1; 0 0 1 1];
u = randn(ComplexF64,size(L,2));
A = (L[2:end,:])*diagm(u);
solve_PS(L, u, A0 = A, w = [4,3,2,1],return_boundary = true)
Number of solutions on the reciprocal space: 2  Number of solutions in the open stratum: 1
[12]:
(Result with 2 solutions
=======================
• 2 paths tracked
• 2 non-singular solutions (0 real)
• random_seed: 0xa58d9279
, Vector{ComplexF64}[[0.06864414648070097 + 0.8542986381367365im, -0.573720679524029 + 0.20952230940091082im, 4.755983297738069e-270 + 0.0im, 6.057227193173887e-269 - 7.017538145858909e-269im], [-0.10161994480740036 - 0.05098260217951653im, -0.22134209561374185 - 0.0022015270853874814im, 0.25077567087312835 - 0.06135253003958946im, -0.5026490080970151 - 0.6427209562315538im]])

The following computation verifies Example 1.1.

[13]:
L =  [0 0 2 2; 1 0 -1 -2; 0 1 -2 -1];
u = randn(ComplexF64,size(L,2));     #choose a generic data vector u
solve_PS(L, u)
Tracking 3 paths... 100%|███████████████████████████████| Time: 0:00:04
  # paths tracked:                  3
  # non-singular solutions (real):  3 (0)
  # singular endpoints (real):      0 (0)
  # total solutions (real):         3 (0)
Number of solutions on the reciprocal space: 3  Number of solutions in the open stratum: 3
[13]:
3-element Vector{Any}:
 ComplexF64[1.3585463807183518 + 1.5141218462062542im, -1.6930248738834233 - 7.501191164478883im]
 ComplexF64[1.1978657709540061 + 0.06020968239986663im, -2.067117930694147 - 2.852162590347564im]
 ComplexF64[-3.418163277331961 - 6.377114818901963im, 3.0553519503981867 + 7.104276776594001im]

Scattering equations of \(\mathcal{M}_{0,m}\)

The following function creates the matrix \((8)\) from Section 5, which represents a point in the moduli space \(\mathcal{M}_{0,m}\). It returns the matrix, the corresponding ring, and its \(x\) coordinates.

[14]:
m = 6;
sigma, R, x = create_point_of_M0m(m)
[14]:
([1 1 1 1 1 0; 0 1 x3 x4 x5 1], Multivariate polynomial ring in 3 variables over QQ, Nemo.QQMPolyRingElem[x3, x4, x5])

The following function creates the matrix \(L_m\), as defined in Equation (10) from Section 5, which represents the hyperplane arrangement \(\mathcal{A}_m\).

[53]:
L = create_arrangement(sigma, R, x)
[53]:
4×9 Matrix{Int64}:
 0  -1  0  -1   0  0  -1   0   0
 1   1  0   0  -1  0   0  -1   0
 0   0  1   1   1  0   0   0  -1
 0   0  0   0   0  1   1   1   1

The following function verifies that a submatrix \(L_I\), associated with a flat \(I\) of \(M(L_m)\), takes the form of \(L_k\) for some \(k < m\).

[16]:
check_submatrix(L, [1,2])
[16]:
true
[17]:
check_submatrix(L, [3,6])
[17]:
false

The following function returns all flats of type \(\mathrm{(ii)}\) of a given rank.

[18]:
type2_flats(L, 2)
[18]:
3-element Vector{Vector{Int64}}:
 [1, 2]
 [3, 4]
 [6, 7]
[19]:
type2_flats(L, 3)
[19]:
3-element Vector{Vector{Int64}}:
 [1, 2, 3, 4, 5]
 [1, 2, 6, 7, 8]
 [3, 4, 6, 7, 9]

We now solve the scattering equations on \(\mathcal{M}_{0,m}\) for \(m = 6\). The ML degree is given by \((m-3)!\), while the reciprocal degree is \((m-3)(m-3)!\).

[20]:
u = randn(ComplexF64,size(L,2));
solve_PS(L, u)
Tracking 18 paths... 100%|██████████████████████████████| Time: 0:00:07
  # paths tracked:                  18
  # non-singular solutions (real):  12 (0)
  # singular endpoints (real):      6 (0)
  # total solutions (real):         18 (0)
Number of solutions on the reciprocal space: 18 Number of solutions in the open stratum: 6
[20]:
6-element Vector{Any}:
 ComplexF64[-0.20773386898619628 - 0.434150235577397im, 0.004253240442404493 + 2.7109563519458932im, -1.215980710669242 - 1.4248892075000539im]
 ComplexF64[0.4967729508704175 + 2.8026438356876247im, -6.4909383940920105 + 1.3792339134669165im, -0.9183539147471516 - 0.9931925313756897im]
 ComplexF64[-0.05341378483572183 - 0.04925178766554267im, 0.28730579454958904 - 0.13129985060486854im, 0.6473612494459542 - 0.175753707217006im]
 ComplexF64[2.536986841457401 + 1.9830112986164297im, 1.5930491911993427 + 1.2307383922844592im, 5.440460197457181 - 0.8821390837383705im]
 ComplexF64[6.809110478272321 - 7.987087845852356im, 2.524507761625622 - 3.044278607665599im, 7.489342797201872 - 8.856761505722606im]
 ComplexF64[-1.4883561685686297 + 4.480143927359773im, -1.7002235530195515 + 3.5323229829459604im, -1.2340322843054856 + 0.7656520757667802im]

The following computation verifies Example 5.3. The scattering equations on \(\mathcal{R}_{L_6}\) contain six distinct solutions of multiplicity one in \(\mathcal{R}_{L_6}^{\circ}\), all of whose coordinates are non-zero. These are exactly the solutions to the scattering equations on \(\mathcal{M}_{0,6}\), which were found in the previous computation in \(x\) coordinates. In addition, there are two roots of multiplicity one in each of the three strata \(I_1(W)\), and one root of multiplicity two in each of the three strata \(I_2(W)\).

[21]:
solve_PS(L, u, return_boundary = true)
Tracking 18 paths... 100%|██████████████████████████████| Time: 0:00:04
  # paths tracked:                  18
  # non-singular solutions (real):  12 (0)
  # singular endpoints (real):      6 (0)
  # total solutions (real):         18 (0)
Number of solutions on the reciprocal space: 18 Number of solutions in the open stratum: 6
[21]:
(Result with 15 solutions
========================
• 18 paths tracked
• 12 non-singular solutions (0 real)
• 3 singular solutions (0 real)
• random_seed: 0xa2d7eaa3
• multiplicity table of singular solutions:
╭───────┬───────┬────────┬────────────╮
│ mult. │ total │ # real │ # non-real │
├───────┼───────┼────────┼────────────┤
│   2   │   3   │   0    │     3      │
╰───────┴───────┴────────┴────────────╯
, Vector{ComplexF64}[[-0.4675102323654169 - 1.7314431609337997im, 0.12690642785289455 - 0.3410387104182609im, 0.0 - 0.0im, 0.0 - 0.0im, 0.0 - 0.0im, -0.0 - 0.0im, -0.0 - 0.0im, -0.0 - 0.0im, -0.0 + 0.0im], [-1.2000984390277176 - 3.356541510566452im, 0.0366738598047027 - 0.42838121794799694im, -0.24378074589473064 + 0.5782963184998801im, -0.7271345978856832 - 1.304194860471188im, -0.16008305050389 + 0.5287501868894022im, -3.331106487405392e-32 + 9.52914025296347e-32im, -3.02942761721036e-32 + 9.356709337630051e-32im, -2.532221718676952e-32 + 9.277866580531698e-32im, -2.8175000916893113e-32 + 9.656432185225314e-32im], [0.18832882598474987 + 0.11692617240416957im, -0.00880847320881957 + 0.07213007127644099im, 0.05286584989278164 - 0.079031717564627im, 0.0528066912443007 + 0.3866452694006201im, 0.015773735706177454 - 0.08706096242525602im, -0.2005061346876381 - 0.42114829724155456im, -0.04995015678430967 + 0.07268163652160489im, -0.11532850488320519 - 0.10468054386649793im, -0.07346394166162455 + 0.07386457513796689im], [0.656584053824752 - 0.3480768596549584im, 0.03250202711585736 + 0.20529307626497992im, -4.31337072585081e-33 - 1.0426164694053361e-32im, 4.929553109608345e-34 - 6.467287799580029e-33im, -6.596968336362743e-33 + 1.1791336813324333e-32im, -0.11484553747576377 - 0.37996751746238544im, -0.11444319238559628 + 0.2917181288595402im, -0.2799419198583818 - 0.26000818376298995im, 7.20923632393204e-33 - 4.7720368665981584e-33im], [-0.04233257864753513 - 1.8065367024603287im, 0.0882697580591116 - 0.1583942186710651im, -0.37938682258162076 + 0.1697337321301196im, 0.0454928189851177 - 0.2977901722251049im, -0.30640650842468437 + 0.2155404674488519im, -0.16325880964706893 + 0.10795452604930801im, -0.3447239169289488 - 0.31865869584896955im, -0.14442737030750427 + 0.11459965665098798im, -0.27051458809857865 + 0.24038936227759916im], [0.0018206799504096878 - 0.09810874935008543im, -0.11152689868179003 + 0.17647527771176538im, -0.012890748537768944 - 0.11746217577206365im, -0.07741038940351447 + 0.12285348002230488im, -0.25304275871432 + 0.4043168619579543im, -0.19962351032587786 - 0.24879399790978526im, -0.029206420393856767 + 0.07312898864470321im, -0.03329899559764178 + 0.11988186946700352im, -0.028317765064892367 + 0.16266227798956245im], [-0.006180113000479396 - 0.0532801868453754im, -0.2835012572538974 + 0.11360774195604505im, -0.014473726110025485 - 0.1416084487063686im, -0.009723593177624756 + 0.07721460442472296im, 0.010619644291165983 + 0.08540358889938014im, -0.005398732582272001 - 0.04823452067788285im, -0.29814814846336846 - 0.06913655824624179im, -0.03733956107804301 - 0.5085068677507861im, -0.008555292807901575 - 0.07314584747178357im], [-0.02814672908348811 - 0.2318548553615288im, -0.06307330667066817 + 0.21196594026592305im, -0.042923572847527056 - 0.37111240079742863im, -0.02980229056638115 + 0.16332802620323053im, 0.08091961044832789 + 0.6177890756674657im, 0.08825805648895786 - 0.10406695340824013im, 0.1605580481704605 + 0.12124361408043574im, 0.1786642713279335 - 0.045506873135397787im, 0.14817928517830167 - 0.08601714877022015im], [-0.3097050919558079 - 0.001259593042751626im, -0.30635180698899017 - 0.11420465234495686im, 1.7489851307466586e-32 + 5.151862601235856e-33im, -1.2495072367319814e-31 - 2.6625981481153536e-32im, -8.666684749742561e-34 + 2.7552835266889893e-32im, -0.2574579124803718 - 0.2210859560942153im, -0.15154082924693799 - 0.24074170826339278im, 0.2149060537929689 - 0.4125337017425248im, 1.8798881816542285e-32 - 1.768244430190531e-32im], [-0.5907308227010577 - 0.5655336982632764im, -0.10164296489724965 - 0.02532718940046657im, 0.1378675198523493 + 0.045518317777940076im, -0.47540555205993695 + 0.18007898601091027im, 0.11574008495109103 + 0.046849666601825365im, -0.10929164688697562 - 0.17945839024168148im, -0.0731540399369454 - 0.03724843063499706im, -0.12344505591991015 - 0.24958630250674im, -0.07511623842968305 - 0.05185666880638946im], [-0.0 + 0.0im, -0.0 + 0.0im, -0.0 + 0.0im, -0.0 + 0.0im, 0.0 + 0.0im, -0.24352690246938885 - 0.8073299020123733im, 0.3141715853094931 + 0.21986787617039089im, 0.0 - 0.0im, 0.0 - 0.0im], [-0.009411683529582434 - 0.2287626905692162im, -0.13347192175355307 + 0.2609308005347487im, -0.0729806391033912 - 0.3487546167760968im, -0.07654510903324517 + 0.18279067601298923im, -0.14267771607258414 + 0.5835834345052964im, -6.375543404234226e-34 + 7.799569954256977e-33im, 2.6648456933141258e-34 - 3.0021346954993803e-33im, 6.397711758322796e-33 - 1.1552508687331892e-32im, 6.046726777582523e-33 - 5.072242695434816e-33im], [3.851130223305666e-32 + 8.381951182953238e-32im, 3.743640863975235e-32 + 7.688565864254612e-32im, 0.0406726873851348 - 1.5133956156308708im, 0.4314732806365117 + 0.7169633164343341im, -5.413699860247204e-32 - 8.834294337961447e-32im, -0.0017361449937966216 - 0.5881034766804434im, 1.6838315402858555 - 0.045809014854169175im, -1.448451554141768e-32 - 8.243255473768314e-32im, -0.021034319613382223 - 0.9610065388667416im], [-0.0 - 0.0im, -0.0 - 0.0im, 0.1474441991008139 - 0.49338056158010996im, 0.29614252049080825 + 0.8450829917086088im, 0.0 + 0.0im, 0.0 - 0.0im, 0.0 - 0.0im, 0.0 + 0.0im, 0.0 - 0.0im], [-5.176035502345256e-32 - 4.475095415715664e-32im, 3.4344926165029567e-33 - 1.6033970199035824e-32im, 0.01560181670100982 - 0.09060914597821763im, 0.1365146614227934 + 0.342531662069499im, -5.180060523170974e-33 + 3.342523858498075e-32im, -0.13110567114749658 - 0.42207681954772275im, -0.012102786770658696 + 0.08862318135173287im, 5.002731668168129e-34 + 1.7616588725061603e-32im, -0.03162942446526765 + 0.10754965338500434im]])

Special start systems

We now verify Remark 5.7. If we take \(A_0 = A^{\top}\) for the start system \(G(y)\), then the start solutions are not regular. Among the 18 solutions, 13 are distinct, with 5 solutions having multiplicity 2. Tracking these 5 start solutions becomes impossible, so our homotopy algorithm results in 8 solutions to the scattering equations (including boundary solutions).

[55]:
u = randn(ComplexF64,size(L,2));
startsols = solve_start_system(L[2:end,:]*diagm(u), L, [9,8,7,6,5,4,3,2,1])
[55]:
18-element Vector{Any}:
 ComplexF64[-0.19988293030723936 + 0.6488429223356875im, -0.5339617406467889 - 0.5039191758924517im, 0.0 + 0.0im, 0.0 + 0.0im, 2.7755575615628914e-17 - 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 1.1102230246251565e-16 - 2.7755575615628914e-17im]
 ComplexF64[0.020475644518465924 - 0.678624396610435im, 0.6485715457875734 + 0.344099733073703im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -1.1102230246251565e-16 - 5.551115123125783e-17im, 0.0 - 6.938893903907228e-17im]
 ComplexF64[-0.09105483637432607 + 0.3655914302696858im, 0.0 + 0.0im, 0.0 + 0.0im, -0.5800248793247031 - 0.6093757884006835im, 0.3365569509280245 - 0.19238926566638417im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 5.551115123125783e-17 + 5.551115123125783e-17im]
 ComplexF64[-0.28924772111943653 - 0.1613102558952414im, 0.0 + 0.0im, 0.0 + 0.0im, 0.6503768431440442 - 0.35201117026503387im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -0.2810836890867246 + 0.2846510482747422im, 0.07178783760179608 + 0.4221671492416237im]
 ComplexF64[0.3217081417780667 - 0.2805165062546984im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -0.43739752312543057 - 0.03960045433916326im, 0.0 + 0.0im, -0.5412460492557974 + 0.165508397610611im, 0.0 + 0.0im, 0.5433191575320797 + 0.09692032581569893im]
 ComplexF64[0.2858516404668838 - 0.3942138576392884im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -0.5593618631698851 + 0.3225510669861772im, -0.36665579993335046 - 0.45991620288914664im, -5.551115123125783e-17 + 1.3877787807814457e-17im]
 ComplexF64[0.0 + 0.0im, 0.15744155984624825 + 0.6257690262407924im, 0.45421872581228 + 0.018765413708774548im, 0.0 + 0.0im, 0.6106972079907276 + 0.06330410376087925im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 - 1.734723475976807e-17im]
 ComplexF64[0.0 + 0.0im, 0.35714572989379173 + 0.33473371312799616im, 0.2975417044717679 - 0.17433817767645127im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.4615564792457484 + 0.29308766847272383im, 0.5431340889882961 - 0.2180504511644261im]
 ComplexF64[0.0 + 0.0im, 0.014196858860473976 - 0.1980749258158689im, 0.0 + 0.0im, 0.0 + 0.0im, -0.17242603754721275 - 0.07727445751771667im, -0.9086477070894217 + 0.20698786908796019im, 0.0 + 0.0im, 0.0 + 0.0im, 0.20750709380093404 + 0.11540738809320625im]
 ComplexF64[0.0 + 0.0im, 0.030622747906646465 - 0.20065935103410162im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -0.9427007880350615 + 0.13677729140510272im, 0.0 + 0.0im, -0.008119055757005007 - 0.22658188339051122im, -1.1102230246251565e-16 + 2.7755575615628914e-17im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, -0.2768658598203704 + 0.1661898442120585im, -0.62407978113617 - 0.7115129360199494im, 0.0 - 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 1.1102230246251565e-16 - 5.551115123125783e-17im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.1258081483106038 - 0.29739885418736667im, 0.9234558006028247 + 0.20725736580323095im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 - 0.0im, 2.220446049250313e-16 + 3.8163916471489756e-17im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.38040812042672445 + 0.0040565371861313315im, 0.0 + 0.0im, 0.0 - 0.0im, 0.0 + 0.0im, -0.6296752155445937 + 0.2047537733429436im, 0.0 + 0.0im, 0.6375115605565224 + 0.10216277113972433im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.38024327384404716 - 0.011909923463096744im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -0.6205286016306724 + 0.23099618898931235im, 0.0 - 2.7755575615628914e-17im, 0.6412370393212512 + 0.07532118594841924im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -0.07028015534949415 - 0.38586755188661076im, 0.0 - 0.0im, -0.7436403687104751 + 0.49151300584425556im, 0.0 + 0.0im, 0.0 + 0.0im, 0.22464822540211501 + 0.03337774855886222im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.13594072429282356 - 0.3679037745303223im, 0.0 + 0.0im, -0.8902843548085102 + 0.04449494884928901im, 0.0 + 0.0im, -5.551115123125783e-17 + 5.551115123125783e-17im, 0.17636913992959768 + 0.14309027135229063im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 - 0.0im, -0.9392522284352095 - 0.23215535088376898im, 0.22178718632283173 + 0.12132431091305752im, 0.0 + 0.0im, 3.3306690738754696e-16 - 5.724587470723463e-17im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.9111169320068183 - 0.32551004865434735im, -0.25189233580249415 + 0.02143351579863574im, -1.1102230246251565e-16 - 5.551115123125783e-17im, 1.1102230246251565e-16 + 2.0816681711721685e-17im]
[23]:
length(startsols)
[23]:
18

The following function projectively_unique removes duplicate solutions up to a specified numerical precision.

[24]:
length(projectively_unique(startsols))
[24]:
13
[25]:
solve_PS(L, u, A0 = L[2:end,:]*diagm(u), w = [9,8,7,6,5,4,3,2,1], return_boundary = true)
Tracking 18 paths... 100%|██████████████████████████████| Time: 0:00:05
  # paths tracked:                  18
  # non-singular solutions (real):  8 (0)
  # singular endpoints (real):      0 (0)
  # total solutions (real):         8 (0)
Number of solutions on the reciprocal space: 18 Number of solutions in the open stratum: 4
[25]:
(Result with 8 solutions
=======================
• 18 paths tracked
• 8 non-singular solutions (0 real)
• random_seed: 0xd314cc8e
, Vector{ComplexF64}[[0.13126839234954701 + 0.0885040367715507im, 0.11876783546771816 + 0.19407983928606976im, 0.07902499598475775 + 0.437605674304593im, -0.20549770575747647 + 0.19636905515895903im, -0.19242799974210567 - 0.052429694626687603im, 1.1872076010152547e-32 - 2.876474753472661e-32im, 2.3873555581231395e-36 + 6.868286391527943e-33im, 1.7794705114434792e-32 + 2.4144984573675954e-32im, 8.995651619265979e-33 - 8.197062083290588e-33im], [0.007719606802575357 + 0.1529835971727099im, -0.11315226168196157 + 0.06406668157151593im, 0.2497896374156257 + 0.16311980976934876im, -0.22695742206316868 - 0.048364889134717134im, 0.08814025857038457 - 0.1667548285857718im, 0.21539462048711516 + 0.48715411193122643im, -0.15561308250142794 - 0.025194259764158303im, 0.0184999260458161 - 0.20654681128380015im, -0.48688500481483377 - 0.027511667349733912im], [1.3666753778769027 - 0.023673979976593436im, 0.3523565376314228 + 0.3060713596148046im, -0.15724831608898646 + 0.09597708983699288im, -0.11685405014148584 + 0.13239724004561723im, -0.1455838292847707 + 0.07708585315039371im, 0.02308731247256024 - 0.8005157621980582im, 1.049052131854651 + 0.1929326153638794im, -0.3459913056175252 - 0.6146312766138373im, 0.12154224031930562 - 0.10610137973093743im], [1.5702757170555826 + 0.23870172653145194im, 0.2605498329738751 + 0.48332738408557063im, 1.3718656899263702e-29 - 3.091628776163353e-30im, 1.3712746851612348e-29 - 3.096900513428516e-30im, 1.3740249571068038e-29 - 3.0652700550778024e-30im, 0.36708706613085884 - 0.7690484058416548im, 0.9826847108518755 + 0.5910942975060368im, -0.08697917868111016 - 0.8580038058351419im, -1.373582541103851e-29 + 3.12620508773391e-30im], [-0.03331722203789459 + 0.5615637383828137im, -0.6538721937584989 + 0.05402099426544573im, 0.431026250059964 + 0.008221719696911977im, 0.26669993083703136 - 0.4726577708028915im, 0.27327647892299034 - 0.1950268161375502im, -1.622135360857068e-32 + 1.4005375280310327e-32im, -4.038475081179531e-33 + 9.123153703285456e-33im, -4.8339031342819354e-33 + 1.4478079199849956e-32im, -3.18504850414954e-33 + 9.371308757062073e-33im], [-0.008087115083297139 + 0.13131776529537434im, -0.04317116840914807 - 0.002479275939519763im, 0.15556477334091565 + 0.21102950194222594im, -0.04538545413321939 - 0.013024602038529863im, 0.0980400957715768 - 0.1621536120122318im, -0.017271993178676007 + 0.2183308808675094im, -0.04200312425401303 - 0.007970082060021949im, 0.011617334680592726 - 0.3291198848411702im, -0.2890175666740632 + 0.1632145039225938im], [-0.9036381234616635 + 0.05777582780247768im, 0.1361756635140978 - 0.09970990421529907im, 0.006519139438976055 - 0.719017209685414im, 0.09929669202079698 - 0.0835691794369773im, 0.3300416029374075 - 0.43259995561259107im, -0.5930332768896681 - 1.0902066164821365im, 0.11328238757535988 - 0.08816467658143289im, 0.6402924989341446 - 0.6949174393617739im, -0.6368212742260192 + 1.0936078584757907im], [-0.38167657744052597 + 0.3728565720474491im, 0.2966966903271187 - 0.3268043246574443im, -2.069177087991062e-31 + 1.217079386058696e-31im, -1.906249376190958e-31 + 1.0286967106401188e-31im, -2.088653019978017e-31 + 1.0781424207971217e-31im, -1.1955627844935173 + 0.0907062230863065im, 0.16026776343091934 - 0.23063459376049936im, 0.280749886349973 - 0.6875746951218511im, 1.9302546612694033e-31 - 1.253450341422121e-31im]])

If we solve a general linear system on \(V(J)\), we will have 18 distinct start solutions with exactly 4 non-zero coordinates.

[26]:
d,n = size(L).-(1,1);
A0 = randn(ComplexF64,d,n+1);
[27]:
generalstartsols = solve_start_system(A0, L, [9,8,7,6,5,4,3,2,1])
[27]:
18-element Vector{Any}:
 ComplexF64[0.5779147313879762 + 0.3463699217570473im, -0.15454451213981474 - 0.6245063718726553im, 0.0 + 0.0im, 0.0 + 0.0im, 0.26920507719179476 - 0.029636430335673758im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.23967494327958988 + 0.036830093398519226im]
 ComplexF64[0.249407240564037 - 0.30539461339909113im, -0.7700243762043572 - 0.003020505304359128im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.08987246511449425 - 0.39399656303422737im, 0.28234457488567166 + 0.09249153703955107im]
 ComplexF64[0.03247916602837983 - 0.33185069345828194im, 0.0 + 0.0im, 0.0 + 0.0im, -0.6900561457370853 - 0.20567753587132542im, 0.270374584506547 - 0.027095178238724954im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.5306093527473197 - 0.12229733496659209im]
 ComplexF64[-0.3294003222956752 - 0.4722548324383878im, 0.0 + 0.0im, 0.0 + 0.0im, -0.6927464818354667 - 0.074322425322645im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.3215427244316777 - 0.06360081296305171im, 0.27276361802283017 + 0.03484984286087178im]
 ComplexF64[-0.6039268009036628 - 0.2936075552536636im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -0.2570909275308202 - 0.18742398246212652im, 0.0 + 0.0im, -0.46685018565060254 - 0.36108485696108267im, 0.0 + 0.0im, 0.2311183626962956 + 0.21470086418920092im]
 ComplexF64[-0.4636380110307557 + 0.13260015314003307im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -0.4441880605254434 - 0.29165068601362826im, -0.2864315181286745 - 0.21325712969734104im, 0.5738884271846382 + 0.16800087365369876im]
 ComplexF64[0.0 + 0.0im, -0.12539279521830943 - 0.30285827861952164im, 0.13970906898275598 - 0.44112670586343006im, 0.0 + 0.0im, 0.18149382044598067 - 0.03289851915130686im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.7971263441003716 - 0.09491779346233653im]
 ComplexF64[0.0 + 0.0im, -0.30476736935248405 - 0.5715982664322367im, 0.01779099785906564 - 0.3825067487304756im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.3770410148505583 - 0.09648644522957811im, 0.5277958389413651 + 0.06104368406353967im]
 ComplexF64[0.0 + 0.0im, -0.035824277998209086 + 0.012564996259081335im, 0.0 + 0.0im, 0.0 + 0.0im, 0.17050022608555906 + 0.0014308163018761522im, 0.004744195797305584 - 0.6139400126927637im, 0.0 + 0.0im, 0.0 + 0.0im, 0.7558393314830136 + 0.14576839866293712im]
 ComplexF64[0.0 + 0.0im, -0.25907138609173913 - 0.28052050015015284im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -0.3766360289842723 - 0.42334830196281203im, 0.0 + 0.0im, 0.3446821397868757 - 0.2053875403632597im, 0.6088001879817708 - 0.038526545251380266im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, -0.08369837780234908 - 0.37351902221134003im, 0.03367882045013129 - 0.6123348484323703im, 0.11145781166569654 + 0.20036700215262554im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.6483406437310417 + 0.06689187096662652im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.16626127740870403 - 0.533888379961698im, 0.5379066421071226 - 0.2327618520791539im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -0.1370656691519014 + 0.18961473652235236im, 0.537620844668357 + 0.004672406404000573im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.28656210366623525 - 0.4787732252893948im, 0.0 + 0.0im, 0.19240969165585375 + 0.15703796986712434im, 0.0 + 0.0im, 0.2459602882669248 + 0.2680973365906546im, 0.0 + 0.0im, 0.698823202682503 - 0.07905335012826006im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.40980594472156157 - 0.2743940384365675im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -0.18942807981647938 + 0.4309577058125907im, -0.10018282024226567 + 0.32815463084619256im, 0.6242349457363391 - 0.1666377238898346im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, -0.0738603456601448 - 0.032973386428387166im, 0.19380781274779055 - 0.018671868215768304im, -0.12040401785349908 - 0.5657255217458476im, 0.0 + 0.0im, 0.0 + 0.0im, 0.7879458681306739 - 0.012087746174534508im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.19070379569024715 - 0.22494575197829453im, 0.0 + 0.0im, -0.4413727550901377 - 0.5513869238981566im, 0.0 + 0.0im, 0.1658748469580483 + 0.008273749559108631im, 0.6149790677801199 - 0.09171613054252634im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.18445184630516648 - 0.01796948192445774im, -0.060880695615426486 - 0.6128938235773177im, 0.018151814747168038 - 0.029989752175687147im, 0.0 + 0.0im, 0.7591016058530113 + 0.09404889373801241im]
 ComplexF64[0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.048007417778476225 - 0.7104961926706235im, -0.005018607389707948 + 0.2707270066232891im, 0.2307970864481574 + 0.24268281574145334im, 0.5525520829980848 + 0.04578319461081626im]
[28]:
length(projectively_unique(generalstartsols))
[28]:
18

Remark.

The solutions of the scattering equations are determined entirely by the matrix \(L\) and the data vector \(u\). Once this input is fixed, the solutions remain unchanged. This is illustrated using the system from Example 2.6.

[29]:
L =  [1 0 0 0; 1 1 0 1; 0 0 1 1];
u = randn(ComplexF64,size(L,2));
[32]:
result1, sols1 = solve_PS(L, u, return_boundary = true)
Number of solutions on the reciprocal space: 2  Number of solutions in the open stratum: 1
[32]:
(Result with 2 solutions
=======================
• 2 paths tracked
• 2 non-singular solutions (0 real)
• random_seed: 0x1c535ed2
, Vector{ComplexF64}[[-0.24835880512178543 + 1.00549024065695im, 0.9004008121211424 + 0.6825464804666357im, -1.6952246393437855 + 2.018236752458335im, 0.5161554211370468 + 0.9233134212556691im], [0.6420791918781175 + 0.2536802083759153im, 0.6867325873591787 + 0.8982927725601545im, 0.0 - 3.851859888774472e-34im, 9.62964972193618e-35 - 1.925929944387236e-34im]])
[33]:
result2, sols2 = solve_PS(L, u, return_boundary = true)
Number of solutions on the reciprocal space: 2  Number of solutions in the open stratum: 1
[33]:
(Result with 2 solutions
=======================
• 2 paths tracked
• 2 non-singular solutions (0 real)
• random_seed: 0xcebb6502
, Vector{ComplexF64}[[0.18360335047166804 - 0.4674110358140313im, 0.65242836292655 - 0.5008182703370966im, 1.1479437019748901e-41 + 0.0im, 1.0761972206014595e-42 - 2.8698592549372254e-42im], [0.013939491333395861 - 0.36983323167540355im, -0.36456832410030243 - 0.17348328163187432im, 0.4466994777538528 - 0.8291698577583362im, -0.24759447219667596 - 0.2856066141375253im]])

The following function are_projectively_equal divides each solution by its first non-zero entry and checks whether the difference between the solutions is approximately zero. The two outputs above are projectively equal, up to a permutation of the solutions.

[35]:
are_projectively_equal(sols1[1], sols2[2])
[35]:
true
[36]:
are_projectively_equal(sols1[2], sols2[1])
[36]:
true

If the start solutions for the homotopy are all distinct, we will find all the solutions of the scattering equations. The following 3 cells verify that we obtain the same solutions as before.

[44]:
A = L[2:end, :]*diagm(u);
result3, sols3 = solve_PS(L, u, A0 = A, w = [4,3,2,1], return_boundary = true)
Number of solutions on the reciprocal space: 2  Number of solutions in the open stratum: 1
[44]:
(Result with 2 solutions
=======================
• 2 paths tracked
• 2 non-singular solutions (0 real)
• random_seed: 0x3b5480fa
, Vector{ComplexF64}[[0.4720780541365913 - 0.6862954960274747im, 1.2421056186151522 - 0.5643147983974919im, -5.0e-324 + 5.0e-324im, -5.0e-324 + 5.0e-324im], [0.28792918353389513 + 0.2284907298836655im, 0.3531414678006915 - 0.18995899954542353im, 0.4014060218350382 + 0.8449214926773742im, 0.3741783933415124 - 0.03041118539668818im]])
[45]:
are_projectively_equal(sols1[1], sols3[2])
[45]:
true
[46]:
are_projectively_equal(sols1[2], sols3[1])
[46]:
true

However, for some choices of the weight \(\omega\) the special start system doesn’t have reciprocal degree many distinct solutions. This happens for the weight which selects the leading term \(y_2y_3\) of the quadric \(y₃y₂ + y₁y₃ -y₁y₂\). Then we have only one start solution of multiplicity 2. This solution lies on the intersection of coordinate subspaces \(y_2 = y_3 = 0\). The reason is that the complement of \(\{2,3\}\) is \(\{0,1\}\) is exactly the unique flat of type 2.

[50]:
startsols = solve_start_system(L[2:end,:]*diagm(u), L, [1,2,3,4])
[50]:
2-element Vector{Any}:
 ComplexF64[0.3017996771855759 + 0.42481946428433603im, 0.06468705685264975 + 0.851035229759376im, 1.1102230246251565e-16 - 0.0im, 0.0 + 0.0im]
 ComplexF64[-0.3463834985023435 + 0.3893238938845457im, -0.8148951531528024 + 0.25375434377350586im, 0.0 + 0.0im, 0.0 + 4.163336342344337e-17im]
[51]:
are_projectively_equal(startsols[1], startsols[2])
[51]:
true
[47]:
A = L[2:end, :]*diagm(u);
result3, sols3 = solve_PS(L, u, A0 = A, w = [1,2,3,4], return_boundary = true)
Number of solutions on the reciprocal space: 2  Number of solutions in the open stratum: 0
[47]:
(Result with 0 solutions
=======================
• 2 paths tracked
• 0 non-singular solutions (0 real)
• random_seed: 0x7150fdcf
, Vector{ComplexF64}[])
[49]:
A = L[2:end, :]*diagm(u);
result3, sols3 = solve_PS(L, u, A0 = A, w = [1,3,2,4], return_boundary = true)
Number of solutions on the reciprocal space: 2  Number of solutions in the open stratum: 1
[49]:
(Result with 2 solutions
=======================
• 2 paths tracked
• 2 non-singular solutions (0 real)
• random_seed: 0xaa31d709
, Vector{ComplexF64}[[0.33000404739242317 + 0.4351789346317084im, 0.09551495449568645 + 0.8893942680219674im, 6.66789793897474e-241 + 0.0im, 6.871227573528218e-241 + 0.0im], [-0.19595864460958262 + 0.34210291315465613im, 0.2582738797026779 + 0.3439097227802666im, -0.8313777457877778 + 0.5616471553189161im, 0.09247015266917316 + 0.39189594820578233im]])
[ ]: