

"""simple docstring"""


import unittest

import numpy as np

from transformers import is_tf_available
from transformers.testing_utils import require_tf


if is_tf_available():
			import tensorflow as tf

			from transformers.activations_tf import get_tf_activation





@require_tf
class 					snake_case			(       unittest.TestCase						):

				def 							lowercase_  (			self							:       Tuple)->     Tuple:



						'''simple docstring'''


						__lowerCAmelCase: Dict					   =    tf.constant([-1_0_0, -1.0, -0.1, 0, 0.1, 1.0, 100.0])
						__lowerCAmelCase: List[str]					   =    get_tf_activation("gelu")
						__lowerCAmelCase: Optional[int]					   =    get_tf_activation("gelu_10")

						__lowerCAmelCase: Any					   =    gelu(UpperCamelCase__)
						__lowerCAmelCase: List[Any]					   =    geluaa(UpperCamelCase__)

						__lowerCAmelCase: Union[str, Any]					   =    tf.where(y_gelu_aa < 10.0  ,						1.0  ,						0.0)

						self.assertEqual(tf.math.reduce_max(UpperCamelCase__).numpy().item()  ,						10.0)
						self.assertTrue(np.allclose(y_gelu * clipped_mask  ,						y_gelu_aa * clipped_mask))




				def 							lowercase_  (			self							:       int)->     Union[str, Any]:



						'''simple docstring'''


						get_tf_activation("gelu")
						get_tf_activation("gelu_10")
						get_tf_activation("gelu_fast")
						get_tf_activation("gelu_new")
						get_tf_activation("glu")
						get_tf_activation("mish")
						get_tf_activation("quick_gelu")
						get_tf_activation("relu")
						get_tf_activation("sigmoid")
						get_tf_activation("silu")
						get_tf_activation("swish")
						get_tf_activation("tanh")
						with self.assertRaises(UpperCamelCase__):
								get_tf_activation("bogus")
						with self.assertRaises(UpperCamelCase__):
								get_tf_activation(UpperCamelCase__)





"""simple docstring"""


import math

import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute






def 					a__					(					__SCREAMING_SNAKE_CASE = 1      ,				__SCREAMING_SNAKE_CASE = 1				)			->			qiskit.result.counts.Counts:
		if isinstance(__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE				) or isinstance(__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE				):
				raise TypeError("inputs must be integers."				)
		if (bit_a < 0) or (bit_a < 0):
				raise ValueError("inputs must be positive."				)
		if (math.floor(__SCREAMING_SNAKE_CASE				) != bit_a) or (math.floor(__SCREAMING_SNAKE_CASE				) != bit_a):
				raise ValueError("inputs must be exact integers."				)
		if (bit_a > 1) or (bit_a > 1):
				raise ValueError("inputs must be less or equal to 1."				)

		# build registers
		__lowerCAmelCase: str					   =    QuantumRegister(2      ,				"qr"				)
		__lowerCAmelCase: Optional[Any]					   =    ClassicalRegister(2      ,				"cr"				)

		__lowerCAmelCase: Dict					   =    QuantumCircuit(__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE				)

		# entanglement the qubits
		quantum_circuit.h(1				)
		quantum_circuit.cx(1      ,				0				)

		# send the information
		__lowerCAmelCase: Dict					   =    str(__SCREAMING_SNAKE_CASE				) + str(__SCREAMING_SNAKE_CASE				)

		if c_information == "11":
				quantum_circuit.x(1				)
				quantum_circuit.z(1				)
		elif c_information == "10":
				quantum_circuit.z(1				)
		elif c_information == "01":
				quantum_circuit.x(1				)
		else:
				quantum_circuit.i(1				)

		# unentangled the circuit
		quantum_circuit.cx(1      ,				0				)
		quantum_circuit.h(1				)

		# measure the circuit
		quantum_circuit.measure(__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE				)

		__lowerCAmelCase: List[str]					   =    Aer.get_backend("aer_simulator"				)
		__lowerCAmelCase: Dict					   =    execute(__SCREAMING_SNAKE_CASE      ,				__SCREAMING_SNAKE_CASE      ,				shots=1_0_0_0				)

		return job.result().get_counts(__SCREAMING_SNAKE_CASE				)


if __name__ == "__main__":
			print(F'''Counts for classical state send: {superdense_coding(1,1)}''')


