JuliaQUBO / ToQUBO.jl

🟦 JuMP ToQUBO Automatic Reformulation
https://juliaqubo.github.io/ToQUBO.jl/
Other
27 stars 2 forks source link

Usage of Random #14

Closed joaquimg closed 2 years ago

joaquimg commented 2 years ago

Where is Random used? Only in shuffle?

Usage of Random should be accompanied by an explicit random number generator like Random.MersenneTwister that requires a seed. This is necessary to ensure reproducibility.

pedromxavier commented 2 years ago

I was shuffling variables in PBF terms during quadratization to look for differences in the output's number of slack variables and the non-deterministic ordering of the Set type seems random enough. We can drop this dependency.

joaquimg commented 2 years ago

That is interesting. The ordering in Set should be deterministic, although not the same as the user added. If we run the same code twice and get different results we are in a bad spot. There exist the OrderedCollections.jl with OrderedSet to consider it the current runs are non deterministic

pedromxavier commented 2 years ago

That's not a problem for us, we rely mainly on term-by-term quadratization now.

pedromxavier commented 2 years ago

Random is now used to generate states for our RandomSampler