fn impose_translational_symmetry(&mut self, sc: SupercellWrapper<'_>) {
        let mut bee = self.0.to_coo().into_bee();
        for (&prim_r, row) in bee.map.iter_mut() {
            let super_r = sc.designated_super(prim_r);

            // compute the sum without the diagonal submatrix
            row.insert(super_r, M33::zero());
            let sum = row.values().fold(M33::zero(), |acc, m| &acc + m);

            // (to my understanding, the .t() here represents the sum over columns,
            //  on the precondition that `self` is symmetric)
            row.insert(super_r, -(sum + sum.t()) / 2.0);
        }
        self.0 = bee.into_csr();
    }
// this corresponds to set_translational_symmetry_compact_fc in _phonopy.c
//
/// If `self` is a symmetric matrix, this imposes that the sum over each row and column is the
/// zero matrix, by ignoring the existing values in the submatrices along the main diagonal and
/// replacing them with values computed from the rest of the row and column.
this corresponds to set_translational_symmetry_compact_fc in _phonopy.c
If `self` is a symmetric matrix, this imposes that the sum over each row and column is the
zero matrix, by ignoring the existing values in the submatrices along the main diagonal and
replacing them with values computed from the rest of the row and column.
this corresponds to set_translational_symmetry_compact_fc in _phonopy . c If ` self ` is a symmetric matrix this imposes that the sum over each row and column is the zero matrix by ignoring the existing values in the submatrices along the main diagonal and replacing them with values computed from the rest of the row and column .
fn impose_translational_symmetry(&mut self, sc: SupercellWrapper<'_>) {
        let mut bee = self.0.to_coo().into_bee();
        for (&prim_r, row) in bee.map.iter_mut() {
            let super_r = sc.designated_super(prim_r);
            // compute the sum without the diagonal submatrix
            row.insert(super_r, M33::zero());
            let sum = row.values().fold(M33::zero(), |acc, m| &acc + m);
            // (to my understanding, the .t() here represents the sum over columns,
            //  on the precondition that `self` is symmetric)
            row.insert(super_r, -(sum + sum.t()) / 2.0);
        }
        self.0 = bee.into_csr();
    }
fn impose_translational_symmetry ( & mut self , sc : SupercellWrapper < ' _ > ) { let mut bee = self . 0 . to_coo ( ) . into_bee ( ) ; for ( & prim_r , row ) in bee . map . iter_mut ( ) { let super_r = sc . designated_super ( prim_r ) ; // compute the sum without the diagonal submatrix row . insert ( super_r , M33 :: zero ( ) ) ; let sum = row . values ( ) . fold ( M33 :: zero ( ) , | acc , m | & acc + m ) ; // (to my understanding, the .t() here represents the sum over columns, //  on the precondition that `self` is symmetric) row . insert ( super_r , - ( sum + sum . t ( ) ) / 2.0 ) ; } self . 0 = bee . into_csr ( ) ; }
this corresponds to set_translational_symmetry_compact_fc in _phonopy.c
If `self` is a symmetric matrix, this imposes that the sum over each row and column is the
zero matrix, by ignoring the existing values in the submatrices along the main diagonal and
replacing them with values computed from the rest of the row and column.
this corresponds to set_translational_symmetry_compact_fc in _phonopy . c If ` self ` is a symmetric matrix this imposes that the sum over each row and column is the zero matrix by ignoring the existing values in the submatrices along the main diagonal and replacing them with values computed from the rest of the row and column .
&mut self
sc
SupercellWrapper<'_>
&mut self
sc
SupercellWrapper<'_>