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
{{ message }}
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Positive and negative problems of the tolerance parameter in LocalUnivariateMinimum
Conceptual overview
When calling the LocalUnivariateMinimum function, the search will never stop if the tolerance input is negative, because the bool value of Width(interval) > tolerance is always true.
When the (item1,item2) in argument bounds is item1>item2, the bool value of Width(interval) > tolerance is always false, the program will not enter the search logic.
Current status
mutable tolerance = -1.0;The program will never finish executing
let bounds = (1.0, 0.1); The program will never search
Fact(left <= right, "Left endpoint of bounds must be less than or equal to right endpoint.");
I hope I will be allowed to submit a pr as soon as possible because this logic problem is serious.
Code
namespaceTest{openMicrosoft.Quantum.Canon;
open Microsoft.Quantum.Intrinsic;
open Microsoft.Quantum.Math;
open Microsoft.Quantum.Diagnostics;
open Microsoft.Quantum.Optimization;
@EntryPoint()
operation main (): Unit {//mutable tolerance = -1.0;
mutable tolerance=0.1;mutablefn=AbsD;letbounds=(1.0,0.1);//let bounds = (0.1,1.0);letresult=LocalUnivariateMinimum(fn,bounds,tolerance);Message($"{result}");}}