120 Quartics
[ ]:
using HomotopyContinuation
using MultivariatePolynomials
We need the function var_coefficients(f,t) to compute the coefficients of a polynomial f with respect to a variable t.
[2]:
#return the t^m-coefficient of f, where t is a variable
function var_coeff(f,t,m)
v = terms(f)
v = filter(a -> (degree(a,t) == m),v)
if length(v) == 0
return polynomial(zeroterm(t))
end
v = map(a -> div(a,1.0*t^m),v)
v = map(a -> subs(a,t => 0),v)
return reduce(+,v)
end
function var_coefficients(f,t)
d = maxdegree(f,t)
v = Array{AbstractPolynomial}(undef,d+1)
for m=0:d
v[d-m+1] = polynomial(var_coeff(f,t,m))
end
return v
end
[2]:
var_coefficients (generic function with 1 method)
We take f to be a quartic in normal form and choose f_2, f_3 as quite generic degree 4 and 6 binary forms.
[3]:
@polyvar z x y c[0:14] d[0:14]
f = c[1]*x^4 + c[3]*x^3*z + c[4]*x^2*y^2 + c[5]*x^2*y*z + c[6]*x^2*z^2 + c[7]*x*y^3 + c[8]*x*y^2*z + c[9]*x*y*z^2 + c[11]*y^4 + c[12]*y^3*z + c[13]*y^2*z^2 + c[15]*y*z^3 + c[15]*z^4
p = var_coefficients(f,z)
#use equation (4) on page 18 in Vakils paper
u_2 = p[2]*p[4] - 4p[1]*p[5] - p[3]^2/3
u_3 = p[2]^2*p[5] + p[1]*p[4]^2 - 8p[1]*p[3]*p[5]/3 - p[2]*p[3]*p[4]/3 +2p[3]^3/27
f_2 = x^4 + 3x^3*y + 5x^2*y^2 + 7x*y^3 + 9y^4
f_3 = x^6 + 2*x^5*y + 3*x^4*y^2 + 4*x^3*y^3 + 5*x^2*y^4 + 6*x*y^5 + 7*y^6
[3]:
$$ x^{6} + 2x^{5}y + 3x^{4}y^{2} + 4x^{3}y^{3} + 5x^{2}y^{4} + 6xy^{5} + 7y^{6} $$
By demanding the vanishing of the coefficients of u_2 - f_2 and u_3 - f_3 t, we get twelve nonhomogenous equations. HomotopyContinuation.jl solves them for us.
[4]:
h_2 = u_2 - f_2
h_3 = u_3 - f_3
h_2 = subs(h_2,y =>1)
h_3 = subs(h_3,y => 1)
v = var_coefficients(h_2,x)
w = var_coefficients(h_3,x)
s = [v[i] for i in 1:length(v)]
for i in 1:length(w)
push!(s,w[i])
end
F = System(s)
res = solve(F)
sol = solutions(res)
Tracking 234 paths... 100%|█████████████████████████████| Time: 0:00:11
# paths tracked: 234
# non-singular solutions (real): 120 (8)
# singular endpoints (real): 0 (0)
# total solutions (real): 120 (8)
[4]:
120-element Vector{Vector{ComplexF64}}:
[-0.002999182663836804 - 0.0018445841878379794im, 0.042014686306177974 + 0.00897059872046452im, -0.016009209477069186 - 0.007554261312818278im, -0.1894506360380634 - 0.33538044581026777im, -0.5255017569540404 - 1.7113528455970557im, -0.029062075894411267 - 0.0348758805051172im, -0.2753224500274953 - 0.5547102977368354im, -0.7803152195997181 - 2.0411622811052097im, 0.025249342981252504 - 0.07460826327778351im, 1.324497959351418 - 0.356643966691034im, 10.667010079914279 + 5.257505371723499im, 29.304932613839156 + 31.952396126211465im]
[0.04012458761118343 - 3.17310994922088e-68im, -0.9202090454184744 + 4.8683330727772406e-67im, -0.10043779038739781 + 6.3172417253895145e-68im, -1.008452251547852 + 2.3414363826214347e-67im, 6.131870050056369 - 1.557866583288717e-66im, 0.10862384872649553 - 5.955014562236446e-68im, 2.6393289446986654 - 6.166555225517838e-67im, 18.247046914454984 + 7.0474916863061e-67im, -0.033768574321275 + 1.4996204554537036e-68im, -1.235987024689044 + 2.05165465209898e-67im, -15.858374223983322 - 1.7062348293162138e-66im, -84.32034804569224 - 2.744812551508692e-65im]
[-0.032470135069962276 - 0.06683018207733786im, 0.619367871768142 + 0.3058094665977249im, -0.07137488558697273 - 0.032547818663796205im, 0.30328990637265535 - 0.22706724821350444im, -1.336609865104886 + 0.6399669136586201im, 0.11020340226629728 - 0.04416557537032975im, 0.40908013064248194 - 0.07612998363619777im, -0.3315935457330107 + 3.3492334756433566im, -0.16854153159497778 - 0.07257328824900731im, -0.7153574194098674 + 0.9134933241283844im, 0.37741621562761857 + 2.867080364775104im, 0.41948370672031277 - 5.254013279807802im]
[0.008856210432055502 + 5.142787784847508e-39im, -0.07879828348814749 - 9.991701981989444e-38im, 0.07348814118244709 - 5.877471754111438e-39im, 0.44314490243888227 - 3.6293388081638127e-37im, 1.170403106249138 - 4.055455510336892e-37im, -0.047734170182069824 - 1.7044668086923169e-37im, -0.2897909356870769 - 3.9966807927957775e-37im, 0.3076671301290688 + 1.954259358242053e-36im, -0.04340313137004093 + 4.819526838371379e-37im, -2.052681080765898 + 6.770847460736376e-36im, -14.310595459040732 + 3.535887007273441e-35im, -41.11844699869937 + 7.673627122167893e-35im]
[-0.07408845345516302 - 0.06784391286475368im, -0.2157476536961062 + 2.0812773166872356im, -0.1724864343920742 + 0.10326507158095907im, -1.756925560992219 + 0.9943716279814979im, 10.60974758587671 - 6.199150949285394im, 0.14061619721982221 + 0.047509808588885136im, 4.159920069320126 + 1.7342174951848361im, 29.172396666903374 + 13.019839258689494im, -0.0131533811254121 - 0.027635934385188594im, -0.4421595071784843 - 1.4078233422210213im, -5.496721129105741 - 22.53046213114627im, -26.501469908906376 - 123.68919348594288im]
[-0.15658551176356034 - 0.5828443691316555im, 0.03581517285650325 + 2.7924612443217742im, -1.017661162215025 - 1.0643489928161256im, 0.08659918098806824 + 1.5504633958139065im, 0.46515253798452966 - 2.9245466704704937im, 0.49747053771737554 + 1.0778627834503876im, 2.4299365731276024 + 4.782468081677544im, 0.38616122602632696 - 2.4899501817208947im, 0.03665825171756822 + 0.7286120875839217im, -0.13510898622977763 - 1.0914608405954085im, -0.6927584237432767 - 4.43065128035005im, -0.5540031146187545 + 0.6141748176435983im]
[0.014108929891208143 - 0.03702433907262009im, 0.42437812256063595 + 0.35614604626584073im, 0.01238216948135064 + 0.026256733508955767im, 0.44698225818465215 - 0.3212858565374154im, -1.8113594043292174 + 1.453506330443415im, 0.026399201515043283 - 0.012208540462393025im, -0.39879525660842846 + 0.19038242755771212im, 0.9606324075033171 + 6.2368585040015745im, 0.0403615164171113 - 0.03002958953958146im, -0.4468948057671659 + 0.06920238925209637im, -0.2242560079448765 - 0.22956998756520772im, -13.47080229458544 - 4.248644325288272im]
[-0.05734161254057213 - 0.009414595746546484im, 0.814893065622805 + 0.4298836495518131im, -0.0033978941308084546 + 0.011898430128703261im, 0.47722456998109597 + 0.5356133178636351im, -2.954501008180969 - 3.0503301025989735im, 0.010181206902509976 + 0.0577434820218969im, -0.20621710857738676 - 0.29625597905720397im, -4.141589794380622 - 7.706605316715734im, -0.009206331217001307 - 0.024188049444002435im, 0.10399156832719941 - 0.40458421361991836im, 1.1903600957205016 + 1.470730642001703im, 7.618909708496588 + 24.943577196321254im]
[-0.021197554606821 - 0.0014683133562517412im, 0.2823626209021861 + 0.03189075239676406im, -0.013884247157660463 - 0.07040338618841688im, 0.266296969977519 - 0.24793934835805453im, 0.10743927525879594 - 0.19935975601941175im, -0.045311310752424026 - 0.00017369836552936122im, 0.5205620885084589 + 0.48608731614672235im, 0.41875682297692246 + 2.1130086883790486im, 0.051519283924117636 - 0.010073878219126628im, 1.3501741107212752 - 0.03522065201435287im, 3.6158036041070583 - 0.43735221778208644im, 11.615549547269554 - 0.9729948354941667im]
[-0.00848566781855874 + 0.01521405725298721im, 0.10382743700386435 - 0.1592382035857117im, -0.0052607584878172345 + 0.0007745603905453842im, 0.3396207018960779 - 0.16815995242120532im, 0.7727282481678399 + 0.3623267369669875im, -0.020770731254891695 + 0.008726038615054528im, 0.29503394598054955 - 0.06175866737592601im, 0.7147521059433618 + 1.0728982154040336im, 0.07295819006689636 + 0.10078009826406993im, 1.0133807481962605 + 0.836867318721335im, 3.1101491074303405 + 6.692868513248937im, 5.736513997599751 + 15.784144046497197im]
[0.01396084769701754 + 0.013988871300197159im, -0.2618115282497204 - 0.18201419362031157im, -0.01248242197075361 + 0.0064218760896972114im, -0.17636144338682178 - 0.025641738487291683im, 1.9980497250885358 + 0.46559611840235454im, 0.052146678564305625 + 0.021845578125772296im, 0.6502400172376461 + 0.02226890393806914im, 4.703353705425215 - 0.46491526790472304im, -0.02958740234732283 + 0.009088006403845673im, -0.7957361460223586 - 0.04699308288052437im, -5.753288976724982 + 2.0333616397941814im, -25.7338747856907 + 14.679659918753485im]
[-0.02589561855938872 + 0.0009096687567943394im, 0.37797518132141955 - 0.056167932024844935im, -0.07646972531888223 - 0.02016299308281677im, 0.3785028432777615 + 0.177693334868996im, -0.16663408193485557 + 0.861667985685952im, -0.09879482717937355 - 0.08015246515054171im, 0.26466625691666745 - 0.022766224999098156im, -1.03636609003253 + 0.6335652067966971im, -0.04910695618610761 + 0.005589211709395945im, 1.4631386808023976 - 0.002019195126800937im, 3.170280967308832 - 0.607220114527461im, 7.377547475072495 - 0.6649548767709326im]
[0.006097748877585383 + 0.002742955974934422im, -0.07568733906425484 - 0.012615730184591566im, -0.0016672373446162806 + 0.0410423504599427im, 0.16536112671778766 + 0.21043508162970123im, 1.2069901877261089 - 0.016900181321376495im, 0.022923012556394368 + 0.005723311802206985im, 0.35843656330828816 - 0.25215573891407755im, 1.4004974348595987 - 1.3763717638977788im, -0.15094859752680323 - 0.09913329513594683im, -2.850318197317976 - 0.6023889720276282im, -18.410994037677764 + 3.4093411675484195im, -50.44577384967553 + 23.249606558343423im]
⋮
[-0.009760712833450761 + 0.018916341105757396im, 0.10909407542796856 - 0.26376380809351724im, 0.005541379252819021 + 0.07680106356110135im, 0.23478465991395495 - 0.0805422431353533im, 0.835122218139891 + 0.7441553568090306im, -0.04278641474337166 + 0.16363887957710843im, 0.0795218479175098 + 0.1093815591948621im, 1.589153358838772 + 0.5392597484020103im, -0.18723151461235396 + 0.05634281406812722im, -0.568254376819047 - 0.36959518511598033im, 1.1729258780111214 + 2.0387985885788993im, 1.3192204564634398 + 13.16825984377292im]
[0.0064126324798665 + 0.0026780998806608673im, 0.21993549772004173 + 0.216811366224838im, 0.013537741775588715 - 0.011762044337550006im, 0.13697959890565226 + 0.05080966971661197im, 0.1374327333344669 + 2.2195503799706344im, 0.0370648990138235 + 0.001782649737202304im, 0.4154508940571182 + 0.1078430914182411im, 0.5479049452748231 - 2.9375912205772723im, 0.011161690339720387 + 0.01281743872168348im, 0.3496935166680805 + 0.29167308609890213im, 1.09317537000454 - 0.48268720989491776im, 18.287872983903863 - 15.565614176592447im]
[-0.009102095926560787 + 0.0017846157211960224im, 0.24093864995795897 - 0.05715128092233966im, -0.006175225872315327 + 0.02458500025866934im, 0.250443927334052 + 0.2341238035949854im, -0.07105035284109594 + 1.0595166254147932im, -0.012537693618336496 - 0.019430370237249455im, 0.24090129833043727 - 0.27857302964497777im, -0.8142927217726335 - 1.6041079380321688im, 0.04008531517472057 - 0.007843597542759997im, 0.8311048729252405 - 0.13004682390481365im, 2.744575312597188 - 0.20275157550302267im, 16.857033945379165 + 1.9266796263590773im]
[-0.009102095926560779 - 0.0017846157211960205im, 0.24093864995795894 + 0.05715128092233959im, -0.006175225872315324 - 0.024585000258669318im, 0.25044392733405196 - 0.2341238035949854im, -0.07105035284109598 - 1.0595166254147939im, -0.01253769361833647 + 0.019430370237249455im, 0.24090129833043736 + 0.2785730296449777im, -0.8142927217726328 + 1.604107938032169im, 0.04008531517472055 + 0.00784359754276im, 0.8311048729252404 + 0.1300468239048136im, 2.7445753125971883 + 0.2027515755030235im, 16.85703394537917 - 1.9266796263590744im]
[-0.03201924484808428 + 0.016234227360444796im, 0.7814469220991733 + 0.3720391405542952im, 0.031293089222399435 + 0.08268320727979743im, 0.2884127537659622 + 0.9360062351975098im, -1.372530064475242 - 5.655511086103136im, 0.05019974121361827 - 0.07028102814807044im, 1.2400986380951664 - 1.840718285185974im, 9.729601566957903 - 13.80585843881563im, -0.023373510612628788 - 0.0003874438562749093im, -0.9239428977613258 + 0.004093994602083262im, -12.389617591398768 + 0.42085776144057824im, -72.40584133626264 + 3.693828800738473im]
[0.0013307072298393444 - 0.007196775678597676im, 0.0794825478409094 + 0.1578725085777674im, 0.020193329542137352 - 0.00782077139235472im, 0.21157466992551013 - 0.09478838263042468im, -0.8942010758686709 - 1.450071440575537im, -0.002089396808281705 - 0.005054951414623545im, -0.17403213148076557 + 0.18556165497468644im, -2.8972218823093585 + 1.1880723149676138im, 0.020551834421896474 + 0.022381141728044885im, 0.5136816794234346 + 0.15478997002731534im, 4.4424052864439725 - 2.987704104064755im, 25.52290129972724 - 24.36797841523356im]
[0.08020384393308462 + 0.06733566625818865im, 1.9455816757511186 - 1.3841833325602726im, 0.0769084185525255 + 0.27498529518871295im, 0.9591848170898208 + 2.353929854751525im, -5.4849951456024755 - 14.270414694301639im, 0.2519435887767035 + 0.006480470037414868im, 6.706289382708154 - 0.37181865513782836im, 42.94580404937721 - 5.510129766296915im, 0.01944835104268076 - 0.05856703705469033im, 0.6375403838657712 - 2.5244123762354223im, 6.563787105430389 - 35.84830924973077im, 23.847713380996783 - 182.67612670531562im]
[-0.08699504684033964 - 1.6456920911512025e-37im, 0.6681938251429103 + 6.58276836460481e-37im, -0.5524144585995917 - 9.4039548065783e-37im, -0.08230296810049298 - 3.291384182302405e-37im, -0.542431764246673 - 3.291384182302405e-37im, -0.18169338028271134 - 4.231779662960235e-37im, 1.9418666850938158 + 9.4039548065783e-37im, 2.4651891593574464 + 1.9983403963978888e-37im, -1.1436513115589924 - 1.034435028723613e-36im, -1.6435278409041152 - 7.019905326316848e-37im, 0.864696112603031 - 9.4039548065783e-37im, 3.155574501566739 - 2.445028249710358e-36im]
[-0.24547541563071082 - 0.07459255757203431im, -1.4555470515878732 - 0.8073361819871147im, 1.3683406241474365 - 0.51040065323661im, -2.0530969357177424 - 0.3537570845542005im, 0.26030297524299445 - 1.357941533662438im, 0.5515525736047557 - 1.4478413943851274im, -0.23318379657017732 + 3.050457772884965im, -1.0114474609647939 - 3.923092511800867im, -1.6120976729486365 - 2.743787731086325im, 3.369253778769673 + 3.204071856070313im, -0.8434659008861203 - 2.052919831534526im, 0.31355636253324276 - 0.33527461144165976im]
[-0.0016967202005576843 + 0.008104214827900896im, 0.0027734058355966492 - 0.05737061685740039im, 0.14089798978665624 + 0.08168401522375436im, 0.8181243940411851 + 0.18164159592108436im, 1.033123382404166 + 0.08345038072459686im, -0.0491099600101548 - 0.004315048358004973im, -0.396204051886057 - 0.2195162006704425im, -0.99278506426142 - 0.31336976604690786im, 0.30906374121178987 + 0.06901551086075847im, 1.969756520659921 + 1.3858134688470491im, 4.317666147209821 + 12.856968042120785im, 6.675605438849604 + 40.35410817475256im]
[-0.019508406955237628 + 0.028390089515164387im, -0.323238669604747 - 0.5853196802787947im, -0.08534550584788204 + 0.0004709547816354042im, -0.7161503538880313 + 0.17758302244384225im, 3.9840575808986007 - 0.13367283700867547im, 0.003340233832767699 - 0.05757308232571451im, 0.7365394840723646 - 1.4050700403260383im, 3.781245689392323 - 10.431470781209978im, 0.01654261363597788 - 0.005192141223705897im, 0.30134734800263663 + 0.2266580259561642im, 3.417528480162265 + 6.765884966180729im, 27.956291742302966 + 36.13424612712085im]
[-0.018202990941852404 + 0.0005085323954645636im, 0.2148024563254744 + 0.3213592377283094im, 0.02641266175806776 + 0.009051819781260866im, 0.10758150685944583 + 0.5350352090453842im, -0.35740198371487875 - 2.297490837359396im, 0.04572584095757667 + 0.005893939537688808im, -0.003337766753660184 + 0.07102925072853157im, 1.8095657978907187 - 4.604852974220487im, 0.01929862741951325 + 0.04553740124536396im, -0.44105524458989287 - 0.20178018572880788im, -0.09187384804679088 - 1.7463808218928012im, -10.048230661009189 + 7.237534759303535im]