code: def spectral_radius_bound(X, log2_exponent):
      """
      Returns upper bound on the largest eigenvalue of square symmetrix matrix X.
  
      log2_exponent must be a positive-valued integer. The larger it is, the
      slower and tighter the bound. Values up to 5 should usually suffice. The
      algorithm works by multiplying X by itself this many times.
  
      From V.Pan, 1990. "Estimating the Extremal Eigenvalues of a Symmetric
      Matrix", Computers Math Applic. Vol 20 n. 2 pp 17-22.
      Rq: an efficient algorithm, not used here, is defined in this paper.
  
      """
      if X.type.ndim != 2:
          raise TypeError(
              "spectral_radius_bound requires a matrix argument", X
          )
      if not isinstance(log2_exponent, integer_types):
          raise TypeError(
              "spectral_radius_bound requires an integer exponent",
              log2_exponent,
          )
      if log2_exponent <= 0:
          raise ValueError(
              "spectral_radius_bound requires a strictly positive "
              "exponent",
              log2_exponent,
          )
  
      XX = X
      for i in xrange(log2_exponent):
          XX = tensor.dot(XX, XX)
      return tensor.pow(trace(XX), 2 ** (-log2_exponent))
  
imports: from __future__ import absolute_import, print_function, division
  import logging
  from six import iteritems, integer_types
  from six.moves import xrange
  from theano.gof import Op, Apply
  from theano.tensor import DimShuffle, Dot
  from theano.tensor.blas import Dot22
  from theano import tensor
  import theano.tensor
  from theano.tensor.opt import register_stabilize, register_specialize, register_canonicalize
  from theano.gof import local_optimizer
  from theano.gof.opt import Optimizer
  from theano.tensor.nlinalg import MatrixInverse, matrix_inverse, extract_diag, trace, det
  from theano.tensor.slinalg import Cholesky, cholesky, Solve, solve, imported_scipy
label_desc: Use image node_id 16 for calling a global function with example usage: spectral_radius_bound(X, log2_exponent) and returns: tensor