Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c1658de
Absorb T gate S corrections into Pauli frame in unbounded-weight mode
stevenhofmeyr Jul 24, 2026
af4e88a
Add --record-cultivation-dist flag to control cultivation dist output
stevenhofmeyr Jul 24, 2026
90d8fb0
Added a wide range of QFT files
stevenhofmeyr Jul 24, 2026
55818b0
Updated gitignore
stevenhofmeyr Jul 24, 2026
8d16cd5
Cache unbounded-weight mode detection to avoid O(n_products) scan per…
stevenhofmeyr Jul 24, 2026
f643fc3
Fix scheduled product count in unbounded-weight mode
stevenhofmeyr Jul 24, 2026
55593db
Extend JIT S correction to bounded-weight mode
stevenhofmeyr Jul 24, 2026
435567c
Add deterministic product-dropping optimization
stevenhofmeyr Jul 24, 2026
8d865fd
Fix bounded-mode JIT parity reset after T gate recovery
stevenhofmeyr Jul 24, 2026
fea5808
updated plotting script to use correct text for volume estimates
stevenhofmeyr Jul 25, 2026
50d94b0
Fix spurious product drops after T gate failures
stevenhofmeyr Jul 25, 2026
05c2e37
Revert scheduler.rs and puremagic.rs to 343727c
stevenhofmeyr Jul 25, 2026
80cd96d
Add --record-cultivation-dist flag to control cultivation dist output
stevenhofmeyr Jul 24, 2026
dd0a85f
Remove unused product_mut method
stevenhofmeyr Jul 25, 2026
1899658
Add lazy just-in-time T gate correction tracking
stevenhofmeyr Jul 25, 2026
897c461
Fix release build warnings: guard logging-only loop with #[cfg(debug_…
stevenhofmeyr Jul 25, 2026
1492793
Print S correction gate count and percentage at end of run
stevenhofmeyr Jul 25, 2026
60e2787
Fix scheduling failure at high magic production rates (-m 100)
stevenhofmeyr Jul 26, 2026
a069343
Remove recovery lcycle mechanism; T gate failures are purely classical
stevenhofmeyr Jul 26, 2026
ea97e30
Fix area fit line using wrong series in slash-y mode
stevenhofmeyr Jul 26, 2026
49a60e5
Fix FLASQ x-axis using Q instead of circuit qubit count
stevenhofmeyr Jul 26, 2026
b123939
Skip T conjugation when no correction is active
stevenhofmeyr Jul 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,22 @@ __pycache__
results
target
notes
data/*.old
data/transpiled/python-version/
data/transpiled_truncated/
wisq
related
tableau
data/qasmbench/
data/native_benchpress/
data/pm_paper_circuits/
data/lssp-data-silva-et-al/
data/custom_qft_benchmarks/
data/all_compiled_truncated/
data/all_wisq/
data/benchpress/
data/clifford_rz/
data/transpiled/max-weight-vary/
data_processing/*out
data_processing/out_dir
data/*out
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N008.cliffordt.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N008.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N024.cliffordt.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N024.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N032.cliffordt.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N032.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N040.cliffordt.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N040.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N048.cliffordt.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N048.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N056.cliffordt.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N056.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N064.cliffordt.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N064.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N072.cliffordt.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N072.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N080.cliffordt.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N080.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N088.cliffordt.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N088.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N096.cliffordt.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/all_compiled/qft_N096.qasm
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-0/qft_N008.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-0/qft_N024.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-0/qft_N032.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-0/qft_N040.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-0/qft_N048.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-0/qft_N056.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-0/qft_N064.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-0/qft_N072.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-0/qft_N080.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-0/qft_N088.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-0/qft_N096.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-1/qft_N008.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-1/qft_N024.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-1/qft_N032.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-1/qft_N040.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-1/qft_N048.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-1/qft_N056.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-1/qft_N064.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-1/qft_N072.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-1/qft_N080.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-1/qft_N088.trans
Git LFS file not shown
3 changes: 3 additions & 0 deletions data/transpiled/max-weight-1/qft_N096.trans
Git LFS file not shown
43 changes: 26 additions & 17 deletions data_processing/plot_puremagic.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class Series:
is_ratio: bool = False
ratio_label: Optional[str] = None
point_labels: Optional[list] = None
y_key: Optional[str] = None


# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -216,7 +217,7 @@ def _flush():
cur["avg_cultivation_time"] = float(m.group(1))
in_cultivation_block = False

if m := re.match(r"Min volume estimate:\s+(\d+)", s):
if m := re.match(r"Volume estimate:\s+(\d+)", s):
cur["min_volume"] = int(m.group(1))

if m := re.match(r"Products per layer:\s+([0-9.eE+\-]+)\s+avg", s):
Expand Down Expand Up @@ -348,6 +349,8 @@ def prettify_circuit_name(name):
# separate trailing _n<digits> or _N<digits> qubit count: foo_n8 -> foo(8)
name = re.sub(r"[_-][nN](\d+)$", lambda mo: f"({mo.group(1)})", name)

name = re.sub(r"(?i)hubbard_18", "hubbard(18)", name)

return name


Expand Down Expand Up @@ -473,31 +476,31 @@ def parse_flasq_file(filepath):
FLASQ Lower Bound for <filepath>
Layout: ...
========================================================================
Max simultaneous qubit usage (Q) : <Q>
Circuit qubits (n_qubits) : <n>
...
FLASQ spacetime volume (S, blocks) : <cons> <opt>
========================================================================

The circuit name is taken from the "FLASQ Lower Bound for" header line,
Q from the "Max simultaneous qubit usage" row, and the two volumes from
the "FLASQ spacetime volume" row.
n_data_qubits from the "Circuit qubits (n_qubits)" row, and the two volumes
from the "FLASQ spacetime volume" row.
"""
entries = []
current_circuit = None
current_q = None
current_n_qubits = None
with open(filepath) as f:
for line in f:
s = line.strip()
# Header: "FLASQ Lower Bound for <path>"
m = re.match(r"^FLASQ Lower Bound for\s+(.+)$", s)
if m:
current_circuit = m.group(1).strip()
current_q = None
current_n_qubits = None
continue
# Q row: "Max simultaneous qubit usage (Q) : <Q>"
m = re.match(r"Max simultaneous qubit usage \(Q\)\s*:\s*(\d+)", s)
# n_qubits row: "Circuit qubits (n_qubits) : <n>"
m = re.match(r"Circuit qubits \(n_qubits\)\s*:\s*(\d+)", s)
if m and current_circuit is not None:
current_q = int(m.group(1))
current_n_qubits = int(m.group(1))
continue
# Volume row: "FLASQ spacetime volume (S, blocks) : <cons> <opt>"
m = re.match(
Expand All @@ -508,11 +511,11 @@ def parse_flasq_file(filepath):
try:
vol_cons = float(m.group(1))
vol_opt = float(m.group(2))
entries.append((current_circuit, vol_cons, vol_opt, current_q))
entries.append((current_circuit, vol_cons, vol_opt, current_n_qubits))
except ValueError:
pass
current_circuit = None
current_q = None
current_n_qubits = None
return entries


Expand Down Expand Up @@ -667,7 +670,7 @@ def main():
action="store_true",
default=False,
help=(
"Read the 'Min volume estimate' line from each data file and plot it as "
"Read the 'Volume estimate' line from each data file and plot it as "
"an additional dashed series alongside each regular volume series. "
"Only meaningful when -y is 'volume'."
),
Expand Down Expand Up @@ -901,6 +904,7 @@ def load_series(y_keys_for_axis, label_suffix=None):
circuits=merged["circuit"].tolist(),
is_ratio=True,
ratio_label=ratio_label,
y_key=y_key,
)
)
else:
Expand Down Expand Up @@ -931,6 +935,7 @@ def load_series(y_keys_for_axis, label_suffix=None):
ys=ys_vals,
circuits=d1["circuit"].fillna("").tolist(),
point_labels=pt_labels,
y_key=y_key,
)
)

Expand All @@ -952,7 +957,9 @@ def load_series(y_keys_for_axis, label_suffix=None):
def draw_series(ax, series_list, yk_list, colour_offset=0):
y_key = yk_list[0] if isinstance(yk_list, list) else yk_list
draw_lines = args.lines or args.lines_with_markers
show_markers = args.lines_with_markers or is_cultivation_x or is_weight_x
show_markers = args.lines_with_markers or (
(is_cultivation_x or is_weight_x) and not args.lines
)
is_timing_y = y_key == "timing"
is_total_qubits_y = y_key == "total_qubits"
is_ancilla_qubits_y = "ancilla_qubits" in (
Expand Down Expand Up @@ -1075,8 +1082,10 @@ def draw_series(ax, series_list, yk_list, colour_offset=0):
ratio_series = [s for s in series_list if s.is_ratio]
non_ratio_series = [s for s in series_list if not s.is_ratio]
if ratio_series:
# Use the first ratio series (there is typically only one per axis)
s = ratio_series[0]
# In slash mode multiple ratio series share the axis; pick the one for
# ancilla_qubits, falling back to the first if none is tagged.
ancilla_rs = [s for s in ratio_series if s.y_key == "ancilla_qubits"]
s = ancilla_rs[0] if ancilla_rs else ratio_series[0]
rx = np.array(s.xs, float)
ry = np.array(s.ys, float)
elif len(non_ratio_series) >= 2:
Expand All @@ -1101,7 +1110,7 @@ def draw_series(ax, series_list, yk_list, colour_offset=0):
# Least-squares fit for y = A / sqrt(x):
# minimise sum((y - A/sqrt(x))^2) => A = sum(y/sqrt(x)) / sum(1/x)
A = np.sum(sy / np.sqrt(sx)) / np.sum(1.0 / sx)
# A *= 0.48
# A *= 0.85
y_pred = A / np.sqrt(sx)
ss_res = np.sum((sy - y_pred) ** 2)
ss_tot = np.sum((sy - sy.mean()) ** 2)
Expand Down Expand Up @@ -1276,7 +1285,7 @@ def draw_series(ax, series_list, yk_list, colour_offset=0):
if d1.empty:
minvol_series.append(None)
continue
mv_label = f"{file_label} Min volume" if file_label else "Min volume"
mv_label = f"{file_label} Volume" if file_label else "Volume"
mv_ys = d1["min_volume"].tolist()
if args.max_efficiency:
mv_ys = [1.0 / v if v else float("nan") for v in mv_ys]
Expand Down
Loading
Loading