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

fix: fix total degree with many parameters threaded (#599) #600

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

oameye
Copy link
Contributor

@oameye oameye commented Nov 3, 2024

resolve #599

@PBrdng
Copy link
Collaborator

PBrdng commented Nov 4, 2024

Awesome. Thanks!

You said this problem only appears when using :total_degree. Is that right?

@oameye
Copy link
Contributor Author

oameye commented Nov 4, 2024

I didn't test the other methods, but probably the rest is covered by the tests?

@oameye
Copy link
Contributor Author

oameye commented Nov 4, 2024

It seems that polyhedral is also broken with many parameters (threading doesn't matter this time) but for another reason (see #601).

@PBrdng
Copy link
Collaborator

PBrdng commented Nov 4, 2024

Okay. I would like to fix #601 while we are at it before merging. Thanks for noticing.

@oameye
Copy link
Contributor Author

oameye commented Nov 4, 2024

I tried solve #601 but can't seem to solve it as I don't know enough of the internals. Could you take a look?

@PBrdng
Copy link
Collaborator

PBrdng commented Nov 4, 2024

Yes, I will pick it up from here. Don't worry.

@PBrdng
Copy link
Collaborator

PBrdng commented Nov 5, 2024

I added a warning message for when using total_degree and an error message for when using polyhedral on multiple parameters. I also changed your example the way it should best be solved.

@PBrdng
Copy link
Collaborator

PBrdng commented Nov 5, 2024

@oameye I'm waiting for you to take a look at the PR and then merge it later today or tomorrow.

src/solve.jl Show resolved Hide resolved
@oameye
Copy link
Contributor Author

oameye commented Nov 5, 2024

This is good to go for me :)

@PBrdng PBrdng merged commit 5b38909 into JuliaHomotopyContinuation:main Nov 5, 2024
4 checks passed
@oameye
Copy link
Contributor Author

oameye commented Nov 5, 2024

Can it be that this recommended way of computing the roots of many parameters sets does not always guarantee to find all solutions? Whereas doing a total degree does guarantee to find all solutions?

@PBrdng
Copy link
Collaborator

PBrdng commented Nov 5, 2024

No. In theory this method finds all solutions (if the generic parameters are chosen complex).

@oameye
Copy link
Contributor Author

oameye commented Nov 5, 2024

Sorry one other question:

What if I want to avoid zero solutions? For one parameter set I can use :polyhedral with only_non_zero=true. But if I use the recommended way, I will just get one less solution which is not necessarily non zero. Do you never of a better way? Or is running :polyhedral in a loop the best way for the moment?

@PBrdng
Copy link
Collaborator

PBrdng commented Nov 6, 2024

Sorry one other question:

What if I want to avoid zero solutions? For one parameter set I can use :polyhedral with only_non_zero=true. But if I use the recommended way, I will just get one less solution which is not necessarily non zero. Do you never of a better way? Or is running :polyhedral in a loop the best way for the moment?

The recommended method should, in theory, find all non-zero solutions (this doesnt mean that some solutions can't potentially be zero). Do you have an example that I can look at?

@saschatimme
Copy link
Member

Just for context: The non-zero solutions option works by constructing a slightly different start system than in the general case. I assume in your case, you are actually sampling from a parameter space that is smaller than C^m (m = number of parameters). So by solving once for a general sample of your parameter space and then reusing these solutions you should have only the results you are interested in.

@PBrdng
Copy link
Collaborator

PBrdng commented Nov 7, 2024

I think this is true in general (provided setting the parameters does not change the support). However, all solution nonzero is only true for generic coefficients, which is not necessarily the case here.

@oameye
Copy link
Contributor Author

oameye commented Nov 10, 2024

Thank you both for the answers. This is really useful. In general, the zero solutions are non-interesting solutions for my use case. So I was hoping it could give a speedup in finding the solutions. However, in my testing it doesn't seem to make much of a difference. Probably, this is because it just tracks one less solution of the generic system compared to only_non_zero=false case.

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

Successfully merging this pull request may close these issues.

threaded total degree solve for multiple sets of parameters
3 participants