code: def get_change_basis_matrix(
      tensor_size: int,
      n_cob: int,
      entry_distribution: Callable = torch.randn,
      random_seed: int = None,
  ):
      """Generate a list of change of basis matrices.
  
      Args:
          tensor_size (int): Size of the tensor.
          n_cob (int): Number of change of basis matrices.
          entry_distribution (Callable, optional): Distribution of the entries
          of the change of basis matrices.
          random_seed (int, optional): Random seed for reproducibility.
      """
      if random_seed is not None:
          torch.random.manual_seed(random_seed)
      for _ in range(n_cob):
          diag_p = 2 * (torch.rand(tensor_size) > 0.5).float() - 1
          diag_l = 2 * (torch.rand(tensor_size) > 0.5).float() - 1
          random_matrix = entry_distribution((tensor_size, tensor_size))
          p_matrix = torch.diag(diag_p)
          l_matrix = torch.diag(diag_l)
          p_matrix = p_matrix + torch.triu(random_matrix, diagonal=1)
          l_matrix = l_matrix + torch.tril(random_matrix, diagonal=-1)
          yield torch.matmul(p_matrix, l_matrix)
  
file_path: nebuly/optimization/open_alpha_tensor/open_alpha_tensor/core/data/basis_change.py
imports: from pathlib import Path
  from typing import Callable
  import numpy
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: get_change_basis_matrix(tensor_size, n_cob, entry_distribution, random_seed) without return types