import math
# -----------------------------
# 1. Core parameters
# -----------------------------
AES256_LOGICAL_QUBITS = 6500 # literature midpoint
GROVER_ITERATIONS = 2**128 # Grover complexity for AES-256
T_GATE_DEPTH_PER_AES = 20000 # approximate reversible AES depth
SURFACE_CODE_OVERHEAD = 1000 # physical/logical qubit ratio
TARGET_RUNTIME_SECONDS = 365 * 24 * 3600 # 1 year
# -----------------------------
# 2. Physical qubit model
# -----------------------------
def physical_qubits(logical_qubits=AES256_LOGICAL_QUBITS,
overhead=SURFACE_CODE_OVERHEAD):
return logical_qubits * overhead
# -----------------------------
# 3. Parallel Grover model
# -----------------------------
def required_parallel_instances(target_runtime_seconds=TARGET_RUNTIME_SECONDS,
grover_iterations=GROVER_ITERATIONS,
gate_time=1e-6):
"""
gate_time = logical gate time (1 microsecond default)
"""
iterations_per_second = 1 / gate_time
required = grover_iterations / (iterations_per_second * target_runtime_seconds)
return math.ceil(required)
# -----------------------------
# 4. Total physical qubits
# -----------------------------
def total_physical_qubits(parallel_instances,
logical_qubits=AES256_LOGICAL_QUBITS,
overhead=SURFACE_CODE_OVERHEAD):
return parallel_instances * physical_qubits(logical_qubits, overhead)
# -----------------------------
# 5. Full simulation wrapper
# -----------------------------
def simulate(target_runtime_seconds=TARGET_RUNTIME_SECONDS,
logical_qubits=AES256_LOGICAL_QUBITS,
overhead=SURFACE_CODE_OVERHEAD,
gate_time=1e-6):
P = required_parallel_instances(target_runtime_seconds,
GROVER_ITERATIONS,
gate_time)
total = total_physical_qubits(P, logical_qubits, overhead)
return {
"logical_qubits_per_instance": logical_qubits,
"physical_qubits_per_instance": physical_qubits(logical_qubits, overhead),
"parallel_instances_required": P,
"total_physical_qubits_required": total
}
# -----------------------------
# 6. Run the simulation
# -----------------------------
result = simulate()
for k, v in result.items():
print(f"{k}: {v}")
# ============================================================
# AES‑256 Grover Resource Estimation Notebook
# ============================================================
import math
import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact, FloatSlider, IntSlider, Dropdown
# ------------------------------------------------------------
# 1. Core constants from literature
# ------------------------------------------------------------
AES256_LOGICAL_QUBITS = 6500 # midpoint from Grassl et al.
GROVER_ITERATIONS = 2**128 # Grover complexity for AES-256
DEFAULT_SURFACE_CODE_OVERHEAD = 1000 # physical/logical qubit ratio
DEFAULT_GATE_TIME = 1e-6 # 1 microsecond logical gate
SECONDS_PER_YEAR = 365 * 24 * 3600
# ------------------------------------------------------------
# 2. Physical qubit model
# ------------------------------------------------------------
def physical_qubits(logical_qubits, overhead):
return logical_qubits * overhead
# ------------------------------------------------------------
# 3. Parallel Grover model
# ------------------------------------------------------------
def required_parallel_instances(target_runtime_seconds,
grover_iterations,
gate_time):
iterations_per_second = 1 / gate_time
required = grover_iterations / (iterations_per_second * target_runtime_seconds)
return math.ceil(required)
# ------------------------------------------------------------
# 4. Total physical qubits
# ------------------------------------------------------------
def total_physical_qubits(parallel_instances,
logical_qubits,
overhead):
return parallel_instances * physical_qubits(logical_qubits, overhead)
# ------------------------------------------------------------
# 5. Simulation wrapper
# ------------------------------------------------------------
def simulate(target_runtime_seconds,
logical_qubits,
overhead,
gate_time):
P = required_parallel_instances(target_runtime_seconds,
GROVER_ITERATIONS,
gate_time)
total = total_physical_qubits(P, logical_qubits, overhead)
return {
"logical_qubits_per_instance": logical_qubits,
"physical_qubits_per_instance": physical_qubits(logical_qubits, overhead),
"parallel_instances_required": P,
"total_physical_qubits_required": total
}
# ------------------------------------------------------------
# 6. Interactive exploration
# ------------------------------------------------------------
def interactive_simulation(logical_qubits=AES256_LOGICAL_QUBITS,
overhead=DEFAULT_SURFACE_CODE_OVERHEAD,
gate_time=DEFAULT_GATE_TIME,
runtime_years=1):
target_runtime_seconds = runtime_years * SECONDS_PER_YEAR
result = simulate(target_runtime_seconds, logical_qubits, overhead, gate_time)
print("=== AES‑256 Grover Resource Estimate ===")
print(f"Logical qubits per instance: {result['logical_qubits_per_instance']:,}")
print(f"Physical qubits per instance: {result['physical_qubits_per_instance']:,}")
print(f"Parallel Grover instances required: {result['parallel_instances_required']:,}")
print(f"Total physical qubits required: {result['total_physical_qubits_required']:,}")
# Plot scaling
plt.figure(figsize=(10,6))
plt.title("Total Physical Qubits vs Runtime Target")
runtimes = np.logspace(2, 7, 100) # seconds
totals = [
total_physical_qubits(
required_parallel_instances(rt, GROVER_ITERATIONS, gate_time),
logical_qubits,
overhead
)
for rt in runtimes
]
plt.loglog(runtimes, totals)
plt.xlabel("Runtime target (seconds)")
plt.ylabel("Total physical qubits")
plt.grid(True, which="both")
plt.show()
# ------------------------------------------------------------
# 7. Launch interactive widget
# ------------------------------------------------------------
interact(
interactive_simulation,
logical_qubits=IntSlider(value=AES256_LOGICAL_QUBITS, min=2000, max=12000, step=500),
overhead=IntSlider(value=DEFAULT_SURFACE_CODE_OVERHEAD, min=100, max=5000, step=100),
gate_time=FloatSlider(value=DEFAULT_GATE_TIME, min=1e-9, max=1e-5, step=1e-9),
runtime_years=FloatSlider(value=1, min=0.01, max=10, step=0.01)
)
# ============================================================
# AES‑256 Grover Resource Estimation Notebook
# ============================================================
import math
import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact, FloatSlider, IntSlider, Dropdown
# ------------------------------------------------------------
# 1. Core constants from literature
# ------------------------------------------------------------
AES256_LOGICAL_QUBITS = 6500 # midpoint from Grassl et al.
GROVER_ITERATIONS = 2**128 # Grover complexity for AES-256
DEFAULT_SURFACE_CODE_OVERHEAD = 1000 # physical/logical qubit ratio
DEFAULT_GATE_TIME = 1e-6 # 1 microsecond logical gate
SECONDS_PER_YEAR = 365 * 24 * 3600
# ------------------------------------------------------------
# 2. Physical qubit model
# ------------------------------------------------------------
def physical_qubits(logical_qubits, overhead):
return logical_qubits * overhead
# ------------------------------------------------------------
# 3. Parallel Grover model
# ------------------------------------------------------------
def required_parallel_instances(target_runtime_seconds,
grover_iterations,
gate_time):
iterations_per_second = 1 / gate_time
required = grover_iterations / (iterations_per_second * target_runtime_seconds)
return math.ceil(required)
# ------------------------------------------------------------
# 4. Total physical qubits
# ------------------------------------------------------------
def total_physical_qubits(parallel_instances,
logical_qubits,
overhead):
return parallel_instances * physical_qubits(logical_qubits, overhead)
# ------------------------------------------------------------
# 5. Simulation wrapper
# ------------------------------------------------------------
def simulate(target_runtime_seconds,
logical_qubits,
overhead,
gate_time):
P = required_parallel_instances(target_runtime_seconds,
GROVER_ITERATIONS,
gate_time)
total = total_physical_qubits(P, logical_qubits, overhead)
return {
"logical_qubits_per_instance": logical_qubits,
"physical_qubits_per_instance": physical_qubits(logical_qubits, overhead),
"parallel_instances_required": P,
"total_physical_qubits_required": total
}
# ------------------------------------------------------------
# 6. Interactive exploration
# ------------------------------------------------------------
def interactive_simulation(logical_qubits=AES256_LOGICAL_QUBITS,
overhead=DEFAULT_SURFACE_CODE_OVERHEAD,
gate_time=DEFAULT_GATE_TIME,
runtime_years=1):
target_runtime_seconds = runtime_years * SECONDS_PER_YEAR
result = simulate(target_runtime_seconds, logical_qubits, overhead, gate_time)
print("=== AES‑256 Grover Resource Estimate ===")
print(f"Logical qubits per instance: {result['logical_qubits_per_instance']:,}")
print(f"Physical qubits per instance: {result['physical_qubits_per_instance']:,}")
print(f"Parallel Grover instances required: {result['parallel_instances_required']:,}")
print(f"Total physical qubits required: {result['total_physical_qubits_required']:,}")
# Plot scaling
plt.figure(figsize=(10,6))
plt.title("Total Physical Qubits vs Runtime Target")
runtimes = np.logspace(2, 7, 100) # seconds
totals = [
total_physical_qubits(
required_parallel_instances(rt, GROVER_ITERATIONS, gate_time),
logical_qubits,
overhead
)
for rt in runtimes
]
plt.loglog(runtimes, totals)
plt.xlabel("Runtime target (seconds)")
plt.ylabel("Total physical qubits")
plt.grid(True, which="both")
plt.show()
# ------------------------------------------------------------
# 7. Launch interactive widget
# ------------------------------------------------------------
interact(
interactive_simulation,
logical_qubits=IntSlider(value=AES256_LOGICAL_QUBITS, min=2000, max=12000, step=500),
overhead=IntSlider(value=DEFAULT_SURFACE_CODE_OVERHEAD, min=100, max=5000, step=100),
gate_time=FloatSlider(value=DEFAULT_GATE_TIME, min=1e-9, max=1e-5, step=1e-9),
runtime_years=FloatSlider(value=1, min=0.01, max=10, step=0.01)
)
import math
# ============================================================
# MACHINE PARAMETERS
# ============================================================
PHYSICAL_QUBITS_TOTAL = 100_000_000_000 # 100 billion
SURFACE_CODE_OVERHEAD = 1000 # physical/logical qubits
LOGICAL_QUBITS = PHYSICAL_QUBITS_TOTAL // SURFACE_CODE_OVERHEAD
# AES-256 Grover parameters
AES256_LOGICAL_QUBITS_REQUIRED = 6500
GROVER_ITERATIONS = 2**128
GATE_TIME = 1e-6 # 1 microsecond logical gate
# ============================================================
# CALCULATE PARALLEL GROVER INSTANCES
# ============================================================
def parallel_instances_available(total_logical, per_instance):
return total_logical // per_instance
P = parallel_instances_available(LOGICAL_QUBITS, AES256_LOGICAL_QUBITS_REQUIRED)
# ============================================================
# RUNTIME ESTIMATION
# ============================================================
def grover_runtime_seconds(iterations, gate_time, parallel_instances):
return iterations * gate_time / parallel_instances
runtime_seconds = grover_runtime_seconds(GROVER_ITERATIONS, GATE_TIME, P)
# ============================================================
# OUTPUT RESULTS
# ============================================================
print("=== 100 BILLION PHYSICAL QUBIT MACHINE SIMULATION ===")
print(f"Total physical qubits: {PHYSICAL_QUBITS_TOTAL:,}")
print(f"Surface-code overhead: {SURFACE_CODE_OVERHEAD}")
print(f"Logical qubits available: {LOGICAL_QUBITS:,}")
print(f"Logical qubits needed per AES-256 Grover instance: {AES256_LOGICAL_QUBITS_REQUIRED:,}")
print(f"Parallel Grover instances possible: {P:,}")
print()
print(f"Grover iterations required for AES-256: 2^128 ≈ {GROVER_ITERATIONS:.3e}")
print(f"Logical gate time: {GATE_TIME} seconds")
print()
print(f"Estimated runtime with 100 billion physical qubits: {runtime_seconds:.3e} seconds")
years = runtime_seconds / (365*24*3600)
print(f"Runtime in years: {years:.3e} years")














No comments:
Post a Comment