forked from deepcausality-rs/deep_causality
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelectroweak_impl.rs
More file actions
89 lines (78 loc) · 3.19 KB
/
electroweak_impl.rs
File metadata and controls
89 lines (78 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* SPDX-License-Identifier: MIT
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/
use crate::{
EM, ElectroweakField, ElectroweakOps, ElectroweakParams, PhysicsError, SIN2_THETA_W, W_MASS,
Z_MASS,
};
use deep_causality_metric::{LorentzianMetric, WestCoastMetric};
use deep_causality_num::RealField;
use deep_causality_tensor::{CausalTensor, TensorData};
use deep_causality_topology::{BaseTopology, GaugeField, GaugeFieldWitness, Manifold, U1};
impl<S> ElectroweakOps<S> for ElectroweakField<S>
where
S: RealField + Clone + From<f64> + Into<f64> + TensorData,
{
fn new_field(base: Manifold<S, S>, connection: CausalTensor<S>) -> Result<Self, PhysicsError> {
let metric = WestCoastMetric::minkowski_4d().into_metric();
// Initial field strength
let num_points = base.len();
let dim = 4;
let lie_dim = 4; // SU(2)xU(1) = 3 + 1
// zero() from Field trait
let field_strength = CausalTensor::zeros(&[num_points, dim, dim, lie_dim]);
GaugeField::new(base, metric, connection, field_strength)
.map_err(|e| PhysicsError::TopologyError(e.to_string()))
}
fn standard_model_params() -> ElectroweakParams<S> {
ElectroweakParams::standard_model()
}
fn extract_photon(&self) -> Result<EM<S>, PhysicsError> {
let params = Self::standard_model_params();
let cos_theta = params.cos_theta_w();
let sin_theta = params.sin_theta_w();
// Use topology gauge_rotation method from the GaugeField
// Photon: A_μ = W³_μ sin(θ_W) + B_μ cos(θ_W)
// index_a = 2 (W³), index_b = 3 (B)
let (new_conn, new_strength) = GaugeFieldWitness::<S>::gauge_rotation(
self.connection(),
self.field_strength(),
2, // W³ index
3, // B index
cos_theta,
sin_theta,
);
GaugeField::new(self.base().clone(), self.metric(), new_conn, new_strength)
.map_err(|e| PhysicsError::TopologyError(e.to_string()))
}
fn extract_z(&self) -> Result<GaugeField<U1, S, S, S>, PhysicsError> {
let params = Self::standard_model_params();
let cos_theta = params.cos_theta_w();
let sin_theta = params.sin_theta_w();
// Use the topology gauge_rotation method from the GaugeField.
// Z_μ = W³_μ cos(θ_W) - B_μ sin(θ_W)
// This is equivalent to: A^a cos(θ) + A^b (-sin(θ))
// So we pass -sin_theta for the second component
let neg_sin_theta = S::zero() - sin_theta;
let (new_conn, new_strength) = GaugeFieldWitness::<S>::gauge_rotation(
self.connection(),
self.field_strength(),
2, // W³ index
3, // B index
neg_sin_theta,
cos_theta,
);
GaugeField::new(self.base().clone(), self.metric(), new_conn, new_strength)
.map_err(|e| PhysicsError::TopologyError(e.to_string()))
}
fn sin2_theta_w(&self) -> S {
<S as From<f64>>::from(SIN2_THETA_W)
}
fn w_mass(&self) -> S {
<S as From<f64>>::from(W_MASS)
}
fn z_mass(&self) -> S {
<S as From<f64>>::from(Z_MASS)
}
}