






'''simple docstring'''





import qiskit






def    lowerCamelCase_     (    lowercase__ = 2):
 lowerCamelCase__  =     qubits

 # Using Aer's simulator
 lowerCamelCase__  =     qiskit.Aer.get_backend("aer_simulator")

 # Creating a Quantum Circuit acting on the q register
 lowerCamelCase__  =     qiskit.QuantumCircuit(lowercase__				,     lowercase__)

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

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

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

 # 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
 lowerCamelCase__  =     qiskit.execute(lowercase__				,     lowercase__				,     shots=1000)

 return job.result().get_counts(lowercase__)


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













'''simple docstring'''





from decimal import Decimal, getcontext
from math import ceil, factorial






def    lowerCamelCase_     (    lowercase__):

 if not isinstance(lowercase__				,     lowercase__):
  raise TypeError("Undefined for non-integers")
 elif precision < 1:
  raise ValueError("Undefined for non-natural numbers")

 lowerCamelCase__  =     precision
 lowerCamelCase__  =     ceil(precision / 14)
 lowerCamelCase__  =     426880 * Decimal(10005).sqrt()
 lowerCamelCase__  =     1
 lowerCamelCase__  =     13591409
 lowerCamelCase__  =     Decimal(lowercase__)
 for k in range(1				,     lowercase__):
  lowerCamelCase__  =     factorial(6 * k) // (factorial(3 * k) * factorial(lowercase__) ** 3)
  linear_term += 545140134
  exponential_term *= -262537412640768000
  partial_sum += Decimal(multinomial_term * linear_term) / exponential_term
 return str(constant_term / partial_sum)[:-1]


if __name__ == "__main__":
 __A							:							Dict  							=		50
 print(F"""The first {n} digits of pi is: {pi(n)}""")

