code: def eigh_tridiagonal(
      alpha: Union[ivy.Array, ivy.NativeArray],
      beta: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      eigvals_only: bool = True,
      select: str = "a",
      select_range: Optional[
          Union[Tuple[int, int], List[int], ivy.Array, ivy.NativeArray]
      ] = None,
      tol: Optional[float] = None,
  ) -> Union[ivy.Array, Tuple[ivy.Array, ivy.Array]]:
      """Compute the eigenvalues and eigenvectors of a Hermitian tridiagonal
      matrix.
  
      Parameters
      ----------
      alpha
          A real or complex array of shape (n), the diagonal elements of the
          matrix. If alpha is complex, the imaginary part is ignored
          (assumed zero) to satisfy the requirement that the matrix be Hermitian.
      beta
          A real or complex array of shape (n-1), containing the elements of
          the first super-diagonal of the matrix. If beta is complex, the first
          sub-diagonal of the matrix is assumed to be the conjugate of beta to
          satisfy the requirement that the matrix be Hermitian.
      eigvals_only
          If False, both eigenvalues and corresponding eigenvectors are
          computed. If True, only eigenvalues are computed. Default is True.
      select
          Optional string with values in {'a', 'v', 'i'} (default is 'a') that
          determines which eigenvalues to calculate: 'a': all eigenvalues.
          'v': eigenvalues in the interval (min, max] given by select_range.
          'i': eigenvalues with indices min <= i <= max.
      select_range
          Size 2 tuple or list or array specifying the range of eigenvalues to
          compute together with select. If select is 'a', select_range is ignored.
      tol
          Optional scalar. Ignored when backend is not Tensorflow. The absolute
          tolerance to which each eigenvalue is required. An eigenvalue
          (or cluster) is considered to have converged if it lies in an interval
          of this width. If tol is None (default), the value eps*|T|_2 is used
          where eps is the machine precision, and |T|_2 is the 2-norm of the matrix T.
  
      Returns
      -------
      eig_vals
          The eigenvalues of the matrix in non-decreasing order.
      eig_vectors
          If eigvals_only is False the eigenvectors are returned in the second output
          argument.
  
      Both the description and the type hints above assumes an array input for
      simplicity, but this function is *nestable*, and therefore also accepts
      :class:`ivy.Container` instances in place of any of the arguments.
  
      Examples
      --------
      With :class:`ivy.Array` input:
  
      >>> alpha = ivy.array([0., 1., 2.])
      >>> beta = ivy.array([0., 1.])
      >>> y = ivy.eigh_tridiagonal(alpha, beta)
      >>> print(y)
      ivy.array([0., 0.38196602, 2.61803389])
  
      >>> alpha = ivy.array([0., 1., 2.])
      >>> beta = ivy.array([0., 1.])
      >>> y = ivy.eigh_tridiagonal(alpha,
      ...     beta, select='v',
      ...     select_range=[0.2,3.0])
      >>> print(y)
      ivy.array([0.38196602, 2.61803389])
  
      >>> alpha = ivy.array([0., 1., 2., 3.])
      >>> beta = ivy.array([2., 1., 2.])
      >>> y = ivy.eigh_tridiagonal(alpha,
      ...     beta,
      ...     eigvals_only=False,
      ...     select='i',
      ...     select_range=[1,2],
      ...     tol=1.)
      >>> print(y)
      (ivy.array([0.38196602, 2.61803389]), ivy.array([[ 0.35048741, -0.56710052],
             [ 0.06693714, -0.74234426],
             [-0.74234426, -0.06693714],
             [ 0.56710052,  0.35048741]]))
  
      With :class:`ivy.Container` input:
  
      >>> alpha = ivy.Container(a=ivy.array([0., 1., 2.]), b=ivy.array([2., 2., 2.]))
      >>> beta = ivy.array([0.,2.])
      >>> y = ivy.eigh_tridiagonal(alpha, beta)
      >>> print(y)
      {
          a: ivy.array([-0.56155282, 0., 3.56155276]),
          b: ivy.array([0., 2., 4.])
      }
  
      >>> alpha = ivy.Container(a=ivy.array([0., 1., 2.]), b=ivy.array([2., 2., 2.]))
      >>> beta = ivy.Container(a=ivy.array([0.,2.]), b=ivy.array([2.,2.]))
      >>> y = ivy.eigh_tridiagonal(alpha, beta)
      >>> print(y)
      {
          a: ivy.array([-0.56155282, 0., 3.56155276]),
          b: ivy.array([-0.82842714, 2., 4.82842731])
      }
      """
      x = ivy.diag(alpha)
      y = ivy.diag(beta, k=1)
      z = ivy.diag(beta, k=-1)
      w = x + y + z
  
      eigh_out = ivy.linalg.eigh(w)
      eigenvalues = eigh_out.eigenvalues
      eigenvectors = eigh_out.eigenvectors
  
      if select == "i":
          eigenvalues = eigenvalues[
              select_range[0] : select_range[1] + 1
          ]
          eigenvectors = eigenvectors[
              :, select_range[0] : select_range[1] + 1
          ]
      elif select == "v":
          condition = ivy.logical_and(
              eigenvalues.greater(select_range[0]),
              eigenvalues.less_equal(select_range[1]),
          )
          eigenvalues = eigenvalues[condition]
          eigenvectors = eigenvectors[:, condition]
  
      if eigvals_only:
          return eigenvalues
      return eigenvalues, eigenvectors
  
imports: import logging
  from typing import Union, Optional, Tuple, List, Sequence, Literal
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, handle_device, inputs_to_ivy_arrays, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 2 for calling a global function with example usage: eigh_tridiagonal() and returns: eigenvalues,  eigenvectors, eigenvalues