Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tring GAPS on an eight variables problem, generated solver is inaccurate, and shows C0 ill-condtional with large contion number #6

Open
Chastj opened this issue Sep 8, 2024 · 1 comment

Comments

@Chastj
Copy link

Chastj commented Sep 8, 2024

I used GAPS to generate a solver for an eight-variable problem. The problem has a quotient ring basis (degree = 80), and the template size is [1145, 1345]. While the generated solver can solve the problem, the results are not 100% accurate. I set the parameters to be solved as [0.5; 0.5; 100], but the closest solution returned is [0.49998; 0.49998; 100.0002]. As the amount of input data increases, the solution deviates further from the true values.

Here is a part of my code:
[C0, C1] = setup_elimination_template(H);
b_ind = [1102, 2248, 3394, 4540, 5686, 6832, 7978, 9124, 10270, 11416, 12562, 13708, 14854, 16000, 17146, 18292, 19438, 20584, 21730, 22876, 24022, 25168, 26314, 27460, 28606, 29752, 30898, 32044, 33190, 34336, 35482, 36628, 37774, 38920, 40066, 41212, 42358, 43504, 44650, 45796, 46942, 48088, 49234, 50380];
b = zeros(1145, 44);
b(b_ind) = -1;
alpha = C0' \ b;

At this line alpha = C0' \ b;, MATLAB indicates that the matrix C0 is ill-conditioned with a large condition number. This makes the solution numerically unstable.

Question:
What can I do to improve the accuracy of the solution, given the ill-conditioned nature of C0? Is there a way to mitigate the problem and make the solver more reliable as the data grows?

@prclibo
Copy link
Owner

prclibo commented Oct 20, 2024

Hi I havn't touched this code for long time and might forget the details. Probably two reasons related:

  1. [1145, 1345] is very large and it is easy to have numerical issue with such large matrix.
  2. Check if you generate your Zp samples correctly s.t. all constraints are obeyed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants