


import math

import numpy as np
import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute






def 		lowercase_(  SCREAMING_SNAKE_CASE_ = 3	):


  '''simple docstring'''

  if isinstance(SCREAMING_SNAKE_CASE_      ,						SCREAMING_SNAKE_CASE_	):
    raise TypeError("number of qubits must be a integer."	)
  if number_of_qubits <= 0:
    raise ValueError("number of qubits must be > 0."	)
  if math.floor(SCREAMING_SNAKE_CASE_	) != number_of_qubits:
    raise ValueError("number of qubits must be exact integer."	)
  if number_of_qubits > 10:
    raise ValueError("number of qubits too large to simulate(>10)."	)

  lowerCamelCase :					Tuple    =				QuantumRegister(SCREAMING_SNAKE_CASE_      ,						"qr"	)
  lowerCamelCase :					Union[str, Any]    =				ClassicalRegister(SCREAMING_SNAKE_CASE_      ,						"cr"	)

  lowerCamelCase :					Dict    =				QuantumCircuit(SCREAMING_SNAKE_CASE_      ,						SCREAMING_SNAKE_CASE_	)

  lowerCamelCase :					List[Any]    =				number_of_qubits

  for i in range(SCREAMING_SNAKE_CASE_	):
    quantum_circuit.h(number_of_qubits - i - 1	)
    counter -= 1
    for j in range(SCREAMING_SNAKE_CASE_	):
      quantum_circuit.cp(np.pi / 2 ** (counter - j)      ,						SCREAMING_SNAKE_CASE_      ,						SCREAMING_SNAKE_CASE_	)

  for k in range(number_of_qubits // 2	):
    quantum_circuit.swap(SCREAMING_SNAKE_CASE_      ,						number_of_qubits - k - 1	)

  # measure all the qubits
  quantum_circuit.measure(SCREAMING_SNAKE_CASE_      ,						SCREAMING_SNAKE_CASE_	)
  # simulate with 10000 shots
  lowerCamelCase :					Optional[int]    =				Aer.get_backend("qasm_simulator"	)
  lowerCamelCase :					Any    =				execute(SCREAMING_SNAKE_CASE_      ,						SCREAMING_SNAKE_CASE_      ,						shots=10000	)

  return job.result().get_counts(SCREAMING_SNAKE_CASE_	)


if __name__ == "__main__":
   print(
       f'''Total count for quantum fourier transform state is: \
    {quantum_fourier_transform(3)}'''
   )




import requests





def 				UpperCAmelCase						(    lowercase							,			lowercase							):







				"""simple docstring"""



				__lowercase 			=							{'''Content-Type''': '''application/json'''}
				__lowercase 			=							requests.post(lowercase							,			json={'''text''': message_body}							,			headers=lowercase							)
				if response.status_code != 200:
								__lowercase 			=							(
								    '''Request to slack returned an error '''
								    F"{response.status_code}, the response is:\n{response.text}"
								)
								raise ValueError(lowercase							)


if __name__ == "__main__":
		# Set the slack url to the one provided by Slack when you create the webhook at
		# https://my.slack.com/services/new/incoming-webhook/
		send_slack_message("""<YOUR MESSAGE BODY>""", """<SLACK CHANNEL URL>""")