@@ -357,145 +357,6 @@ fn ndarray_from_subgrid_orders_slice(
357357 Ok ( ( x1n, ( !zero) . then_some ( array) ) )
358358}
359359
360- pub ( crate ) fn evolve_slice_sequential (
361- grid : & Grid ,
362- operators : & [ ArrayView4 < f64 > ] ,
363- infos : & [ OperatorSliceInfo ] ,
364- scale_values : & [ f64 ] ,
365- order_mask : & [ bool ] ,
366- xi : ( f64 , f64 , f64 ) ,
367- alphas_table : & AlphasTable ,
368- ) -> Result < ( Array3 < SubgridEnum > , Vec < Channel > ) > {
369- let gluon_has_pid_zero = gluon_has_pid_zero ( grid) ;
370-
371- // TODO: implement matching of different scales for different EKOs
372- let mut fac1_scales: Vec < _ > = infos. iter ( ) . map ( |info| info. fac1 ) . collect ( ) ;
373- fac1_scales. sort_by ( f64:: total_cmp) ;
374- assert ! ( fac1_scales
375- . windows( 2 )
376- . all( |scales| subgrid:: node_value_eq( scales[ 0 ] , scales[ 1 ] ) ) ) ;
377- let fac1 = fac1_scales[ 0 ] ;
378-
379- assert_eq ! ( operators. len( ) , infos. len( ) ) ;
380- assert_eq ! ( operators. len( ) , grid. convolutions( ) . len( ) ) ;
381-
382- let ( pid_indices, pids01) : ( Vec < _ > , Vec < _ > ) = izip ! ( 0 ..infos. len( ) , operators, infos)
383- . map ( |( d, operator, info) | {
384- pid_slices ( operator, info, gluon_has_pid_zero, & |pid1| {
385- grid. channels ( )
386- . iter ( )
387- . flat_map ( Channel :: entry)
388- . any ( |( pids, _) | pids[ d] == pid1)
389- } )
390- } )
391- . collect :: < Result < Vec < _ > > > ( ) ?
392- . into_iter ( )
393- . unzip ( ) ;
394-
395- let mut channels0: Vec < _ > = pids01
396- . iter ( )
397- . map ( |pids| pids. iter ( ) . map ( |& ( pid0, _) | pid0) )
398- . multi_cartesian_product ( )
399- . collect ( ) ;
400- channels0. sort_unstable ( ) ;
401- channels0. dedup ( ) ;
402- let channels0 = channels0;
403-
404- let mut sub_fk_tables = Vec :: with_capacity ( grid. bwfl ( ) . len ( ) * channels0. len ( ) ) ;
405-
406- // TODO: generalize to `n`
407- let mut last_x1 = vec ! [ Vec :: new( ) ; infos. len( ) ] ;
408- let mut eko_slices = vec ! [ Vec :: new( ) ; infos. len( ) ] ;
409- let dim: Vec < _ > = infos. iter ( ) . map ( |info| info. x0 . len ( ) ) . collect ( ) ;
410-
411- for subgrids_oc in grid. subgrids ( ) . axis_iter ( Axis ( 1 ) ) {
412- let mut tables = vec ! [ ArrayD :: zeros( dim. clone( ) ) ; channels0. len( ) ] ;
413-
414- for ( subgrids_o, channel1) in subgrids_oc. axis_iter ( Axis ( 1 ) ) . zip ( grid. channels ( ) ) {
415- let ( x1, array) = ndarray_from_subgrid_orders_slice (
416- grid,
417- fac1,
418- grid. kinematics ( ) ,
419- & subgrids_o,
420- grid. orders ( ) ,
421- order_mask,
422- xi,
423- alphas_table,
424- ) ?;
425-
426- // skip over zero arrays to speed up evolution and avoid problems with NaNs
427- let Some ( array) = array else {
428- continue ;
429- } ;
430-
431- for ( last_x1, x1, pid_indices, slices, operator, info) in izip ! (
432- & mut last_x1,
433- x1,
434- & pid_indices,
435- & mut eko_slices,
436- operators,
437- infos
438- ) {
439- if ( last_x1. len ( ) != x1. len ( ) )
440- || last_x1
441- . iter ( )
442- . zip ( x1. iter ( ) )
443- . any ( |( & lhs, & rhs) | !subgrid:: node_value_eq ( lhs, rhs) )
444- {
445- * slices = operator_slices ( operator, info, pid_indices, & x1) ?;
446- * last_x1 = x1;
447- }
448- }
449-
450- for ( pids1, factor) in channel1. entry ( ) {
451- for ( fk_table, ops) in
452- channels0
453- . iter ( )
454- . zip ( tables. iter_mut ( ) )
455- . filter_map ( |( pids0, fk_table) | {
456- izip ! ( pids0, pids1, & pids01, & eko_slices)
457- . map ( |( & pid0, & pid1, pids, slices) | {
458- pids. iter ( ) . zip ( slices) . find_map ( |( & ( p0, p1) , op) | {
459- ( ( p0 == pid0) && ( p1 == pid1) ) . then_some ( op)
460- } )
461- } )
462- // TODO: avoid using `collect`
463- . collect :: < Option < Vec < _ > > > ( )
464- . map ( |ops| ( fk_table, ops) )
465- } )
466- {
467- general_tensor_mul ( * factor, array. view ( ) , & ops, fk_table. view_mut ( ) ) ;
468- }
469- }
470- }
471-
472- let mut node_values = vec ! [ scale_values. to_vec( ) ] ;
473-
474- for info in infos {
475- node_values. push ( info. x0 . clone ( ) ) ;
476- }
477-
478- sub_fk_tables. extend ( tables. into_iter ( ) . map ( |table| {
479- ImportSubgridV1 :: new (
480- // TODO: insert one more axis if initial frg scale unequals fac
481- PackedArray :: from ( table. insert_axis ( Axis ( 0 ) ) . view ( ) ) ,
482- node_values. clone ( ) ,
483- )
484- . into ( )
485- } ) ) ;
486- }
487-
488- Ok ( (
489- Array1 :: from_iter ( sub_fk_tables)
490- . into_shape ( ( 1 , grid. bwfl ( ) . len ( ) , channels0. len ( ) ) )
491- . unwrap ( ) ,
492- channels0
493- . into_iter ( )
494- . map ( |c| Channel :: new ( vec ! [ ( c, 1.0 ) ] ) )
495- . collect ( ) ,
496- ) )
497- }
498-
499360pub ( crate ) fn evolve_slice (
500361 grid : & Grid ,
501362 operators : & [ ArrayView4 < f64 > ] ,
0 commit comments