


import copy
from typing import Dict

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING
from ..bit import BitConfig


_A		:					Union[str, Any]          =							logging.get_logger(__name__)

_A		:					Optional[int]          =							{
    '''google/vit-hybrid-base-bit-384''': '''https://huggingface.co/vit-hybrid-base-bit-384/resolve/main/config.json''',
    # See all ViT hybrid models at https://huggingface.co/models?filter=vit
}



class 							a       (      _UpperCAmelCase ):
     UpperCAmelCase__			:	Dict       =						"vit-hybrid"





     def __init__(     self       :					Union[str, Any]     ,						SCREAMING_SNAKE_CASE_       :					List[Any]=None     ,						SCREAMING_SNAKE_CASE_       :					List[str]=768     ,						SCREAMING_SNAKE_CASE_       :					Dict=12     ,						SCREAMING_SNAKE_CASE_       :					Optional[int]=12     ,						SCREAMING_SNAKE_CASE_       :					str=3072     ,						SCREAMING_SNAKE_CASE_       :					Optional[Any]="gelu"     ,						SCREAMING_SNAKE_CASE_       :					Union[str, Any]=0.0     ,						SCREAMING_SNAKE_CASE_       :					List[Any]=0.0     ,						SCREAMING_SNAKE_CASE_       :					str=0.02     ,						SCREAMING_SNAKE_CASE_       :					List[str]=1E-1_2     ,						SCREAMING_SNAKE_CASE_       :					Tuple=224     ,						SCREAMING_SNAKE_CASE_       :					int=1     ,						SCREAMING_SNAKE_CASE_       :					Dict=3     ,						SCREAMING_SNAKE_CASE_       :					Union[str, Any]=[1, 1024, 24, 24]     ,						SCREAMING_SNAKE_CASE_       :					Tuple=True     ,						**SCREAMING_SNAKE_CASE_       :					str     ,						):
        super().__init__(**lowercase__				)

        if backbone_config is None:
           logger.info("""`backbone_config` is `None`. Initializing the config with a `BiT` backbone."""				)
           __lowerCamelCase:					int	 =						{
               """global_padding""": """same""",
               """layer_type""": """bottleneck""",
               """depths""": [3, 4, 9],
               """out_features""": ["""stage3"""],
               """embedding_dynamic_padding""": True,
           }

        if isinstance(lowercase__     ,						lowercase__				):
           if "model_type" in backbone_config:
              __lowerCamelCase:					Any	 =						CONFIG_MAPPING[backbone_config["""model_type"""]]
           else:
              logger.info(
                  """`model_type` is not found in `backbone_config`. Use `Bit` as the backbone configuration class."""				)
              __lowerCamelCase:					Any	 =						BitConfig
           __lowerCamelCase:					int	 =						backbone_config_class(**lowercase__				)

        __lowerCamelCase:					str	 =						backbone_featmap_shape
        __lowerCamelCase:					int	 =						backbone_config
        __lowerCamelCase:					Tuple	 =						hidden_size
        __lowerCamelCase:					List[Any]	 =						num_hidden_layers
        __lowerCamelCase:					List[str]	 =						num_attention_heads
        __lowerCamelCase:					Optional[Any]	 =						intermediate_size
        __lowerCamelCase:					str	 =						hidden_act
        __lowerCamelCase:					int	 =						hidden_dropout_prob
        __lowerCamelCase:					Tuple	 =						attention_probs_dropout_prob
        __lowerCamelCase:					Dict	 =						initializer_range
        __lowerCamelCase:					List[str]	 =						layer_norm_eps
        __lowerCamelCase:					Dict	 =						image_size
        __lowerCamelCase:					Optional[int]	 =						patch_size
        __lowerCamelCase:					Tuple	 =						num_channels
        __lowerCamelCase:					Union[str, Any]	 =						qkv_bias







     def 			SCREAMING_SNAKE_CASE__							(     self       :					Optional[Any]				):
        __lowerCamelCase:					Dict	 =						copy.deepcopy(self.__dict__				)
        __lowerCamelCase:					int	 =						self.backbone_config.to_dict()
        __lowerCamelCase:					int	 =						self.__class__.model_type
        return output




"""simple docstring"""




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

def     UpperCamelCase_    (						SCREAMING_SNAKE_CASE_ = np.pi / 2,	SCREAMING_SNAKE_CASE_ = np.pi / 2,	SCREAMING_SNAKE_CASE_ = np.pi / 2     ):
					SCREAMING_SNAKE_CASE           =      QuantumRegister(3,	'qr'     )  # Define the number of quantum bits
					SCREAMING_SNAKE_CASE           =      ClassicalRegister(1,	'cr'     )  # Define the number of classical bits

					SCREAMING_SNAKE_CASE           =      QuantumCircuit(SCREAMING_SNAKE_CASE_,	SCREAMING_SNAKE_CASE_     )  # Define the quantum circuit.

					# Build the circuit
					quantum_circuit.u(SCREAMING_SNAKE_CASE_,	SCREAMING_SNAKE_CASE_,	SCREAMING_SNAKE_CASE_,	0     )  # Quantum State to teleport
					quantum_circuit.h(1     )  # add hadamard gate
					quantum_circuit.cx(
					    1,	2     )  # add control gate with qubit 1 as control and 2 as target.
					quantum_circuit.cx(0,	1     )
					quantum_circuit.h(0     )
					quantum_circuit.cz(0,	2     )  # add control z gate.
					quantum_circuit.cx(1,	2     )

					quantum_circuit.measure([2],	[0]     )  # measure the qubit.

					# Simulate the circuit using qasm simulator
					SCREAMING_SNAKE_CASE           =      Aer.get_backend('aer_simulator'     )
					SCREAMING_SNAKE_CASE           =      execute(SCREAMING_SNAKE_CASE_,	SCREAMING_SNAKE_CASE_,	shots=1_0_0_0     )

					return job.result().get_counts(SCREAMING_SNAKE_CASE_     )


if __name__ == "__main__":
	print(
	    'Total count for teleported state is: '
	    f'{quantum_teleportation(np.pi/2, np.pi/2, np.pi/2)}'
	)
