
'''simple docstring'''
__lowerCAmelCase												=	'Alexander Joslin'

import operator as op

from .stack import Stack






def  __SCREAMING_SNAKE_CASE				(  _SCREAMING_SNAKE_CASE				):
							_snake_case       =  {"""*""": op.mul, """/""": op.truediv, """+""": op.add, """-""": op.sub}

							_snake_case       =  Stack()
							_snake_case       =  Stack()

							for i in equation:
														if i.isdigit():
																					# RULE 1
																					operand_stack.push(int(_SCREAMING_SNAKE_CASE				)				)
														elif i in operators:
																					# RULE 2
																					operator_stack.push(_SCREAMING_SNAKE_CASE				)
														elif i == ")":
																					# RULE 4
																					_snake_case       =  operator_stack.peek()
																					operator_stack.pop()
																					_snake_case       =  operand_stack.peek()
																					operand_stack.pop()
																					_snake_case       =  operand_stack.peek()
																					operand_stack.pop()

																					_snake_case       =  operators[opr](_SCREAMING_SNAKE_CASE							, _SCREAMING_SNAKE_CASE				)
																					operand_stack.push(_SCREAMING_SNAKE_CASE				)

    # RULE 5
							return operand_stack.peek()


if __name__ == "__main__":
				__lowerCAmelCase												=	'(5 + ((4 * 2) * (2 + 3)))'
				# answer = 45
				print(f'''{equation} = {dijkstras_two_stack_algorithm(equation)}''')

'''simple docstring'''
import qiskit






def  __SCREAMING_SNAKE_CASE				(  _SCREAMING_SNAKE_CASE							, _SCREAMING_SNAKE_CASE				):
							_snake_case       =  qiskit.Aer.get_backend("""aer_simulator"""				)

							# Create a Quantum Circuit acting on the q register
							_snake_case       =  qiskit.QuantumCircuit(_SCREAMING_SNAKE_CASE							, _SCREAMING_SNAKE_CASE				)

							# Apply X (NOT) Gate to Qubits 0 & 1
							circuit.x(0				)
							circuit.x(1				)

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

							# Execute the circuit on the qasm simulator
							_snake_case       =  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__":
				__lowerCAmelCase												=	single_qubit_measure(2, 2)
				print(f'''Total count for various states are: {counts}''')