





from __future__ import annotations


class 						lowerCamelCase       :







							"""simple docstring"""




							def __init__( self     :					Tuple,			_UpperCAmelCase     :					int = 0						)				->			Union[str, Any]:





														"""simple docstring"""
														SCREAMING_SNAKE_CASE__       :      Dict     =						key






							def  A_     ( self     :					List[Any],			_UpperCAmelCase     :					str,			_UpperCAmelCase     :					int						)				->			list[str]:





														"""simple docstring"""
														assert isinstance(_UpperCAmelCase,			_UpperCAmelCase						) and isinstance(_UpperCAmelCase,			_UpperCAmelCase						)

														SCREAMING_SNAKE_CASE__       :      int     =						key or self.__key or 1

														# make sure key is an appropriate size
														key %= 2_5_5

														return [chr(ord(_UpperCAmelCase						) ^ key						) for ch in content]






							def  A_     ( self     :					Optional[Any],			_UpperCAmelCase     :					str,			_UpperCAmelCase     :					int						)				->			list[str]:





														"""simple docstring"""
														assert isinstance(_UpperCAmelCase,			_UpperCAmelCase						) and isinstance(_UpperCAmelCase,			_UpperCAmelCase						)

														SCREAMING_SNAKE_CASE__       :      Any     =						key or self.__key or 1

														# make sure key is an appropriate size
														key %= 2_5_5

														return [chr(ord(_UpperCAmelCase						) ^ key						) for ch in content]






							def  A_     ( self     :					Union[str, Any],			_UpperCAmelCase     :					str,			_UpperCAmelCase     :					int = 0						)				->			str:





														"""simple docstring"""
														assert isinstance(_UpperCAmelCase,			_UpperCAmelCase						) and isinstance(_UpperCAmelCase,			_UpperCAmelCase						)

														SCREAMING_SNAKE_CASE__       :      Tuple     =						key or self.__key or 1

														# make sure key can be any size
														while key > 2_5_5:
																					key -= 2_5_5

														# This will be returned
														SCREAMING_SNAKE_CASE__       :      List[Any]     =						""

														for ch in content:
																					ans += chr(ord(_UpperCAmelCase						) ^ key						)

														return ans






							def  A_     ( self     :					Dict,			_UpperCAmelCase     :					str,			_UpperCAmelCase     :					int = 0						)				->			str:





														"""simple docstring"""
														assert isinstance(_UpperCAmelCase,			_UpperCAmelCase						) and isinstance(_UpperCAmelCase,			_UpperCAmelCase						)

														SCREAMING_SNAKE_CASE__       :      List[str]     =						key or self.__key or 1

														# make sure key can be any size
														while key > 2_5_5:
																					key -= 2_5_5

														# This will be returned
														SCREAMING_SNAKE_CASE__       :      Tuple     =						""

														for ch in content:
																					ans += chr(ord(_UpperCAmelCase						) ^ key						)

														return ans






							def  A_     ( self     :					Tuple,			_UpperCAmelCase     :					str,			_UpperCAmelCase     :					int = 0						)				->			bool:





														"""simple docstring"""
														assert isinstance(_UpperCAmelCase,			_UpperCAmelCase						) and isinstance(_UpperCAmelCase,			_UpperCAmelCase						)

														try:
																					with open(_UpperCAmelCase						) as fin, open("encrypt.out",			"w+"						) as fout:
																												# actual encrypt-process
																												for line in fin:
																																			fout.write(self.encrypt_string(_UpperCAmelCase,			_UpperCAmelCase						)						)

														except OSError:
																					return False

														return True






							def  A_     ( self     :					Tuple,			_UpperCAmelCase     :					str,			_UpperCAmelCase     :					int						)				->			bool:





														"""simple docstring"""
														assert isinstance(_UpperCAmelCase,			_UpperCAmelCase						) and isinstance(_UpperCAmelCase,			_UpperCAmelCase						)

														try:
																					with open(_UpperCAmelCase						) as fin, open("decrypt.out",			"w+"						) as fout:
																												# actual encrypt-process
																												for line in fin:
																																			fout.write(self.decrypt_string(_UpperCAmelCase,			_UpperCAmelCase						)						)

														except OSError:
																					return False

														return True


# Tests
# crypt = XORCipher()
# key = 67

# # test encrypt
# print(crypt.encrypt("hallo welt",key))
# # test decrypt
# print(crypt.decrypt(crypt.encrypt("hallo welt",key), key))

# # test encrypt_string
# print(crypt.encrypt_string("hallo welt",key))

# # test decrypt_string
# print(crypt.decrypt_string(crypt.encrypt_string("hallo welt",key),key))

# if (crypt.encrypt_file("test.txt",key)):
#       print("encrypt successful")
# else:
#       print("encrypt unsuccessful")

# if (crypt.decrypt_file("encrypt.out",key)):
#       print("decrypt successful")
# else:
#       print("decrypt unsuccessful")













import qiskit




def _a (  SCREAMING_SNAKE_CASE__      :  int			,				SCREAMING_SNAKE_CASE__      :  int       )	->    qiskit.result.counts.Counts:

							'''simple docstring'''






							SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						qiskit.Aer.get_backend("aer_simulator"       )

							# Create a Quantum Circuit acting on the q register
							SCREAMING_SNAKE_CASE__       :      List[Any]     =						qiskit.QuantumCircuit(SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__       )

							# Apply X (NOT) Gate to Qubits 0 & 1
							circuit.x(0       )
							circuit.x(1       )

							# Map the quantum measurement to the classical bits
							circuit.measure([0, 1]			,				[0, 1]       )

							# Execute the circuit on the qasm simulator
							SCREAMING_SNAKE_CASE__       :      int     =						qiskit.execute(SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				shots=10_00       )

							# Return the histogram data of the results of the experiment.
							return job.result().get_counts(SCREAMING_SNAKE_CASE__       )


if __name__ == "__main__":
		_lowerCamelCase :    List[str]  							= single_qubit_measure(2, 2)
		print(f"Total count for various states are: {counts}")






