Skip to main content

ProcessIntegrandImpl

Trait ProcessIntegrandImpl 

Source
pub trait ProcessIntegrandImpl {
    type G: GraphTerm;

Show 30 methods // Required methods fn warm_up(&mut self, model: &Model) -> Result<()>; fn get_rotations(&self) -> impl Iterator<Item = &Rotation>; fn increment_loop_cache_id(&mut self, val: usize); fn loop_cache_id(&self) -> usize; fn increment_external_cache_id(&mut self, val: usize); fn external_cache_id(&self) -> usize; fn revert_to_base_external_cache_id(&mut self); fn get_base_external_cache_id(&self) -> usize; fn get_group_masters(&self) -> impl Iterator<Item = &Self::G>; fn get_terms_mut(&mut self) -> impl Iterator<Item = &mut Self::G>; fn graph_count(&self) -> usize; fn get_settings(&self) -> &RuntimeSettings; fn get_master_graph(&self, group_id: GroupId) -> &Self::G; fn get_graph(&self, graph_id: usize) -> &Self::G; fn get_graph_mut(&mut self, graph_id: usize) -> &mut Self::G; fn graph_group_id_for_graph(&self, graph_id: usize) -> Option<usize>; fn get_group(&self, group_id: GroupId) -> &GraphGroup; fn get_group_structure(&self) -> &TiVec<GroupId, GraphGroup>; fn get_dependent_momenta_constructor( &self, ) -> DependentMomentaConstructor<'_>; // Provided methods fn signal_external_momenta_changed(&mut self) { ... } fn get_current_external_cache_id(&self) -> usize { ... } fn is_external_caching_beneficial(&self) -> bool { ... } fn debug_cache_state(&self, context: &str) { ... } fn validate_cache_consistency(&self) -> CacheValidationResult { ... } fn get_cache_stats(&self) -> CacheStats { ... } fn take_event_processing_runtime( &mut self, ) -> Option<EventProcessingRuntime> { ... } fn restore_event_processing_runtime( &mut self, _runtime: Option<EventProcessingRuntime>, ) { ... } fn event_processing_runtime(&self) -> Option<&EventProcessingRuntime> { ... } fn event_processing_runtime_mut( &mut self, ) -> Option<&mut EventProcessingRuntime> { ... } fn groups_default_sample_events_by_graph_group(&self) -> bool { ... }
}

Required Associated Types§

Required Methods§

Source

fn warm_up(&mut self, model: &Model) -> Result<()>

Source

fn get_rotations(&self) -> impl Iterator<Item = &Rotation>

Source

fn increment_loop_cache_id(&mut self, val: usize)

Source

fn loop_cache_id(&self) -> usize

Source

fn increment_external_cache_id(&mut self, val: usize)

Source

fn external_cache_id(&self) -> usize

Source

fn revert_to_base_external_cache_id(&mut self)

Revert to the base external cache ID for the current configuration

This allows new samples to reuse the base cache ID when they represent the same underlying external momenta configuration (e.g., after rotations)

§Usage

Call this method when you want to create a new sample that represents the same base external momenta configuration as before, allowing reuse of cached polarizations and other external-dependent computations.

§Example Cache Flow
1. Initial sample:           cache_id = 0, base_cache_id = 0
2. Rotation 1:               cache_id = 1, base_cache_id = 0
3. Rotation 2:               cache_id = 2, base_cache_id = 0
4. revert_to_base():         cache_id = 0, base_cache_id = 0  // Reuse cache!
5. signal_changed():         cache_id = 3, base_cache_id = 3  // New base config
6. Rotation of new config:   cache_id = 4, base_cache_id = 3
7. revert_to_base():         cache_id = 3, base_cache_id = 3  // Reuse new base
Source

fn get_base_external_cache_id(&self) -> usize

Get the base external cache ID for the current configuration

Source

fn get_group_masters(&self) -> impl Iterator<Item = &Self::G>

Source

fn get_terms_mut(&mut self) -> impl Iterator<Item = &mut Self::G>

Source

fn graph_count(&self) -> usize

Source

fn get_settings(&self) -> &RuntimeSettings

Source

fn get_master_graph(&self, group_id: GroupId) -> &Self::G

Source

fn get_graph(&self, graph_id: usize) -> &Self::G

Source

fn get_graph_mut(&mut self, graph_id: usize) -> &mut Self::G

Source

fn graph_group_id_for_graph(&self, graph_id: usize) -> Option<usize>

Source

fn get_group(&self, group_id: GroupId) -> &GraphGroup

Source

fn get_group_structure(&self) -> &TiVec<GroupId, GraphGroup>

Source

fn get_dependent_momenta_constructor(&self) -> DependentMomentaConstructor<'_>

Provided Methods§

Source

fn signal_external_momenta_changed(&mut self)

Signal that external momenta configuration has actually changed This increments the external cache ID to invalidate cached computations

§Usage

Call this method when:

  • You change the external momenta values in your Monte Carlo sampling
  • You switch to a different kinematic configuration
  • You want to force recomputation of cached polarizations/external quantities
§Example
// When you change external momenta in your sampling
integrand.signal_external_momenta_changed();
let new_sample = parameterize(&sample_point, &mut integrand)?;

// Rotations will automatically get new cache IDs
let rotated_samples = evaluate_all_rotations(&new_sample, &mut integrand, true)?;

// Next iteration - revert to base configuration to reuse cache
integrand.revert_to_base_external_cache_id();
let next_sample = parameterize(&next_sample_point, &mut integrand)?;
Source

fn get_current_external_cache_id(&self) -> usize

Get the current external cache ID for reuse (doesn’t increment)

This returns the current cache ID without incrementing it, allowing new samples to reuse cached computations for the same external momenta configuration.

Source

fn is_external_caching_beneficial(&self) -> bool

Check if external momenta caching is beneficial

Returns true if the same external cache ID has been used multiple times, indicating that caching is providing benefits.

Source

fn debug_cache_state(&self, context: &str)

Force a cache consistency check with detailed reporting

Source

fn validate_cache_consistency(&self) -> CacheValidationResult

Validate cache ID consistency and return diagnostics

Source

fn get_cache_stats(&self) -> CacheStats

Get cache usage statistics for monitoring

Source

fn take_event_processing_runtime(&mut self) -> Option<EventProcessingRuntime>

Source

fn restore_event_processing_runtime( &mut self, _runtime: Option<EventProcessingRuntime>, )

Source

fn event_processing_runtime(&self) -> Option<&EventProcessingRuntime>

Source

fn event_processing_runtime_mut( &mut self, ) -> Option<&mut EventProcessingRuntime>

Source

fn groups_default_sample_events_by_graph_group(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§