{% extends "base.html" %} {% block title %}Diff - devqubit{% endblock %} {% block content %}

Run A (Baseline)

{{ run_a.run_id | short_id }}

{{ run_a.project }} / {{ run_a.created_at | ago }}

Run B (Candidate)

{{ run_b.run_id | short_id }}

{{ run_b.project }} / {{ run_b.created_at | ago }}

Metadata

{% if not report.metadata.project_match %} {% endif %} {% if not report.metadata.backend_match %} {% endif %}
Project {% if report.metadata.project_match %}✓ Match{% else %}✗ Different{% endif %}
Backend {% if report.metadata.backend_match %}✓ Match{% else %}✗ Different{% endif %}
Project A {{ report.metadata.project_a or 'N/A' }}
Project B {{ report.metadata.project_b or 'N/A' }}
Backend A {{ report.metadata.backend_a or 'N/A' }}
Backend B {{ report.metadata.backend_b or 'N/A' }}

Fingerprints

Run A {{ report.fingerprints.a | short_digest }}
Run B {{ report.fingerprints.b | short_digest }}
Match {% if report.fingerprints.a == report.fingerprints.b %}✓ Yes{% else %}✗ No{% endif %}

Program {% if report.program.exact_match %} Exact Match {% elif report.program.structural_match %} Structural Match {% else %} Different {% endif %}

{% if report.program.circuit_hash_a or report.program.circuit_hash_b %} {% endif %}
Exact Match {% if report.program.exact_match %}✓ Yes{% else %}✗ No{% endif %}
Structural Match {% if report.program.structural_match %}✓ Yes{% else %}✗ No{% endif %}
Circuit Hash A {{ report.program.circuit_hash_a | short_digest if report.program.circuit_hash_a else 'N/A' }}
Circuit Hash B {{ report.program.circuit_hash_b | short_digest if report.program.circuit_hash_b else 'N/A' }}
{% if report.program.structural_only_match %}

ℹ Same circuit structure with different parameter values (typical for VQE/QAOA).

{% elif not report.program.exact_match and not report.program.structural_match %}

⚠ Program artifacts differ between runs.

{% endif %}

Device Calibration {% if report.device_drift and report.device_drift.significant_drift %} Drifted {% elif report.device_drift and report.device_drift.has_calibration_data %} Stable {% else %} N/A {% endif %}

{% if report.device_drift and report.device_drift.significant_drift %}

⚠ Significant calibration drift detected. Results may not be directly comparable.

{% elif report.device_drift and not report.device_drift.has_calibration_data %}

No calibration data available

{% elif report.device_drift and report.device_drift.has_calibration_data %}

Calibration within acceptable thresholds

{% else %}

No calibration data available

{% endif %} {% if report.device_drift and report.device_drift.top_drifts %}

Top Drifting Metrics

{% for d in report.device_drift.top_drifts[:5] %} {% endfor %}
Metric Change
{{ d.metric }} {{ "%.1f" | format(d.percent_change) if d.percent_change is not none else 'N/A' }}%
{% endif %}

Parameters {% if report.params.match %} Match {% else %} Different {% endif %}

{% if report.params.changed %}

Changed

{% for key, values in report.params.changed.items() %} {% endfor %}
Parameter Run A Run B
{{ key }} {{ values.a }} {{ values.b }}
{% endif %} {% if report.params.removed %}

Only in Run A (removed)

{% for key, value in report.params.removed.items() %} {% endfor %}
Parameter Value
{{ key }} {{ value }}
{% endif %} {% if report.params.added %}

Only in Run B (added)

{% for key, value in report.params.added.items() %} {% endfor %}
Parameter Value
{{ key }} {{ value }}
{% endif %} {% if report.params.match %}

All parameters match

{% endif %}

Metrics {% if report.metrics.match %} Match {% else %} Different {% endif %}

{% if report.metrics.changed %}

Changed

{% for key, values in report.metrics.changed.items() %} {% endfor %}
Metric Run A Run B
{{ key }} {{ values.a }} {{ values.b }}
{% endif %} {% if report.metrics.removed %}

Only in Run A

{% for key, value in report.metrics.removed.items() %} {% endfor %}
Metric Value
{{ key }} {{ value }}
{% endif %} {% if report.metrics.added %}

Only in Run B

{% for key, value in report.metrics.added.items() %} {% endfor %}
Metric Value
{{ key }} {{ value }}
{% endif %} {% if report.metrics.match %}

All metrics match

{% endif %}
{% if report.circuit_diff %}

Circuit {% if report.circuit_diff.match %} Match {% else %} Different {% endif %}

{% if report.circuit_diff.changes %}

Changes

{% endif %} {% if report.circuit_diff.match %}

Circuit structure matches

{% endif %}
{% endif %} {% if report.tvd is defined and report.tvd is not none %}

Results

{% if report.shots %} {% endif %} {% if report.noise_context %} {% if report.noise_context.p_value is defined and report.noise_context.p_value is not none %} {% endif %} {% endif %}
Total Variation Distance (TVD) {{ "%.6f" | format(report.tvd) }}
Total Shots (A / B) {{ report.shots.a }} / {{ report.shots.b }}
Noise Threshold (p95) {{ "%.6f" | format(report.noise_context.noise_p95) if report.noise_context.noise_p95 else "%.6f" | format(report.noise_context.expected_noise * 2) }}
p-value {{ "%.3f" | format(report.noise_context.p_value) }}
{% if report.tvd > 0 and report.noise_context %}

{# Bootstrap path: use p_value #} {% if report.noise_context.p_value is defined and report.noise_context.p_value is not none %} {% if report.noise_context.p_value >= 0.10 %} Consistent with sampling noise — difference is not statistically significant. {% elif report.noise_context.p_value >= 0.05 %} Borderline (p={{ "%.2f" | format(report.noise_context.p_value) }}). Consider increasing shots for a clearer signal. {% else %} Statistically significant difference (p={{ "%.2f" | format(report.noise_context.p_value) }}) — results show meaningful divergence. {% endif %} {# Fallback: use noise_ratio heuristic #} {% else %} {% if report.noise_context.noise_ratio < 1.5 %} TVD is within expected shot noise range. {% elif report.noise_context.noise_ratio < 3.0 %} Ambiguous ({{ "%.1f" | format(report.noise_context.noise_ratio) }}× expected noise). Consider increasing shots. {% else %} TVD exceeds expected noise ({{ "%.1f" | format(report.noise_context.noise_ratio) }}×) — results show meaningful differences. {% endif %} {% endif %}

{% endif %}
{% endif %} {% if report.warnings %}

Warnings

{% endif %} {% endblock %}