



'''simple docstring'''




from __future__ import annotations

from typing import Any






def        lowerCAmelCase_     (			_lowerCamelCase:     list      ):
		if not postfix_notation:
				return 0

		__SCREAMING_SNAKE_CASE :	str					 =	{"""+""", """-""", """*""", """/"""}
		__SCREAMING_SNAKE_CASE :	list[Any]					 =	[]

		for token in postfix_notation:
				if token in operations:
						__SCREAMING_SNAKE_CASE :	Dict					 =	stack.pop(), stack.pop()
						if token == "+":
								stack.append(a + b      )
						elif token == "-":
								stack.append(a - b      )
						elif token == "*":
								stack.append(a * b      )
						else:
								if a * b < 0 and a % b != 0:
										stack.append(a // b + 1      )
								else:
										stack.append(a // b      )
				else:
						stack.append(int(_lowerCamelCase      )      )

		return stack.pop()


if __name__ == "__main__":
						import doctest

						doctest.testmod()




'''simple docstring'''




import qiskit


def        lowerCAmelCase_     (			_lowerCamelCase:     int = 2      ):
		__SCREAMING_SNAKE_CASE :	Dict					 =	qubits

		# Using Aer's simulator
		__SCREAMING_SNAKE_CASE :	Optional[Any]					 =	qiskit.Aer.get_backend("""aer_simulator"""      )

		# Creating a Quantum Circuit acting on the q register
		__SCREAMING_SNAKE_CASE :	str					 =	qiskit.QuantumCircuit(_lowerCamelCase ,   _lowerCamelCase      )

		# Adding a H gate on qubit 0 (now q0 in superposition)
		circuit.h(0      )

		for i in range(1 ,   _lowerCamelCase      ):
				# Adding CX (CNOT) gate
				circuit.cx(i - 1 ,   _lowerCamelCase      )

		# Mapping the quantum measurement to the classical bits
		circuit.measure(list(range(_lowerCamelCase      )      ) ,   list(range(_lowerCamelCase      )      )      )

		# Now measuring any one qubit would affect other qubits to collapse
		# their super position and have same state as the measured one.

		# Executing the circuit on the simulator
		__SCREAMING_SNAKE_CASE :	str					 =	qiskit.execute(_lowerCamelCase ,   _lowerCamelCase ,   shots=10_00      )

		return job.result().get_counts(_lowerCamelCase      )


if __name__ == "__main__":
						print(f"Total count for various states are: {quantum_entanglement(3)}")