original_docstring: 
      Returns the curvature matrix `F` (see Warren & Dye 2003) by computing it using `w_tilde_preload`
      (see `w_tilde_preload_interferometer_from`) for an imaging inversion.
  
      To compute the curvature matrix via w_tilde the following matrix multiplication is normally performed:
  
      curvature_matrix = mapping_matrix.T * w_tilde * mapping matrix
  
      This function speeds this calculation up in two ways:
  
      1) Instead of using `w_tilde` (dimensions [image_pixels, image_pixels] it uses `w_tilde_preload` (dimensions
      [image_pixels, kernel_overlap]). The massive reduction in the size of this matrix in memory allows for much fast
      computation.
  
      2) It omits the `mapping_matrix` and instead uses directly the 1D vector that maps every image pixel to a source
      pixel `native_index_for_slim_index`. This exploits the sparsity in the `mapping_matrix` to directly
      compute the `curvature_matrix` (e.g. it condenses the triple matrix multiplication into a double for loop!).
  
      Parameters
      ----------
      curvature_preload
          A matrix that precomputes the values for fast computation of the curvature matrix in a memory efficient way.
      curvature_indexes
          The image-pixel indexes of the values stored in the w tilde preload matrix, which are used to compute
          the weights of the data values when computing the curvature matrix.
      curvature_lengths
          The number of image pixels in every row of `w_tilde_curvature`, which is iterated over when computing the
          curvature matrix.
      data_to_pix_unique
          An array that maps every data pixel index (e.g. the masked image pixel indexes in 1D) to its unique set of
          pixelization pixel indexes (see `data_slim_to_pixelization_unique_from`).
      data_weights
          For every unique mapping between a set of data sub-pixels and a pixelization pixel, the weight of these mapping
          based on the number of sub-pixels that map to pixelization pixel.
      pix_lengths
          A 1D array describing how many unique pixels each data pixel maps too, which is used to iterate over
          `data_to_pix_unique` and `data_weights`.
      pix_pixels
          The total number of pixels in the pixelization that reconstructs the data.
  
      Returns
      -------
      ndarray
          The curvature matrix `F` (see Warren & Dye 2003).
      
docstring: Returns the curvature matrix `F`  by computing it using `w_tilde_preload`
  for an imaging inversion.
  
  To compute the curvature matrix via w_tilde the following matrix multiplication is normally performed.
  
  
  
  This function speeds this calculation up in two ways.
  
  
  
  2) It omits the `mapping_matrix` and instead uses directly the 1D vector that maps every image pixel to a source
  pixel `native_index_for_slim_index`. This exploits the sparsity in the `mapping_matrix` to directly
  compute the `curvature_matrix` .
docstring_tokens: Returns the curvature matrix ` F ` by computing it using ` w_tilde_preload ` for an imaging inversion . To compute the curvature matrix via w_tilde the following matrix multiplication is normally performed . This function speeds this calculation up in two ways . 2 ) It omits the ` mapping_matrix ` and instead uses directly the 1D vector that maps every image pixel to a source pixel ` native_index_for_slim_index ` . This exploits the sparsity in the ` mapping_matrix ` to directly compute the ` curvature_matrix ` .
code: def curvature_matrix_via_w_tilde_curvature_preload_imaging_from(
      curvature_preload: np.ndarray,
      curvature_indexes: np.ndarray,
      curvature_lengths: np.ndarray,
      data_to_pix_unique: np.ndarray,
      data_weights: np.ndarray,
      pix_lengths: np.ndarray,
      pix_pixels: int,
  ) -> np.ndarray:
      """
      Returns the curvature matrix `F` (see Warren & Dye 2003) by computing it using `w_tilde_preload`
      (see `w_tilde_preload_interferometer_from`) for an imaging inversion.
  
      To compute the curvature matrix via w_tilde the following matrix multiplication is normally performed:
  
      curvature_matrix = mapping_matrix.T * w_tilde * mapping matrix
  
      This function speeds this calculation up in two ways:
  
      1) Instead of using `w_tilde` (dimensions [image_pixels, image_pixels] it uses `w_tilde_preload` (dimensions
      [image_pixels, kernel_overlap]). The massive reduction in the size of this matrix in memory allows for much fast
      computation.
  
      2) It omits the `mapping_matrix` and instead uses directly the 1D vector that maps every image pixel to a source
      pixel `native_index_for_slim_index`. This exploits the sparsity in the `mapping_matrix` to directly
      compute the `curvature_matrix` (e.g. it condenses the triple matrix multiplication into a double for loop!).
  
      Parameters
      ----------
      curvature_preload
          A matrix that precomputes the values for fast computation of the curvature matrix in a memory efficient way.
      curvature_indexes
          The image-pixel indexes of the values stored in the w tilde preload matrix, which are used to compute
          the weights of the data values when computing the curvature matrix.
      curvature_lengths
          The number of image pixels in every row of `w_tilde_curvature`, which is iterated over when computing the
          curvature matrix.
      data_to_pix_unique
          An array that maps every data pixel index (e.g. the masked image pixel indexes in 1D) to its unique set of
          pixelization pixel indexes (see `data_slim_to_pixelization_unique_from`).
      data_weights
          For every unique mapping between a set of data sub-pixels and a pixelization pixel, the weight of these mapping
          based on the number of sub-pixels that map to pixelization pixel.
      pix_lengths
          A 1D array describing how many unique pixels each data pixel maps too, which is used to iterate over
          `data_to_pix_unique` and `data_weights`.
      pix_pixels
          The total number of pixels in the pixelization that reconstructs the data.
  
      Returns
      -------
      ndarray
          The curvature matrix `F` (see Warren & Dye 2003).
      """
  
      data_pixels = curvature_lengths.shape[0]
  
      curvature_matrix = np.zeros((pix_pixels, pix_pixels))
  
      curvature_index = 0
  
      for data_0 in range(data_pixels):
  
          for data_1_index in range(curvature_lengths[data_0]):
  
              data_1 = curvature_indexes[curvature_index]
              w_tilde_value = curvature_preload[curvature_index]
  
              for pix_0_index in range(pix_lengths[data_0]):
  
                  data_0_weight = data_weights[data_0, pix_0_index]
                  pix_0 = data_to_pix_unique[data_0, pix_0_index]
  
                  for pix_1_index in range(pix_lengths[data_1]):
  
                      data_1_weight = data_weights[data_1, pix_1_index]
                      pix_1 = data_to_pix_unique[data_1, pix_1_index]
  
                      curvature_matrix[pix_0, pix_1] += (
                          data_0_weight * data_1_weight * w_tilde_value
                      )
  
              curvature_index += 1
  
      for i in range(pix_pixels):
          for j in range(i, pix_pixels):
              curvature_matrix[i, j] += curvature_matrix[j, i]
  
      for i in range(pix_pixels):
          for j in range(i, pix_pixels):
              curvature_matrix[j, i] = curvature_matrix[i, j]
  
      return curvature_matrix
