Skip to content

Commit d22a18d

Browse files
authored
Update quark_zbw_mixing.ipynb
1 parent 480ddfc commit d22a18d

File tree

1 file changed

+81
-45
lines changed

1 file changed

+81
-45
lines changed

standard_model_emergence_in_the_600-cell_lattice/cpp-zbw-mixing-fractions/notebooks/quark_zbw_mixing.ipynb

Lines changed: 81 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Quark Orbital ZBW DP Mixing Fractions (Up Quark + N_k Sensitivity)\n\n",
8-
"This notebook reproduces the quark orbital ZBW composition (~74% qDP) for up quark (N_k=1) and shows N_k dependence."
7+
"# Lepton Orbital ZBW DP Mixing Fractions (Muon Example)\n\n",
8+
"This notebook reproduces the lepton orbital ZBW composition (~68.5% eDP, 13% qDP, 18.5% hDP) for muon-like cages (N_k=4)."
99
]
1010
},
1111
{
@@ -17,97 +17,133 @@
1717
},
1818
{
1919
"cell_type": "code",
20+
"execution_count": null,
2021
"metadata": {},
22+
"outputs": [],
2123
"source": [
2224
"import numpy as np\n",
2325
"import matplotlib.pyplot as plt\n",
2426
"from scipy.optimize import minimize\n\n",
25-
"phi = (1 + np.sqrt(5)) / 2\n",
27+
"phi = (1 + np.sqrt(5)) / 2 # ≈1.618\n",
2628
"base_gradient = 1.0\n",
2729
"gradients = {\n",
28-
" 'qDP': (phi - 1) * base_gradient, # favorable for quarks\n",
30+
" 'eDP': (phi - 1) * base_gradient, # Favorable for leptons\n",
2931
" 'hDP': base_gradient,\n",
30-
" 'eDP': phi * base_gradient # least favorable\n",
31-
"}"
32-
],
33-
"execution_count": null,
34-
"outputs": []
32+
" 'qDP': phi * base_gradient\n",
33+
"}\n\n",
34+
"N_k = 4 # muon tetra cage\n",
35+
"T = N_k # thermal scale T ∝ N_k (normalized)"
36+
]
3537
},
3638
{
3739
"cell_type": "markdown",
3840
"metadata": {},
3941
"source": [
40-
"## 2. Function Definitions (same as lepton notebook)"
42+
"## 2. Energy Function"
4143
]
4244
},
4345
{
4446
"cell_type": "code",
47+
"execution_count": null,
4548
"metadata": {},
49+
"outputs": [],
4650
"source": [
4751
"def energy(f):\n",
48-
" f_q, f_h, f_e = f\n",
49-
" E = f_q * gradients['qDP'] + f_h * gradients['hDP'] + f_e * gradients['eDP']\n",
50-
" return E\n\n",
52+
" f_e, f_h, f_q = f\n",
53+
" E = f_e * gradients['eDP'] + f_h * gradients['hDP'] + f_q * gradients['qDP']\n",
54+
" return E # minimize total energy"
55+
]
56+
},
57+
{
58+
"cell_type": "markdown",
59+
"metadata": {},
60+
"source": [
61+
"## 3. Constraints and Bounds"
62+
]
63+
},
64+
{
65+
"cell_type": "code",
66+
"execution_count": null,
67+
"metadata": {},
68+
"outputs": [],
69+
"source": [
5170
"cons = ({'type': 'eq', 'fun': lambda f: np.sum(f) - 1})\n",
5271
"bounds = [(0, 1)] * 3"
53-
],
54-
"execution_count": null,
55-
"outputs": []
72+
]
5673
},
5774
{
5875
"cell_type": "markdown",
5976
"metadata": {},
6077
"source": [
61-
"## 3. Single Calculation (Up Quark, N_k=1)"
78+
"## 4. Minimize Energy"
6279
]
6380
},
6481
{
6582
"cell_type": "code",
83+
"execution_count": null,
6684
"metadata": {},
85+
"outputs": [],
6786
"source": [
68-
"N_k = 1\n",
69-
"T = N_k\n",
7087
"res = minimize(energy, [1/3, 1/3, 1/3], method='SLSQP', bounds=bounds, constraints=cons)\n",
71-
"min_fractions = res.x\n",
72-
"probs = np.exp(-np.array([gradients['qDP'], gradients['hDP'], gradients['eDP']]) / T)\n",
73-
"probs /= np.sum(probs)\n",
88+
"min_fractions = res.x"
89+
]
90+
},
91+
{
92+
"cell_type": "markdown",
93+
"metadata": {},
94+
"source": [
95+
"## 5. Thermal Probabilities"
96+
]
97+
},
98+
{
99+
"cell_type": "code",
100+
"execution_count": null,
101+
"metadata": {},
102+
"outputs": [],
103+
"source": [
104+
"probs = np.exp(-np.array([gradients['eDP'], gradients['hDP'], gradients['qDP']]) / T)\n",
105+
"probs /= np.sum(probs)"
106+
]
107+
},
108+
{
109+
"cell_type": "markdown",
110+
"metadata": {},
111+
"source": [
112+
"## 6. Equilibrium Fractions (average min + thermal)"
113+
]
114+
},
115+
{
116+
"cell_type": "code",
117+
"execution_count": null,
118+
"metadata": {},
119+
"outputs": [],
120+
"source": [
74121
"equil = 0.5 * min_fractions + 0.5 * probs\n",
75122
"equil /= np.sum(equil)\n\n",
76-
"print(\"Up quark (N_k=1) equilibrium fractions:\", equil)"
77-
],
78-
"execution_count": null,
79-
"outputs": []
123+
"print(\"Optimized minimum fractions:\", min_fractions)\n",
124+
"print(\"Thermal probabilities:\", probs)\n",
125+
"print(\"Equilibrium fractions:\", equil)"
126+
]
80127
},
81128
{
82129
"cell_type": "markdown",
83130
"metadata": {},
84131
"source": [
85-
"## 4. N_k Sensitivity Sweep"
132+
"## 7. Visualization"
86133
]
87134
},
88135
{
89136
"cell_type": "code",
137+
"execution_count": null,
90138
"metadata": {},
139+
"outputs": [],
91140
"source": [
92-
"N_k_values = [1, 4, 12, 20, 60, 30000] # up → top\n",
93-
"qDP_fracs = []\n",
94-
"for nk in N_k_values:\n",
95-
" T = nk\n",
96-
" probs = np.exp(-np.array([gradients['qDP'], gradients['hDP'], gradients['eDP']]) / T)\n",
97-
" probs /= np.sum(probs)\n",
98-
" # Simplified: use thermal only for sweep (min is always qDP-heavy)\n",
99-
" qDP_fracs.append(probs[0])\n\n",
100-
"plt.plot(N_k_values, qDP_fracs, marker='o')\n",
101-
"plt.xscale('log')\n",
102-
"plt.xlabel('N_k (cage occupancy)')\n",
103-
"plt.ylabel('qDP fraction in orbital ZBW')\n",
104-
"plt.title('Quark Orbital ZBW: qDP Dominance vs. Cage Size')\n",
105-
"plt.grid(True, which=\"both\", ls=\"--\")\n",
106-
"plt.savefig('../figures/sensitivity_plot.png')\n",
141+
"labels = ['eDP', 'hDP', 'qDP']\n",
142+
"plt.pie(equil, labels=labels, autopct='%1.1f%%', colors=['#1f77b4', '#ff7f0e', '#2ca02c'])\n",
143+
"plt.title('Lepton Orbital ZBW DP Composition (Muon, N_k=4)')\n",
144+
"plt.savefig('../figures/lepton_pie_chart.png')\n",
107145
"plt.show()"
108-
],
109-
"execution_count": null,
110-
"outputs": []
146+
]
111147
}
112148
],
113149
"metadata": {

0 commit comments

Comments
 (0)