Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions xtheta-lab/notebooks/01_internal_consistency.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 01 Internal Consistency of X-Theta Tensor Model\n",
"\n",
"This notebook verifies the internal mathematical consistency of the X-Theta correlation tensor $T(\\Phi)$.\n",
"\n",
"> **Scientific Scope:** This result is **mathematical validation**. It confirms that the core relational evolution produces the predicted tensor components $T_{xx} = T_{yy} = -\\cos(2\\Phi)$, $T_{zz} = -1$, and the anisotropy invariant $R_\\Theta = 2\\sin^2(2\\Phi)$."
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -77,6 +88,17 @@
"plt.savefig('internal_consistency.png')\n",
"print(\"Plots saved to internal_consistency.png\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Conclusion\n",
"\n",
"The numerical results from the engine match the analytic predictions for the correlation tensor components and the anisotropy invariant.\n",
"\n",
"**Claim Classification:** This result is **mathematical validation**. It establishes the internal consistency of the X-Theta framework's kinematic engine."
]
}
],
"metadata": {
Expand Down
22 changes: 22 additions & 0 deletions xtheta-lab/notebooks/02_benchmark_scenarios.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 02 Benchmark Scenarios\n",
"\n",
"This notebook calculates predicted X-Theta relational phases for various physical regimes.\n",
"\n",
"> **Scientific Scope:** Micius-like and GPS-like scenarios are treated as null-regime consistency checks. The predicted X-Theta corrections are far below current experimental sensitivity and should not be interpreted as positive evidence."
]
},
{
"cell_type": "code",
"execution_count": 3,
Expand Down Expand Up @@ -149,6 +160,17 @@
" 'purity'\n",
"]])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Conclusion\n",
"\n",
"Earth-orbit scenarios (Micius, GPS) show effectively zero predicted deviation, while extreme regimes (Neutron Star, Black Hole) show significant anisotropy.\n",
"\n",
"**Claim Classification:** This result is **simulation/benchmark**. It identifies the physical regimes where the X-Theta effect becomes potentially observable."
]
}
],
"metadata": {
Expand Down
8 changes: 6 additions & 2 deletions xtheta-lab/notebooks/03_entanglement_lensing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"\n",
"We distinguish between two types of surfaces:\n",
"1. **Direct Correlation-Strength Ellipsoid**: Shows the actual observable correlation magnitude along each axis. Radii: $r_x = r_y = |\\cos(2\\Phi)|, r_z = 1$.\n",
"2. **Dual Response Ellipsoid**: The inverse surface defined by $v^T(T^TT)v=1$. Radii: $r_x = r_y = 1/|\\cos(2\\Phi)|, r_z = 1$."
"2. **Dual Response Ellipsoid**: The inverse surface defined by $v^T(T^TT)v=1$. Radii: $r_x = r_y = 1/|\\cos(2\\Phi)|, r_z = 1$. \n",
"\n",
"> **Scientific Scope:** This notebook visualizes the tensor deformation. In the paper, this effect is called **correlation-space lensing**, distinguishing it from literal optical or gravitational lensing."
]
},
{
Expand Down Expand Up @@ -160,7 +162,9 @@
"source": [
"## Conclusion\n",
"\n",
"The direct correlation-strength ellipsoid shows actual observable correlation magnitudes. The dual response ellipsoid is the inverse surface $v^T(T^TT)v=1$ and expands in directions where correlation strength weakens."
"The direct correlation-strength ellipsoid shows actual observable correlation magnitudes. The dual response ellipsoid is the inverse surface $v^T(T^TT)v=1$ and expands in directions where correlation strength weakens.\n",
"\n",
"**Claim Classification:** This result is **mathematical validation**. it provides a geometric interpretation of the correlation tensor anisotropy."
]
}
],
Expand Down
24 changes: 23 additions & 1 deletion xtheta-lab/notebooks/04_monte_carlo_uncertainty.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 04 Monte Carlo Uncertainty Analysis\n",
"\n",
"This notebook propagates coordinate uncertainties through the X-Theta phase prediction model.\n",
"\n",
"> **Scientific Scope:** This analysis supports the null prediction for Earth-orbit scales by showing that even with coordinate uncertainties, the predicted X-Theta correction remains orders of magnitude below current CHSH sensitivity."
]
},
{
"cell_type": "code",
"execution_count": 5,
Expand Down Expand Up @@ -53,9 +64,20 @@
")\n",
"\n",
"print(f\"Micius Simulation Results ({res['samples']} samples):\")\n",
"print(f\"Phi_rel: {res['phi_mean']:.2e} +/- {res['phi_std']:.2e}\")\n",
"print(f\"Phi_rel: {res['Phi_mean']:.2e} +/- {res['Phi_std']:.2e}\")\n",
"print(f\"S_max: {res['s_max_mean']:.6f} +/- {res['s_max_std']:.2e}\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Conclusion\n",
"\n",
"Monte Carlo propagation confirms that coordinate uncertainties do not bring the X-Theta effect into the measurable regime for Earth-orbit experiments.\n",
"\n",
"**Claim Classification:** This result is **simulation/benchmark**. It quantifies the robustness of the null-prediction in the satellite regime."
]
}
],
"metadata": {
Expand Down
8 changes: 6 additions & 2 deletions xtheta-lab/notebooks/05_concurrence_chsh_geometry.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"- **Horodecki Maximum**: $S_{max} = 2\\sqrt{1 + C^2} = 2\\sqrt{1 + \\cos^2(2\\Phi)}$\n",
"- **XY Projection**: $S_{XY} = 2\\sqrt{2}|\\cos(2\\Phi)| = 2\\sqrt{2} C$\n",
"- **XZ Projection**: $S_{XZ} = 2\\sqrt{2}\\cos^2(\\Phi)$\n",
"- **Anisotropy Invariant**: $R_\\Theta = 2\\sin^2(2\\Phi) = 2(1 - C^2)$"
"- **Anisotropy Invariant**: $R_\\Theta = 2\\sin^2(2\\Phi) = 2(1 - C^2)$\n",
"\n",
"> **Scientific Scope:** This notebook establishes the fundamental relations between measurable invariants ($S_{max}$, $R_\\Theta$) and the relational phase $\\Phi$. These relations bridge the abstract tensor theory with experimental observables."
]
},
{
Expand Down Expand Up @@ -140,7 +142,9 @@
"1. The basis-independent relation is $S_{max} = 2\\sqrt{1 + C^2}$.\n",
"2. The anisotropy invariant is $R_\\Theta = 2(1 - C^2)$.\n",
"\n",
"This demonstrates that the relational phase doesn't just rotate the measurement basis but changes the underlying entanglement structure of the state as seen in any fixed laboratory frame."
"This demonstrates that the relational phase doesn't just rotate the measurement basis but changes the underlying entanglement structure of the state as seen in any fixed laboratory frame.\n",
"\n",
"**Claim Classification:** This result is **mathematical validation**. It provides the core mapping from theory to measurable quantum diagnostics."
]
}
],
Expand Down
228 changes: 228 additions & 0 deletions xtheta-lab/notebooks/06_hensen_open_data_audit.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Notebook 06: Hensen Open Data Audit\n",
"\n",
"This notebook performs a detailed audit of the Hensen et al. (2015) Delft loophole-free Bell-test dataset. \n",
"It verifies the loading process, filtering steps, and reproduction of the published CHSH result.\n",
"\n",
"> **Scientific Scope:** This notebook validates the open-data loading, filtering, setting-pair mapping, and CHSH reconstruction pipeline. It does not claim that the Hensen experiment measured X-Theta spacetime holonomy, because the dataset does not contain the required spacetime-path or gravitational metadata."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from __future__ import annotations\n",
"import pandas as pd\n",
"import numpy as np\n",
"import sys\n",
"import os\n",
"from pathlib import Path\n",
"\n",
"# Standardized project root addition\n",
"project_root = Path(os.getcwd()).parent\n",
"if str(project_root) not in sys.path:\n",
" sys.path.append(str(project_root))\n",
"\n",
"from xtheta.data.adapters.hensen import load_hensen_dataset\n",
"from xtheta.data.validation import run_open_data_chsh_validation\n",
"from xtheta.data.bell_chsh import compute_chsh_variants\n",
"from xtheta.data.schema import BellEventSchema"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. Manual Raw Audit\n",
"\n",
"We inspect the raw file structure directly to ensure the adapter is reading the correct format."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"data_path = project_root / \"data\" / \"open_bell\" / \"hensen\" / \"raw\" / \"bell_open_data.txt\"\n",
"\n",
"if not data_path.exists():\n",
" print(f\"[ERROR] Raw data not found at {data_path}\")\n",
" print(\"Please run: python scripts/download_open_data.py --dataset hensen\")\n",
"else:\n",
" print(f\"Raw file path: {data_path.resolve()}\")\n",
" raw_lines = data_path.read_text(encoding='utf-8').splitlines()\n",
" print(f\"\\nFirst 10 raw lines:\")\n",
" for line in raw_lines[:10]:\n",
" print(line)\n",
"\n",
" df_raw = pd.read_csv(data_path, header=None)\n",
" print(f\"\\nRaw total row count: {len(df_raw)}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2. Apply Hensen Adapter\n",
"\n",
"The adapter applies official filtering (Hensen et al., 2015) and mapping logic."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"if data_path.exists():\n",
" data_iterator = load_hensen_dataset(str(data_path))\n",
" df = pd.concat(list(data_iterator), ignore_index=True)\n",
" print(f\"Valid Bell trial count: {len(df)}\")\n",
" display(df.head())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3. Data Distribution Audit\n",
"\n",
"Verify the distribution of settings and outcomes."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"if data_path.exists():\n",
" schema = BellEventSchema()\n",
" \n",
" print(\"Unique Alice Settings:\", df[schema.alice_setting].unique())\n",
" print(\"Unique Bob Settings:\", df[schema.bob_setting].unique())\n",
" \n",
" print(\"\\nAlice Outcome Counts:\")\n",
" print(df[schema.alice_outcome].value_counts())\n",
" \n",
" print(\"\\nBob Outcome Counts:\")\n",
" print(df[schema.bob_outcome].value_counts())\n",
" \n",
" print(\"\\nSetting-pair counts:\")\n",
" counts = df.groupby([schema.alice_setting, schema.bob_setting]).size().reset_index(name='count')\n",
" print(counts)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4. Correlation and CHSH Audit\n",
"\n",
"Calculate expectations $E(a,b)$ and CHSH variants manually before running the pipeline validation."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"if data_path.exists():\n",
" df['ab'] = df[schema.alice_outcome] * df[schema.bob_outcome]\n",
" \n",
" # Calculate E(a,b)\n",
" expectations = df.groupby([schema.alice_setting, schema.bob_setting])['ab'].mean()\n",
" \n",
" E00 = expectations.get((0, 0), 0.0)\n",
" E01 = expectations.get((0, 1), 0.0)\n",
" E10 = expectations.get((1, 0), 0.0)\n",
" E11 = expectations.get((1, 1), 0.0)\n",
" \n",
" print(f\"E00: {E00:.4f}\")\n",
" print(f\"E01: {E01:.4f}\")\n",
" print(f\"E10: {E10:.4f}\")\n",
" print(f\"E11: {E11:.4f}\")\n",
"\n",
" variants = compute_chsh_variants(E00, E01, E10, E11)\n",
" \n",
" print(\"\\nCHSH Sign Variants:\")\n",
" for k, v in variants.items():\n",
" if k not in ['max_abs', 'max_abs_convention']:\n",
" print(f\" {k}: {v:.4f}\")\n",
" \n",
" print(f\"\\nMax Absolute CHSH: {variants['max_abs']:.4f} (Convention: {variants['max_abs_convention']})\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 5. Automated Pipeline Validation\n",
"\n",
"Verify the CHSH S-value and effective phase using the standardized pipeline."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"if data_path.exists():\n",
" results = run_open_data_chsh_validation(\n",
" load_hensen_dataset(str(data_path)),\n",
" dataset_name=\"hensen_audit\",\n",
" output_dir=\"../outputs/hensen_audit\",\n",
" bootstrap_samples=1000\n",
" )\n",
" \n",
" print(f\"\\nFinal Results:\")\n",
" print(f\"S = {results['CHSH_S']:.4f} \u00b1 {results['CHSH_S_se']:.4f}\")\n",
" print(f\"Phi_eff = {results['Phi_eff']:.4f}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 6. Conclusion\n",
"\n",
"Target S (Hensen 2015): 2.42 \u00b1 0.20. \n",
"Observed S: {results['CHSH_S']:.4f} \u00b1 {results['CHSH_S_se']:.4f}. \n",
"Valid Trials: {results['row_count']}. \n",
"\n",
"**Claim Classification:** This result is **open-data pipeline validation**. It confirms the framework can correctly process and interpret historical Bell-test data but does not constitute physical evidence for the X-Theta theory due to missing spacetime metadata."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading
Loading