code: def optimal_t(self, t_max=100, plot=False, ax=None):
          
          tasklogger.log_start("optimal t")
          t, h = self.von_neumann_entropy(t_max=t_max)
          t_opt = vne.find_knee_point(y=h, x=t)
          tasklogger.log_info("Automatically selected t = {}".format(t_opt))
          tasklogger.log_complete("optimal t")
  
          if plot:
              if ax is None:
                  fig, ax = plt.subplots()
                  show = True
              else:
                  show = False
              ax.plot(t, h)
              ax.scatter(t_opt, h[t == t_opt], marker='*', c='k', s=50)
              ax.set_xlabel("t")
              ax.set_ylabel("Von Neumann Entropy")
              ax.set_title("Optimal t = {}".format(t_opt))
              if show:
                  plt.show()
  
          return t_opt
docs: Find the optimal value of t
  
          Selects the optimal value of t based on the knee point of the
          Von Neumann Entropy of the diffusion operator.
  
          Parameters
          ----------
          t_max : int, default: 100
              Maximum value of t to test
  
          plot : boolean, default: False
              If true, plots the Von Neumann Entropy and knee point
  
          ax : matplotlib.Axes, default: None
              If plot=True and ax is not None, plots the VNE on the given axis
              Otherwise, creates a new axis and displays the plot
  
          Returns
          -------
          t_opt : int
              The optimal value of t