Skip to content

Resource Analysis

Resource Analyzer helps you understand how your quantum algorithm uses resources through detailed metric analysis and visualization.

Available Metrics

Resource Analyzer can display various resource metrics depending on what was measured in your quantum resource estimate:

  • Toffoli Gates (TOFs) - Number of Toffoli operations
  • T-Gates - Count of T-gate operations
  • Left/Right Elbows - Specific operation counts
  • Local Ancillae - Ancilla qubit usage
  • Rotations - Quantum rotation operations

Metric Selection

Multi-Metric Analysis

Viewing Multiple Metrics

  1. Select "All Resource Counts" in the metric selector
  2. Compare different resource types side by side
  3. Look for correlations between different metrics
  4. Identify trade-offs between resource types

Metric Comparison

While you can view multiple metrics simultaneously, remember that different resource types often use different scales and cannot be directly compared.

Setting Cost Property

Change which metric determines node coloring:

  1. Open Graph Setup (gear icon)
  2. Select desired metric in "Cost property"
  3. Choose appropriate scale (Log10 recommended for quantum resources)
  4. Set Scale max to the cut-off above which everything should be full red, or leave at Max root cost for automatic gradients

Cost Controls

Choosing Cost property

Choosing which Cost Property should be used for costing is only availble when "All Resource Counts" is selected.

Analyzing Resource Distribution

Understanding Node Colors

  • Dark Red: Highest resource usage
  • Light Red: Moderate resource usage
  • White: Minimal or zero resource usage

Interpreting Metrics

Each node shows four key values:

  • Calls Frequency: Times this node is run per parent node run
  • Resources Per Call: Resources used in a single function call
  • Resources Total: Cumulative resources across all calls
  • Percentage: Portion of total program resources

Available Metrics

Finding Hotspots

  1. Look for darkest colored nodes
  2. Check both per-call and total resource usage
  3. Consider call frequency when evaluating impact
  4. Follow dark paths to identify expensive call chains

Resource Optimization

Identifying Optimization Targets

  • Focus on nodes with highest total resource usage
  • Consider frequency of calls multiplied by per-call cost
  • Look for repeated patterns that could be optimized
  • Examine parent-child relationships for restructuring opportunities

Optimization Strategy

  1. Start with darkest nodes (highest resource usage)
  2. Evaluate per-call vs total usage patterns
  3. Consider call frequency in optimization decisions
  4. Document baseline measurements before optimization

Optimization Priority

Even small per-call improvements in frequently called functions can lead to significant total resource reductions.