Qiskit-Extensions / monodromy

Computations in the monodromy polytope for quantum gate sets
Apache License 2.0
17 stars 9 forks source link

Embarrassingly parallel volume calculation #13

Open ecpeterson opened 4 days ago

ecpeterson commented 4 days ago

Polytope.volume currently works by a slight modification of inclusion-exclusion, the summands of which could be calculated in parallel by separately launched lrs subprocesses.

mpham26uchicago commented 4 days ago

Monodromy is definitely not threaded, and 99% sure lrs isn’t either, so it only occupies 1 of the computer’s probably ~8 cores, & you could speed some parts up by kicking off several lrs processes & letting them run in parallel. python has a package called “multiprocessing” which makes this fairly plug-and-play, though you’ll have to figure out where in volume.py its hooks ought to be placed. That’d turn your 3 day calculation into a 1/2 day calculation, which is obviously still very slow but an improvement nonetheless.