pub fn unflatten_grad(&self, coords: &[f64], grad: &[f64]) -> (Vec<V3>, ArrayVec<[f64; 4]>) {
        let (_, params) = self.split(coords);
        let (d_fracs, d_params) = self.split(grad);

        // gradients transform as reciprocal vectors
        let recip_lattice = self.lattice_with_params(params).reciprocal();
        let d_carts = CoordsKind::Fracs(d_fracs).to_carts(&recip_lattice);
        (d_carts, d_params.iter().cloned().collect())
    }
/// Get the gradient with respect to positions in cartesian space,
/// and with respect to each lattice parameter.
Get the gradient with respect to positions in cartesian space,
and with respect to each lattice parameter.
Get the gradient with respect to positions in cartesian space and with respect to each lattice parameter .
pub fn unflatten_grad(&self, coords: &[f64], grad: &[f64]) -> (Vec<V3>, ArrayVec<[f64; 4]>) {
        let (_, params) = self.split(coords);
        let (d_fracs, d_params) = self.split(grad);
        // gradients transform as reciprocal vectors
        let recip_lattice = self.lattice_with_params(params).reciprocal();
        let d_carts = CoordsKind::Fracs(d_fracs).to_carts(&recip_lattice);
        (d_carts, d_params.iter().cloned().collect())
    }
pub fn unflatten_grad ( & self , coords : & [ f64 ] , grad : & [ f64 ] ) -> ( Vec < V3 > , ArrayVec < [ f64 ; 4 ] > ) { let ( _ , params ) = self . split ( coords ) ; let ( d_fracs , d_params ) = self . split ( grad ) ; // gradients transform as reciprocal vectors let recip_lattice = self . lattice_with_params ( params ) . reciprocal ( ) ; let d_carts = CoordsKind :: Fracs ( d_fracs ) . to_carts ( & recip_lattice ) ; ( d_carts , d_params . iter ( ) . cloned ( ) . collect ( ) ) }
Get the gradient with respect to positions in cartesian space,
and with respect to each lattice parameter.
Get the gradient with respect to positions in cartesian space and with respect to each lattice parameter .
&self
coords
&[f64]
grad
&[f64]
&self
coords
&[f64]
grad
&[f64]