
'''simple docstring'''







from __future__ import annotations

from collections.abc import Sequence
from typing import Literal
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			str				,				__SCREAMING_SNAKE_CASE :			str							):



						"""simple docstring"""





						lowercase_     :					List[str]													=	list(__SCREAMING_SNAKE_CASE							)
						lowercase_     :					Union[str, Any]													=	list(__SCREAMING_SNAKE_CASE							)
						lowercase_     :					Tuple													=	0
						for i in range(len(__SCREAMING_SNAKE_CASE							)							):
												if lista[i] != lista[i]:
																		count += 1
																		lowercase_     :					Any													=	'''_'''
						if count > 1:
												return False
						else:
												return "".join(__SCREAMING_SNAKE_CASE							)
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			list[str]							):



						"""simple docstring"""





						lowercase_     :					Optional[int]													=	[]
						while True:
												lowercase_     :					Union[str, Any]													=	['''$'''] * len(__SCREAMING_SNAKE_CASE							)
												lowercase_     :					Tuple													=	[]
												for i in range(len(__SCREAMING_SNAKE_CASE							)							):
																		for j in range(i + 1				,				len(__SCREAMING_SNAKE_CASE							)							):
																								lowercase_     :					List[Any]													=	compare_string(binary[i]				,				binary[j]							)
																								if k is False:
																														lowercase_     :					Optional[int]													=	'''*'''
																														lowercase_     :					List[str]													=	'''*'''
																														temp.append('''X'''							)
												for i in range(len(__SCREAMING_SNAKE_CASE							)							):
																		if checka[i] == "$":
																								pi.append(binary[i]							)
												if len(__SCREAMING_SNAKE_CASE							) == 0:
																		return pi
												lowercase_     :					Dict													=	list(set(__SCREAMING_SNAKE_CASE							)							)
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			int				,				__SCREAMING_SNAKE_CASE :			Sequence[float]							):



						"""simple docstring"""





						lowercase_     :					Tuple													=	[]
						for minterm in minterms:
												lowercase_     :					Dict													=	''''''
												for _ in range(__SCREAMING_SNAKE_CASE							):
																		lowercase_     :					int													=	str(minterm % 2							) + string
																		minterm //= 2
												temp.append(__SCREAMING_SNAKE_CASE							)
						return temp
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			str				,				__SCREAMING_SNAKE_CASE :			str				,				__SCREAMING_SNAKE_CASE :			int							):



						"""simple docstring"""





						lowercase_     :					List[str]													=	list(__SCREAMING_SNAKE_CASE							)
						lowercase_     :					Optional[int]													=	list(__SCREAMING_SNAKE_CASE							)
						lowercase_     :					Dict													=	0
						for i in range(len(__SCREAMING_SNAKE_CASE							)							):
												if lista[i] != lista[i]:
																		count_n += 1
						return count_n == count
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			list[list[int]]				,				__SCREAMING_SNAKE_CASE :			list[str]							):



						"""simple docstring"""





						lowercase_     :					Optional[Any]													=	[]
						lowercase_     :					Tuple													=	[0] * len(__SCREAMING_SNAKE_CASE							)
						for i in range(len(chart[0]							)							):
												lowercase_     :					Optional[Any]													=	0
												lowercase_     :					List[str]													=	-1
												for j in range(len(__SCREAMING_SNAKE_CASE							)							):
																		if chart[j][i] == 1:
																								count += 1
																								lowercase_     :					List[Any]													=	j
												if count == 1:
																		lowercase_     :					Union[str, Any]													=	1
						for i in range(len(__SCREAMING_SNAKE_CASE							)							):
												if select[i] == 1:
																		for j in range(len(chart[0]							)							):
																								if chart[i][j] == 1:
																														for k in range(len(__SCREAMING_SNAKE_CASE							)							):
																																				lowercase_     :					Union[str, Any]													=	0
																		temp.append(prime_implicants[i]							)
						while True:
												lowercase_     :					Union[str, Any]													=	0
												lowercase_     :					Dict													=	-1
												lowercase_     :					Dict													=	0
												for i in range(len(__SCREAMING_SNAKE_CASE							)							):
																		lowercase_     :					Any													=	chart[i].count(1							)
																		if count_n > max_n:
																								lowercase_     :					Optional[int]													=	count_n
																								lowercase_     :					List[Any]													=	i

												if max_n == 0:
																		return temp

												temp.append(prime_implicants[rem]							)

												for i in range(len(chart[0]							)							):
																		if chart[rem][i] == 1:
																								for j in range(len(__SCREAMING_SNAKE_CASE							)							):
																														lowercase_     :					Optional[Any]													=	0
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			list[str]				,				__SCREAMING_SNAKE_CASE :			list[str]							):



						"""simple docstring"""





						lowercase_     :					List[Any]													=	[[0 for x in range(len(__SCREAMING_SNAKE_CASE							)							)] for x in range(len(__SCREAMING_SNAKE_CASE							)							)]
						for i in range(len(__SCREAMING_SNAKE_CASE							)							):
												lowercase_     :					Union[str, Any]													=	prime_implicants[i].count('''_'''							)
												for j in range(len(__SCREAMING_SNAKE_CASE							)							):
																		if is_for_table(prime_implicants[i]				,				binary[j]				,				__SCREAMING_SNAKE_CASE							):
																								lowercase_     :					Union[str, Any]													=	1

						return chart
def  snake_case_		(    ):



						"""simple docstring"""





						lowercase_     :					Optional[int]													=	int(input('''Enter the no. of variables\n'''							)							)
						lowercase_     :					Union[str, Any]													=	[
						    float(__SCREAMING_SNAKE_CASE							)
						    for x in input(
						        '''Enter the decimal representation of Minterms \'Spaces Separated\'\n'''							).split()
						]
						lowercase_     :					Optional[int]													=	decimal_to_binary(__SCREAMING_SNAKE_CASE				,				__SCREAMING_SNAKE_CASE							)

						lowercase_     :					Dict													=	check(__SCREAMING_SNAKE_CASE							)
						print('''Prime Implicants are:'''							)
						print(__SCREAMING_SNAKE_CASE							)
						lowercase_     :					List[Any]													=	prime_implicant_chart(__SCREAMING_SNAKE_CASE				,				__SCREAMING_SNAKE_CASE							)

						lowercase_     :					Tuple													=	selection(__SCREAMING_SNAKE_CASE				,				__SCREAMING_SNAKE_CASE							)
						print('''Essential Prime Implicants are:'''							)
						print(__SCREAMING_SNAKE_CASE							)


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							main()





'''simple docstring'''







import qiskit
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			int				,				__SCREAMING_SNAKE_CASE :			int							):



						"""simple docstring"""





						lowercase_     :					List[Any]													=	qiskit.Aer.get_backend('''aer_simulator'''							)

						# Create a Quantum Circuit acting on the q register
						lowercase_     :					Dict													=	qiskit.QuantumCircuit(__SCREAMING_SNAKE_CASE				,				__SCREAMING_SNAKE_CASE							)

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

						# Execute the circuit on the simulator
						lowercase_     :					Union[str, Any]													=	qiskit.execute(__SCREAMING_SNAKE_CASE				,				__SCREAMING_SNAKE_CASE				,				shots=1000							)

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


if __name__ == "__main__":
							print(f"""Total count for various states are: {single_qubit_measure(1, 1)}""")



