This page demonstrates how the method detRep computes a monic symmetric determinantal representation of a real quadric $f$ (in any number of variables), or returns false if no such representation exists.
If a quadratic determinantal representation of size $2$ exists, then it is returned. Otherwise, the method will find a determinantal representation of size $n+1$, where $n$ is the number of variables (if it exists). If no monic symmetric determinantal representation exists, then null is returned.
When working over an InexactFieldFamily like RR or CC, the option Tolerance can be used to specify the internal threshold for checking equality (any floating point number below the tolerance is treated as numerically zero).
i1 : R = RR[x1, x2, x3, x4] o1 = R o1 : PolynomialRing |
i2 : f = 260*x1^2+180*x1*x2-25*x2^2-140*x1*x3-170*x2*x3-121*x3^2+248*x1*x4+94*x2*x4-142*x3*x4+35*x4^2+36*x1+18*x2+2*x3+20*x4+1 2 2 2 2 o2 = 260x1 + 180x1*x2 - 25x2 - 140x1*x3 - 170x2*x3 - 121x3 + 248x1*x4 + 94x2*x4 - 142x3*x4 + 35x4 + 36x1 + 18x2 + 2x3 + 20x4 ---------------------------------------------------------------------------------------------------------------------------- + 1 o2 : R |
i3 : A = first detRep f o3 = | 18.1757x1+4.19887x2+2.24134x3+14.1528x4+1 7.99807x1+9.10764x2+10.9754x3+6.91046x4 | | 7.99807x1+9.10764x2+10.9754x3+6.91046x4 17.8243x1+13.8011x2-.241342x3+5.84723x4+1 | 2 2 o3 : Matrix R <--- R |
i4 : clean(1e-10, f - det A) o4 = 0 o4 : R |
i5 : g = -61*x1^2-96*x1*x2-177*x2^2-126*x1*x3-202*x2*x3-86*x3^2-94*x1*x4-190*x2*x4-140*x3*x4-67*x4^2+8*x1+3*x2+5*x3+3*x4+1 2 2 2 2 o5 = - 61x1 - 96x1*x2 - 177x2 - 126x1*x3 - 202x2*x3 - 86x3 - 94x1*x4 - 190x2*x4 - 140x3*x4 - 67x4 + 8x1 + 3x2 + 5x3 + 3x4 + 1 o5 : R |
i6 : B = first detRep g o6 = | 1 0 0 0 | 0 1 0 0 | 0 0 1 0 | 0 0 0 1 | 7.81025x1+6.14577x2+8.06632x3+6.01773x4 11.7996x2+4.35832x3+4.91683x4 1.39265x3+.0214748x4 2.57123x4 ---------------------------------------------------------------------------------------------------------------------------- 7.81025x1+6.14577x2+8.06632x3+6.01773x4 | 11.7996x2+4.35832x3+4.91683x4 | 1.39265x3+.0214748x4 | 2.57123x4 | 8x1+3x2+5x3+3x4+1 | 5 5 o6 : Matrix R <--- R |
i7 : clean(1e-10, g - det B) o7 = 0 o7 : R |