From 1f2239ffef2bda6551b3f82e2fc1f8b16fe5de82 Mon Sep 17 00:00:00 2001 From: divyang4481 <772783+divyang4481@users.noreply.github.com> Date: Sat, 6 Jun 2026 11:54:54 +0000 Subject: [PATCH] fix: resolve KeyError in benchmark scenarios notebook - Update column names to match the benchmark engine output (`scenario` and `delta_S_from_tsirelson`). - Simplify notebook by removing manual recalculation loop and using fields already returned by `run_benchmark_scenarios()`. - Remove unused imports from the notebook. --- .../notebooks/02_benchmark_scenarios.ipynb | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/xtheta-lab/notebooks/02_benchmark_scenarios.ipynb b/xtheta-lab/notebooks/02_benchmark_scenarios.ipynb index 07f4c0b..d3cb6f7 100644 --- a/xtheta-lab/notebooks/02_benchmark_scenarios.ipynb +++ b/xtheta-lab/notebooks/02_benchmark_scenarios.ipynb @@ -7,26 +7,26 @@ "metadata": {}, "outputs": [], "source": [ - "import numpy as np\n", - "import pandas as pd\n", "from xtheta.experiments.benchmarks import run_benchmark_scenarios\n", - "from xtheta.quantum.engine import compute_chsh_max, evolve_state, compute_correlation_tensor\n", + "import pandas as pd\n", "\n", "print(\"--- X-Theta V2 Benchmark Scenarios ---\")\n", "\n", "results = run_benchmark_scenarios()\n", - "\n", - "for r in results:\n", - " phi = r['phi_rel']\n", - " psi = evolve_state(phi)\n", - " T = compute_correlation_tensor(psi)\n", - " s_max = compute_chsh_max(T)\n", - " \n", - " r['S_max'] = s_max\n", - " r['delta_S'] = abs(s_max - 2*np.sqrt(2))\n", - "\n", "df = pd.DataFrame(results)\n", - "print(df[['name', 'phi_rel', 'S_max', 'delta_S']])\n" + "\n", + "display(df[[\n", + " 'scenario',\n", + " 'phi_rel',\n", + " 'phi_rel_scientific',\n", + " 'S_max',\n", + " 'delta_S_from_tsirelson',\n", + " 'delta_S_scientific',\n", + " 'R_theta',\n", + " 'R_theta_scientific',\n", + " 'concurrence',\n", + " 'purity'\n", + "]])" ] } ],