code_tokens: def curvature_matrix_via_w_tilde_curvature_preload_imaging_from ( curvature_preload : np . ndarray , curvature_indexes : np . ndarray , curvature_lengths : np . ndarray , data_to_pix_unique : np . ndarray , data_weights : np . ndarray , pix_lengths : np . ndarray , pix_pixels : int , ) -> np . ndarray : data_pixels = curvature_lengths . shape [ 0 ] curvature_matrix = np . zeros ( ( pix_pixels , pix_pixels ) ) curvature_index = 0 for data_0 in range ( data_pixels ) : for data_1_index in range ( curvature_lengths [ data_0 ] ) : data_1 = curvature_indexes [ curvature_index ] w_tilde_value = curvature_preload [ curvature_index ] for pix_0_index in range ( pix_lengths [ data_0 ] ) : data_0_weight = data_weights [ data_0 , pix_0_index ] pix_0 = data_to_pix_unique [ data_0 , pix_0_index ] for pix_1_index in range ( pix_lengths [ data_1 ] ) : data_1_weight = data_weights [ data_1 , pix_1_index ] pix_1 = data_to_pix_unique [ data_1 , pix_1_index ] curvature_matrix [ pix_0 , pix_1 ] += ( data_0_weight * data_1_weight * w_tilde_value ) curvature_index += 1 for i in range ( pix_pixels ) : for j in range ( i , pix_pixels ) : curvature_matrix [ i , j ] += curvature_matrix [ j , i ] for i in range ( pix_pixels ) : for j in range ( i , pix_pixels ) : curvature_matrix [ j , i ] = curvature_matrix [ i , j ] return curvature_matrix
short_docstring: Returns the curvature matrix `F` (see Warren & Dye 2003) by computing it using `w_tilde_preload`
  (see `w_tilde_preload_interferometer_from`) for an imaging inversion.
short_docstring_tokens: Returns the curvature matrix ` F ` ( see Warren & Dye 2003 ) by computing it using ` w_tilde_preload ` ( see ` w_tilde_preload_interferometer_from ` ) for an imaging inversion .
comment: """
      Returns the curvature matrix `F` (see Warren & Dye 2003) by computing it using `w_tilde_preload`
      (see `w_tilde_preload_interferometer_from`) for an imaging inversion.
  
      To compute the curvature matrix via w_tilde the following matrix multiplication is normally performed:
  
      curvature_matrix = mapping_matrix.T * w_tilde * mapping matrix
  
      This function speeds this calculation up in two ways:
  
      1) Instead of using `w_tilde` (dimensions [image_pixels, image_pixels] it uses `w_tilde_preload` (dimensions
      [image_pixels, kernel_overlap]). The massive reduction in the size of this matrix in memory allows for much fast
      computation.
  
      2) It omits the `mapping_matrix` and instead uses directly the 1D vector that maps every image pixel to a source
      pixel `native_index_for_slim_index`. This exploits the sparsity in the `mapping_matrix` to directly
      compute the `curvature_matrix` (e.g. it condenses the triple matrix multiplication into a double for loop!).
  
      Parameters
      ----------
      curvature_preload
          A matrix that precomputes the values for fast computation of the curvature matrix in a memory efficient way.
      curvature_indexes
          The image-pixel indexes of the values stored in the w tilde preload matrix, which are used to compute
          the weights of the data values when computing the curvature matrix.
      curvature_lengths
          The number of image pixels in every row of `w_tilde_curvature`, which is iterated over when computing the
          curvature matrix.
      data_to_pix_unique
          An array that maps every data pixel index (e.g. the masked image pixel indexes in 1D) to its unique set of
          pixelization pixel indexes (see `data_slim_to_pixelization_unique_from`).
      data_weights
          For every unique mapping between a set of data sub-pixels and a pixelization pixel, the weight of these mapping
          based on the number of sub-pixels that map to pixelization pixel.
      pix_lengths
          A 1D array describing how many unique pixels each data pixel maps too, which is used to iterate over
          `data_to_pix_unique` and `data_weights`.
      pix_pixels
          The total number of pixels in the pixelization that reconstructs the data.
  
      Returns
      -------
      ndarray
          The curvature matrix `F` (see Warren & Dye 2003).
      """