code: def get_matrix_system(xyz, xyz_target, weight):
      """
      Build matrix of size 3N x 6 and b of size 3N
  
      xyz size N x 3
      xyz_target size N x 3
      weight size N
      the matrix is minus cross product matrix concatenate with the identity (rearanged).
      """
      assert xyz.shape == xyz_target.shape
      A_x = torch.zeros(xyz.shape[0], 6, device=xyz.device)
      A_y = torch.zeros(xyz.shape[0], 6, device=xyz.device)
      A_z = torch.zeros(xyz.shape[0], 6, device=xyz.device)
      b_x = weight.view(-1) * (xyz_target[:, 0] - xyz[:, 0])
      b_y = weight.view(-1) * (xyz_target[:, 1] - xyz[:, 1])
      b_z = weight.view(-1) * (xyz_target[:, 2] - xyz[:, 2])
      A_x[:, 1] = weight.view(-1) * xyz[:, 2]
      A_x[:, 2] = -weight.view(-1) * xyz[:, 1]
      A_x[:, 3] = weight.view(-1) * 1
      A_y[:, 0] = -weight.view(-1) * xyz[:, 2]
      A_y[:, 2] = weight.view(-1) * xyz[:, 0]
      A_y[:, 4] = weight.view(-1) * 1
      A_z[:, 0] = weight.view(-1) * xyz[:, 1]
      A_z[:, 1] = -weight.view(-1) * xyz[:, 0]
      A_z[:, 5] = weight.view(-1) * 1
      return torch.cat([A_x, A_y, A_z], 0), torch.cat(
          [b_x, b_y, b_z], 0
      ).view(-1, 1)
  
file_path: torch-points3d/torch_points3d/utils/registration.py
imports: import open3d
  import numpy
  import torch
  from torch_points3d.utils.geometry import get_trans
  from torch_geometric.nn import knn
label_desc: Use image node_id 4 for calling a global function with example usage: get_matrix_system(xyz, xyz_target, weight) and returns: torch,  torch