


A
      tensor([[ 0.9828+0.3889j, -0.4617+0.3010j],
              [ 0.1662-0.7435j, -0.6139+0.0562j]], dtype=torch.complex128)
      >>> L, V = torch.linalg.eig(A)
      >>> L
      tensor([ 1.1226+0.5738j, -0.7537-0.1286j], dtype=torch.complex128)
      >>> V
      tensor([[ 0.9218+0.0000j,  0.1882-0.2220j],
              [-0.0270-0.3867j,  0.9567+0.0000j]], dtype=torch.complex128)
      >>> torch.dist(V @ torch.diag(L) @ torch.linalg.inv(V), A)
      tensor(7.7119e-16, dtype=torch.float64)



  >>> A = torch.randn(3, 2, 2, dtype=torch.float64)
  >>> L, V = torch.linalg.eig(A)
  >>> torch.dist(V @ torch.diag_embed(L) @ torch.linalg.inv(V), A)
  tensor(3.2841e-16, dtype=torch.float64)
