



"""simple docstring"""


import math

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

def 					_lowerCAmelCase (  lowercase_ = 1						,      lowercase_ = 1		):
						if isinstance(UpperCAmelCase_						,      UpperCAmelCase_		) or isinstance(UpperCAmelCase_						,      UpperCAmelCase_		):
												raise TypeError('inputs must be integers.'		)
						if (bit_a < 0) or (bit_a < 0):
												raise ValueError('inputs must be positive.'		)
						if (math.floor(UpperCAmelCase_		) != bit_a) or (math.floor(UpperCAmelCase_		) != 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			 =					QuantumRegister(2						,      'qr'		)
						UpperCAmelCase			 =					ClassicalRegister(2						,      'cr'		)

						UpperCAmelCase			 =					QuantumCircuit(UpperCAmelCase_						,      UpperCAmelCase_		)

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

						# send the information
						UpperCAmelCase			 =					str(UpperCAmelCase_		) + str(UpperCAmelCase_		)

						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(UpperCAmelCase_						,      UpperCAmelCase_		)

						UpperCAmelCase			 =					Aer.get_backend('aer_simulator'		)
						UpperCAmelCase			 =					execute(UpperCAmelCase_						,      UpperCAmelCase_						,      shots=1000		)

						return job.result().get_counts(UpperCAmelCase_		)


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










'''simple docstring'''







def 			_lowerCAmelCase(      UpperCAmelCase_      :	str						) ->							str:
							lowerCAmelCase__  =   word.upper()
							lowerCAmelCase__  =   0
							lowerCAmelCase__  =   {}
							lowerCAmelCase__  =   []

							for letter in word:
														if letter not in letter_nums:
																					lowerCAmelCase__  =   str(UpperCAmelCase_						)
																					next_num += 1
														word_pattern.append(letter_nums[letter]						)
							return ".".join(UpperCAmelCase_						)


if __name__ == "__main__":
		import pprint
		import time

		_UpperCamelCase  						=			time.time()
		with open("""dictionary.txt""") as in_file:
				_UpperCamelCase  						=			in_file.read().splitlines()

		_UpperCamelCase  						=			{}
		for word in word_list:
				_UpperCamelCase  						=			get_word_pattern(word)
				if pattern in all_patterns:
						all_patterns[pattern].append(word)
				else:
						_UpperCamelCase  						=			[word]

		with open("""word_patterns.txt""", """w""") as out_file:
				out_file.write(pprint.pformat(all_patterns))

		_UpperCamelCase  						=			round(time.time() - start_time, 2)
		print(f'Done!  {len(all_patterns):,} word patterns found in {total_time} seconds.')
		# Done!  9,581 word patterns found in 0.58 seconds.





