


"""simple docstring"""

from math import sqrt

import numpy as np
from sympy import symbols

# Coefficient
# Speed of light (m/s)
UpperCAmelCase__  							=2_9979_2458

# Symbols
UpperCAmelCase__							,      UpperCAmelCase__							,      UpperCAmelCase__							,      UpperCAmelCase__  							=symbols("ct x y z")


def lowerCAmelCase_      (				UpperCamelCase__	: float ):






 """simple docstring"""







 if velocity > c:
  raise ValueError("""Speed must not exceed light speed 299,792,458 [m/s]!""" )
 elif velocity < 1:
  # Usually the speed should be much higher than 1 (c order of magnitude)
  raise ValueError("""Speed must be greater than or equal to 1!""" )

 return velocity / c


def lowerCAmelCase_      (				UpperCamelCase__	: float ):






 """simple docstring"""







 return 1 / sqrt(1 - beta(UpperCamelCase__ ) ** 2 )


def lowerCAmelCase_      (				UpperCamelCase__	: float ):






 """simple docstring"""







 return np.array(
     [
         [gamma(UpperCamelCase__ ), -gamma(UpperCamelCase__ ) * beta(UpperCamelCase__ ), 0, 0],
         [-gamma(UpperCamelCase__ ) * beta(UpperCamelCase__ ), gamma(UpperCamelCase__ ), 0, 0],
         [0, 0, 1, 0],
         [0, 0, 0, 1],
     ] )


def lowerCAmelCase_      (				UpperCamelCase__	: float				,   UpperCamelCase__	: np.ndarray | None = None ):






 """simple docstring"""







 if event is None:
  __lowercase									=	np.array([ct, x, y, z] )  # Symbolic four vector
 else:
  event[0] *= c  # x0 is ct (speed of light * time)

 return transformation_matrix(UpperCamelCase__ ) @ event


if __name__ == "__main__":
       import doctest

       doctest.testmod()

       # Example of symbolic vector:
       UpperCAmelCase__  							=transform(2997_9245)
       print("Example of four vector: ")
       print(f"""ct' = {four_vector[0]}""")
       print(f"""x' = {four_vector[1]}""")
       print(f"""y' = {four_vector[2]}""")
       print(f"""z' = {four_vector[3]}""")

       # Substitute symbols with numerical values
       UpperCAmelCase__  							={ct: c, x: 1, y: 1, z: 1}
       UpperCAmelCase__  							=[four_vector[i].subs(sub_dict) for i in range(4)]

       print(f"""\n{numerical_vector}""")




"""simple docstring"""

import inspect
import unittest





class    lowerCamelCase__						(		unittest.TestCase    ):
      def SCREAMING_SNAKE_CASE_	(		self	:	int							):






       '''simple docstring'''


       try:
        import diffusers  # noqa: F401
       except ImportError:
        assert False






      def SCREAMING_SNAKE_CASE_	(		self	:	Optional[Any]							):






       '''simple docstring'''


       import diffusers
       from diffusers.dependency_versions_table import deps

       __lowercase									=	inspect.getmembers(A_      ,       inspect.isclass							)

       for cls_name, cls_module in all_classes:
        if "dummy_" in cls_module.__module__:
         for backend in cls_module._backends:
          if backend == "k_diffusion":
           __lowercase									=	"""k-diffusion"""
          elif backend == "invisible_watermark":
           __lowercase									=	"""invisible-watermark"""
          assert backend in deps, F'''{backend} is not in the deps table!'''
