+
    åûjXQ  ã                  óÈ   € ^ RI Ht ^ RIHt ^ RIHtHtHt ^ RIt^ RIH	t	 ^ RI
HtHtHt ^ RIHt ^ RIHt ^ R	IHtHtHt ^ R
IHt R R lt ! R R]	P2                  4      tR# )é    )Úannotations)ÚCallable)ÚOptionalÚUnionÚoverloadN)Únn)ÚKORNIA_CHECKÚKORNIA_CHECK_IS_TENSORÚKORNIA_CHECK_SHAPE)ÚTypeCheckError)Ú_unwrap)Ú_deepcopy_module_stateÚis_compilingÚregister_module_state)ÚVector2c               ó$   € V ^8„  d   QhRRRRRR/# )é   Úrealútorch.TensorÚimagÚreturn© )Úformats   "ÚXC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\geometry\liegroup\so2.pyÚ__annotate__r   #   s!   € ÷ 
%ñ 
%˜Lð 
%°ð 
%Àñ 
%ó    c                óº   € \         P                  V P                  VP                  39   d   \        R\         P                  R7      h\         P                  ! W4      # )zhBuild the complex ``z`` an So2 stores, rejecting bfloat16 parts, for which PyTorch has no complex dtype.zýSo2 stores its rotation as a complex tensor, and PyTorch has no complex bfloat16 dtype; got a bfloat16 real or imaginary part. Build the rotation in float16, float32 or float64; `.bfloat16()` on a built So2 or Se2 keeps the rotation's complex precision.©Úactual_type)ÚtorchÚbfloat16Údtyper   Úcomplex)r   r   s   &&r   Ú_complex_rotationr$   #   sG   € ä‡~�~˜$Ÿ*™* d§j¡jÐ1Ô1äð=ô Ÿ™ô	
ð 	
ô �=Š=˜Ó$Ð$r   c                  ón  a € ] tR t^0tRt]tR V 3R lltR'R V 3R llltR R lt	R R	 lt
]R
 R l4       t]R R l4       tR R lt]R R l4       t]R R l4       tR R lt]R R l4       t]R R l4       tR R lt]R R l4       t]R(R R ll4       tR  R! lt]R(R" R# ll4       tR$ R% ltR&tV ;t# ))ÚSo2a•  Represent a 2D rotation as an SO(2) Lie group element stored as a complex number.

``r = So2.exp(theta)`` builds rotations from angles ``theta`` in radians, ``()`` or ``(B,)``, and ``So2(z)`` wraps
complex numbers ``z`` of shape ``()``, ``(B,)`` or ``(B, 1)``, read as ``(B,)``; ``So2.identity(B)`` and
``So2.random(B)`` build ``B`` rotations, or an unbatched one with ``batch_size=None``. ``r * p`` rotates points
``p`` as :math:`R p`, ``r1 * r2`` composes, ``r.inverse()`` inverts, ``r.log()`` returns the angles and
``r.matrix()`` the ``(B, 2, 2)`` matrices (``(2, 2)`` unbatched). An unbatched rotation maps ``(2,)`` or
``(N, 2)`` points, and a batch of ``B`` maps ``(B, 2)``, one point per rotation, or a single ``(2,)`` point. For a
rotation and a translation, use :class:`Se2`; for 3D rotations, :class:`So3`.

SO(2) is the group of rotations of :math:`R^2` about the origin under composition; see
https://en.wikipedia.org/wiki/Orthogonal_group#Special_orthogonal_group.

Convention:
    - For unit :math:`z = \cos\theta + i \sin\theta`, ``matrix()`` is
      :math:`[[\cos\theta, -\sin\theta], [\sin\theta, \cos\theta]]`. Non-unit ``z = a + i b``
      is accepted and produces :math:`[[a, -b], [b, a]]`, which rotates and scales by :math:`|z|`. The complex
      storage has no bfloat16 counterpart in PyTorch, so ``exp``, ``identity``, ``random`` and ``from_matrix``
      raise ``TypeCheckError`` for bfloat16 values.
    - A positive angle rotates the x axis toward the y axis: counter-clockwise in a y-up frame, clockwise as
      displayed on y-down image axes. For a unit rotation, ``matrix()`` is the transpose of
      :func:`~kornia.geometry.conversions.angle_to_rotation_matrix`, which takes degrees.
      ``log`` returns the angle in :math:`[-\pi, \pi]`, and ``adjoint()`` is the 2x2 identity.
    - ``a * b`` composes like ``a.matrix() @ b.matrix()``, so ``b`` acts first; an unbatched rotation composes
      with each rotation of a batch.
    - ``hat`` returns the so(2) generator :math:`[[0, -\theta], [\theta, 0]]` and ``vee`` reads its ``[1, 0]``
      entry, so ``matrix_exp(hat(theta))`` equals ``exp(theta).matrix()``.
    - Module dtype conversions act on the real and imaginary components together: ``.float()`` and
      ``.to(torch.float32)`` use complex64 state, while ``.double()`` and ``.to(torch.float64)`` use complex128.
      Device-only conversions preserve the complex precision, and explicit complex dtypes are also accepted.
      The complex checkpoint key ``_z`` and its shape are unchanged. ``.half()`` uses PyTorch's experimental
      complex32 dtype, which torch's CUDA ``foreach`` SGD step does not support: build a ``torch.optim.SGD``
      of a CUDA complex32 rotation with ``foreach=False``. Since PyTorch has no complex bfloat16 dtype,
      ``.bfloat16()`` and ``.to(torch.bfloat16)`` keep the rotation's existing complex precision while
      following any requested device move.
    - ``copy.deepcopy`` holds a ``z`` with autograd history, as from ``exp(theta)`` for a ``theta`` that
      requires grad, as a new leaf that keeps ``requires_grad``, as for
      :class:`~kornia.geometry.quaternion.Quaternion`.

See Also:
    - :class:`So3`: the 3D rotation group, stored as a quaternion.
    - :class:`Se2`: a 2D rotation followed by a translation, mapping points as :math:`R p + t`.
    - :func:`~kornia.geometry.conversions.angle_to_rotation_matrix`: a ``(*, 2, 2)`` matrix from an angle in
      degrees on a plain tensor, the transpose of :meth:`matrix` for the same angle.

Example:
    >>> real = torch.tensor([0.6])
    >>> imag = torch.tensor([0.8])
    >>> So2(torch.complex(real, imag))
    Parameter containing:
    tensor([0.6000+0.8000j], requires_grad=True)

c               ó    € V ^8„  d   QhRRRR/# )r   Úzr   r   ÚNoner   )r   s   "r   r   ÚSo2.__annotate__j   s   € ÷ #-ñ #-˜,ð #-¨4ñ #-r   c                ó˜  <€ \         SV `  4        \        V4       VP                  4       '       g&   \	        RVP
                   R2VP
                  R7      h\        VP                  4      ^ 8H  p\        VR.RR7      p\        VRR.RR7      pV'       g)   V'       g!   V'       g   \        RVP                   24      h\        V R	V4       R
# )aÐ  Construct an So2 from complex numbers ``z``, stored as given.

Args:
    z: Complex number with the shape of ``(B,)`` or ``()``; ``(B, 1)`` is read as ``(B,)``.

Raises:
    TypeCheckError: if ``z`` is not a complex tensor (an integer, bool or real floating-point tensor).

Example:
    >>> real = torch.tensor(0.6)
    >>> imag = torch.tensor(0.8)
    >>> So2(torch.complex(real, imag)).z
    Parameter containing:
    tensor(0.6000+0.8000j, requires_grad=True)

z(So2 stores 'z' as a complex tensor; got z,. Build it with `torch.complex(real, imag)`.r   ÚBF©ÚraisesÚ1ú7Invalid input size, we expect [], [B], or [B, 1]. Got: Ú_zN)ÚsuperÚ__init__r
   Ú
is_complexr   r"   ÚlenÚshaper   Ú
ValueErrorr   )Úselfr(   Ú	is_scalarÚis_flatÚ	is_columnÚ	__class__s   &&   €r   r3   ÚSo2.__init__j   s®   ø€ ô" 	‰ÑÔÜ˜qÔ!Ø�|‰|�~Š~ä Ø:¸1¿7¹7¸)ÐCoÐpØŸG™Gôð ô
 ˜Ÿ™“L AÑ%ˆ	Ü$ Q¨¨°eÔ<ˆÜ& q¨3°¨*¸UÔCˆ	çŸW¯	ÜÐVÐWX×W^ÑW^ÐV_Ð`ÓaÐaô 	˜d D¨!Ö,r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úfnz&Callable[[torch.Tensor], torch.Tensor]ÚrecurseÚboolr   r&   r   )r   s   "r   r   r*   �   s#   € ÷ 8ñ 8Ð?ð 8È$ð 8ÐZ]ñ 8r   c                	ó8   <a€ R  V3R llp\         SV `  W2R7      # )c               ó    € V ^8„  d   QhRRRR/# )r   Útensorr   r   r   )r   s   "r   r   Ú So2._apply.<locals>.__annotate__�   s   € ÷ 	4ñ 	4˜Lð 	4¨\ñ 	4r   c                ó„  <€ V P                  4       '       g	   S! V 4      # \        P                  ! V P                  4       4      pS! V4      pVP                  4       '       d	   S! V 4      # W!J d   V # VP                  \        P
                  8X  d   V P                  VP                  R 7      # \        P                  ! V4      # ))Údevice)	r4   r    Úview_as_realÚresolve_conjr"   r!   ÚtorG   Úview_as_complex)rD   Ú
componentsÚ	convertedr?   s   &  €r   ÚconvertÚSo2._apply.<locals>.convert�   sš   ø€ Ø×$Ñ$×&Ò&Ù˜&“zÐ!ä×+Ò+¨F×,?Ñ,?Ó,AÓBˆJÙ˜:›ˆIØ×#Ñ#×%Ò%Ù˜&“zÐ!ØÓ&Ø�Ø�‰¤%§.¡.Ô0à—y‘y¨	×(8Ñ(8�yÓ9Ð9Ü×(Ò(¨Ó3Ð3r   )r@   )r2   Ú_apply)r8   r?   r@   rN   r<   s   &f& €r   rP   Ú
So2._apply�   s    ù€ ÷	4ð 	4ô  ‰w‰~˜gˆ~Ó7Ð7r   c               ó   € V ^8„  d   QhRR/# )r   r   Ústrr   )r   s   "r   r   r*   ¢   s   € ÷ ñ ˜#ñ r   c                	ó   € V P                    # ©N)r(   ©r8   s   &r   Ú__repr__ÚSo2.__repr__¢   s   € Ø—&‘&�Ðr   c               ó    € V ^8„  d   QhRRRR/# )r   Úidxzint | slicer   r&   r   )r   s   "r   r   r*   ¥   s   € ÷  ñ  ˜{ð  ¨sñ  r   c                	ó:   € \        V P                  V,          4      # rU   )r&   r(   )r8   rZ   s   &&r   Ú__getitem__ÚSo2.__getitem__¥   s   € Ü�4—6‘6˜#•;ÓÐr   c               ó    € V ^8„  d   QhRRRR/# )r   Úrightr&   r   r   )r   s   "r   r   r*   ©   s   € ×-Ñ-˜SÐ- SÑ-r   c                	ó   € R # rU   r   ©r8   r_   s   &&r   Ú__mul__ÚSo2.__mul__¨   s   € Ù*-r   c               ó    € V ^8„  d   QhRRRR/# )r   r_   r   r   r   )r   s   "r   r   r*   ¬   s   € ×?Ñ?˜\Ð?¨lÑ?r   c                	ó   € R # rU   r   ra   s   &&r   rb   rc   «   s   € Ù<?r   c               ó    € V ^8„  d   QhRRRR/# )r   r_   zSo2 | torch.Tensorr   r   )r   s   "r   r   r*   ®   s    € ÷ &Mñ &MÐ/ð &MÐ4Fñ &Mr   c                ó  € V P                   p\        V\        4      '       d   \        W!P                   ,          4      # \        V\        \        P
                  34      '       Ed�   \        V\        P
                  4      '       dÌ   \        VRR.RR7      p\        VR.RR7      pV'       d]   VP                  4       ^8X  dH   VP                  ^ ,          VP                  ^ ,          ^39   ;'       g    VP                  ^ ,          ^8H  pV'       gA   V'       g9   \        R\        VP                  4       R\        VP                  4       R24      h\        V4      pVR	,          pVR
