





from typing import Any

import numpy as np



def     _lowerCAmelCase		(  _lowerCAmelCase     ):
   '''simple docstring'''


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



def     _lowerCAmelCase		(  _lowerCAmelCase  ,_lowerCAmelCase     ):
   '''simple docstring'''


   A_     :				Optional[Any]			      =	v.conjugate().T
   A_     :				Tuple			      =	v_star.dot(_lowerCAmelCase     )
   assert isinstance(_lowerCAmelCase  ,np.ndarray     )
   return (v_star_dot.dot(_lowerCAmelCase     )) / (v_star.dot(_lowerCAmelCase     ))



def     _lowerCAmelCase		(  ):
   '''simple docstring'''


   A_     :				Tuple			      =	np.array([[2, 2 + 1J, 4], [2 - 1J, 3, 1J], [4, -1J, 1]]     )
   A_     :				Any			      =	np.array([[1], [2], [3]]     )
   assert is_hermitian(_lowerCAmelCase     ), f"""{a} is not hermitian."""
   print(rayleigh_quotient(_lowerCAmelCase  ,_lowerCAmelCase     )     )

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


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      tests()













from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowerCAmelCase 				=     {
    """configuration_nllb_moe""": [
        """NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """NllbMoeConfig""",
    ]
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _lowerCAmelCase 				=     [
          """NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """NllbMoeForConditionalGeneration""",
          """NllbMoeModel""",
          """NllbMoePreTrainedModel""",
          """NllbMoeTop2Router""",
          """NllbMoeSparseMLP""",
      ]


if TYPE_CHECKING:
      from .configuration_nllb_moe import (
          NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP,
          NllbMoeConfig,
      )

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_nllb_moe import (
                NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST,
                NllbMoeForConditionalGeneration,
                NllbMoeModel,
                NllbMoePreTrainedModel,
                NllbMoeSparseMLP,
                NllbMoeTopaRouter,
            )


else:
      import sys

      _lowerCAmelCase 				=     _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)






