Skip to content

Latest commit

 

History

History
 
 

integer-factorization

README.md

Integer Factorization Sample

This sample contains Q# code implementing Shor's quantum algorithm for factoring integers. The sample relies on the arithmetic library provided as a part of Microsoft.Quantum.Canon library.

Manifest

Flame Graph Visualization

This sample also contains an adapter for the ResourcesEstimator allowing it to produce a resource utilization stack trace which can then be used to produce a flame graph. More details can be found in this article.

To generate a flame graph, follow these steps:

  1. Download the flamegraph.pl script
  2. Install Perl
  3. Run program with the visualize command by specifying the generator and the resource (more information in the help text) to be visualized. Save the output in a file.
  4. Use flamegraph.pl with the above file to generate an svg of the flame graph.

Example usage:

dotnet run -- visualize -g 4 -r 0 > output.txt
perl flamegraph.pl output.txt > output.svg

Manifest