You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having a problem with getting the dimensions right for the diagonal homotopy solver. In the example below, I define two sets of polynomials, where one contains some that are also in the other. Unless I understood it incorrectly, the dimension for the first set is 1 while it is zero for the second. However, when I do this the output is incorrect and gives me results for the variables a1, a2, b1, b2. If I set dim2 = 1, which I think is actually incorrect for this system, the output for the intersection is correct.
polys1= ['a + b;']
polys2= ['a + b;', 'a - 5;']
amb_dim=2dim1=1dim2=0emb1=embed(amb_dim, dim1, polys1)
emb2=embed(amb_dim, dim2, polys2)
sols1=solve(emb1, verbose=False, precision='d')
sols2=solve(emb2, verbose=False, precision='d')
emb1[0] ='a + b - a - b + '+emb1[0]
emb2[0] ='a + b - a - b + '+emb2[0]
polys, sols=diagsolve(amb_dim, dim1, emb1, sols1, dim2, emb2, sols2, prc='d', verbose=False)
print("Diagonal solutions")
forsolinsols:
print(sol)
polys= ['a + b;', 'a - 5;']
dim3=0emb=embed(amb_dim, dim3, polys)
sols=solve(emb, verbose=False, precision='d')
print("Regular solutions")
forsolinsols:
print(sol)
Another example is the following,
polys1= ['x + y + z;']
polys2= ['z - 2;', 'x + y + z;']
amb_dim=3dim1=2dim2=1emb1=embed(amb_dim, dim1, polys1)
emb2=embed(amb_dim, dim2, polys2)
sols1=solve(emb1, verbose=False, precision='d')
sols2=solve(emb2, verbose=False, precision='d')
emb1[0] ='x + y + z - x - y - z + '+emb1[0]
emb2[0] ='x + y + z - x - y - z + '+emb2[0]
polys, sols=diagsolve(amb_dim, dim1, emb1, sols1, dim2, emb2, sols2, prc='d', verbose=False)
print("Diagonal solutions")
forsolinsols:
print(sol)
polys= ['z - 2;', 'x + y + z;']
emb=embed(amb_dim, 1, polys)
sols=solve(emb, verbose=False, precision='d')
print("Regular solutions")
forsolinsols:
print(sol)
When running this, it gives a solution of dimension 0 for the diagonal homotopy but of dimension 1 for the black box solver. Lastly, the following example gives me zero solutions for the diagonal homotopy but four for the black box solver.
polys1= [
'(3 * d * h + 1 * d * j + 9 * d * k + 9 * f * h + 5 * f * j + 3 * f * k + 5 * g * h + 2 * g * j + 1 * g * k) - (5 * d * h + 8 * d * j + 1 * d * k + 5 * f * h + 8 * f * j + 7 * f * k + 2 * g * h + 8 * g * j + 9 * g * k);',
'b + c - 1;', 'd + f + g - 1;', 'h + j + k - 1;', 'a;']
polys2= [
'(3 * a * h + 5 * a * j + 2 * a * k + 6 * b * h + 8 * b * j + 7 * b * k + 4 * c * h + 7 * c * j + 3 * c * k) - (2 * a * h + 1 * a * j + 8 * a * k + 9 * b * h + 7 * b * j + 4 * b * k + 8 * c * h + 2 * c * j + 4 * c * k);',
'a + b + c - 1;', 'd + g - 1;', 'h + j + k - 1;', 'f;']
amb_dim=9dim1=4emb1=embed(amb_dim, dim1, polys1)
sols1=solve(emb1, verbose=False, precision='d')
dim2=4emb2=embed(amb_dim, dim2, polys2)
sols2=solve(emb2, verbose=False, precision='d')
emb1[0] ='a + b + c + d + f + g + h + j + k - a - b - c - d - f - g - h - j - k + '+emb1[0]
emb2[0] ='a + b + c + d + f + g + h + j + k - a - b - c - d - f - g - h - j - k + '+emb2[0]
polys, sols=diagsolve(amb_dim, dim1, emb1, sols1, dim2, emb2, sols2, prc='d', verbose=False)
print("Diagonal solutions: ", len(sols))
polys3= [
'(3 * d * h + 1 * d * j + 9 * d * k + 9 * f * h + 5 * f * j + 3 * f * k + 5 * g * h + 2 * g * j + 1 * g * k) - (5 * d * h + 8 * d * j + 1 * d * k + 5 * f * h + 8 * f * j + 7 * f * k + 2 * g * h + 8 * g * j + 9 * g * k);',
'b + c - 1;', 'h + j + k - 1;', 'a;', 'd + g - 1;', 'f;',
'(3 * a * h + 5 * a * j + 2 * a * k + 6 * b * h + 8 * b * j + 7 * b * k + 4 * c * h + 7 * c * j + 3 * c * k) - (2 * a * h + 1 * a * j + 8 * a * k + 9 * b * h + 7 * b * j + 4 * b * k + 8 * c * h + 2 * c * j + 4 * c * k);',
]
dim=2emb=embed(amb_dim, dim, polys3)
sols=solve(emb, verbose=False)
print("Regular solutions: ", len(sols))
All of these examples have in common that some polynomials are overlapping or the same in both systems. I'm wondering then if the output for the diagonal homotopy is a bug or if I should be setting the dimensions differently? I have tried a lot of dimension configurations but anything I try leads to other problems.
I'm honestly completely stuck here, so if you could help me out I would greatly appreciate it!
The text was updated successfully, but these errors were encountered:
Thanks for reporting this issue. Setting the verbose option to True in the blackbox solver gives different results, I will check this out.
To compute a witness set for one polynomial, there are more efficient methods available.
For example:
from phcpy.sets import witness_set_of_hypersurface as withyp
(p, s) = withyp(3, 'x+y+z;', 'd')
will return in p the embedded system and in s the witness points.
I'm having a problem with getting the dimensions right for the diagonal homotopy solver. In the example below, I define two sets of polynomials, where one contains some that are also in the other. Unless I understood it incorrectly, the dimension for the first set is 1 while it is zero for the second. However, when I do this the output is incorrect and gives me results for the variables
a1, a2, b1, b2
. If I setdim2 = 1
, which I think is actually incorrect for this system, the output for the intersection is correct.Another example is the following,
When running this, it gives a solution of dimension 0 for the diagonal homotopy but of dimension 1 for the black box solver. Lastly, the following example gives me zero solutions for the diagonal homotopy but four for the black box solver.
All of these examples have in common that some polynomials are overlapping or the same in both systems. I'm wondering then if the output for the diagonal homotopy is a bug or if I should be setting the dimensions differently? I have tried a lot of dimension configurations but anything I try leads to other problems.
I'm honestly completely stuck here, so if you could help me out I would greatly appreciate it!
The text was updated successfully, but these errors were encountered: