class_docstr: Encapsulates a Unitary Linear Operator.
class_docstr_tok: ["Encapsulates","a","Unitary","Linear","Operator","."]
docstr: Initialize a `LinearOperatorUnitary`.
  
  A Unitary Operator is one for which U* = U^-1. That is, the inverse of this
  operator is equivalent to the conjugate transpose of the operator. In the
  case that this operator is of real dtype, this corresponds to an orthogonal
  operator.
  
  This is useful as it reduces the complexity of `solve` to that of a
  `matmul` with the transpose operator.
  
  Args:
    matrix:  Shape `[B1,...,Bb, N, N]` `Tensor` with `b >= 0` `N >= 0`.
      The orthogonal matrix.
    is_non_singular:  Expect that this operator is non-singular.
    is_self_adjoint:  Expect that this operator is equal to its hermitian
      transpose.  If `diag.dtype` is real, this is auto-set to `True`.
    is_positive_definite:  Expect that this operator is positive definite,
      meaning the quadratic form `x^H A x` has positive real part for all
      nonzero `x`.  Note that we do not require the operator to be
      self-adjoint to be positive-definite.  See:
      https://en.wikipedia.org/wiki/Positive-definite_matrix#Extension_for_non-symmetric_matrices
    is_square:  Expect that this operator acts like square [batch] matrices.
    name: A name for this `LinearOperator`.
docstr_tok: ["Initialize","a","`","LinearOperatorUnitary","`",".","A","Unitary","Operator","is","one","for","which","U","*","=","U^-1",".","That","is",",","the","inverse","of","this","operator","is","equivalent","to","the","conjugate","transpose","of","the","operator",".","In","the","case","that","this","operator","is","of","real","dtype",",","this","corresponds","to","an","orthogonal","operator",".","This","is","useful","as","it","reduces","the","complexity","of","`","solve","`","to","that","of","a","`","matmul","`","with","the","transpose","operator",".","Args",":","matrix",":","Shape","`","[","B1",",","...",",","Bb",",","N",",","N","]","`","`","Tensor","`","with","`","b",">","=","0","`","`","N",">","=","0","`",".","The","orthogonal","matrix",".","is_non_singular",":","Expect","that","this","operator","is","non-singular",".","is_self_adjoint",":","Expect","that","this","operator","is","equal","to","its","hermitian","transpose",".","If","`","diag.dtype","`","is","real",",","this","is","auto-set","to","`","True","`",".","is_positive_definite",":","Expect","that","this","operator","is","positive","definite",",","meaning","the","quadratic","form","`","x^H","A","x","`","has","positive","real","part","for","all","nonzero","`","x","`",".","Note","that","we","do","not","require","the","operator","to","be","self-adjoint","to","be","positive-definite",".","See",":","https",":","\/\/en.wikipedia.org\/wiki\/Positive-definite_matrix","#","Extension_for_non-symmetric_matrices","is_square",":","Expect","that","this","operator","acts","like","square","[","batch","]","matrices",".","name",":","A","name","for","this","`","LinearOperator","`","."]
code: def __init__(
      self,
      matrix,
      is_non_singular=None,
      is_self_adjoint=None,
      is_positive_definite=None,
      is_square=None,
      name="LinearOperatorUnitary",
  ):
      r"""Initialize a `LinearOperatorUnitary`.
  
      A Unitary Operator is one for which U* = U^-1. That is, the inverse of this
      operator is equivalent to the conjugate transpose of the operator. In the
      case that this operator is of real dtype, this corresponds to an orthogonal
      operator.
  
      This is useful as it reduces the complexity of `solve` to that of a
      `matmul` with the transpose operator.
  
      Args:
        matrix:  Shape `[B1,...,Bb, N, N]` `Tensor` with `b >= 0` `N >= 0`.
          The orthogonal matrix.
        is_non_singular:  Expect that this operator is non-singular.
        is_self_adjoint:  Expect that this operator is equal to its hermitian
          transpose.  If `diag.dtype` is real, this is auto-set to `True`.
        is_positive_definite:  Expect that this operator is positive definite,
          meaning the quadratic form `x^H A x` has positive real part for all
          nonzero `x`.  Note that we do not require the operator to be
          self-adjoint to be positive-definite.  See:
          https://en.wikipedia.org/wiki/Positive-definite_matrix#Extension_for_non-symmetric_matrices
        is_square:  Expect that this operator acts like square [batch] matrices.
        name: A name for this `LinearOperator`.
      """
      parameters = dict(
          matrix=matrix,
          is_non_singular=is_non_singular,
          is_self_adjoint=is_self_adjoint,
          is_positive_definite=is_positive_definite,
          is_square=is_square,
          name=name,
      )
  
      with tf.name_scope(name):
          self._matrix = tensor_util.convert_nonref_to_tensor(
              matrix, name="matrix"
          )
  
          if is_square is False:  # pylint:disable=g-bool-id-comparison
              raise ValueError("Unitary operators are square.")
          is_square = True
  
          # Add checks for unitary matrix
          if (
              self._matrix.shape[-1] is not None
              and self._matrix.shape[-2] is not None
          ):
              if self._matrix.shape[-2] != self._matrix.shape[-1]:
                  raise ValueError(
                      "Expected square matrix, got mismatched dimensions {} {}".format(
                          self._matrix.shape[-2], self._matrix.shape[-1]
                      )
                  )
  
          super(LinearOperatorUnitary, self).__init__(
              dtype=self._matrix.dtype,
              is_non_singular=is_non_singular,
              is_self_adjoint=is_self_adjoint,
              is_positive_definite=is_positive_definite,
              is_square=is_square,
              parameters=parameters,
              name=name,
          )
  
file_path: probability/tensorflow_probability/python/experimental/linalg/linear_operator_unitary.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import tensor_util
label_desc: Use image node_id 1 to create a new LinearOperatorUnitary object from inherited base classes: tf.linalg with example: obj = LinearOperatorUnitary(matrix, is_non_singular, is__adjoint, is_positive_definite, is_square, name)