


from manim import *
class       UpperCAmelCase_   (   UpperCamelCase       ):

   '''simple docstring'''




   def _snake_case       (						self					):






     """simple docstring"""





     lowerCamelCase					:   Any       =							Rectangle(height=0.5		,							width=0.5					)
     lowerCamelCase					:   Dict       =							Rectangle(height=0.46		,							width=0.46					).set_stroke(width=0					)

     lowerCamelCase					:   Tuple       =							[mem.copy() for i in range(6					)]
     lowerCamelCase					:   int       =							[mem.copy() for i in range(6					)]
     lowerCamelCase					:   List[Any]       =							VGroup(*lowerCamelCase_					).arrange(lowerCamelCase_		,							buff=0					)
     lowerCamelCase					:   List[str]       =							VGroup(*lowerCamelCase_					).arrange(lowerCamelCase_		,							buff=0					)
     lowerCamelCase					:   Any       =							VGroup(lowerCamelCase_		,							lowerCamelCase_					).arrange(lowerCamelCase_		,							buff=0					)
     lowerCamelCase					:   str       =							Text("CPU"		,							font_size=24					)
     lowerCamelCase					:   Optional[Any]       =							Group(lowerCamelCase_		,							lowerCamelCase_					).arrange(lowerCamelCase_		,							buff=0.5		,							aligned_edge=lowerCamelCase_					)
     cpu.move_to([-2.5, -0.5, 0]					)
     self.add(lowerCamelCase_					)

     lowerCamelCase					:   Dict       =							[mem.copy() for i in range(4					)]
     lowerCamelCase					:   Optional[int]       =							VGroup(*lowerCamelCase_					).arrange(lowerCamelCase_		,							buff=0					)
     lowerCamelCase					:   Optional[Any]       =							Text("GPU"		,							font_size=24					)
     lowerCamelCase					:   Optional[int]       =							Group(lowerCamelCase_		,							lowerCamelCase_					).arrange(lowerCamelCase_		,							buff=0.5		,							aligned_edge=lowerCamelCase_					)
     gpu.move_to([-1, -1, 0]					)
     self.add(lowerCamelCase_					)

     lowerCamelCase					:   Optional[int]       =							[mem.copy() for i in range(6					)]
     lowerCamelCase					:   str       =							VGroup(*lowerCamelCase_					).arrange(lowerCamelCase_		,							buff=0					)

     lowerCamelCase					:   Optional[Any]       =							Text("Model"		,							font_size=24					)
     lowerCamelCase					:   Optional[int]       =							Group(lowerCamelCase_		,							lowerCamelCase_					).arrange(lowerCamelCase_		,							buff=0.5		,							aligned_edge=lowerCamelCase_					)
     model.move_to([3, -1.0, 0]					)
     self.add(lowerCamelCase_					)

     lowerCamelCase					:   Union[str, Any]       =							[]
     for i, rect in enumerate(lowerCamelCase_					):
       rect.set_stroke(lowerCamelCase_					)
       # target = fill.copy().set_fill(YELLOW, opacity=0.7)
       # target.move_to(rect)
       # self.add(target)

       lowerCamelCase					:   Any       =							Rectangle(height=0.46 / 4		,							width=0.46 / 3					).set_stroke(width=0.0					).set_fill(lowerCamelCase_		,							opacity=0.7					)

       if i == 0:
         cpu_target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT					)		,							buff=0.02		,							direction=lowerCamelCase_					)
         cpu_target.set_x(cpu_target.get_x() + 0.1					)
       elif i == 3:
         cpu_target.next_to(cpu_targs[0]		,							direction=lowerCamelCase_		,							buff=0.0					)
       else:
         cpu_target.next_to(cpu_targs[i - 1]		,							direction=lowerCamelCase_		,							buff=0.0					)
       self.add(lowerCamelCase_					)
       cpu_targs.append(lowerCamelCase_					)

     lowerCamelCase					:   Dict       =							[mem.copy() for i in range(6					)]
     lowerCamelCase					:   Any       =							VGroup(*lowerCamelCase_					).arrange(lowerCamelCase_		,							buff=0					)

     lowerCamelCase					:   Dict       =							Text("Loaded Checkpoint"		,							font_size=24					)
     lowerCamelCase					:   Dict       =							Group(lowerCamelCase_		,							lowerCamelCase_					).arrange(lowerCamelCase_		,							aligned_edge=lowerCamelCase_		,							buff=0.4					)
     checkpoint.move_to([3, 0.5, 0]					)

     lowerCamelCase					:   List[str]       =							Square(side_length=2.2					)
     key.move_to([-5, 2, 0]					)

     lowerCamelCase					:   Dict       =							MarkupText(
         F"""<b>Key:</b>\n\n<span fgcolor=\'{YELLOW}\'>●</span> Empty Model"""		,							font_size=18		,							)

     key_text.move_to([-5, 2.4, 0]					)

     self.add(lowerCamelCase_		,							lowerCamelCase_					)

     lowerCamelCase					:   str       =							MarkupText(
         F"""<span fgcolor=\'{BLUE}\'>●</span> Checkpoint"""		,							font_size=18		,							)

     blue_text.next_to(lowerCamelCase_		,							DOWN * 2.4		,							aligned_edge=key_text.get_left()					)

     lowerCamelCase					:   Tuple       =							MarkupText(
         F"""Next, a <i><span fgcolor=\"{BLUE}\">second</span></i> model is loaded into memory,\nwith the weights of a <span fgcolor=\"{BLUE}\">single shard</span>."""		,							font_size=24		,							)
     step_a.move_to([2, 2, 0]					)
     self.play(Write(lowerCamelCase_					)		,							Write(lowerCamelCase_					)					)

     self.play(Write(lowerCamelCase_		,							run_time=1					)		,							Create(lowerCamelCase_		,							run_time=1					)					)

     lowerCamelCase					:   int       =							[]
     lowerCamelCase					:   Dict       =							[]
     for i, rect in enumerate(lowerCamelCase_					):
       lowerCamelCase					:   Dict       =							fill.copy().set_fill(lowerCamelCase_		,							opacity=0.7					)
       target.move_to(lowerCamelCase_					)
       first_animations.append(GrowFromCenter(lowerCamelCase_		,							run_time=1					)					)

       lowerCamelCase					:   List[str]       =							target.copy()
       cpu_target.generate_target()
       if i < 5:
         cpu_target.target.move_to(cpu_left_col_base[i + 1]					)
       else:
         cpu_target.target.move_to(cpu_right_col_base[i - 5]					)
       second_animations.append(MoveToTarget(lowerCamelCase_		,							run_time=1.5					)					)

     self.play(*lowerCamelCase_					)
     self.play(*lowerCamelCase_					)
     self.wait()






"""simple docstring"""


import qiskit



def   _A					(	_a	:						int     ,   _a	:						int				):



      """simple docstring"""






      A				  =		qiskit.Aer.get_backend("""aer_simulator"""				)

      # Create a Quantum Circuit acting on the q register
      A				  =		qiskit.QuantumCircuit(_a     ,   _a				)

      # Apply X (NOT) Gate to Qubits 0 & 1
      circuit.x(0				)
      circuit.x(1				)

      # Map the quantum measurement to the classical bits
      circuit.measure([0, 1]     ,   [0, 1]				)

      # Execute the circuit on the qasm simulator
      A				  =		qiskit.execute(_a     ,   _a     ,   shots=1_0_0_0				)

      # Return the histogram data of the results of the experiment.
      return job.result().get_counts(_a				)


if __name__ == "__main__":
  UpperCAmelCase													=single_qubit_measure(2, 2)
  print(f"""Total count for various states are: {counts}""")




