


import qiskit







def 						lowerCamelCase(   a__ = 2):
				_SCREAMING_SNAKE_CASE			  =qubits

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

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

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

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

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

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

				return job.result().get_counts(a__)


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



from datetime import datetime

import matplotlib.pyplot as plt
import torch







def 						lowerCamelCase(   a__):
				for param in module.parameters():
								_SCREAMING_SNAKE_CASE			  =False







def 						lowerCamelCase(   ):
				_SCREAMING_SNAKE_CASE			  ='''cuda''' if torch.cuda.is_available() else '''cpu'''
				if torch.backends.mps.is_available() and torch.backends.mps.is_built():
								_SCREAMING_SNAKE_CASE			  ='''mps'''
				if device == "mps":
								print(
								    '''WARNING: MPS currently doesn\'t seem to work, and messes up backpropagation without any visible torch'''
								    ''' errors. I recommend using CUDA on a colab notebook or CPU instead if you\'re facing inexplicable issues'''
								    ''' with generations.''')
				return device







def 						lowerCamelCase(   a__):
				_SCREAMING_SNAKE_CASE			  =plt.imshow(a__)
				fig.axes.get_xaxis().set_visible(a__)
				fig.axes.get_yaxis().set_visible(a__)
				plt.show()







def 						lowerCamelCase(   ):
				_SCREAMING_SNAKE_CASE			  =datetime.now()
				_SCREAMING_SNAKE_CASE			  =current_time.strftime('''%H:%M:%S''')
				return timestamp