

'''simple docstring'''


import math



class 					lowercase						:


							def __init__(			self    ,			_snake_case=0)							->				Union[str, Any]:  # a graph with Node 0,1,...,N-1
								UpperCAmelCase_		:      Tuple       	=					n
								UpperCAmelCase_		:      Optional[Any]       	=					[
								    [math.inf for j in range(0    ,			_snake_case)] for i in range(0    ,			_snake_case)
								]  # adjacency matrix for weight
								UpperCAmelCase_		:      Tuple       	=					[
								    [math.inf for j in range(0    ,			_snake_case)] for i in range(0    ,			_snake_case)
								]  # dp[i][j] stores minimum distance from i to j


							def 						_snake_case							(			self    ,			_snake_case    ,			_snake_case    ,			_snake_case)							->				List[Any]:
								UpperCAmelCase_		:      Union[str, Any]       	=					w


							def 						_snake_case							(			self)							->				str:
								for k in range(0    ,			self.n):
									for i in range(0    ,			self.n):
										for j in range(0    ,			self.n):
											UpperCAmelCase_		:      Optional[int]       	=					min(self.dp[i][j]    ,			self.dp[i][k] + self.dp[k][j])





							def 						_snake_case							(			self    ,			_snake_case    ,			_snake_case)							->				str:
								return self.dp[u][v]


if __name__ == "__main__":
						lowerCAmelCase__										= Graph(5)
						graph.add_edge(0, 2, 9)
						graph.add_edge(0, 4, 10)
						graph.add_edge(1, 3, 5)
						graph.add_edge(2, 3, 7)
						graph.add_edge(3, 0, 10)
						graph.add_edge(3, 1, 2)
						graph.add_edge(3, 2, 1)
						graph.add_edge(3, 4, 6)
						graph.add_edge(4, 1, 3)
						graph.add_edge(4, 2, 4)
						graph.add_edge(4, 3, 9)
						graph.floyd_warshall()
						graph.show_min(1, 4)
						graph.show_min(0, 3)









'''simple docstring'''


import qiskit







def 						SCREAMING_SNAKE_CASE(  UpperCamelCase   ,UpperCamelCase  )    ->    qiskit.result.counts.Counts:
	UpperCAmelCase_		:      Tuple       	=					qiskit.Aer.get_backend('aer_simulator'  )

	UpperCAmelCase_		:      List[str]       	=					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
	UpperCAmelCase_		:      List[str]       	=					qiskit.execute(UpperCamelCase   ,UpperCamelCase   ,shots=1_0_0_0  )

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


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






