

'''simple docstring'''

from __future__ import annotations





def 				lowercase (					__magic_name__			,   __magic_name__							):



					'''simple docstring'''







					UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase		:							List[Any]        =       "", "", ""
					UpperCAmelCase		:							Tuple        =       []

					for character in message_part:
										tmp.append(character_to_number[character]							)

					for each in tmp:
										one += each[0]
										two += each[1]
										three += each[2]

					return one + two + three





def 				lowercase (					__magic_name__			,   __magic_name__							):



					'''simple docstring'''







					UpperCAmelCase ,			UpperCAmelCase		:							Optional[Any]        =       "", ""
					UpperCAmelCase		:							Optional[Any]        =       []

					for character in message_part:
										this_part += character_to_number[character]

					for digit in this_part:
										tmp += digit
										if len(__magic_name__							) == len(__magic_name__							):
															result.append(__magic_name__							)
															UpperCAmelCase		:							str        =       ""

					return result[0], result[1], result[2]





def 				lowercase (					__magic_name__			,   __magic_name__							):



					'''simple docstring'''







					UpperCAmelCase		:							Optional[Any]        =       alphabet.replace(" "			,   ""							).upper()
					UpperCAmelCase		:							Union[str, Any]        =       message.replace(" "			,   ""							).upper()

					# Check length and characters
					if len(__magic_name__							) != 27:
										raise KeyError("Length of alphabet has to be 27."							)
					for each in message:
										if each not in alphabet:
															raise ValueError("Each message character has to be included in alphabet!"							)

    # Generate dictionares
					UpperCAmelCase		:							Union[str, Any]        =       (
					    "111",
					    "112",
					    "113",
					    "121",
					    "122",
					    "123",
					    "131",
					    "132",
					    "133",
					    "211",
					    "212",
					    "213",
					    "221",
					    "222",
					    "223",
					    "231",
					    "232",
					    "233",
					    "311",
					    "312",
					    "313",
					    "321",
					    "322",
					    "323",
					    "331",
					    "332",
					    "333",
					)
					UpperCAmelCase		:							Dict        =       {}
					UpperCAmelCase		:							str        =       {}
					for letter, number in zip(__magic_name__			,   __magic_name__							):
										UpperCAmelCase		:							Union[str, Any]        =       number
										UpperCAmelCase		:							Optional[Any]        =       letter

					return message, alphabet, character_to_number, number_to_character





def 				lowercase (					__magic_name__			,   __magic_name__ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ."			,   __magic_name__ = 5							):



					'''simple docstring'''







					UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase		:							Dict        =       __prepare(
					    __magic_name__			,   __magic_name__							)
					UpperCAmelCase ,			UpperCAmelCase		:							List[Any]        =       "", ""

					for i in range(0			,   len(__magic_name__							) + 1			,   __magic_name__							):
										encrypted_numeric += __encrypt_part(
										    message[i : i + period]			,   __magic_name__							)

					for i in range(0			,   len(__magic_name__							)			,   3							):
										encrypted += number_to_character[encrypted_numeric[i : i + 3]]

					return encrypted





def 				lowercase (					__magic_name__			,   __magic_name__ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ."			,   __magic_name__ = 5							):



					'''simple docstring'''







					UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase		:							Dict        =       __prepare(
					    __magic_name__			,   __magic_name__							)
					UpperCAmelCase		:							List[str]        =       []
					UpperCAmelCase		:							List[str]        =       ""

					for i in range(0			,   len(__magic_name__							) + 1			,   __magic_name__							):
										UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase		:							Any        =       __decrypt_part(message[i : i + period]			,   __magic_name__							)

										for j in range(0			,   len(__magic_name__							)							):
															decrypted_numeric.append(a[j] + b[j] + c[j]							)

					for each in decrypted_numeric:
										decrypted += number_to_character[each]

					return decrypted


if __name__ == "__main__":
				a       :      int  	=			"DEFEND THE EAST WALL OF THE CASTLE."
				a       :      Optional[Any]  	=			encrypt_message(msg, "EPSDUCVWYM.ZLKXNBTFGORIJHAQ")
				a       :      Union[str, Any]  	=			decrypt_message(encrypted, "EPSDUCVWYM.ZLKXNBTFGORIJHAQ")
				print(F'Encrypted: {encrypted}\nDecrypted: {decrypted}')



'''simple docstring'''

import math

import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute





def 				lowercase (					__magic_name__ = 1			,   __magic_name__ = 1							):



					'''simple docstring'''







					if isinstance(__magic_name__			,   __magic_name__							) or isinstance(__magic_name__			,   __magic_name__							):
										raise TypeError("inputs must be integers."							)
					if (bit_a < 0) or (bit_a < 0):
										raise ValueError("inputs must be positive."							)
					if (math.floor(__magic_name__							) != bit_a) or (math.floor(__magic_name__							) != bit_a):
										raise ValueError("inputs must be exact integers."							)
					if (bit_a > 1) or (bit_a > 1):
										raise ValueError("inputs must be less or equal to 1."							)

					# build registers
					UpperCAmelCase		:							List[Any]        =       QuantumRegister(2			,   "qr"							)
					UpperCAmelCase		:							Optional[int]        =       ClassicalRegister(2			,   "cr"							)

					UpperCAmelCase		:							Optional[int]        =       QuantumCircuit(__magic_name__			,   __magic_name__							)

					# entanglement the qubits
					quantum_circuit.h(1							)
					quantum_circuit.cx(1			,   0							)

					# send the information
					UpperCAmelCase		:							Any        =       str(__magic_name__							) + str(__magic_name__							)

					if c_information == "11":
										quantum_circuit.x(1							)
										quantum_circuit.z(1							)
					elif c_information == "10":
										quantum_circuit.z(1							)
					elif c_information == "01":
										quantum_circuit.x(1							)
					else:
										quantum_circuit.i(1							)

					# unentangled the circuit
					quantum_circuit.cx(1			,   0							)
					quantum_circuit.h(1							)

					# measure the circuit
					quantum_circuit.measure(__magic_name__			,   __magic_name__							)

					UpperCAmelCase		:							Tuple        =       Aer.get_backend("aer_simulator"							)
					UpperCAmelCase		:							Any        =       execute(__magic_name__			,   __magic_name__			,   shots=1000							)

					return job.result().get_counts(__magic_name__							)


if __name__ == "__main__":
				print(F'Counts for classical state send: {superdense_coding(1,1)}')
