code: def test_Trace():
      assert isinstance(Trace(A), Trace)
      assert not isinstance(Trace(A), MatrixExpr)
      raises(ShapeError, lambda: Trace(C))
      assert trace(eye(3)) == 3
      assert trace(Matrix(3, 3, [1, 2, 3, 4, 5, 6, 7, 8, 9])) == 15
  
      assert adjoint(Trace(A)) == trace(Adjoint(A))
      assert conjugate(Trace(A)) == trace(Adjoint(A))
      assert transpose(Trace(A)) == Trace(A)
  
      _ = A / Trace(A)  # Make sure this is possible
  
      # Some easy simplifications
      assert trace(Identity(5)) == 5
      assert trace(ZeroMatrix(5, 5)) == 0
      assert trace(OneMatrix(1, 1)) == 1
      assert trace(OneMatrix(2, 2)) == 2
      assert trace(OneMatrix(n, n)) == n
      assert trace(2 * A * B) == 2 * Trace(A * B)
      assert trace(A.T) == trace(A)
  
      i, j = symbols("i j")
      F = FunctionMatrix(3, 3, Lambda((i, j), i + j))
      assert trace(F) == (0 + 0) + (1 + 1) + (2 + 2)
  
      raises(TypeError, lambda: Trace(S.One))
  
      assert Trace(A).arg is A
  
      assert str(trace(A)) == str(Trace(A).doit())
  
      assert Trace(A).is_commutative is True
  
file_path: sympy/sympy/matrices/expressions/tests/test_trace.py
imports: from sympy.core import Lambda, S, symbols
  from sympy.concrete import Sum
  from sympy.functions import adjoint, conjugate, transpose
  from sympy.matrices import eye, Matrix, ShapeError, ImmutableMatrix
  from sympy.matrices.expressions import Adjoint, Identity, FunctionMatrix, MatrixExpr, MatrixSymbol, Trace, ZeroMatrix, trace, MatPow, MatAdd, MatMul
  from sympy.matrices.expressions.special import OneMatrix
  from sympy.testing.pytest import raises
  from sympy.abc import i
label_desc: Use image node_id 1 for calling a global function with example usage: test_Trace() without return types