,          pVP                  pVP                  p	\        P                  ! W†,          W—,          ,
          W–,          W‡,          ,           3R4      p
\        V\        P
                  4      '       d   V
# \        V
4      # \        R\!        V4       24      h)aÇ  Perform a left-multiplication either rotation concatenation or point-transform.

Args:
    right: the other So2 transformation, or points as a tensor or a ``Vector2``: ``(2,)`` or ``(N, 2)``
        for an unbatched rotation, ``(B, 2)``, one point per rotation, or a single ``(2,)`` point for a
        batch of ``B`` (a batch of one also maps ``(N, 2)``).

Return:
    The resulting So2 transformation, or the rotated points with the type of ``right``.

r,   Ú2Fr-   zåExpected points of shape (2,) or (N, 2) for an unbatched pose, or (B, 2), one point per pose, for a batch of B poses (a batch of one pose also maps (N, 2), and one point (2,) or (1, 2) maps under every pose). Got points of shape z for a pose of batch shape Ú.z#Not So2 or torch.Tensor type. Got: ).r   ).é   éÿÿÿÿ)r(   Ú
isinstancer&   r   r    ÚTensorr   Údimr6   r7   Útupler   r   r   ÚstackÚ	TypeErrorÚtype)r8   r_   r(   Úis_batch_shapeÚis_single_shapeÚ
right_dataÚxÚyr   r   Úouts   &&         r   rb   rc   ®   s‹  € ð �F‰FˆÜ�eœS×!Ò!Ü�qŸ7™7•{Ó#Ð#Ü�eœg¤u§|¡|Ð4×5Ó5Ü˜%¤§¡×.Ò.ä!3°E¸CÀ¸:ÈeÔ!T�Ü"4°U¸S¸EÈ%Ô"P�ß! a§e¡e£g°¤lØ%*§[¡[°¥^¸¿¹À½
ÀA°Ñ%F×%YÐ%YÈ!Ï'É'ÐRSÍ*ÐXYÉ/�Nß&¯/Ü$ðNäNSÐTY×T_ÑT_ÓN`ÐMað b!Ü!& q§w¡w£Ð 0°ð3óð ô ! ›ˆJØ˜6Õ"ˆAØ˜6Õ"ˆAØ—6‘6ˆDØ—6‘6ˆDÜ—+’+˜t�x¨$­(Õ2°DµH¸t½xÕ4GÐHÈ"ÓMˆCÜ˜%¤§¡×.Ò.Ø�
Ü˜3“<ÐÜÐ=¼dÀ5»k¸]ÐKÓLÐLr   c               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r   s   "r   r   r*   ×   s   € ÷ Fñ F�<ñ Fr   c                óŽ   € V P                   P                  4       ^8X  d   V P                   P                  R4      # V P                   # )zÃReturn the underlying complex number of shape ``()`` or ``(B,)``.

A ``(B, 1)`` ``z`` given to the constructor stays stored, and registered, as it was given, and is read
here as a ``(B,)`` view.
rk   )r1   rn   ÚsqueezerV   s   &r   r(   ÚSo2.zÖ   s1   € ð '+§g¡g§k¡k£m°qÔ&8ˆt�w‰w�‰˜rÓ"ÐE¸d¿g¹gÐEr   c               ó    € V ^8„  d   QhRRRR/# )r   Úthetar   r   r&   r   )r   s   "r   r   r*   à   s   € ÷ Jñ J�<ð J Cñ Jr   c                óJ  € \        V P                  4      ^ 8H  p\        V R.RR7      p\        V RR.RR7      pV'       g)   V'       g!   V'       g   \        RV P                   24      h\	        \        \        P                  ! V 4      \        P                  ! V 4      4      4      # )a˜  Convert elements of lie algebra to elements of lie group.

Args:
    theta: angle in radians of shape ``(B,)`` or ``()``; ``(B, 1)`` is squeezed to ``(B,)``.

Raises:
    TypeCheckError: if ``theta`` is bfloat16, which has no complex dtype in PyTorch.

Example:
    >>> v = torch.tensor([3.1415/2])
    >>> s = So2.exp(v)
    >>> s
    Parameter containing:
    tensor([4.6329e-05+1.j], requires_grad=True)

r,   Fr-   r/   r0   )	r5   r6   r   r7   r&   r$   r    ÚcosÚsin)r   r9   r:   r;   s   &   r   ÚexpÚSo2.expß   s€   € ô& ˜Ÿ™Ó$¨Ñ)ˆ	Ü$ U¨S¨E¸%Ô@ˆÜ& u¨s°C¨jÀÔGˆ	ßŸW¯	ÜÐVÐW\×WbÑWbÐVcÐdÓeÐeÜÔ$¤U§Y¢Y¨uÓ%5´u·y²yÀÓ7GÓHÓIÐIr   c               ó   € V ^8„  d   QhRR/# rz   r   )r   s   "r   r   r*   ù   s   € ÷ 
.ñ 
.�\ñ 
.r   c                ót   € V P                   P                  P                  V P                   P                  4      # )zçConvert elements of lie group to elements of lie algebra.

Example:
    >>> real = torch.tensor([0.6])
    >>> imag = torch.tensor([0.8])
    >>> So2(torch.complex(real, imag)).log()
    tensor([0.9273], grad_fn=<Atan2Backward0>)

)r(   r   Úatan2r   rV   s   &r   ÚlogÚSo2.logù   s%   € ð �v‰v�{‰{× Ñ  §¡§¡Ó-Ð-r   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   r   )r   s   "r   r   r*     s   € ÷ -ñ -�<ð - Lñ -r   c                óÀ  € \        V P                  4      ^ 8H  p\        V R.RR7      p\        V RR.RR7      pV'       g)   V'       g!   V'       g   \        RV P                   24      hV'       d   V P	                  R4      p \
        P                  ! V 4      p\
        P                  ! W@) 3R4      p\
        P                  ! W3R4      p\
        P                  ! WV3R4      # )añ  Convert an angle to the so(2) generator :math:`[[0, -\theta], [\theta, 0]]`, which :meth:`vee` inverts.

The output has shape ``(2, 2)`` or ``(B, 2, 2)``; a ``(B, 1)`` angle is squeezed to ``(B,)``.
Its matrix exponential is the rotation :meth:`exp` returns.

Args:
    theta: angle in radians of shape ``(B,)`` or ``()``; ``(B, 1)`` is squeezed to ``(B,)``.

Example:
    >>> theta = torch.tensor(3.1415/2)
    >>> So2.hat(theta)
    tensor([[ 0.0000, -1.5707],
            [ 1.5707,  0.0000]])

r,   Fr-   r/   r0   rk   éþÿÿÿ)r5   r6   r   r7   r|   r    Ú
zeros_likerp   )r   r9   r:   r;   r(   Úrow0Úrow1s   &      r   ÚhatÚSo2.hat  sµ   € ô$ ˜Ÿ™Ó$¨Ñ)ˆ	Ü$ U¨S¨E¸%Ô@ˆÜ& u¨s°C¨jÀÔGˆ	ßŸW¯	ÜÐVÐW\×WbÑWbÐVcÐdÓeÐeßØ—M‘M "Ó%ˆEÜ×Ò˜UÓ#ˆÜ�{Š{˜A˜v˜;¨Ó+ˆÜ�{Š{˜E˜: rÓ*ˆÜ�{Š{˜D˜<¨Ó,Ð,r   c               ó    € V ^8„  d   QhRRRR/# )r   Úomegar   r   r   )r   s   "r   r   r*   $  s   € ÷  ñ  �<ð   Lñ  r   c                ó¤   € \        V . RORR7      p\        V RR.RR7      pV'       g!   V'       g   \        RV P                   24      hV R,          # )a˜  Read the angle back from a :meth:`hat` matrix of shape ``(2, 2)`` or ``(B, 2, 2)``.

Returns a scalar or a ``(B,)`` vector, respectively.

It reads the ``[1, 0]`` entry, :math:`\theta` in the so(2) generator :math:`[[0, -\theta], [\theta, 0]]`.

Args:
    omega: 2x2-matrix built by :meth:`hat`.

Example:
    >>> v = torch.ones(3)
    >>> omega = So2.hat(v)
    >>> So2.vee(omega)
    tensor([1., 1., 1.])

rh   Fr-   ú8Invalid input size, we expect [B, 2, 2] or [2, 2]. Got: ©r,   rh   rh   ©.rj   r   )r   r7   r6   )r“   Úis_batchÚ	is_singles   &  r   ÚveeÚSo2.vee#  sO   € ô& & eª_ÀUÔKˆÜ& u¨s°C¨jÀÔGˆ	ßŸIÜÐWÐX]×XcÑXcÐWdÐeÓfÐfØ�YÕÐr   c               ó   € V ^8„  d   QhRR/# rz   r   )r   s   "r   r   r*   <  s   € ÷ -ñ -˜ñ -r   c                ó8  € \         P                  ! V P                  P                  V P                  P                  ) 3R4      p\         P                  ! V P                  P                  V P                  P                  3R4      p\         P                  ! W3R4      # )zÝReturn a matrix of shape ``z.shape + (2, 2)`` for each stored complex number.

Example:
    >>> s = So2.identity()
    >>> m = s.matrix()
    >>> m
    tensor([[1., -0.],
            [0., 1.]], grad_fn=<StackBackward0>)

rk   rŒ   )r    rp   r(   r   r   )r8   rŽ   r�   s   &  r   ÚmatrixÚ
So2.matrix<  sc   € ô �{Š{˜DŸF™FŸK™K¨$¯&©&¯+©+¨Ð6¸Ó;ˆÜ�{Š{˜DŸF™FŸK™K¨¯©¯©Ð5°rÓ:ˆÜ�{Š{˜D˜<¨Ó,Ð,r   c               ó    € V ^8„  d   QhRRRR/# )r   rž   r   r   r&   r   )r   s   "r   r   r*   L  s   € ÷ "ñ " ð "°#ñ "r   c                ód  € \        V. RORR7      p\        VRR.RR7      pV'       g!   V'       g   \        RVP                   24      h\        V4       \	        VP                  4      ^8  g   VP                  R	R R
8w  d   \        RVP                   24      h\        4       '       gg   \        P                  ! VR,          VR,          4      p\        P                  ! VR,          VR,          ) 4      pV'       d	   V'       g   \        R4      h\        VR,          VR,          4      pV ! V4      # )a\  Create So2 from a rotation matrix.

Args:
    matrix: the rotation matrix to convert of shape ``(B, 2, 2)``.

Raises:
    TypeCheckError: if ``matrix`` is bfloat16, which has no complex dtype in PyTorch.

Example:
    >>> m = torch.eye(2)
    >>> s = So2.from_matrix(m)
    >>> s.z
    Parameter containing:
    tensor(1.+0.j, requires_grad=True)

rh   Fr-   r•   Nz"Input size must be (*, 2, 2). Got zHInvalid SO2 rotation matrix: constraints m00==m11 and m01==-m10 not met.r–   rŒ   )r   r   ).r   r   ).rj   rj   ).r   rj   r—   )	r   r7   r6   r
   r5   r   r    Úallcloser$   )Úclsrž   r˜   r™   Ú	mask_diagÚmask_off_diagr(   s   &&     r   Úfrom_matrixÚSo2.from_matrixK  sö   € ô& & fªoÀeÔLˆÜ& v°°S¨zÀ%ÔHˆ	ßŸIÜÐWÐX^×XdÑXdÐWeÐfÓgÐgä˜vÔ&Üˆv�|‰|Ó˜qÔ  F§L¡L°°Ð$5¸Ô$?ÜÐAÀ&Ç,Á,ÀÐPÓQÐQô �~Š~ÜŸš v¨iÕ'8¸&ÀÕ:KÓLˆIÜ!ŸNšN¨6°)Õ+<¸vÀiÕ?PÐ>PÓQˆMß§-Ü Ð!kÓlÐlÜ˜f YÕ/°¸	Õ1BÓCˆÙ�1‹vˆr   c               ó(   € V ^8„  d   QhRRRRRRRR/# ©	r   Ú
batch_sizezOptional[int]rG   zUnion[str, torch.device, None]r"   zUnion[torch.dtype, None]r   r&   r   )r   s   "r   r   r*   q  s2   € ÷ <ñ <à!ð<ð /ð<ð (ð	<ð
 
ñ<r   c                óð   € \         P                  ! RW#R7      p\         P                  ! RW#R7      pVe3   \        V^8¬  RR7       VP                  V4      pVP                  V4      pV ! \	        WE4      4      # )a¤  Create a So2 group representing an identity rotation.

Args:
    batch_size: the batch size of the underlying data.
    device: device to place the result on.
    dtype: dtype of the result.

Raises:
    TypeCheckError: if ``dtype`` is bfloat16, which has no complex dtype in PyTorch.

Example:
    >>> s = So2.identity(batch_size=2)
    >>> s
    Parameter containing:
    tensor([1.+0.j, 1.+0.j], requires_grad=True)

g      ð?©rG   r"   g        úbatch_size must be positive©Úmsg)r    rD   r	   Úrepeatr$   )r£   rª   rG   r"   Ú	real_dataÚ	imag_datas   &&&&  r   ÚidentityÚSo2.identityp  sj   € ô0 —L’L ¨VÔAˆ	Ü—L’L ¨VÔAˆ	ØÒ!Ü˜ q™Ð.KÕLØ!×(Ñ(¨Ó4ˆIØ!×(Ñ(¨Ó4ˆIÙÔ$ YÓ:Ó;Ð;r   c               ó   € V ^8„  d   QhRR/# )r   r   r&   r   )r   s   "r   r   r*   �  s   € ÷ ñ ˜ñ r   c                ó  € V P                   pVP                  \        P                  8X  dI   \	        ^VP                  \        P                  4      ,          P                  VP                  4      4      # \	        ^V,          4      # )zÛReturn the inverse transformation.

Complex-half state is inverted in complex64 and returned in its original dtype.

Example:
    >>> s = So2.identity()
    >>> s.inverse().z
    tensor(1.+0.j, grad_fn=<MulBackward0>)

)r(   r"   r    Ú	complex32r&   rJ   Ú	complex64)r8   r(   s   & r   ÚinverseÚSo2.inverse�  sW   € ð �F‰Fˆà�7‰7”e—o‘oÔ%Ü˜˜AŸD™D¤§¡Ó1Õ1×5Ñ5°a·g±gÓ>Ó?Ð?Ü�1�q•5‹zÐr   c               ó(   € V ^8„  d   QhRRRRRRRR/# r©   r   )r   s   "r   r   r*   ¢  s2   € ÷ ñ à!ðð /ðð (ð	ð
 
ñr   c                óÌ   € RpVe   \        V^8¬  RR7       V3p^\        P                  ! WBVR7      ,          ^,
          \        P                  ,          pV P	                  V4      # )aˆ  Create a So2 group with a unit rotation whose angle is drawn from :math:`U[-\pi, \pi)`.

Args:
    batch_size: the batch size of the underlying data.
    device: device to place the result on.
    dtype: dtype of the result.

Raises:
    TypeCheckError: if ``dtype`` is bfloat16, which has no complex dtype in PyTorch.

Example:
    >>> s = So2.random()
    >>> s = So2.random(batch_size=3)

r­   r®   r¬   r   )r	   r    ÚrandÚpirƒ   )r£   rª   rG   r"   r6   r   s   &&&&  r   ÚrandomÚ
So2.random¡  sX   € ð, "$ˆØÒ!Ü˜ q™Ð.KÕLØ�MˆEð ”U—Z’Z ¸EÔBÕBÀQÕFÌ%Ï(É(ÕRˆØ�w‰w�u‹~Ðr   c               ó   € V ^8„  d   QhRR/# rz   r   )r   s   "r   r   r*   Á  s   € ÷ Tñ T˜ñ Tr   c                ó  € \        V P                  P                  4      ^ 8”  d   \        V P                  4      MRpV P                  WP                  P                  V P                  P
                  P                  4      P                  4       # )zÚReturn the adjoint matrix, the identity, of shape ``(B, 2, 2)`` (``(2, 2)`` unbatched).

Example:
    >>> s = So2.identity()
    >>> s.adjoint()
    tensor([[1., -0.],
            [0., 1.]], grad_fn=<StackBackward0>)

N)r5   r(   r6   r³   rG   r   r"   rž   )r8   rª   s   & r   ÚadjointÚSo2.adjointÁ  sW   € ô %(¨¯©¯©Ó$5¸Ô$9”S˜Ÿ™”[¸tˆ
Ø�}‰}˜Z¯©¯©¸¿¹¿¹×8IÑ8IÓJ×QÑQÓSÐSr   r   )T)NNN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__deepcopy__r3   rP   rW   r\   r   rb   Úpropertyr(   Ústaticmethodrƒ   rˆ   r�   rš   rž   Úclassmethodr¦   r³   r¹   r¿   rÃ   Ú__static_attributes__Ú__classcell__)r<   s   @r   r&   r&   0   s   ø† ñ4ðn *€L÷#-ð #-÷J8ò 8õ&õ ð Ü-ó Ø-àÜ?ó Ø?õ&MðP ôFó ðFð ôJó ðJõ2
.ð ô-ó ð-ð: ô ó ð õ0-ð ô"ó ð"ðH ö<ó ð<õ>ð" öó ð÷>Tó Tr   r&   )Ú
__future__r   Úcollections.abcr   Útypingr   r   r   r    r   Úkornia.core.checkr	   r
   r   Úkornia.core.exceptionsr   Úkornia.core.tensor_wrapperr   Úkornia.core.utilsr   r   r   Úkornia.geometry.vectorr   r$   ÚModuler&   r   r   r   Ú<module>rÙ      sG   ðõ( #å $ß ,Ñ ,ã Ý ç VÑ VÝ 1Ý .ß YÑ YÝ *õ
%ô\Tˆ"�)‰)ö \Tr   