tensorcircuit icon indicating copy to clipboard operation
tensorcircuit copied to clipboard

Add examples benchmarking different contractor settings provided by cotengra

Open refraction-ray opened this issue 1 year ago • 0 comments

Task description

Add an example script in /examples or a jupyter notebook in /docs/source/tutorials to demonstrate the usage of different cotengra optimizers and benchmark the performance metric (pathfinding time, and the metrics for the tensor contraction), specifically with the newly added SimulatedAnnealing optimizer in cotengra (accessed by opt = HyperOptimizer(simulated_annealing_opts={}), might try combination of different path finding strategy if allowed ).

Implementation

The contraction path finding can be evaluated on different circuit sets: random circuits, qft circuits tc.templates.blocks.qft, QAOA circuits on different types of graph instances (regular graph, all-to-all graph, grid graph...), etc.

Also note that the contraction metric can be directly obtained without any real computation by setting debug_level=2 for contractor setup in tc.

References

  • https://github.com/jcmgray/cotengra
  • https://cotengra.readthedocs.io/en/latest/advanced.html#simulated-annealing-simulated-annealing-opts
  • https://tensorcircuit.readthedocs.io/en/latest/whitepaper/6-5-custom-contraction.html

refraction-ray avatar May 13 '24 07:05 refraction-ray