code: def test_dyadic():
      d1 = A.x | A.x
      d2 = A.y | A.y
      d3 = A.x | A.y
      assert d1 * 0 == 0
      assert d1 != 0
      assert d1 * 2 == 2 * A.x | A.x
      assert d1 / 2.0 == 0.5 * d1
      assert d1 & (0 * d1) == 0
      assert d1 & d2 == 0
      assert d1 & A.x == A.x
      assert d1 ^ A.x == 0
      assert d1 ^ A.y == A.x | A.z
      assert d1 ^ A.z == -A.x | A.y
      assert d2 ^ A.x == -A.y | A.z
      assert A.x ^ d1 == 0
      assert A.y ^ d1 == -A.z | A.x
      assert A.z ^ d1 == A.y | A.x
      assert A.x & d1 == A.x
      assert A.y & d1 == 0
      assert A.y & d2 == A.y
      assert d1 & d3 == A.x | A.y
      assert d3 & d1 == 0
      assert d1.dt(A) == 0
      q = dynamicsymbols("q")
      qd = dynamicsymbols("q", 1)
      B = A.orientnew("B", "Axis", [q, A.z])
      assert d1.express(B) == d1.express(B, B)
      assert d1.express(B) == (
          (cos(q) ** 2) * (B.x | B.x)
          + (-sin(q) * cos(q)) * (B.x | B.y)
          + (-sin(q) * cos(q)) * (B.y | B.x)
          + (sin(q) ** 2) * (B.y | B.y)
      )
      assert d1.express(B, A) == (cos(q)) * (B.x | A.x) + (-sin(q)) * (
          B.y | A.x
      )
      assert d1.express(A, B) == (cos(q)) * (A.x | B.x) + (-sin(q)) * (
          A.x | B.y
      )
      assert d1.dt(B) == (-qd) * (A.y | A.x) + (-qd) * (A.x | A.y)
  
      assert d1.to_matrix(A) == Matrix(
          [[1, 0, 0], [0, 0, 0], [0, 0, 0]]
      )
      assert d1.to_matrix(A, B) == Matrix(
          [[cos(q), -sin(q), 0], [0, 0, 0], [0, 0, 0]]
      )
      assert d3.to_matrix(A) == Matrix(
          [[0, 1, 0], [0, 0, 0], [0, 0, 0]]
      )
      a, b, c, d, e, f = symbols("a, b, c, d, e, f")
      v1 = a * A.x + b * A.y + c * A.z
      v2 = d * A.x + e * A.y + f * A.z
      d4 = v1.outer(v2)
      assert d4.to_matrix(A) == Matrix(
          [
              [a * d, a * e, a * f],
              [b * d, b * e, b * f],
              [c * d, c * e, c * f],
          ]
      )
      d5 = v1.outer(v1)
      C = A.orientnew("C", "Axis", [q, A.x])
      for expected, actual in zip(
          C.dcm(A) * d5.to_matrix(A) * C.dcm(A).T, d5.to_matrix(C)
      ):
          assert (expected - actual).simplify() == 0
  
      raises(TypeError, lambda: d1.applyfunc(0))
  
file_path: sympy/sympy/physics/vector/tests/test_dyadic.py
imports: from sympy.core.numbers import Float, pi
  from sympy.core.symbol import symbols
  from sympy.functions.elementary.trigonometric import cos, sin
  from sympy.matrices.immutable import ImmutableDenseMatrix
  from sympy.physics.vector import ReferenceFrame, dynamicsymbols, outer
  from sympy.physics.vector.dyadic import _check_dyadic
  from sympy.testing.pytest import raises
label_desc: Use image node_id 1 for calling a global function with example usage: test_dyadic() without return types