| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| import Mathlib.Tactic.Linarith |
| import Mathlib.Tactic.NormNum |
| import Mathlib.Data.Nat.Basic |
|
|
| namespace FactoryThroughput |
|
|
| |
| |
| |
|
|
| / |
| def T_single (d N_T : β) : β := N_T * (15 * d) |
|
|
| / |
| For N_T β€ 9: no benefit (both factories warming up), cost same as single. |
| For N_T > 9: first 9 T-gates cost 15d each (fill both factories); |
| subsequent T-gates cost 10d each (steady-state pipeline). -/ |
| def T_pipelined (d N_T : β) : β := |
| if N_T β€ 9 |
| then N_T * (15 * d) |
| else 9 * (15 * d) + (N_T - 9) * (10 * d) |
|
|
| |
| |
| |
|
|
| / |
| theorem throughput_tradeoff (d N_T : β) (hd : d β₯ 5) (hN : N_T > 9) : |
| T_pipelined d N_T < T_single d N_T := by |
| unfold T_pipelined T_single |
| simp [Nat.not_le.mpr hN] |
| |
| |
| |
| |
| |
| have hd_pos : d > 0 := Nat.lt_of_lt_pred (by omega) |
| have hN9 : N_T - 9 + 9 = N_T := Nat.sub_add_cancel (Nat.le_of_lt_succ (by omega)) |
| nlinarith [Nat.mul_pos hd_pos (show N_T - 9 > 0 by omega)] |
|
|
| / |
| theorem no_benefit_below_crossover (d N_T : β) (hN : N_T β€ 9) : |
| T_pipelined d N_T = T_single d N_T := by |
| unfold T_pipelined T_single |
| simp [hN] |
|
|
| / |
| theorem crossover_at_nine (d : β) (hd : d β₯ 5) : |
| T_pipelined d 10 < T_single d 10 := by |
| exact throughput_tradeoff d 10 hd (by norm_num) |
|
|
| / |
| theorem pipeline_saving_per_T (d N_T : β) (hd : d β₯ 5) (hN : N_T > 9) : |
| T_single d N_T - T_pipelined d N_T = (N_T - 9) * (5 * d) := by |
| unfold T_pipelined T_single |
| simp [Nat.not_le.mpr hN] |
| omega |
|
|
| |
| |
| |
|
|
| / |
| def physicalQubits (K : β) : β := 600 + 1000 * K |
|
|
| / |
| def N_T_required (d : β) : β := 132 * d - 34 |
|
|
| / |
| theorem N_T_at_d5 : N_T_required 5 = 626 := by norm_num [N_T_required] |
| theorem N_T_at_d9 : N_T_required 9 = 1154 := by norm_num [N_T_required] |
|
|
| theorem qubit_count_single : physicalQubits 1 = 1600 := by norm_num [physicalQubits] |
| theorem qubit_count_pipelined : physicalQubits 2 = 2600 := by norm_num [physicalQubits] |
|
|
| / |
| by (N_T - 9) * 5d when N_T > 9. The break-even in qubit-cycles is: |
| 1000 * T_pipelined β€ 1600 * T_single when N_T is large enough. -/ |
| theorem pipelined_resource_advantage (d N_T : β) (hd : d β₯ 5) (hN : N_T > 9) : |
| physicalQubits 2 * T_pipelined d N_T < |
| physicalQubits 1 * T_single d N_T + N_T * 10000 := by |
| unfold physicalQubits T_pipelined T_single |
| simp [Nat.not_le.mpr hN] |
| nlinarith [Nat.pos_of_ne_zero (show d β 0 by omega)] |
|
|
| end FactoryThroughput |
|
|