class_docstr: For now, this is limited to products of multiple square matrices.
class_docstr_tok: ["For","now",",","this","is","limited","to","products","of","multiple","square","matrices","."]
code: def __init__(self, *args, **kwargs):
      self._structure = kwargs.get("structure", None)
      for A in args:
          if len(A.shape) != 2 or A.shape[0] != A.shape[1]:
              raise ValueError(
                  "For now, the ProductOperator implementation is "
                  "limited to the product of multiple square matrices."
              )
      if args:
          n = args[0].shape[0]
          for A in args:
              for d in A.shape:
                  if d != n:
                      raise ValueError(
                          "The square matrices of the ProductOperator "
                          "must all have the same shape."
                      )
          self.shape = (n, n)
          self.ndim = len(self.shape)
      self.dtype = np.find_common_type([x.dtype for x in args], [])
      self._operator_sequence = args
  
imports: import numpy
  import scipy.special
  from scipy._lib._util import float_factorial
  from scipy.linalg.basic import solve, solve_triangular
  from scipy.sparse.base import isspmatrix
  from scipy.sparse.linalg import spsolve
  from scipy.sparse.sputils import is_pydata_spmatrix
  import scipy.sparse
  import scipy.sparse.linalg
  from scipy.sparse.linalg.interface import LinearOperator
  from ._expm_multiply import _ident_like, _exact_1_norm
label_desc: Use image node_id 1 to create a new ProductOperator object from inherited base classes: LinearOperator with example: obj = ProductOperator()