

from typing import Any

import numpy as np


def 							__lowerCAmelCase     (							_UpperCamelCase		:	np.ndarray						)		->				bool:
 '''simple docstring'''


 return np.array_equal(_UpperCamelCase		,				matrix.conjugate().T						)


def 							__lowerCAmelCase     (							_UpperCamelCase		:	np.ndarray		,				_UpperCamelCase		:	np.ndarray						)		->				Any:
 '''simple docstring'''


 SCREAMING_SNAKE_CASE		    =      v.conjugate().T
 SCREAMING_SNAKE_CASE		    =      v_star.dot(_UpperCamelCase						)
 assert isinstance(_UpperCamelCase		,				np.ndarray						)
 return (v_star_dot.dot(_UpperCamelCase						)) / (v_star.dot(_UpperCamelCase						))


def 							__lowerCAmelCase     (							)		->				None:
 '''simple docstring'''


 SCREAMING_SNAKE_CASE		    =      np.array([[2, 2 + 1j, 4], [2 - 1j, 3, 1j], [4, -1j, 1]]						)
 SCREAMING_SNAKE_CASE		    =      np.array([[1], [2], [3]]						)
 assert is_hermitian(_UpperCamelCase						), f"""{a} is not hermitian."""
 print(rayleigh_quotient(_UpperCamelCase		,				_UpperCamelCase						)						)

 SCREAMING_SNAKE_CASE		    =      np.array([[1, 2, 4], [2, 3, -1], [4, -1, 1]]						)
 assert is_hermitian(_UpperCamelCase						), f"""{a} is not hermitian."""
 assert rayleigh_quotient(_UpperCamelCase		,				_UpperCamelCase						) == float(3						)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      tests()




from graphs.minimum_spanning_tree_kruskal import kruskal


def 							__lowerCAmelCase     (							)		->				Optional[Any]:
 '''simple docstring'''


 SCREAMING_SNAKE_CASE		    =      9
 SCREAMING_SNAKE_CASE		    =      [
     [0, 1, 4],
     [0, 7, 8],
     [1, 2, 8],
     [7, 8, 7],
     [7, 6, 1],
     [2, 8, 2],
     [8, 6, 6],
     [2, 3, 7],
     [2, 5, 4],
     [6, 5, 2],
     [3, 5, 14],
     [3, 4, 9],
     [5, 4, 10],
     [1, 7, 11],
 ]

 SCREAMING_SNAKE_CASE		    =      kruskal(_UpperCamelCase		,				_UpperCamelCase						)

 SCREAMING_SNAKE_CASE		    =      [
     [7, 6, 1],
     [2, 8, 2],
     [6, 5, 2],
     [0, 1, 4],
     [2, 5, 4],
     [2, 3, 7],
     [0, 7, 8],
     [3, 4, 9],
 ]

 assert sorted(_UpperCamelCase						) == sorted(_UpperCamelCase						)

