
"""simple docstring"""






from math import sqrt

import numpy as np
from sympy import symbols

# Coefficient
# Speed of light (m/s)
__UpperCAmelCase       =  2_99_79_24_58

# Symbols
__UpperCAmelCase , __UpperCAmelCase , __UpperCAmelCase , __UpperCAmelCase       =  symbols('ct x y z')






def 						_snake_case       (	lowercase__		:  float		)  ->				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 						_snake_case       (	lowercase__		:  float		)  ->				float:


			'''simple docstring'''





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






def 						_snake_case       (	lowercase__		:  float		)  ->				np.ndarray:


			'''simple docstring'''





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






def 						_snake_case       (	lowercase__		:  float      ,     lowercase__		:  np.ndarray | None = None		)  ->				np.ndarray:


			'''simple docstring'''





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

			return transformation_matrix(lowercase__		) @ event


if __name__ == "__main__":
				import doctest

				doctest.testmod()

				# Example of symbolic vector:
				__UpperCAmelCase       =  transform(29_97_92_45)
				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'''

from __future__ import annotations





def 						UpperCamelCase				(							_lowerCamelCase					:					list[int | str]       ):
    create_state_space_tree(_lowerCamelCase						,       []						,       0						,       [0 for i in range(len(_lowerCamelCase       )       )]       )





def 						UpperCamelCase				(							_lowerCamelCase					:					list[int | str]						,       _lowerCamelCase					:					list[int | str]						,       _lowerCamelCase					:					int						,       _lowerCamelCase					:					list[int]						,       ):

    if index == len(_lowerCamelCase       ):
        print(_lowerCamelCase       )
        return

    for i in range(len(_lowerCamelCase       )       ):
        if not index_used[i]:
            current_sequence.append(sequence[i]       )
            A__				=			True
            create_state_space_tree(_lowerCamelCase						,       _lowerCamelCase						,       index + 1						,       _lowerCamelCase       )
            current_sequence.pop()
            A__				=			False
__lowerCAmelCase							:	list[int | str]			=[3, 1, 2, 4]
generate_all_permutations(sequence)

__lowerCAmelCase							:	list[int | str]			=["A", "B", "C"]



generate_all_permutations(sequence_a)



