Benchmark different kernel implementations

You can benchmark different gate implementations inside the project.

$ make gbenchmark
$ cd BuildGBench

Then you can benchmark all gate operations in all kernels by running the script.

$ ./benchmarks/

The results will be recorded in bench_result.json file. You can then plot the results for a specific gate with

$ ./benchmarks/ ./bench_result.json

It will create a plot for each gate operation comparing performance of kernels and floating point types. The plots can be found in plots subdirectory.

One can also choose a specific datatype by providing an option:

$ ./benchmarks/ --precision float ./bench_result.json # Results for std::complex<float>
$ ./benchmarks/ --precision double ./bench_result.json # Results for std::complex<double>

Currently, we have two different kernels in Pennylane-Lightning named PI and LM. For difference between two kernels, see the documents Pennylane::Gates::GateImplementationsPI and Pennylane::Gates::GateImplementationsLM.

Here are some example plots:

Benchmark result for PauliX gate Benchmark result for RX gate