From 1df78c54ebaee932d2b2157fda0650a4e4960ee4 Mon Sep 17 00:00:00 2001 From: kate bonner Date: Mon, 6 Jul 2026 11:59:26 -0400 Subject: [PATCH] =?UTF-8?q?feat(46):=20template=20records=20its=20identity?= =?UTF-8?q?=20=E2=80=94=20gate=20derived=20from=20declared=20label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gate = GATES[Symbol(gate_name)] derives the matrix from one declared label (no gate/gate_name drift possible), and result.toml [params] gains system + gate so the catalog card can chip a run's identity. Pulse-line labels align to u_N. Touches the same FILL-IN block as #81 — split out small so that coordination is explicit. Co-Authored-By: Claude Fable 5 --- packages/extension/templates/solve_template.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/extension/templates/solve_template.jl b/packages/extension/templates/solve_template.jl index c971dac2..86ee7af7 100644 --- a/packages/extension/templates/solve_template.jl +++ b/packages/extension/templates/solve_template.jl @@ -13,7 +13,9 @@ using Printf # ── FILL IN ────────────────────────────────────────────────────────────── δ = 0.2 # anharmonicity (GHz, positive convention) levels = 3 # transmon levels modeled (3 = qubit + 1 leakage; bump to 4–5 for more leakage realism) -gate = GATES[:X] +system = "transmon" # system family, recorded in result.toml params (drives the catalog card/chip) +gate_name = "X" # gate label, recorded in result.toml params (drives the catalog card/chip) +gate = GATES[Symbol(gate_name)] T = 10.0 # gate time (ns) N = 50 # timesteps drive_max = 0.2 # per-quadrature drive bound (GHz) @@ -80,7 +82,7 @@ function (cb::PulseEmitCallback)(primal, iter) end pulse_emit = PulseEmitCallback(live_plot, prob.trajectory) -let ls = join(("\"a_$i\"" for i in 1:sys.n_drives), ","), +let ls = join(("\"u_$i\"" for i in 1:sys.n_drives), ","), bs = join(("$(-drive_max):$(drive_max)" for _ in 1:sys.n_drives), ",") println("AMICODE_PULSE_META drives=$(sys.n_drives) knots=$N labels=$ls bounds=$bs") flush(stdout) @@ -135,7 +137,7 @@ open("result.toml.tmp", "w") do io TOML.print(io, Dict( "schema_version" => "1", # run-dir contract version (@amicode/schema result schema) "fidelity" => fid, "iterations" => iters[], "wall_seconds" => wall, - "params" => Dict("delta" => δ, "levels" => levels, "T" => T, "N" => N, + "params" => Dict("system" => system, "gate" => gate_name, "delta" => δ, "levels" => levels, "T" => T, "N" => N, "drive_max" => drive_max, "max_iter" => max_iter), )) end