


"""simple docstring"""
import qiskit







def   _a			( _SCREAMING_SNAKE_CASE			,	_SCREAMING_SNAKE_CASE			)      ->			qiskit.result.counts.Counts:
							snake_case_          =						qiskit.Aer.get_backend("""aer_simulator"""			)

							snake_case_          =						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
							snake_case_          =						qiskit.execute(__SCREAMING_SNAKE_CASE			,	__SCREAMING_SNAKE_CASE			,	shots=1_000			)

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


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







"""simple docstring"""
import math





class        __A       :





							'''simple docstring'''

							def __init__(			self							: List[str]						,    UpperCAmelCase_							: Tuple=0    )   ->Optional[int]:  # a graph with Node 0,1,...,N-1



														"""simple docstring"""



														snake_case_          =						n
														snake_case_          =						[
														    [math.inf for j in range(0						,    UpperCAmelCase_    )] for i in range(0						,    UpperCAmelCase_    )
														]  # adjacency matrix for weight
														snake_case_          =						[
														    [math.inf for j in range(0						,    UpperCAmelCase_    )] for i in range(0						,    UpperCAmelCase_    )
														]  # dp[i][j] stores minimum distance from i to j



							def 						lowerCAmelCase    (			self							: List[str]						,    UpperCAmelCase_							: Any						,    UpperCAmelCase_							: List[str]						,    UpperCAmelCase_							: Optional[Any]    )   ->Optional[int]:



														"""simple docstring"""



														snake_case_          =						w



							def 						lowerCAmelCase    (			self							: Optional[int]    )   ->Any:



														"""simple docstring"""



														for k in range(0						,    self.n    ):
																					for i in range(0						,    self.n    ):
																												for j in range(0						,    self.n    ):
																																			snake_case_          =						min(self.dp[i][j]						,    self.dp[i][k] + self.dp[k][j]    )



							def 						lowerCAmelCase    (			self							: Optional[int]						,    UpperCAmelCase_							: Dict						,    UpperCAmelCase_							: Optional[Any]    )   ->Union[str, Any]:



														"""simple docstring"""



														return self.dp[u][v]


if __name__ == "__main__":
				__SCREAMING_SNAKE_CASE							:      Optional[int]						=      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)



