diff --git a/openwave/xperiments/m4_ewt/_launcher.py b/openwave/xperiments/m4_ewt/_launcher.py index fef95ba8..3ab404b5 100644 --- a/openwave/xperiments/m4_ewt/_launcher.py +++ b/openwave/xperiments/m4_ewt/_launcher.py @@ -549,10 +549,15 @@ def compute_wave_oscillation(state): state.wave_field, state.trackers, ) - if state.frame % 60 == 0 or state.frame == 10: + mean_drift, active_wc = instrument.log_stability_metrics( + state.frame, state.wave_center + ) + sampling.sample_stability_metrics(state.frame, mean_drift, active_wc) + if state.frame % 60 == 0 or state.frame == 1: instrument.log_timestep_data( state.frame, state.wave_field, state.trackers, state.wave_center ) + sampling.save_monitor_data() state.amp_global_rms = state.trackers.amp_global_emarms_am[None] * constants.ATTOMETER state.freq_global_avg = state.trackers.freq_global_avg_rHz[None] / constants.RONTOSECOND diff --git a/openwave/xperiments/m4_ewt/utils/instrumentation.py b/openwave/xperiments/m4_ewt/utils/instrumentation.py index 9f1c2da1..b3772350 100644 --- a/openwave/xperiments/m4_ewt/utils/instrumentation.py +++ b/openwave/xperiments/m4_ewt/utils/instrumentation.py @@ -133,3 +133,65 @@ def to_float(val): log_entry["wc_positions"] = positions json_logger.log_timestep(log_entry) + + import numpy as np + + +_pairwise_ref = None +_pairwise_ref_set = False + + +def log_stability_metrics(timestep: int, wave_center) -> tuple: + """ + Log WC stability metrics: mean pairwise distance drift and active WC count. + Returns (mean_drift, n_active) so that the caller can feed the live monitor. + """ + import numpy as np + + global _pairwise_ref, _pairwise_ref_set + + positions = [] + for i in range(wave_center.num_sources): + if wave_center.active[i] == 0: + continue + pos = wave_center.position_float[i] + x = float(pos[0]) + y = float(pos[1]) + z = float(pos[2]) + if any(np.isnan([x, y, z])): + continue + positions.append([x, y, z]) + + n_active = len(positions) + + if n_active < 2: + json_logger.log_timestep( + { + "timestep": timestep, + "mean_drift": None, + "active_wc": n_active, + } + ) + return None, n_active + + positions_np = np.array(positions, dtype=np.float64) + diff = positions_np[:, np.newaxis, :] - positions_np[np.newaxis, :, :] + dist = np.sqrt(np.sum(diff**2, axis=-1)) + + if not _pairwise_ref_set: + _pairwise_ref = dist.copy() + _pairwise_ref_set = True + mean_drift = 0.0 + else: + drift_matrix = np.abs(dist - _pairwise_ref) + i_upper = np.triu_indices_from(drift_matrix, k=1) + mean_drift = float(np.mean(drift_matrix[i_upper])) + + json_logger.log_timestep( + { + "timestep": timestep, + "mean_drift": mean_drift, + "active_wc": n_active, + } + ) + return mean_drift, n_active diff --git a/openwave/xperiments/m4_ewt/utils/live_monitor_viewer.py b/openwave/xperiments/m4_ewt/utils/live_monitor_viewer.py index f75dd0f6..b92f80dd 100644 --- a/openwave/xperiments/m4_ewt/utils/live_monitor_viewer.py +++ b/openwave/xperiments/m4_ewt/utils/live_monitor_viewer.py @@ -30,9 +30,10 @@ def main(data_path_str): plt.ion() plt.style.use("dark_background") - fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(10, 7), facecolor=colormap.DARK_GRAY[1]) + fig, (ax1, ax2, ax3) = plt.subplots(3, 1, figsize=(12, 10), facecolor=colormap.DARK_GRAY[1]) fig.suptitle("OPENWAVE Live Monitor (external)", fontsize=20, family="Monospace") + # Panel 1: Displacement & Amplitude (line_disp,) = ax1.plot( [], [], color=colormap.viridis_palette[2][1], linewidth=2, label="DISPLACEMENT (am)" ) @@ -54,6 +55,7 @@ def main(data_path_str): ax1.legend(loc="upper right") ax1.set_ylim(auto=True) + # Panel 2: Frequency (line_freq,) = ax2.plot( [], [], color=colormap.blueprint_palette[2][1], linewidth=2, label="FREQUENCY (rHz)" ) @@ -72,11 +74,19 @@ def main(data_path_str): ax2.legend(loc="upper right") ax2.set_ylim(auto=True) + # Panel 3: Pairwise Distance Drift + (line_drift,) = ax3.plot( + [], [], color=colormap.ironbow_palette[2][1], linewidth=2, label="MEAN DRIFT (vox)" + ) + ax3.set_xlabel("Timestep", family="Monospace") + ax3.set_ylabel("Mean Pairwise Drift [vox]", family="Monospace") + ax3.set_title("PAIRWISE DISTANCE DRIFT", family="Monospace") + ax3.grid(True, alpha=0.3) + ax3.legend(loc="upper right") + plt.tight_layout() fig.show() - # If the launcher dies without tearing us down (a crash, a force-quit), we - # get reparented and would otherwise loop forever holding a window open. parent_pid = os.getppid() while data_path.exists(): @@ -87,6 +97,8 @@ def main(data_path_str): try: with open(data_path, "r") as f: data = json.load(f) + + # Update panels 1-2 ts = data.get("timesteps", []) if ts: line_disp.set_data(ts, data.get("displacements", [])) @@ -98,7 +110,15 @@ def main(data_path_str): ax1.autoscale_view(scaley=True) ax2.relim() ax2.autoscale_view(scaley=True) - fig.canvas.draw() + + # Update panels 3-4 + st_ts = data.get("stability_timesteps", []) + if st_ts: + line_drift.set_data(st_ts, data.get("mean_drifts", [])) + ax3.set_xlim(st_ts[0], max(st_ts[-1], st_ts[0] + 1)) + ax3.relim() + ax3.autoscale_view(scaley=True) + fig.canvas.draw() except Exception: pass plt.pause(0.5) diff --git a/openwave/xperiments/m4_ewt/utils/plotting.py b/openwave/xperiments/m4_ewt/utils/plotting.py index cf7f58a3..88f90259 100644 --- a/openwave/xperiments/m4_ewt/utils/plotting.py +++ b/openwave/xperiments/m4_ewt/utils/plotting.py @@ -34,6 +34,8 @@ def _read_timestep_data(): "frequencies": [], } for rec in doc["data"]: + if "displacement_am" not in rec: + continue data["timesteps"].append(rec["timestep"]) data["displacements"].append(rec["displacement_am"]) data["amplitudes"].append(rec["amp_local_emarms_am"]) @@ -219,9 +221,74 @@ def plot_live_values(): print("\nLive monitor plot saved to:\n", save_path, "\n") +def plot_wc_drift(): + """Plot mean pairwise distance drift over time.""" + import json + + log_path = json_logger._data_dir / json_logger._filename + if not log_path.exists(): + return + with open(log_path) as f: + doc = json.load(f) + + drift_data = [d for d in doc["data"] if d.get("mean_drift") is not None] + if not drift_data: + print("[plot_wc_drift] No drift data in log.") + return + + ts = [d["timestep"] for d in drift_data] + drift = [d["mean_drift"] for d in drift_data] + + plt.style.use("dark_background") + fig, ax = plt.subplots(figsize=(10, 4), facecolor=colormap.DARK_GRAY[1]) + ax.plot(ts, drift, color=colormap.viridis_palette[2][1], linewidth=2) + ax.set_xlabel("Timestep") + ax.set_ylabel("Mean Pairwise Drift [vox]") + ax.set_title("Pairwise Distance Drift") + ax.grid(True, alpha=0.3) + plt.tight_layout() + PLOT_DIR.mkdir(parents=True, exist_ok=True) + plt.savefig(PLOT_DIR / "wc_drift.png", dpi=150, bbox_inches="tight") + print(f"[plot_wc_drift] Saved to {PLOT_DIR / 'wc_drift.png'}") + + +def plot_wc_active(): + """Plot number of active wave centers over time.""" + import json + + log_path = json_logger._data_dir / json_logger._filename + if not log_path.exists(): + return + with open(log_path) as f: + doc = json.load(f) + + active_data = [d for d in doc["data"] if "active_wc" in d] + if not active_data: + print("[plot_wc_active] No active WC data in log.") + return + + ts = [d["timestep"] for d in active_data] + active = [d["active_wc"] for d in active_data] + + plt.style.use("dark_background") + fig, ax = plt.subplots(figsize=(10, 4), facecolor=colormap.DARK_GRAY[1]) + ax.plot(ts, active, color=colormap.ironbow_palette[2][1], linewidth=2) + ax.set_xlabel("Timestep") + ax.set_ylabel("Active WC count") + ax.set_title("Active Wave Centers") + ax.grid(True, alpha=0.3) + ax.set_ylim(bottom=0) + plt.tight_layout() + PLOT_DIR.mkdir(parents=True, exist_ok=True) + plt.savefig(PLOT_DIR / "wc_active.png", dpi=150, bbox_inches="tight") + print(f"[plot_wc_active] Saved to {PLOT_DIR / 'wc_active.png'}") + + def generate_plots(): """Generate all instrumentation plots. Called after simulation ends.""" json_logger.finalize() plot_probe_values() plot_live_values() + plot_wc_drift() + # plot_wc_active() plt.show() diff --git a/openwave/xperiments/m4_ewt/utils/sampling.py b/openwave/xperiments/m4_ewt/utils/sampling.py index 40576787..99395ea0 100644 --- a/openwave/xperiments/m4_ewt/utils/sampling.py +++ b/openwave/xperiments/m4_ewt/utils/sampling.py @@ -5,6 +5,9 @@ _plot_displacements = [] _plot_amplitudes = [] _plot_frequencies = [] +_stability_timesteps = [] +_stability_drifts = [] +_stability_active = [] # File shared with the external live-monitor process # The model root, one level above utils/. This must match the path the launcher @@ -13,6 +16,15 @@ SAVE_EVERY = 10 # write the shared file every 10 samples +def sample_stability_metrics(timestep, mean_drift, active_wc): + _stability_timesteps.append(timestep) + _stability_drifts.append(mean_drift if mean_drift is not None else 0.0) + _stability_active.append(active_wc) + + if len(_stability_timesteps) % SAVE_EVERY == 0: + save_monitor_data() + + def sample_for_plots(timestep, wave_field, trackers): px = wave_field.nx // 2 + 1 py = wave_field.ny // 2 @@ -49,6 +61,9 @@ def save_monitor_data(): "displacements": _plot_displacements, "amplitudes": _plot_amplitudes, "frequencies": _plot_frequencies, + "stability_timesteps": _stability_timesteps, + "mean_drifts": _stability_drifts, + "active_wcs": _stability_active, } MONITOR_DATA_PATH.parent.mkdir(parents=True, exist_ok=True) with open(MONITOR_DATA_PATH, "w") as f: diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_ewt_vmode10_neumann_boost0015.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_ewt_vmode10_neumann_boost0015.py new file mode 100644 index 00000000..fdeaf0f4 --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_ewt_vmode10_neumann_boost0015.py @@ -0,0 +1,70 @@ +# electron_k09_ewt_vmode10_neumann_boost0015.py +""" +K=9, tricapped trigonal prism (EWT geometry), neumann interaction, V_MODE=10, WC_BOOST=0.015. +K-selectivity test: K=9 EWT geometry with V_MODE=10. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import generate_positions_by_EWT_geometry +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 9 +PERTURBATION = 0.02 + +POSITIONS = generate_positions_by_EWT_geometry( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=9 EWT tricapped prism neumann boost=0.015 V_MODE=10", + "DESCRIPTION": "K-selectivity test: K=9 EWT geometry with V_MODE=10 and neumann interaction", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.05, + "WC_INTERACT_MODE": 2, + "WC_BOOST": 0.015, + "WC_RADIUS": 2, + "WC_SIGMA": 1.5, + "VELOCITY_DAMPING": 0.990, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_ewt_vmode10_soft_pressure_00001.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_ewt_vmode10_soft_pressure_00001.py new file mode 100644 index 00000000..5a63d8ad --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_ewt_vmode10_soft_pressure_00001.py @@ -0,0 +1,71 @@ +# electron_k09_ewt_vmode10_soft_pressure_00001.py +""" +K=9, EWT geometry (tricapped trigonal prism), soft interaction, V_MODE=10, ultra-low boost. +Vacuum pressure force enabled (PRESSURE_STRENGTH=0.0001). +Tests whether the EWT-native geometry with K=9 behaves like 1-3-6 (stable) or golden-angle (metastable). +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import generate_positions_by_EWT_geometry +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 9 +PERTURBATION = 0.02 + +POSITIONS = generate_positions_by_EWT_geometry( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=9 EWT prism soft boost=0.00001 V_MODE=10 pressure=0.0001", + "DESCRIPTION": "K-selectivity pressure test: K=9 EWT geometry with vacuum pressure force", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.1, + "WC_INTERACT_MODE": 3, + "WC_BOOST": 0.00001, + "WC_RADIUS": 2, + "WC_SIGMA": 2.0, + "VELOCITY_DAMPING": 0.95, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0001, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/electron_k09_vmode10_ewt_geometry.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_ewt_geometry.py similarity index 100% rename from openwave/xperiments/m4_ewt/xparameters/electron_k09_vmode10_ewt_geometry.py rename to openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_ewt_geometry.py diff --git a/openwave/xperiments/m4_ewt/xparameters/electron_k09_vmode10_gaussian_saturation.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_gaussian_saturation.py similarity index 100% rename from openwave/xperiments/m4_ewt/xparameters/electron_k09_vmode10_gaussian_saturation.py rename to openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_gaussian_saturation.py diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_neumann_boost0015.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_neumann_boost0015.py new file mode 100644 index 00000000..4d2cb785 --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_neumann_boost0015.py @@ -0,0 +1,70 @@ +# electron_k09_vmode10_neumann_boost0015.py +""" +K=9, golden-angle geometry, neumann interaction, V_MODE=10, WC_BOOST=0.015. +K-selectivity test with V_MODE=10. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import generate_K_positions +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 9 +PERTURBATION = 0.02 + +POSITIONS = generate_K_positions( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=9 golden-angle neumann boost=0.015 V_MODE=10", + "DESCRIPTION": "K-selectivity test: K=9 with V_MODE=10 and neumann interaction", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.05, + "WC_INTERACT_MODE": 2, + "WC_BOOST": 0.015, + "WC_RADIUS": 2, + "WC_SIGMA": 1.5, + "VELOCITY_DAMPING": 0.990, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_soft_boost000001.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_soft_boost000001.py new file mode 100644 index 00000000..be7d3ab1 --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_soft_boost000001.py @@ -0,0 +1,70 @@ +# electron_k09_vmode10_soft_boost000001.py +""" +K=9, golden-angle geometry, soft interaction, V_MODE=10, ultra-low boost. +K-selectivity test: K=9 with soft mode and V_MODE=10. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import generate_K_positions +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 9 +PERTURBATION = 0.02 + +POSITIONS = generate_K_positions( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=9 golden-angle soft boost=0.00001 V_MODE=10", + "DESCRIPTION": "K-selectivity test: K=9 with soft mode and V_MODE=10", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.1, + "WC_INTERACT_MODE": 3, + "WC_BOOST": 0.00001, + "WC_RADIUS": 2, + "WC_SIGMA": 2.0, + "VELOCITY_DAMPING": 0.95, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_soft_pressure_00001.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_soft_pressure_00001.py new file mode 100644 index 00000000..65a1d3fc --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode10_soft_pressure_00001.py @@ -0,0 +1,71 @@ +# electron_k09_vmode10_soft_pressure_00001.py +""" +K=9, golden-angle geometry, soft interaction, V_MODE=10, ultra-low boost. +Vacuum pressure force enabled (PRESSURE_STRENGTH=0.0001). +Tests whether the pressure force accelerates the decay of metastable K=9. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import generate_K_positions +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 11 +PERTURBATION = 0.02 + +POSITIONS = generate_K_positions( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=9 golden-angle soft boost=0.00001 V_MODE=10 pressure=0.0001", + "DESCRIPTION": "K-selectivity pressure test: K=9 with vacuum pressure force", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.1, + "WC_INTERACT_MODE": 3, + "WC_BOOST": 0.00001, + "WC_RADIUS": 2, + "WC_SIGMA": 2.0, + "VELOCITY_DAMPING": 0.95, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0001, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode1_neumann_boost0015.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode1_neumann_boost0015.py new file mode 100644 index 00000000..fefa34c6 --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k09_vmode1_neumann_boost0015.py @@ -0,0 +1,71 @@ +# electron_k09_vmode1_neumann_boost0015.py +""" +K=9, golden-angle geometry, neumann interaction, WC_BOOST=0.015. +K-selectivity test: if K=10 is the only stable configuration, +K=9 should show different behavior. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import generate_K_positions +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 9 +PERTURBATION = 0.02 + +POSITIONS = generate_K_positions( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=9 golden-angle neumann boost=0.015", + "DESCRIPTION": "K-selectivity test: K=9 with equilibrium parameters", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 1, + "V_C1": -0.1, + "V_C2": 0.1, + "WC_INTERACT_MODE": 2, + "WC_BOOST": 0.015, + "WC_RADIUS": 2, + "WC_SIGMA": 1.5, + "VELOCITY_DAMPING": 0.990, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/electron_k10_vmode10_1_3_6.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_1_3_6.py similarity index 100% rename from openwave/xperiments/m4_ewt/xparameters/electron_k10_vmode10_1_3_6.py rename to openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_1_3_6.py diff --git a/openwave/xperiments/m4_ewt/xparameters/electron_k10_vmode10_bcc_lattice.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_bcc_lattice.py similarity index 100% rename from openwave/xperiments/m4_ewt/xparameters/electron_k10_vmode10_bcc_lattice.py rename to openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_bcc_lattice.py diff --git a/openwave/xperiments/m4_ewt/xparameters/electron_k10_vmode10_gaussian_saturation.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_gaussian_saturation.py similarity index 100% rename from openwave/xperiments/m4_ewt/xparameters/electron_k10_vmode10_gaussian_saturation.py rename to openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_gaussian_saturation.py diff --git a/openwave/xperiments/m4_ewt/xparameters/electron_k10_vmode10_golden_angle.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_golden_angle.py similarity index 100% rename from openwave/xperiments/m4_ewt/xparameters/electron_k10_vmode10_golden_angle.py rename to openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_golden_angle.py diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_neumann_boost0015.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_neumann_boost0015.py new file mode 100644 index 00000000..33a2d85d --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_neumann_boost0015.py @@ -0,0 +1,67 @@ +# electron_k10_vmode10_neumann_boost0015.py +""" +K=10, 1-3-6 geometry, neumann interaction, V_MODE=10, WC_BOOST=0.015. +Test V_MODE=10 with neumann mode for enhanced K-selectivity. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import tetrahedron_10 +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 10 + +POSITIONS = tetrahedron_10(UNIVERSE_EDGE, center=(0.5, 0.5, 0.5)) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=10 1-3-6 neumann boost=0.015 V_MODE=10", + "DESCRIPTION": "V_MODE=10 with neumann interaction for K-selectivity", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.05, + "WC_INTERACT_MODE": 2, + "WC_BOOST": 0.015, + "WC_RADIUS": 2, + "WC_SIGMA": 1.5, + "VELOCITY_DAMPING": 0.990, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_neumann_pressure_00001.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_neumann_pressure_00001.py new file mode 100644 index 00000000..2716e28d --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_neumann_pressure_00001.py @@ -0,0 +1,68 @@ +# electron_k10_vmode10_neumann_pressure_00001.py +""" +K=10, 1-3-6 geometry, Neumann interaction, V_MODE=10, WC_BOOST=0.015. +Vacuum pressure force enabled (PRESSURE_STRENGTH=0.0001). +Tests whether the pressure force improves K-selectivity by pulling WCs inward. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import tetrahedron_10 +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 10 + +POSITIONS = tetrahedron_10(UNIVERSE_EDGE, center=(0.5, 0.5, 0.5)) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=10 1-3-6 Neumann boost=0.015 V_MODE=10 pressure=0.0001", + "DESCRIPTION": "Pressure force test: does vacuum pressure improve soliton stability?", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.05, + "WC_INTERACT_MODE": 2, + "WC_BOOST": 0.015, + "WC_RADIUS": 2, + "WC_SIGMA": 1.5, + "VELOCITY_DAMPING": 0.990, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0001, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_bcc_lattice.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_bcc_lattice.py new file mode 100644 index 00000000..a50c7777 --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_bcc_lattice.py @@ -0,0 +1,70 @@ +# electron_k10_vmode10_soft_bcc_lattice.py +""" +K=10, BCC lattice geometry, soft interaction, V_MODE=10. +Control test: is the 1-3-6 geometry unique even for K=10? +Uses the same stable parameters as the 1-3-6 soft-mode test. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import bcc_lattice_positions +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 10 + +LOCK_SPACING = constants.EWAVE_LENGTH / UNIVERSE_EDGE +SPACING = 0.35 * LOCK_SPACING +POSITIONS = bcc_lattice_positions(K, center=(0.5, 0.5, 0.5), spacing=SPACING) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=10 BCC lattice soft boost=0.00001 V_MODE=10", + "DESCRIPTION": "K-selectivity control: K=10 with BCC lattice geometry in soft mode", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.1, + "WC_INTERACT_MODE": 3, + "WC_BOOST": 0.00001, + "WC_RADIUS": 2, + "WC_SIGMA": 2.0, + "VELOCITY_DAMPING": 0.95, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_boost000001.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_boost000001.py new file mode 100644 index 00000000..16ad71d9 --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_boost000001.py @@ -0,0 +1,67 @@ +# electron_k10_vmode10_soft_boost000001.py +""" +K=10, 1-3-6 geometry, soft interaction, V_MODE=10, ultra-low boost. +Goal: find stable regime for soft mode with Gaussian saturation. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import tetrahedron_10 +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 10 + +POSITIONS = tetrahedron_10(UNIVERSE_EDGE, center=(0.5, 0.5, 0.5)) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=10 1-3-6 soft boost=0.00001 V_MODE=10", + "DESCRIPTION": "Ultra-low boost soft mode with V_MODE=10", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.1, # stronger saturation + "WC_INTERACT_MODE": 3, # soft mode + "WC_BOOST": 0.00001, # ultra-low energy injection + "WC_RADIUS": 2, + "WC_SIGMA": 2.0, # slightly wider gaussian + "VELOCITY_DAMPING": 0.95, # stronger damping + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_golden_angle.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_golden_angle.py new file mode 100644 index 00000000..bdedf1d5 --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_golden_angle.py @@ -0,0 +1,70 @@ +# electron_k10_vmode10_soft_golden_angle.py +""" +K=10, golden-angle phyllotaxis, soft interaction, V_MODE=10. +Control test: is the 1-3-6 geometry unique even for K=10? +Uses the same stable parameters as the 1-3-6 soft-mode test. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import golden_angle_positions +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 10 + +LOCK_SPACING = constants.EWAVE_LENGTH / UNIVERSE_EDGE +RADIUS = 0.35 * LOCK_SPACING +POSITIONS = golden_angle_positions(K, RADIUS, center=(0.5, 0.5, 0.5)) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=10 golden-angle soft boost=0.00001 V_MODE=10", + "DESCRIPTION": "K-selectivity control: K=10 with golden-angle geometry in soft mode", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.1, + "WC_INTERACT_MODE": 3, + "WC_BOOST": 0.00001, + "WC_RADIUS": 2, + "WC_SIGMA": 2.0, + "VELOCITY_DAMPING": 0.95, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_pressure_00001.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_pressure_00001.py new file mode 100644 index 00000000..6cf5a4bb --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_pressure_00001.py @@ -0,0 +1,70 @@ +# electron_k10_vmode10_soft_pressure_00001.py +""" +K=10, 1-3-6 geometry, soft interaction, V_MODE=10, ultra-low boost. +Vacuum pressure force enabled (PRESSURE_STRENGTH=0.0001). +Tests whether the pressure force improves soliton stability in the soft mode. +""" + +from openwave.xperiments.m4_ewt.xparameters.utils.geometry import tetrahedron_10 +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 10 +PERTURBATION = 0.1 +POSITIONS = generate_positions_by_EWT_geometry( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=10 1-3-6 soft boost=0.00001 V_MODE=10 pressure=0.0001", + "DESCRIPTION": "Pressure force test in soft mode: does it improve stability?", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.1, + "WC_INTERACT_MODE": 3, + "WC_BOOST": 0.00001, + "WC_RADIUS": 2, + "WC_SIGMA": 2.0, + "VELOCITY_DAMPING": 0.95, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0001, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_pressure_0001.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_pressure_0001.py new file mode 100644 index 00000000..b6a7532e --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_pressure_0001.py @@ -0,0 +1,72 @@ +# electron_k10_vmode10_soft_pressure_0001.py +""" +K=10, 1-3-6 geometry, soft interaction, V_MODE=10, ultra-low boost. +Increased vacuum pressure (PRESSURE_STRENGTH=0.001) to test enhanced stability. +""" + +from openwave.xperiments.m4_ewt.xparameters.utils.geometry import ( + generate_positions_by_EWT_geometry, +) +from openwave.common import constants + +UNIVERSE_EDGE = 4e-15 +TARGET_VOXELS = 55_000_000 +K = 10 + +PERTURBATION = 0.1 +POSITIONS = generate_positions_by_EWT_geometry( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=10 1-3-6 soft boost=0.00001 V_MODE=10 pressure=0.001", + "DESCRIPTION": "Increased pressure test: does stronger vacuum pressure improve soliton stability?", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.1, + "WC_INTERACT_MODE": 3, + "WC_BOOST": 0.0001, + "WC_RADIUS": 2, + "WC_SIGMA": 2.0, + "VELOCITY_DAMPING": 0.95, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.001, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_pressure_0001_2.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_pressure_0001_2.py new file mode 100644 index 00000000..07bc4a90 --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode10_soft_pressure_0001_2.py @@ -0,0 +1,70 @@ +# electron_k10_vmode10_soft_pressure_0001.py +""" +K=10, 1-3-6 geometry, soft interaction, V_MODE=10, ultra-low boost. +Increased vacuum pressure (PRESSURE_STRENGTH=0.001) to test enhanced stability. +""" + +from openwave.xperiments.m4_ewt.xparameters.utils.geometry import ( + generate_positions_by_EWT_geometry_locked, +) +from openwave.common import constants + +UNIVERSE_EDGE = 4e-15 +TARGET_VOXELS = 55_000_000 +K = 10 + +PERTURBATION = 0.1 +POSITIONS = generate_positions_by_EWT_geometry_locked( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=10 1-3-6 soft boost=0.00001 V_MODE=10 pressure=0.001", + "DESCRIPTION": "Increased pressure test: does stronger vacuum pressure improve soliton stability?", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.001, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.5, + "WC_INTERACT_MODE": 1, + "WC_BOOST": 0.002, + "WC_RADIUS": 30, + "WC_SIGMA": 1.5, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.001, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode1_neumann_boost0015.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode1_neumann_boost0015.py new file mode 100644 index 00000000..75a7d0fc --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode1_neumann_boost0015.py @@ -0,0 +1,67 @@ +# electron_k10_vmode1_neumann_boost0015.py +""" +K=10, 1-3-6 geometry, neumann interaction, WC_BOOST=0.015. +Step 3 of K-selectivity sweep - near equilibrium. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import tetrahedron_10 +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 10 + +POSITIONS = tetrahedron_10(UNIVERSE_EDGE, center=(0.5, 0.5, 0.5)) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=10 1-3-6 neumann boost=0.015", + "DESCRIPTION": "Step 3: near-equilibrium boost", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 1, + "V_C1": -0.1, + "V_C2": 0.1, + "WC_INTERACT_MODE": 2, + "WC_BOOST": 0.015, + "WC_RADIUS": 2, + "WC_SIGMA": 1.5, + "VELOCITY_DAMPING": 0.990, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode1_soft_boost00001.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode1_soft_boost00001.py new file mode 100644 index 00000000..6b50c82d --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode1_soft_boost00001.py @@ -0,0 +1,67 @@ +# electron_k10_vmode1_soft_boost00001.py +""" +K=10, 1-3-6 geometry, soft interaction, WC_BOOST=0.0001. +Step 1: find stable baseline for soft mode. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import tetrahedron_10 +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 10 + +POSITIONS = tetrahedron_10(UNIVERSE_EDGE, center=(0.5, 0.5, 0.5)) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=10 1-3-6 soft boost=0.0001", + "DESCRIPTION": "Soft mode baseline - find stable parameters", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 1, + "V_C1": -0.1, + "V_C2": 0.1, + "WC_INTERACT_MODE": 3, + "WC_BOOST": 0.0001, + "WC_RADIUS": 2, + "WC_SIGMA": 1.5, + "VELOCITY_DAMPING": 0.990, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode1_soft_boost0001.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode1_soft_boost0001.py new file mode 100644 index 00000000..cfb4eadc --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k10_vmode1_soft_boost0001.py @@ -0,0 +1,67 @@ +# electron_k10_vmode1_soft_boost0001.py +""" +K=10, 1-3-6 geometry, soft interaction, WC_BOOST=0.001, damping=0.95. +Step 2: higher boost with stronger damping to find equilibrium. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import tetrahedron_10 +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 10 + +POSITIONS = tetrahedron_10(UNIVERSE_EDGE, center=(0.5, 0.5, 0.5)) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=10 1-3-6 soft boost=0.001 damp=0.95", + "DESCRIPTION": "Soft mode - higher boost with stronger damping", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 1, + "V_C1": -0.1, + "V_C2": 0.1, + "WC_INTERACT_MODE": 3, + "WC_BOOST": 0.001, + "WC_RADIUS": 2, + "WC_SIGMA": 1.5, + "VELOCITY_DAMPING": 0.95, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k11_ewt_vmode1_neumann_boost0015.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k11_ewt_vmode1_neumann_boost0015.py new file mode 100644 index 00000000..8e41a09c --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k11_ewt_vmode1_neumann_boost0015.py @@ -0,0 +1,71 @@ +# electron_k11_ewt_vmode1_neumann_boost0015.py +""" +K=11, EWT geometry (tricapped trigonal prism), Neumann interaction, V_MODE=1, WC_BOOST=0.015. +K-selectivity test: can the EWT geometry stabilise the excess wave centre in K=11? +Uses the same parameters as the stable K=10 (1-3-6) and K=9 (EWT prism) Neumann tests. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import generate_positions_by_EWT_geometry +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 11 +PERTURBATION = 0.02 + +POSITIONS = generate_positions_by_EWT_geometry( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=11 EWT prism Neumann boost=0.015 V_MODE=1", + "DESCRIPTION": "K-selectivity test: K=11 with EWT geometry in Neumann mode", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 1, + "V_C1": -0.1, + "V_C2": 0.1, + "WC_INTERACT_MODE": 2, + "WC_BOOST": 0.015, + "WC_RADIUS": 2, + "WC_SIGMA": 1.5, + "VELOCITY_DAMPING": 0.990, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/electron_k11_vmode10_gaussian_saturation.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k11_vmode10_gaussian_saturation.py similarity index 100% rename from openwave/xperiments/m4_ewt/xparameters/electron_k11_vmode10_gaussian_saturation.py rename to openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k11_vmode10_gaussian_saturation.py diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k11_vmode10_soft_boost000001.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k11_vmode10_soft_boost000001.py new file mode 100644 index 00000000..86d80e82 --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k11_vmode10_soft_boost000001.py @@ -0,0 +1,70 @@ +# electron_k11_vmode10_soft_boost000001.py +""" +K=11, golden-angle geometry, soft interaction, V_MODE=10, ultra-low boost. +K-selectivity test: K=11 with soft mode and V_MODE=10. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import generate_K_positions +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 11 +PERTURBATION = 0.02 + +POSITIONS = generate_K_positions( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=11 golden-angle soft boost=0.00001 V_MODE=10", + "DESCRIPTION": "K-selectivity test: K=11 with soft mode and V_MODE=10", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 10, + "V_C1": -0.3, + "V_C2": 0.1, + "WC_INTERACT_MODE": 3, + "WC_BOOST": 0.00001, + "WC_RADIUS": 2, + "WC_SIGMA": 2.0, + "VELOCITY_DAMPING": 0.95, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k11_vmode1_neumann_boost0015.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k11_vmode1_neumann_boost0015.py new file mode 100644 index 00000000..dabe294e --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/electron_k11_vmode1_neumann_boost0015.py @@ -0,0 +1,71 @@ +# electron_k11_vmode1_neumann_boost0015.py +""" +K=11, golden-angle geometry, neumann interaction, WC_BOOST=0.015. +K-selectivity test: if K=10 is the only stable configuration, +K=11 should show different behavior. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import generate_K_positions +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 11 +PERTURBATION = 0.02 + +POSITIONS = generate_K_positions( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=11 golden-angle neumann boost=0.015", + "DESCRIPTION": "K-selectivity test: K=11 with equilibrium parameters", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 1, + "V_C1": -0.1, + "V_C2": 0.1, + "WC_INTERACT_MODE": 2, + "WC_BOOST": 0.015, + "WC_RADIUS": 2, + "WC_SIGMA": 1.5, + "VELOCITY_DAMPING": 0.990, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/formation10e_tmp.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/formation10e_tmp.py new file mode 100644 index 00000000..12de8179 --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/formation10e_tmp.py @@ -0,0 +1,103 @@ +""" +XPERIMENT PARAMETERS + +Progressive particle formation test. +Verifies prediction: K=2..9 are UNSTABLE (decay/fly apart), +K=10 is the first stable standalone particle (electron tetrahedron). + +Switch K below. Positions come from xparameters/utils/geometry.py, which +dispatches on K: + K=10: the 1-3-6 tetrahedron (the electron) + K=11: a golden-angle (Fibonacci) sphere + other: the golden-angle fallback, every point on a sphere of radius 0.35 lambda + +Spacing caveat: only K=10 spans the lock-in wells at r = n*lambda, the energy +minima where same-phase wave centres hold. Under the fallback all pair +separations land between 0.33 and 0.70 lambda, inside the first well, so K=2..9 +are not tested at the lock-in spacing. The named geometries this file used to +build (line, triangle, tetrahedron, bipyramid, octahedron, cube, tricapped +prism) are no longer generated. +""" + +from openwave.xperiments.m4_ewt.xparameters.utils.geometry import ( + generate_positions_by_EWT_geometry, +) + +UNIVERSE_EDGE = 2e-15 # m, universe edge length in meters +TARGET_VOXELS = 55_000_000 # Target voxel count (impacts performance) + +# ════════════════════════════════════════════════════════════════════════════ +# SELECT K VALUE HERE. K=10 is the 1-3-6 tetrahedron, K=11 a golden-angle +# sphere, every other K the golden-angle fallback. +# ════════════════════════════════════════════════════════════════════════════ +K = 10 + +# Perturbation: shift each WC by random ±PERTURBATION fraction of λ. +# At 0.0: perfect lattice (all K stable). At 0.2+: real test. +PERTURBATION = 0.1 # fraction of λ (0.0 = perfect, 0.3 = 30% random displacement) + +POSITIONS = generate_positions_by_EWT_geometry( + UNIVERSE_EDGE, K, center=(0.5, 0.5, 0.5), perturbation=PERTURBATION +) +PHASES = [180] * K # all same phase (electron-like) + +XPARAMETERS = { + "meta": { + "X_NAME": f" /Electron (K={K})", + "DESCRIPTION": f"K={K} stability test — {'STABLE' if K == 10 else 'expect UNSTABLE'}", + }, + "camera": { + "INITIAL_POSITION": [0.94, 0.91, 0.69], + }, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + # Base wave seed (P1) + "SEED_MODE": 2, # 0 = gaussian pulse, 1 = radial cosine, 2 = full (domain-filling base wave) + "SEED_BOOST": 0.05, # seed amplitude multiplier + # Non-linear potential V(ψ) (P2) + "V_MODE": 7, # 0 = linear/off, 1 = cubic ψ³, 2 = saturating, 3 = double-well + "V_C1": 0, + "V_C2": 1, + # Wave-center interaction (P3) + "WC_INTERACT_MODE": 3, # 0 = free, 1 = dirichlet, 2 = neumann, 3 = soft + "WC_BOOST": 0.05, # WC drive amplitude multiplier + "WC_RADIUS": 2, # WC drive ball radius (voxels) + "WC_SIGMA": 1.5, # soft-mode Gaussian width (voxels) + "PRESSURE_STRENGTH": 0.001, + "CFL_SAFETY": 0.1, + "R_SOLITON": 35, + "DEFICIT_DEPTH": 0.9, + "VELOCITY_DAMPING": 0.90, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 30, + "SHOW_GRANULES": False, # Toggle to show/hide granule particles (rendered as points) + "TIMESTEP": 5.0, + "PAUSED": False, + "PARTICLE_SHELL": True, + }, + "color_defaults": { + "COLOR_THEME": "OCEAN", + "WAVE_MENU": 1, + }, + "analytics": { + "INSTRUMENTATION": True, + "EXPORT_VIDEO": False, + "VIDEO_FRAMES": 24, + }, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/test_live_monitor.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/test_live_monitor.py similarity index 100% rename from openwave/xperiments/m4_ewt/xparameters/test_live_monitor.py rename to openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/test_live_monitor.py diff --git a/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/test_logging_1_3_6.py b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/test_logging_1_3_6.py new file mode 100644 index 00000000..75a7d0fc --- /dev/null +++ b/openwave/xperiments/m4_ewt/xparameters/sandbox_k_selectivity/test_logging_1_3_6.py @@ -0,0 +1,67 @@ +# electron_k10_vmode1_neumann_boost0015.py +""" +K=10, 1-3-6 geometry, neumann interaction, WC_BOOST=0.015. +Step 3 of K-selectivity sweep - near equilibrium. +""" + +from openwave.xperiments.m4_ewt.xparameters.geometry import tetrahedron_10 +from openwave.common import constants + +UNIVERSE_EDGE = 2e-15 +TARGET_VOXELS = 55_000_000 +K = 10 + +POSITIONS = tetrahedron_10(UNIVERSE_EDGE, center=(0.5, 0.5, 0.5)) +PHASES = [180] * K + +XPARAMETERS = { + "meta": { + "X_NAME": "K=10 1-3-6 neumann boost=0.015", + "DESCRIPTION": "Step 3: near-equilibrium boost", + }, + "camera": {"INITIAL_POSITION": [1.20, 1.80, 1.20]}, + "universe": { + "SIZE": [UNIVERSE_EDGE, UNIVERSE_EDGE, UNIVERSE_EDGE], + "TARGET_VOXELS": TARGET_VOXELS, + }, + "wave_centers": { + "COUNT": K, + "POSITION": POSITIONS, + "PHASE_OFFSETS_DEG": PHASES, + "APPLY_MOTION": True, + }, + "engine": { + "SEED_MODE": 2, + "SEED_BOOST": 0.01, + "V_MODE": 1, + "V_C1": -0.1, + "V_C2": 0.1, + "WC_INTERACT_MODE": 2, + "WC_BOOST": 0.015, + "WC_RADIUS": 2, + "WC_SIGMA": 1.5, + "VELOCITY_DAMPING": 0.990, + "R_WALL": 100.0, + "WALL_HEIGHT": 1.2, + "DEFICIT_DEPTH": 0.9, + "R_SOLITON": 35.0, + "SIGMA": 3.0, + "PRESSURE_STRENGTH": 0.0, + "CFL_SAFETY": 0.1, + }, + "ui_defaults": { + "SHOW_AXIS": False, + "TICK_SPACING": 0.25, + "SHOW_GRID": False, + "SHOW_EDGES": False, + "FLUX_MESH_PLANES": [0.5, 0.5, 0.5], + "SHOW_FLUX_MESH": 1, + "WARP_MESH": 100, + "SHOW_GRANULES": False, + "PARTICLE_SHELL": False, + "SIM_SPEED": 1.0, + "PAUSED": False, + }, + "color_defaults": {"COLOR_THEME": "OCEAN", "WAVE_MENU": 1}, + "analytics": {"INSTRUMENTATION": True, "EXPORT_VIDEO": False, "VIDEO_FRAMES": 24}, +} diff --git a/openwave/xperiments/m4_ewt/xparameters/utils/geometry.py b/openwave/xperiments/m4_ewt/xparameters/utils/geometry.py index 276a2cef..ca84622c 100644 --- a/openwave/xperiments/m4_ewt/xparameters/utils/geometry.py +++ b/openwave/xperiments/m4_ewt/xparameters/utils/geometry.py @@ -95,6 +95,218 @@ def tetrahedron_10(univ_edge, center=(0.5, 0.5, 0.5), rotation=(0, 0, 0), pertur return positions +def tetrahedron_10_locked( + univ_edge, + center=(0.5, 0.5, 0.5), + rotation=(0, 0, 0), + perturbation=0.0, +): + """ + Generate the 1-3-6 tetrahedral electron geometry locked on n·λ wells. + + Positions are scaled by LOCK_SPACING so that all separations land on + the n·λ lock‑in wells of the standing wave. The inner 3 WCs sit at + 1·λ from the centre, the outer 6 WCs at 2·λ. + + Parameters + ---------- + univ_edge : float + Universe edge length in metres. + center : tuple[float, float, float] + Normalised (cx, cy, cz) centre of the geometry. + rotation : tuple[float, float, float] + Euler angles in degrees (Z, Y, X) applied after construction. + perturbation : float + Random displacement fraction of LOCK_SPACING (0 = exact positions). + """ + import math + import random + + cx, cy, cz = center + LOCK_SPACING = constants.EWAVE_LENGTH / univ_edge + + # Radii in normalised units, chosen as multiples of the lock‑in spacing + r1 = 1.0 * LOCK_SPACING # inner shell + r2 = 2.0 * LOCK_SPACING # outer shell + h = r2 * math.sqrt(2.0 / 3.0) # vertical offset for the outer layers + + positions = [] + + # 1. Centre + positions.append([cx, cy, cz]) + + # 2. Inner 3 – equilateral triangle in the XY plane + angles_inner = [math.radians(90), math.radians(210), math.radians(330)] + for a in angles_inner: + positions.append( + [ + cx + r1 * math.cos(a), + cy + r1 * math.sin(a), + cz, + ] + ) + + # 3. Outer 6 – two layers of 3, rotated 60° relative to the inner triangle + angles_outer = [math.radians(30), math.radians(150), math.radians(270)] + # Lower layer (Z = -h) + for a in angles_outer: + positions.append( + [ + cx + r2 * math.cos(a), + cy + r2 * math.sin(a), + cz - h, + ] + ) + # Upper layer (Z = +h) + for a in angles_outer: + positions.append( + [ + cx + r2 * math.cos(a), + cy + r2 * math.sin(a), + cz + h, + ] + ) + + # ---- Apply rotation ---- + if rotation != (0, 0, 0): + rz, ry, rx = [math.radians(a) for a in rotation] + cos_z, sin_z = math.cos(rz), math.sin(rz) + cos_y, sin_y = math.cos(ry), math.sin(ry) + cos_x, sin_x = math.cos(rx), math.sin(rx) + + rotated = [] + for x, y, z in positions: + dx, dy, dz = x - cx, y - cy, z - cz + # Z + x1 = dx * cos_z - dy * sin_z + y1 = dx * sin_z + dy * cos_z + z1 = dz + # Y + x2 = x1 * cos_y + z1 * sin_y + y2 = y1 + z2 = -x1 * sin_y + z1 * cos_y + # X + x3 = x2 + y3 = y2 * cos_x - z2 * sin_x + z3 = y2 * sin_x + z2 * cos_x + rotated.append([cx + x3, cy + y3, cz + z3]) + positions = rotated + + # ---- Apply perturbation ---- + if perturbation > 0: + rng = random.Random(42) + positions = _apply_perturbation(positions, perturbation, LOCK_SPACING, rng) + + return positions + + +def generate_positions_by_EWT_geometry_locked( + univ_edge: float, + K: int, + center=(0.5, 0.5, 0.5), + rotation=(0, 0, 0), + perturbation: float = 0.0, +): + """ + Generate K WC positions using EWT geometry locked on n·λ wells. + + Same as generate_positions_by_EWT_geometry, but for K=10 uses + tetrahedron_10_locked instead of the unscaled tetrahedron_10. + + Parameters + ---------- + univ_edge : float + Universe edge length in metres. + K : int + Number of wave centres (2..10). + center : tuple + Normalised centre. + rotation : tuple + Euler angles in degrees (only used for K=10). + perturbation : float + Random displacement fraction of LOCK_SPACING. + + Returns + ------- + list of [x, y, z] normalised positions. + """ + import math + import random + + LOCK_SPACING = constants.EWAVE_LENGTH / univ_edge + cx, cy, cz = center + s = LOCK_SPACING + + if K == 2: + positions = [[cx - s / 2, cy, cz], [cx + s / 2, cy, cz]] + elif K == 3: + angles = [math.radians(90), math.radians(210), math.radians(330)] + r = s / math.sqrt(3) + positions = [[cx + r * math.cos(a), cy + r * math.sin(a), cz] for a in angles] + elif K == 4: + h = s * math.sqrt(2 / 3) + r = s / math.sqrt(3) + positions = [ + [cx, cy + r, cz], + [cx - s / 2, cy - r / 2, cz], + [cx + s / 2, cy - r / 2, cz], + [cx, cy, cz + h], + ] + elif K == 5: + angles = [math.radians(90), math.radians(210), math.radians(330)] + r = s / math.sqrt(3) + positions = [[cx + r * math.cos(a), cy + r * math.sin(a), cz] for a in angles] + positions.append([cx, cy, cz + s / 2]) + positions.append([cx, cy, cz - s / 2]) + elif K == 6: + d = s / math.sqrt(2) + positions = [ + [cx + d, cy, cz], + [cx - d, cy, cz], + [cx, cy + d, cz], + [cx, cy - d, cz], + [cx, cy, cz + d], + [cx, cy, cz - d], + ] + elif K == 7: + angles = [math.radians(i * 72) for i in range(5)] + r = s / (2 * math.sin(math.pi / 5)) + positions = [[cx + r * math.cos(a), cy + r * math.sin(a), cz] for a in angles] + positions.append([cx, cy, cz + s / 2]) + positions.append([cx, cy, cz - s / 2]) + elif K == 8: + d = s / 2 + positions = [ + [cx + d, cy + d, cz + d], + [cx + d, cy + d, cz - d], + [cx + d, cy - d, cz + d], + [cx + d, cy - d, cz - d], + [cx - d, cy + d, cz + d], + [cx - d, cy + d, cz - d], + [cx - d, cy - d, cz + d], + [cx - d, cy - d, cz - d], + ] + elif K == 9: + positions = tricapped_trigonal_prism_positions(K, center, LOCK_SPACING, perturbation) + # perturbation already applied inside helper + return positions + elif K == 10: + positions = tetrahedron_10_locked( + univ_edge, center=center, rotation=rotation, perturbation=perturbation + ) + return positions + else: + # Fallback: golden angle on a small sphere + positions = golden_angle_positions(K, 0.35 * LOCK_SPACING, center) + + # Apply perturbation for all cases except K=9 and K=10 (already handled) + if perturbation > 0: + rng = random.Random(42) + positions = _apply_perturbation(positions, perturbation, LOCK_SPACING, rng) + + return positions + + def golden_angle_positions(K, radius, center): """Generate K points on a sphere via Fibonacci spiral.""" points = []