code: def is_hermitian(
          matrix: np.ndarray,
          *,
          rtol: float = 1e-5,
          atol: float = 1e-8) -> bool:
      
      return (matrix.shape[0] == matrix.shape[1] and
              np.allclose(matrix, np.conj(matrix.T), rtol=rtol, atol=atol))
docs: Determines if a matrix is approximately Hermitian.
  
      A matrix is Hermitian if it's square and equal to its adjoint.
  
      Args:
          matrix: The matrix to check.
          rtol: The per-matrix-entry relative tolerance on equality.
          atol: The per-matrix-entry absolute tolerance on equality.
  
      Returns:
          Whether the matrix is Hermitian within the given tolerance.