






import qiskit




def      __A					(     _lowercase					,			_lowercase ):

					'''simple docstring'''







					_A								= qiskit.Aer.get_backend('''aer_simulator''' )

					_A								= qiskit.QuantumCircuit(4					,			2 )
					# encode inputs in qubits 0 and 1
					if bita == 1:
										qc_ha.x(0 )
					if bita == 1:
										qc_ha.x(1 )
					qc_ha.barrier()

					# use cnots to write XOR of the inputs on qubit2
					qc_ha.cx(0					,			2 )
					qc_ha.cx(1					,			2 )

					# use ccx / toffoli gate to write AND of the inputs on qubit3
					qc_ha.ccx(0					,			1					,			3 )
					qc_ha.barrier()

					# extract outputs
					qc_ha.measure(2					,			0 )  # extract XOR value
					qc_ha.measure(3					,			1 )  # extract AND value

					# Execute the circuit on the qasm simulator
					_A								= qiskit.execute(_lowercase					,			_lowercase					,			shots=10_00 )

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


if __name__ == "__main__":
				__A      =				half_adder(1, 1)
				print(f'Half Adder Output Qubit Counts: {counts}')











def      __A					(     _lowercase					,			_lowercase ):

					'''simple docstring'''







					_A								= word.split()

					def justify(_lowercase					,			_lowercase					,			_lowercase ) -> str:
										_A								= max_width - width
										_A								= len(_lowercase )
										if len(_lowercase ) == 1:
															# if there is only word in line
															# just insert overall_spaces_count for the remainder of line
															return line[0] + " " * overall_spaces_count
										else:
															_A								= words_count - 1
															# num_spaces_between_words_list[i] : tells you to insert
															# num_spaces_between_words_list[i] spaces
															# after word on line[i]
															_A								= spaces_to_insert_between_words * [
															    overall_spaces_count // spaces_to_insert_between_words
															]
															_A								= (
															    overall_spaces_count % spaces_to_insert_between_words
															)
															# distribute spaces via round robin to the left words
															for i in range(_lowercase ):
																				num_spaces_between_words_list[i] += 1
															_A								= []
															for i in range(_lowercase ):
																				# add the word
																				aligned_words_list.append(line[i] )
																				# add the spaces to insert
																				aligned_words_list.append(num_spaces_between_words_list[i] * ''' ''' )
															# just add the last word to the sentence
															aligned_words_list.append(line[-1] )
															# join the aligned words list to form a justified line
															return "".join(_lowercase )

					_A								= []
					_A								= []
					_A								= 0
					for word in words:
										if width + len(_lowercase ) + len(_lowercase ) <= max_width:
															# keep adding words until we can fill out max_width
															# width = sum of length of all words (without overall_spaces_count)
															# len(word) = length of current word
															# len(line) = number of overall_spaces_count to insert between words
															line.append(_lowercase )
															width += len(_lowercase )
										else:
															# justify the line and add it to result
															answer.append(justify(_lowercase					,			_lowercase					,			_lowercase ) )
															# reset new line and new width
															_A							,_A								= [word], len(_lowercase )
					_A								= max_width - width - len(_lowercase )
					answer.append(''' '''.join(_lowercase ) + (remaining_spaces + 1) * ''' ''' )
					return answer


if __name__ == "__main__":
				from doctest import testmod

				testmod()



