feat(deep_causality_topology): certified Lattice Gauge Field #450
feat(deep_causality_topology): certified Lattice Gauge Field #450marvin-hansen merged 7 commits intodeepcausality-rs:mainfrom
Conversation
…correctness of the Lattice Gaugle Field up to 1e-31(!) Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
…uge Field. Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
…s and ComplexFiels in GaugeField and LatticeGauge Field Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #450 +/- ##
==========================================
+ Coverage 93.35% 93.38% +0.03%
==========================================
Files 853 854 +1
Lines 38384 38547 +163
==========================================
+ Hits 35835 35999 +164
+ Misses 2549 2548 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||||||||
User description
Describe your changes
Issue ticket number and link
Code checklist before requesting a review
For details on make, please see BUILD.md
Note: The CI runs all of the above and fixing things before they hit CI speeds
up the review and merge process. Thank you.
PR Type
Enhancement, Tests, Documentation
Description
Tto dual parametersM(matrix elements) andR(real scalars) to properly support complex matrices in U(1) and other gauge theoriesComplexField<R>andDivisionAlgebra<R>trait bounds for proper complex matrix arithmetic<G, M, R>) while maintaining full algebraic expressivenessDiagram Walkthrough
File Walkthrough
13 files
lattice_gauge_field_tests.rs
Refactor tests to use complex matrix types for U(1) gauge fieldsdeep_causality_topology/tests/types/gauge/gauge_field_lattice/lattice_gauge_field_tests.rs
LatticeGaugeFieldtype signatures to includeComplexasmatrix type and
f64as scalar typemetropolis_sweep_f64()andmetropolis_update_f64()totry_metropolis_sweep()andtry_metropolis_update()Complex::new(1.0, 0.0)and.norm()for complex number handlingComplexfromdeep_causality_numverification_tests.rs
Add physics verification tests against exact analytical solutionsdeep_causality_topology/tests/types/gauge/gauge_field_lattice/verification_tests.rs
gauge theory
bessel_i0,bessel_i1,bessel_ratio) for exact analytical solutionsimproved action coefficients, and gauge invariance
Metropolis algorithm with real matrices
detection
mod.rs
Register new verification tests moduledeep_causality_topology/tests/types/gauge/gauge_field_lattice/mod.rs
verification_testsmodule to test suitelink_variable_tests.rs
LinkVariable tests refactored for complex matrix supportdeep_causality_topology/tests/types/gauge/link_variable/link_variable_tests.rs
LinkVariabletype signatures fromLinkVariabletoLinkVariable, f64>to support complex matrix elements.abs()to.norm()for complex numbercomparisons
Complex::new()for matrix elementsinstead of raw floats
Complex::new()values andtry_scale()methodshkt_lattice_gauge_tests.rs
HKT lattice gauge field tests updated for complex matricesdeep_causality_topology/tests/extensions/hkt_lattice_gauge_tests.rs
LatticeGaugeFieldtype signatures to includeComplexas matrixelement type
LatticeGaugeFieldWitnesstoLatticeGaugeFieldWitness.norm()for complex number comparisonscomparisons
gauge_field_tests.rs
Gauge field tests updated for complex matrix supportdeep_causality_topology/tests/types/gauge/gauge_field/gauge_field_tests.rs
GaugeFieldtype signatures to useComplexfor matrix elementsComplex::new()for connection and fieldstrength tensors
Complexvalues directlyGaugeFieldtoGaugeField, f64>hkt_gauge_field_tests.rs
Update gauge field test instantiationsdeep_causality_topology/tests/extensions/hkt_gauge_field_tests.rs
GaugeFieldinstantiations from four type parameters to twoGaugeFieldtoGaugeFieldGaugeFieldtoGaugeFieldmetropolis_tests.rs
Update metropolis tests with complex field elementsdeep_causality_topology/tests/types/gauge/gauge_field_lattice/metropolis_tests.rs
Compleximport fromdeep_causality_numLatticeGaugeFieldinstantiations to useComplexfor matrixelements
LatticeGaugeFieldtoLatticeGaugeField
Complex, f64>Renamedmetropolis_sweep_f64method call totry_metropolis_sweepwilson_tests.rs
Update Wilson loop tests with complex field supportdeep_causality_topology/tests/types/gauge/gauge_field_lattice/wilson_tests.rs
Compleximport fromdeep_causality_numLatticeGaugeFieldinstantiations to useComplexfor matrixelements
.abs()and.norm()methods for complexnumber comparisons
comparisons
continuum_tests.rs
Update continuum tests with complex field elementsdeep_causality_topology/tests/types/gauge/gauge_field_lattice/continuum_tests.rs
Compleximport fromdeep_causality_numLatticeGaugeFieldinstantiations to useComplexfor matrixelements
Complexvalues using.norm()Complex::new(0.0, 0.0)gauge_field_validation_tests.rs
Update gauge field validation testsdeep_causality_topology/tests/types/gauge/gauge_field/gauge_field_validation_tests.rs
GaugeFieldtype instantiations from four to two typeparameters
GaugeFieldtoGaugeFieldgradient_flow_tests.rs
Update gradient flow tests with complex field elementsdeep_causality_topology/tests/types/gauge/gauge_field_lattice/gradient_flow_tests.rs
Compleximport fromdeep_causality_numLatticeGaugeFieldinstantiations to useComplexfor matrixelements
LatticeGaugeFieldtoLatticeGaugeField
Complex, f64>display_tests.rs
Clean up display tests and simplify type parametersdeep_causality_topology/tests/types/gauge/gauge_field/display_tests.rs
calculation
GaugeFieldinstantiation from four to two type parameters34 files
ops.rs
Refactor LinkVariable to support complex matrices with real scalarsdeep_causality_topology/src/types/gauge/link_variable/ops.rs
T: TensorDatatoM:TensorData(matrix) andR: RealField(scalar)try_dagger()anddagger()to conjugate complex matrix elementsusing
ComplexFieldtraitproject_sun()to handle complex matrices with polardecomposition and determinant-based phase correction for SU(N)
try_determinant()helper method for 2×2 and 3×3 matricesarithmetic with real scalar parameters
hkt_lattice_gauge.rs
Update HKT witness for separated matrix and scalar type parametersdeep_causality_topology/src/extensions/hkt_gauge/hkt_lattice_gauge.rs
LatticeGaugeFieldWitnessto include matrix type parameterMinaddition to gauge group
Gand dimensionDLatticeGaugeField
R>signature with separate matrix and scalar typesUpdated
map_field(),zip_with(), andscale_field()helper methods towork with new type structure
Modified helper functions
map_link_variable()andzip_link_variables()to handle matrix and scalar type separation
AddedDebugandClonebounds toTensorDataconstraints where neededops_gradient_flow.rs
Gradient flow operations refactored for complex field supportdeep_causality_topology/src/types/gauge/gauge_field_lattice/ops_gradient_flow.rs
FlowParamstoFlowParamswithRealFieldbounds for scalarparameters
LatticeGaugeFieldimpl bounds to useM: ComplexField +DivisionAlgebrafor matrix elementsT::from()toR::from_f64()and addedM::from_re_im()for complex scalingtry_scale()calls to usetry_scale()with error handlinginstead of direct
scale()ops_wilson.rs
Wilson action and loop observables updated for complex matricesdeep_causality_topology/src/types/gauge/gauge_field_lattice/ops_wilson.rs
M: ComplexField + DivisionAlgebraformatrix elements
TtoRfor action and observablecomputations
R::from_f64()instead ofT::from()try_mul()calls to include error handling withmap_err(TopologyError::from)ops_metropolis.rs
Metropolis algorithm refactored for complex field supportdeep_causality_topology/src/types/gauge/gauge_field_lattice/ops_metropolis.rs
RtoRngTypeto avoid conflict with scalartype
RM: RandomField + ComplexField + FieldTtoR(RealField)M::generate_uniform()andM::from_re_im()ops_plague.rs
Plaquette and rectangle operations refactored for complex supportdeep_causality_topology/src/types/gauge/gauge_field_lattice/ops_plague.rs
M: ComplexField + DivisionAlgebraformatrix elements
mul()calls totry_mul()with error handling throughoutplaquette and rectangle computations
TtoRfor observable computationsR::from_f64()instead ofT::from()mod.rs
Lattice gauge field refactored with complex matrix element supportdeep_causality_topology/src/types/gauge/gauge_field_lattice/mod.rs
validation tests
G,D,M,Rinstead of three
linksHashMap to storeLinkVariablewith complexmatrix support
M: ComplexField + DivisionAlgebrabounds
mod.rs
LinkVariable refactored with separate matrix and scalar typesdeep_causality_topology/src/types/gauge/link_variable/mod.rs
G,M,Rinstead of two_scalar: PhantomDatafield to track scalar typeM: Field + ComplexField + DivisionAlgebratry_random()to useM::generate_uniform()for random matrixgeneration
weak_field_ops_impl.rs
Weak force field operations updated for RealField traitdeep_causality_physics/src/theories/weak_force/weak_field_ops_impl.rs
Field + FloattoRealField + ToPrimitiveis_finite()checks to use.to_f64().unwrap_or(f64::NAN).is_finite()powi()calls withpowf()usingS::from()for exponents=to+=for clarityops_continuum.rs
Continuum limit operations refactored for complex field supportdeep_causality_topology/src/types/gauge/gauge_field_lattice/ops_continuum.rs
M: ComplexField + DivisionAlgebraformatrix elements
TtoRfor topological charge computationsM::from_re_im()andtry_scale()with error handling
R::from_f64()instead ofT::from()ops_actions.rs
Improved gauge actions refactored for real field coefficientsdeep_causality_topology/src/types/gauge/gauge_field_lattice/ops_actions.rs
ActionCoeffstoActionCoeffswithRealField + FromPrimitivebounds
M: ComplexField + DivisionAlgebraformatrix elements
T::from()toR::from_f64()=to+=for consistencyops_monte_carlo.rs
Monte Carlo operations refactored with error handling for complexmatricesdeep_causality_topology/src/types/gauge/gauge_field_lattice/ops_monte_carlo.rs
M: ComplexField + DivisionAlgebraformatrix elements
mul()calls totry_mul()with error handling for staple andaction computations
add()calls totry_add()with error handlingR::from_f64()instead ofT::from()hkt_gauge_witness.rs
HKT gauge witness methods updated for new GaugeField signaturedeep_causality_topology/src/extensions/hkt_gauge/hkt_gauge_witness.rs
merge_fields()signature to use separateA,B,F2types andR:RealFieldgauge_transform()signature to useF2: TensorDataandR:RealFieldcompute_field_strength_abelian()to useGaugeFieldsignature
compute_field_strength_non_abelian()to useGaugeField
R>andR: Fieldops_smearing.rs
Refactor smearing operations with algebraic trait boundsdeep_causality_topology/src/types/gauge/gauge_field_lattice/ops_smearing.rs
Tto dualM(matrix elements)and
R(real scalars) with algebraic trait boundsSmearingParamsto useRealFieldbounds instead ofFromtry_scalewith proper errorhandling for complex field elements
Mfor correct matrixoperations
ops_gauge_transform.rs
Refactor gauge transformations with dual type parametersdeep_causality_topology/src/types/gauge/gauge_field_lattice/ops_gauge_transform.rs
MandRreplacing singleTparameterLinkVariableRtoRngTypein random gauge transform to avoidconflict with scalar type
Rtry_mulwith error handlingmod.rs
Simplify GaugeField type parameters with algebraic boundsdeep_causality_topology/src/types/gauge/gauge_field/mod.rs
GaugeFieldfrom four type parametersto twoFieldandRealFieldfromdeep_causality_numRfor both scalar typesMfor matrixelements
gauge_em_ops_impl.rs
Update electromagnetic operations with RealField boundsdeep_causality_physics/src/theories/electromagnetism/gauge_em_ops_impl.rs
GaugeEmOpsimplementation to use simplifiedGaugeField
S>signatureReplaced
Floattrait bound withRealFieldfor scalar operationsChanged method calls from
Float::abs()to.abs()method on valuesUpdated helper functions to useRealFieldinstead ofField + Floatbounds
getters.rs
Update lattice gauge field getters with new type parametersdeep_causality_topology/src/types/gauge/gauge_field_lattice/getters.rs
D, M, R>Changed return types from
TtoRfor beta-related gettersUpdated
LinkVariablereferences to usesignatureAdded#[allow(clippy::type_complexity)]for complex type signaturesops_gauge.rs
Refactor gauge operations with algebraic trait boundsdeep_causality_topology/src/types/gauge/gauge_field_lattice/ops_gauge.rs
MandRwith algebraic trait boundsLinkVariabletry_mulwith error handlinglattice_gauge_simulation.rs
Update lattice gauge simulation example with complex fieldsdeep_causality_topology/examples/lattice_gauge_simulation.rs
Compleximport fromdeep_causality_numLatticeGaugeFieldinstantiation to useComplexfor matrixelements
LatticeGaugeFieldtoLatticeGaugeField
D, Complex, f64>Renamedmetropolis_sweep_f64method call totry_metropolis_sweepmod.rs
Simplify physics field type aliasesdeep_causality_physics/src/theories/alias/mod.rs
parameters
EM,WeakField,ElectroweakField,QCD,SMField, andGRaliasesGaugeFieldtoGaugeFieldlib.rs
Reorganize library exports and add RandomField traitdeep_causality_topology/src/lib.rs
RandomFieldtrait to public exportshkt_adjunction_stokesimports for consistencygetters.rs
Update gauge field getters with new type parametersdeep_causality_topology/src/types/gauge/gauge_field/getters.rs
M, R>Changed return types from
TtoMfor connection and field_strengthgetters
UpdatedManifoldreference to useRfor scalar typegetters.rs
Update link variable getters with dual type parametersdeep_causality_topology/src/types/gauge/link_variable/getters.rs
M: std::fmt::Debug + Clone, Rinstead ofTMfor matrix elementsMinstead ofTrandom.rs
Add RandomField trait for random element generationdeep_causality_topology/src/types/gauge/link_variable/random.rs
RandomFieldtrait for generating random field elementsuniformly
RandomFieldforf64generating values in range [-0.5, 0.5)RandomFieldforComplexwith independent real andimaginary components
deep_causality_randand algebraic types for generic randomgeneration
utils.rs
Refactor lattice gauge field utilities with algebraic boundsdeep_causality_topology/src/types/gauge/gauge_field_lattice/utils.rs
Tto dualMandRFloattrait bound withComplexField + DivisionAlgebraget_link_or_identityreturn type to useLinkVariableDebugtrait bound toMtype parametergauge_em_ops.rs
Update electromagnetic operations trait boundsdeep_causality_physics/src/theories/electromagnetism/gauge_em_ops.rs
Field + FloattoRealFieldweak_field_ops.rs
Update weak force operations trait boundsdeep_causality_physics/src/theories/weak_force/weak_field_ops.rs
Field + FloattoRealField + ToPrimitivedisplay.rs
Update lattice gauge field display with new type parametersdeep_causality_topology/src/types/gauge/gauge_field_lattice/display.rs
Displayimplementation to use dual type parametersR>Changed type name extraction to use
Minstead ofTAdded explicit imports forDebugandDisplaytraitselectroweak_ops.rs
Update electroweak operations with simplified type parametersdeep_causality_physics/src/theories/electroweak/electroweak_ops.rs
extract_zmethod return type fromGaugeFieldtoGaugeFielddisplay.rs
Update gauge field display with new type parametersdeep_causality_topology/src/types/gauge/gauge_field/display.rs
Displayimplementation to use dual type parametersDebugandDisplaytraitsdisplay.rs
Update link variable display with dual type parametersdeep_causality_topology/src/types/gauge/link_variable/display.rs
Displayimplementation to use dual type parametersT: std::fmt::Debug + ClonetoM: std::fmt::Debug + Clone,Relectroweak_impl.rs
Update electroweak implementation with simplified type parametersdeep_causality_physics/src/theories/electroweak/electroweak_impl.rs
extract_zmethod return type fromGaugeFieldtoGaugeFieldpart_eq.rs
Update link variable PartialEq with dual type parametersdeep_causality_topology/src/types/gauge/link_variable/part_eq.rs
PartialEqimplementation to use dual type parametersT: Clone + PartialEqtoR: PartialEq, T: PartialEq2 files
main.rs
Add 2D U(1) gauge theory verification example with Bessel functionsexamples/physics_examples/gauge_lattice_u1_2d/main.rs
verification against exact analytical solutions
expansion and Miller's backward recurrence
compares two independent algorithms
FloatType(f32, f64, orDoubleFloat)
lattice gauge theory
mod.rs
Add DoubleFloat vs f128 comparison documentationdeep_causality_num/src/float_double/mod.rs
DoubleFloatwith IEEEbinary128 (
f128)digits
and physical phenomena
DoubleFloatprovides ~32 digits precision comparableto
f128with better performance1 files
test.sh
Simplify test script with unified feature testingbuild/scripts/test.sh
--all-featuresflag--test-threads=1commandprefix for cargo invocations11 files