+
    åûj`  ã                  óê   € ^ RI Ht ^ RIHtHtHt ^ RIt^ RIHu H	t
 ^ RIHt ^ RIHtHtHtHt ^ RIHtHt ^ RIHtHt ^ RIHt ^ R	IHt ^ R
IHt R R ltR R lt ! R R]P<                  4      tR# )é    )Úannotations)ÚOptionalÚUnionÚoverloadN)Únn)ÚKORNIA_CHECKÚKORNIA_CHECK_SAME_DEVICESÚKORNIA_CHECK_SHAPEÚKORNIA_CHECK_TYPE)ÚDeviceErrorÚTypeCheckError)Ú_deepcopy_module_stateÚregister_module_state)ÚSo2)Ú_so3_small_angle_coefficients)ÚVector2c               ó$   € V ^8„  d   QhRRRRRR/# ©é   Úrr   Útútorch.TensorÚreturnÚNone© )Úformats   "ÚXC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\geometry\liegroup\se2.pyÚ__annotate__r   $   s!   € ÷ 
ñ 
˜Cð 
 Lð 
°Tñ 
ó    c           	     ó  € \        VR R.4       V P                  P                  pVP                  RR p \        P                  ! W#4       R#   \
         d1    \        R\        T4       R\        TP                  4       R24      Rhi ; i)Ú*Ú2NzFExpected a translation whose batch broadcasts with the rotation batch z. Got translation of shape Ú.éÿÿÿÿ)r
   ÚzÚshapeÚtorchÚbroadcast_shapesÚRuntimeErrorÚ
ValueErrorÚtuple)r   r   Úr_batchÚt_batchs   &&  r   Ú_check_se2_r_t_shaper.   $   sŠ   € Ü�q˜3 ˜*Ô%Ø�c‰c�i‰i€GØ�g‰g�c�rˆl€GðÜ×Ò˜wÖ0øÜô ÜØTÔUZÐ[bÓUcÐTdð e(Ü(-¨a¯g©g«Ð'7°qð:ó
ð ð	ðús   µA Á;Bc               ó$   € V ^8„  d   QhRRRRRR/# r   r   )r   s   "r   r   r   1   s!   € ÷ 
ñ 
 3ð 
¨<ð 
¸Dñ 
r   c           	     ó  € V P                   P                  P                  pVP                  4       '       d&   \	        RVP                   R2VP                  R7      hVP                  4       '       g&   \	        RVP                   R2VP                  R7      hVP                  V\        P                  39  dA   \	        RV RV P                   P                   RVP                   R	2VP                  VR
7      hVP                  V P                   P                  8w  dh   \        RV P                   P                   RVP                   R2V P                   P                  VP                  .V P                   P                  R7      hR# )zaReject a translation the rotation's methods cannot combine with: another dtype or another device.z:Se2 translation must be a real floating-point tensor; got r#   )Úactual_typezSSe2 stores 'translation' as module state, which needs a floating-point tensor; got z-. Cast it first, for example with `.float()`.z5Se2 translation must have the dtype of its rotation, z (z is z); got z8. Cast one of them first, for example with `.to(dtype)`.)r1   Úexpected_typez7Se2 translation must be on the device of its rotation, z; got )Úactual_devicesÚexpected_deviceN)
r%   ÚrealÚdtypeÚ
is_complexr   Úis_floating_pointr'   Úbfloat16Údevicer   )r   r   Úr_dtypes   && r   Ú_check_se2_r_t_dtype_devicer<   1   sT  € à�c‰c�h‰h�n‰n€Gð 	‡|�|‡~‚~ÜØHÈÏÉÈ	ÐQRÐSØŸ™ô
ð 	
ð ×Ñ× Ò äØaÐbc×biÑbiÐajð k:ð :àŸ™ô
ð 	
ð
 	‡w�w�w¤§¡Ð/Ô/ÜØCÀGÀ9ÈGÐTU×TWÑTW×T]ÑT]ÐS^Ð^eÐfg×fmÑfmÐenð oEð EàŸ™Ø!ô	
ð 	
ð 	‡x�x�1—3‘3—:‘:ÔÜØEÀaÇcÁcÇjÁjÀ\ÐQWÐXY×X`ÑX`ÐWaÐabÐcØŸC™CŸJ™J¨¯©Ð1ØŸC™CŸJ™Jô
ð 	
ñ r   c                  óþ  a € ] tR t^QtRt]tR V 3R lltR R 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4       t]R R l4       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]R5R" R# ll4       tR$ R% lt]R& R' l4       tR( R) lt]R5R* R+ ll4       t]R, R- l4       t]R. R/ l4       t]R0 R1 l4       t R2 R3 lt!R4t"V ;t## )6ÚSe2aS  Represent a 2D rigid motion, rotation and translation, as an SE(2) Lie group element.

``g = Se2(rotation, t)`` pairs an :class:`So2` rotation with a translation ``t`` of shape ``(B, 2)``, or ``(2,)``
for an unbatched rotation; ``Se2.exp(v)`` builds one from tangent vectors :math:`v = (v_x, v_y, \theta)` of shape
``(B, 3)``, :meth:`from_matrix` from ``(B, 3, 3)`` matrices, and ``Se2.identity(B)`` and ``Se2.random(B)`` build
``B`` poses, or an unbatched one with ``batch_size=None``. ``g * p`` maps points as :math:`R p + t`, ``g1 * g2``
composes, ``g.inverse()`` inverts, ``g.log()`` returns the ``(B, 3)`` tangent vectors and ``g.matrix()`` the
``(B, 3, 3)`` matrices. Unbatched, a pose drops the ``B`` and maps ``(2,)`` or ``(N, 2)`` points; a batch of ``B``
maps ``(B, 2)``, one point per pose, or a single ``(2,)`` point. For 3D, use :class:`Se3`; for a pose that names
its frames and checks them when composing, :class:`~kornia.geometry.pose.NamedPose`.

SE(2) is the group of rigid motions of :math:`R^2` under composition.

Convention:
    - ``matrix()`` is the 3x3 :math:`[[R, t], [0, 1]]`. ``a * b`` is ``a.matrix() @ b.matrix()`` and ``g * p`` is
      :math:`R p + t`, as in :class:`~kornia.geometry.liegroup.Se3`. The rotation is an
      :class:`~kornia.geometry.liegroup.So2`, whose storage and direction conventions apply.
    - The tangent vector is :math:`(v_x, v_y, \theta)`, angle last: ``exp`` rotates by :math:`\theta` and
      translates by :math:`V(\theta) (v_x, v_y)`, and ``log`` returns :math:`\theta` in :math:`[-\pi, \pi]`.
      ``adjoint()`` is :math:`[[R, (t_y, -t_x)^\top], [0, 1]]`.
    - ``from_matrix`` ignores the bottom row. In eager execution, it checks approximately that the rotation block
      has the form :math:`[[a, -b], [b, a]]`, a rotation scaled by :math:`\sqrt{a^2 + b^2}`, and keeps the scale
      as a non-unit ``z`` that ``log`` drops; it rejects a reflection. Graph capture (``torch.compile``,
      ``torch.export``) omits the value check and interprets the block as ``z = m00 + i m10``.
    - ``t`` is always a tensor, whichever constructor built the pose, and registered as module state outside
      graph capture; a ``Vector2`` passed to the constructor is unwrapped. ``g * p`` returns a ``Vector2`` only
      when ``p`` is one.
    - ``hat`` returns the se(2) generator :math:`[[0, -\theta, v_x], [\theta, 0, v_y], [0, 0, 0]]` and ``vee``
      reads it back, so ``matrix_exp(hat(v))`` equals ``exp(v).matrix()``.
    - Module conversions follow :class:`~kornia.geometry.liegroup.So2`'s dtype policy for the rotation and
      PyTorch's native policy for the translation. A bfloat16 cast changes the translation precision while
      keeping the rotation's existing complex precision; both follow any requested device move. Building a
      pose from bfloat16 values (``exp``, ``identity``, ``random``, ``from_matrix`` or ``trans*``) raises
      ``TypeCheckError``, as for ``So2``.
    - ``copy.deepcopy`` copies the rotation and translation as for :class:`~kornia.geometry.liegroup.So2`.

See Also:
    - :class:`Se3`: the 3D rigid motion, with an :class:`So3` rotation and a ``(B, 3)`` translation.
    - :class:`So2`: the rotation alone, without a translation.
    - :class:`~kornia.geometry.pose.NamedPose`: wraps an ``Se2`` with the names of its source and destination
      frames, and checks that they chain when composing.

Example:
    >>> so2 = So2.identity(1)
    >>> t = torch.ones((1, 2))
    >>> se2 = Se2(so2, t)
    >>> se2
    rotation: Parameter containing:
    tensor([1.+0.j], requires_grad=True)
    translation: Parameter containing:
    tensor([[1., 1.]], requires_grad=True)

c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úrotationr   ÚtranslationzVector2 | torch.Tensorr   r   r   )r   s   "r   r   ÚSe2.__annotate__‹   s"   € ÷ ,=ñ ,= ð ,=Ð3Ið ,=Èdñ ,=r   c                ó\  <€ \         SV `  4        \        V\        4       \	        V\
        \        P                  34      '       g   \        R\        V4       24      h\	        V\
        4      '       d   VP                  MTp\        W4       \        W4       V  Wn        \        V RV4       R# )aÓ  Construct an Se2 from an So2 rotation and a translation.

Internally represented by a torch.complex number `z` and a translation 2-vector.

Args:
    rotation: So2 group encompassing a rotation.
    translation: translation torch.Tensor with shape ``(B, 2)``, or ``(2,)`` for an unbatched translation,
        or a Vector2 wrapping one; the tensor is what gets stored. Multidimensional batch shapes ``(*, 2)``
        are also accepted. The rotation and translation batch shapes must be broadcastable (an unbatched side
        may broadcast against a batched side). Incompatible batch shapes raise a ``ValueError`` at
        construction time. It must have the rotation's dtype (``z``'s real dtype) and device;
        a bfloat16 translation is also accepted beside a complex32, complex64 or complex128 rotation, which
        is what ``.bfloat16()`` leaves (PyTorch has no complex bfloat16). Every method then reads the
        translation at the rotation's precision, and ``inverse`` and ``g * g`` return a translation of the
        rotation's real dtype.

Raises:
    ValueError: if translation shape does not end in 2, or rotation and translation batch shapes cannot be
        broadcast.
    TypeCheckError: if the translation is an integer, bool or complex tensor (an ``nn.Parameter`` too), or its
        dtype differs from the rotation's (``log`` and the other methods cannot combine them).
    DeviceError: if the translation is on another device than the rotation.

Example:
    >>> so2 = So2.identity(1)
    >>> t = torch.ones((1, 2))
    >>> se2 = Se2(so2, t)
    >>> se2
    rotation: Parameter containing:
    tensor([1.+0.j], requires_grad=True)
    translation: Parameter containing:
    tensor([[1., 1.]], requires_grad=True)

ztranslation type is Ú_translationN)ÚsuperÚ__init__r   r   Ú
isinstancer   r'   ÚTensorÚ	TypeErrorÚtypeÚdatar.   r<   Ú	_rotationr   )Úselfr@   rA   Ú_t_dataÚ	__class__s   &&& €r   rF   ÚSe2.__init__‹   s‡   ø€ ôF 	‰ÑÔÜ˜(¤CÔ(Ü˜+¬´·±Ð'>×?Ò?ÜÐ2´4¸Ó3DÐ2EÐFÓGÐGÜ&0°¼g×&FÒ&F�+×"Ò"ÈKˆÜ˜XÔ/Ü# HÔ6ÙØ&ŒÜ˜d N°GÖ<r   c               ó   € V ^8„  d   QhRR/# )r   r   Ústrr   )r   s   "r   r   rB   ¹   s   € ÷ <ñ <˜#ñ <r   c                	ó:   € R V P                    RV P                   2# )z
rotation: z
translation: )r   r   ©rM   s   &r   Ú__repr__ÚSe2.__repr__¹   s   € Ø˜DŸF™F˜8 ?°4·6±6°(Ð;Ð;r   c               ó    € V ^8„  d   QhRRRR/# )r   Úidxzint | slicer   r>   r   )r   s   "r   r   rB   ¼   s   € ÷ ,ñ ,˜{ð ,¨sñ ,r   c                	óŠ  € V P                   pV P                  pVP                  P                  pVP                  R R p\	        V4      ^ 8X  d)   \	        V4      ^ 8X  d   \        W!,          W1,          4      # \	        V4      ^ 8X  d   RMTp\	        V4      ^ 8X  d   RMTp\        P                  ! Wg4      pVP                  P                  V8X  d   VP                  MVP                  P                  V4      p	VP                  R R V8X  d   TMVP                  VR,           4      p
\        \        W‘,          4      W¡,          4      # )Nr$   )é   ©r   )
rL   rD   r%   r&   Úlenr>   r'   r(   Úexpandr   )rM   rX   r   r   r,   r-   Úr_bÚt_bÚb_batchr%   Út_exps   &&         r   Ú__getitem__ÚSe2.__getitem__¼   sï   € Ø�N‰NˆØ×ÑˆØ—#‘#—)‘)ˆØ—'‘'˜#˜2�,ˆÜˆw‹<˜1Ô¤ W£°Ô!2Ü�q•v˜q�vÓ&Ð&Ü˜'“l aÔ'‰d¨WˆÜ˜'“l aÔ'‰d¨WˆÜ×(Ò(¨Ó2ˆØ—3‘3—9‘9 Ô'ˆA�CŠC¨Q¯S©S¯Z©Z¸Ó-@ˆØ—W‘W˜S˜b�\ WÔ,‘°!·(±(¸7ÀT½>Ó2JˆÜ”3�q•v“; ¥
Ó+Ð+r   c               ó    € V ^8„  d   QhRRRR/# ©r   Úrightr>   r   r   )r   s   "r   r   rB   Ê   s   € ÷ ñ ˜cð  cñ r   c                	óä  € V P                   pV P                  pW!P                   ,          pVP                  pVP                  VP                  rvVP                  R,          VP                  R,          r˜\
        P                  ! Wh,          Wy,          ,
          Wx,          Wi,          ,           3R4      p
W:,           P                  VP                  P                  P                  4      p\        WK4      # ).©.r   ©.rZ   r$   )
Úso2r   r%   r5   Úimagr'   ÚstackÚtor6   r>   )rM   rf   rj   r   Ú_rr%   r5   rk   ÚxÚyÚrot_tÚ_ts   &&          r   Ú_mul_se2ÚSe2._mul_se2Ê   s�   € Ø�h‰hˆØ�F‰FˆØ—9‘9�_ˆØ�E‰EˆØ—V‘V˜QŸV™VˆdØ�w‰w�v� §¡¨¥ˆ1Ü—’˜T�X¨­Õ0°$µ(¸T½XÕ2EÐFÈÓKˆð �i�^‰^˜BŸD™DŸI™IŸO™OÓ,ˆÜ�2‹{Ðr   c               ó    € V ^8„  d   QhRRRR/# re   r   )r   s   "r   r   rB   Ø   s   € ×-Ñ-˜SÐ- SÑ-r   c                	ó   € R # ©Nr   ©rM   rf   s   &&r   Ú__mul__ÚSe2.__mul__×   s   € Ù*-r   c               ó    € V ^8„  d   QhRRRR/# )r   rf   r   r   r   )r   s   "r   r   rB   Û   s   € ×?Ñ?˜\Ð?¨lÑ?r   c                	ó   € R # rw   r   rx   s   &&r   ry   rz   Ú   s   € Ù<?r   c               ó    € V ^8„  d   QhRRRR/# )r   rf   zSe2 | torch.Tensorr   r   )r   s   "r   r   rB   Ý   s   € ÷ <ñ <Ð/ð <Ð4Fñ <r   c                ó*  € V P                   pV P                  p\        V\        4      '       d"   \	        V\        4       V P                  V4      # \        V\        \        P                  34      '       d‰   \        P                  ! VP                  P                  VP                  RR 4      pVP                  P                  V8X  d   TM#\        VP                  P                  V4      4      pWQ,          V,           # \        R\        V4       24      h)aŽ  Compose two Se2 transformations, or transform points.

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

Return:
    The resulting Se2 transformation, or the transformed points.

NzUnsupported type: r$   )rj   r   rG   r>   r   rs   r   r'   rH   r(   r%   r&   r   r]   rI   rJ   )rM   rf   rj   r   r`   Úrots   &&    r   ry   rz   Ý   sÁ   € ð �h‰hˆØ�F‰FˆÜ�eœS×!Ò!Ü˜e¤SÔ)Ø—=‘= Ó'Ð'Ü�eœg¤u§|¡|Ð4×5Ò5Ü×,Ò,¨S¯U©U¯[©[¸!¿'¹'À#À2¸,ÓGˆGØŸ™Ÿ™¨Ô/‘#´S¸¿¹¿¹ÀgÓ9NÓ5OˆCØ•; •?Ð"ÜÐ,¬T°%«[¨MÐ:Ó;Ð;r   c               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r   s   "r   r   rB   õ   s   € ÷ ñ �Sñ r   c                ó   € V P                   # ©z&Return the underlying `rotation(So2)`.©rL   rT   s   &r   rj   ÚSe2.so2ô   ó   € ð �~‰~Ðr   c               ó   € V ^8„  d   QhRR/# r�   r   )r   s   "r   r   rB   ú   s   € ÷ ñ �3ñ r   c                ó   € V P                   # rƒ   r„   rT   s   &r   r   ÚSe2.rù   r†   r   c               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r   s   "r   r   rB   ÿ   s   € ÷ !ñ !�<ñ !r   c                ó   € V P                   # ©z<Return the underlying translation vector of shape ``(B,2)``.©rD   rT   s   &r   r   ÚSe2.tþ   ó   € ð × Ñ Ð r   c               ó   € V ^8„  d   QhRR/# r�   r   )r   s   "r   r   rB     s   € ÷ ñ ˜#ñ r   c                ó   € V P                   # rƒ   r„   rT   s   &r   r@   ÚSe2.rotation  r†   r   c               ó   € V ^8„  d   QhRR/# r‹   r   )r   s   "r   r   rB   	  s   € ÷ !ñ !˜\ñ !r   c                ó   € V P                   # r�   rŽ   rT   s   &r   rA   ÚSe2.translation  r�   r   c               ó    € V ^8„  d   QhRRRR/# )r   Úvr   r   r>   r   )r   s   "r   r   rB     s   € ÷ )ñ )ˆ|ð ) ñ )r   c           	     ó¼  € \        V RR.RR7      p\        V R.RR7      pV'       g!   V'       g   \        RV P                   24      hV R	,          p\        P                  ! V4      pVP                  4       R8  p\        P                  ! WS\        P                  ! V4      4      p\        P                  ! V\        P                  ! V4      V4      p\        VP                  4       4      w  r‰p
\        P                  ! VRWf,          V	,          ,
          \        P                  ! V4      V,          4      p\        P                  ! WVV,          R\        P                  ! RV,          4      ^,          ,          V,          4      pV R
,          pV R,          p\        P                  ! W½,          WÎ,          ,
          WÍ,          W¾,          ,           3R4      p\        WO4      # )a”  Convert elements of lie algebra to elements of lie group.

Args:
    v: vector :math:`(v_x, v_y, \theta)` of shape ``(B, 3)`` or ``(3,)``, angle last, in radians.

Example:
    >>> v = torch.ones((1, 3))
    >>> s = Se2.exp(v)
    >>> s.r
    Parameter containing:
    tensor([0.5403+0.8415j], requires_grad=True)
    >>> s.t
    Parameter containing:
    tensor([[0.3818, 1.3012]], requires_grad=True)

ÚBÚ3F©Úraisesú0Invalid input shape, we expect [B, 3], [3] Got: ç      à?ç      ð?g       @©.r   rh   ri   r$   )r
   r*   r&   r   ÚexpÚabsr'   ÚwhereÚ
zeros_likeÚ	ones_liker   Úsinrl   r>   )r˜   Úis_batchÚ	is_singleÚthetarj   ÚsmallÚtheta_sÚtheta_lÚcoef_aÚcoef_bÚ_ÚaÚbro   rp   r   s   &               r   r¢   ÚSe2.exp  sZ  € ô& & a¨#¨s¨¸EÔBˆÜ& q¨3¨%¸Ô>ˆ	ßŸIÜÐOÐPQ×PWÑPWÈyÐYÓZÐZØ�&•	ˆÜ�gŠg�e‹nˆð —	‘	“˜cÑ!ˆÜ—+’+˜e¬E×,<Ò,<¸UÓ,CÓDˆÜ—+’+˜e¤U§_¢_°UÓ%;¸UÓCˆÜ9¸'¿+¹+»-ÓHÑˆ˜Ü�KŠK˜˜s WÕ%6¸Õ%?Õ?ÄÇÂÈ7ÓASÐV]ÕA]Ó^ˆÜ�KŠK˜¨Õ/°´u·y²yÀÀwÅÓ7OÐSTÕ7TÕ1TÐW^Õ1^Ó_ˆØˆf�IˆØˆf�IˆÜ�KŠK˜� ¥�¨­°µ­Ð6¸Ó;ˆÜ�3‹{Ðr   c               ó   € V ^8„  d   QhRR/# r‹   r   )r   s   "r   r   rB   9  s   € ÷ Pñ P�\ñ Pr   c                ól  € V P                   P                  4       pRV,          p\        VP                  4       4      w   r4RW,          V,          ,
          p\        P
                  ! WR3R4      p\        P
                  ! V) V3R4      p\        P
                  ! Wg3R4      pW€P                  P                  VP                  4      R,          ,          p	VP                  V	P                  RR 8w  d   VP                  V	P                  RR 4      p\        P
                  ! V	R,          V	R,          V3R4      # )	zðConvert elements of lie group  to elements of lie algebra.

Example:
    >>> v = torch.ones((1, 3))
    >>> s = Se2.exp(v).log()
    >>> s.shape
    torch.Size([1, 3])
    >>> torch.allclose(s, v)
    True
    >>> s.requires_grad
    True

rŸ   r    Nr$   éþÿÿÿ©.N).r   r   ).rZ   r   )rj   Úlogr   r£   r'   rl   r   rm   r6   r&   r]   )
rM   rª   Ú
half_thetar°   Úcoef_cr±   Úrow0Úrow1ÚV_invÚupsilons
   &         r   r¸   ÚSe2.log9  sî   € ð —‘—‘“ˆØ˜5•[ˆ
ô 5°U·Y±Y³[ÓA‰ˆˆ1Ø�%•- &Õ(Õ(ˆÜ�{Š{˜A˜?¨BÓ/ˆÜ�{Š{˜Z˜K¨Ð+¨RÓ0ˆÜ—’˜T˜L¨"Ó-ˆàŸ&™&Ÿ)™) E§K¡KÓ0°Õ;Õ;ˆØ�;‰;˜'Ÿ-™-¨¨Ð,Ô,Ø—L‘L §¡¨s°Ð!3Ó4ˆEÜ�{Š{˜G IÕ.°¸	Õ0BÀEÐJÈBÓOÐOr   c               ó    € V ^8„  d   QhRRRR/# )r   r˜   r   r   r   )r   s   "r   r   rB   X  s   € ÷ (ñ (ˆ|ð ( ñ (r   c                óZ  € \        V RR.RR7      p\        V R.RR7      pV'       g!   V'       g   \        RV P                   24      hV R,          pV R,          p\        P                  ! \
        P                  ! V4      VP                  R4      3R4      p\        P                  ! VR	4      # )
a  Convert a tangent vector to the se(2) generator. Returns ``v.shape[:-1] + (3, 3)``.

For :math:`v = (v_x, v_y, \theta)` the matrix is :math:`[[0, -\theta, v_x], [\theta, 0, v_y], [0, 0, 0]]`.
:meth:`vee` inverts it, and its matrix exponential is the pose :meth:`exp` returns.

Args:
    v: vector of shape ``(B, 3)`` or ``(3,)``.

Example:
    >>> v = torch.tensor([1.0, 2.0, 0.5])
    >>> Se2.hat(v)
    tensor([[ 0.0000, -0.5000,  1.0000],
            [ 0.5000,  0.0000,  2.0000],
            [ 0.0000,  0.0000,  0.0000]])

rš   r›   Frœ   rž   ).ºNr   Nr¡   r$   ©r   r   r   rZ   )
r
   r*   r&   r'   Úcatr   ÚhatÚ	unsqueezeÚFÚpad)r˜   r¨   r©   r¾   rª   Útops   &     r   rÅ   ÚSe2.hatW  s�   € ô& & a¨#¨s¨¸EÔBˆÜ& q¨3¨%¸Ô>ˆ	ßŸIÜÐOÐPQ×PWÑPWÈyÐYÓZÐZØ�G•*ˆØ�&•	ˆÜ�iŠiœŸš ›¨×):Ñ):¸2Ó)>Ð?ÀÓDˆÜ�uŠu�S˜,Ó'Ð'r   c               ó    € V ^8„  d   QhRRRR/# )r   Úomegar   r   r   )r   s   "r   r   rB   t  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,          p\        P                  ! V R,          4      p\
        P                  ! W4R,          3R	4      # )
a—  Read the tangent vector back from a :meth:`hat` matrix.

It reads the translation from the last column and the angle from the ``[1, 0]`` entry.

Args:
    omega: 3x3-matrix built by :meth:`hat`, of shape ``(B, 3, 3)`` or ``(3, 3)``.

Returns:
    vector of shape ``(B, 3)`` or ``(3,)``.

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

r›   Frœ   z8Invalid input size, we expect [B, 3, 3] or [3, 3]. Got: )rš   r›   r›   ).rÂ   r   ©.rÂ   rÂ   r·   r$   )r
   r*   r&   r   Úveer'   rÄ   )rÌ   r¨   r©   r¾   rª   s   &    r   rÏ   ÚSe2.vees  sz   € ô( & eª_ÀUÔKˆÜ& u¨s°C¨jÀÔGˆ	ßŸIÜÐWÐX]×XcÑXcÐWdÐeÓfÐfØ˜
Õ#ˆÜ—’˜˜kÕ*Ó+ˆÜ�yŠy˜'¨Õ#3Ð4°bÓ9Ð9r   c               ó(   € V ^8„  d   QhRRRRRRRR/# ©	r   Ú
batch_sizezOptional[int]r:   zUnion[str, torch.device, None]r6   zUnion[torch.dtype, None]r   r>   r   )r   s   "r   r   rB   �  s2   € ÷ ?ñ ?à!ð?ð /ð?ð (ð	?ð
 
ñ?r   c                ó¾   € \         P                  ! RR.W#R7      pVe#   \        V^8¬  RR7       VP                  V^4      pV ! \        P
                  ! WV4      V4      # )a›  Create a Se2 group representing an identity rotation and zero translation.

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

Example:
    >>> s = Se2.identity(1)
    >>> s.r
    Parameter containing:
    tensor([1.+0.j], requires_grad=True)
    >>> s.t
    Parameter containing:
    tensor([[0., 0.]], requires_grad=True)

g        ©r:   r6   úbatch_size must be positive©Úmsg)r'   Útensorr   Úrepeatr   Úidentity)ÚclsrÓ   r:   r6   r   s   &&&& r   rÛ   ÚSe2.identity�  sU   € ô0  Ÿ,š,¨¨S z¸&ÔNˆØÒ!Ü˜ q™Ð.KÕLØ—‘˜ QÓ'ˆAÙ”3—<’< 
°EÓ:¸AÓ>Ð>r   c               ó   € V ^8„  d   QhRR/# r‹   r   )r   s   "r   r   rB   ­  s   € ÷ ñ ˜ñ r   c                ó   € V P                   P                  4       p\        P                  ! VP                  RR V P
                  P                  RR 4      pVP                  RR V8w  d   VP                  VR,           4      pV P
                  P                  VP                  4      pVP                  RR V8w  d   VP                  VR,           4      p\        P                  ! WR,          3R4      p\        P                  ! VR4      pRVR	&   V# )
zôReturn the matrix representation of shape ``(B, 3, 3)``.

Example:
    >>> s = Se2(So2.identity(1), torch.ones(1, 2))
    >>> s.matrix()
    tensor([[[1., -0., 1.],
             [0., 1., 1.],
             [0., 0., 1.]]], grad_fn=<CopySlices>)

Nr    r¶   r$   )r   r   r[   r·   rÃ   ).r$   r$   )r   Úmatrixr'   r(   r&   r   r]   rm   r6   rÄ   rÇ   rÈ   )rM   Úr_matrixr`   r   ÚrtÚrt_3x3s   &     r   rà   Ú
Se2.matrix­  sÕ   € ð —6‘6—=‘=“?ˆÜ×(Ò(¨¯©¸¸Ð)<¸d¿f¹f¿l¹lÈ3ÈBÐ>OÓPˆØ�>‰>˜#˜2Ð 'Ô)Ø—‘ w°Õ'7Ó8ˆHØ�F‰F�I‰I�h—n‘nÓ%ˆØ�7‰7�3�Bˆ<˜7Ô"Ø—‘˜ 4�Ó(ˆAÜ�YŠY˜ I¥,Ð/°Ó4ˆÜ—’�r˜<Ó(ˆØ!ˆˆ{ÑØˆr   c               ó    € V ^8„  d   QhRRRR/# )r   rà   r   r   r>   r   )r   s   "r   r   rB   Å  s   € ÷ ñ  ð °#ñ r   c                óz   € \        V. RO4       \        P                  ! VR,          4      pVR,          pV ! W#4      # )a^  Create an Se2 group from a matrix.

Args:
    matrix: torch.Tensor of shape ``(B, 3, 3)``.

Example:
    >>> s = Se2.from_matrix(torch.eye(3).repeat(2, 1, 1))
    >>> s.r
    Parameter containing:
    tensor([1.+0.j, 1.+0.j], requires_grad=True)
    >>> s.t
    Parameter containing:
    tensor([[0., 0.],
            [0., 0.]], requires_grad=True)

)r!   r›   r›   rÎ   ).rÂ   r$   )r
   r   Úfrom_matrix)rÜ   rà   r   r   s   &&  r   rç   ÚSe2.from_matrixÄ  s5   € ô$ 	˜6¢?Ô3Ü�OŠO˜F ;Õ/Ó0ˆØ�;ÕˆÙ�1‹yÐr   c               ó   € V ^8„  d   QhRR/# )r   r   r>   r   )r   s   "r   r   rB   Û  s   € ÷ 8ñ 8˜ñ 8r   c                ó¸  € V P                   P                  4       pVP                  pVP                  VP                  rCV P
                  R,          ) V P
                  R,          ) re\        P                  ! W5,          WF,          ,
          WE,          W6,          ,           3R4      p\        WP                  VP                  P                  P                  4      4      # )züReturn the inverse transformation.

Example:
    >>> s = Se2(So2.identity(1), torch.ones(1,2))
    >>> s_inv = s.inverse()
    >>> s_inv.r
    tensor([1.+0.j], grad_fn=<MulBackward0>)
    >>> s_inv.t
    tensor([[-1., -1.]], grad_fn=<StackBackward0>)

rh   ri   r$   )r   Úinverser%   r5   rk   r   r'   rl   r>   rm   r6   )rM   Úr_invr%   r5   rk   ro   rp   Út_invs   &       r   rë   ÚSe2.inverseÛ  s�   € ð —V‘V—^‘^Ó%ˆØ�G‰GˆØ—V‘V˜QŸV™VˆdØ—‘�v•ˆ §¡¨¥ ˆ1Ü—’˜T�X¨­Õ0°$µ(¸T½XÕ2EÐFÈÓKˆä�5Ÿ(™( 5§7¡7§<¡<×#5Ñ#5Ó6Ó7Ð7r   c               ó(   € V ^8„  d   QhRRRRRRRR/# rÒ   r   )r   s   "r   r   rB   ð  s8   € ÷ Eñ Eà!ðEð /ðEð (ð	Eð
 
ñEr   c           	     ó¤   € \         P                  ! WV4      pVf   RpM\        V^8¬  RR7       V^3pV ! V\        P                  ! WRVR7      4      # )a'  Create a Se2 group from ``So2.random`` and a translation drawn from :math:`U[0, 1)`.

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

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

rÖ   r×   rÕ   r[   )r   Úrandomr   r'   Úrand)rÜ   rÓ   r:   r6   r   r&   s   &&&&  r   rñ   Ú
Se2.randomï  sO   € ô& �JŠJ�z¨5Ó1ˆàÒØ‰Eä˜ q™Ð.KÕLØ �OˆEÙ�1”e—j’j ¸UÔCÓDÐDr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   ro   r   rp   r   r>   r   )r   s   "r   r   rB     s!   € ÷ 6ñ 6�lð 6 |ð 6¸ñ 6r   c                óP  € \        VP                  VP                  8H  4       \        W.4       \        VP                  4      ^ 8”  d   VP                  ^ ,          MRp\        P
                  ! W1P                  VP                  4      pV ! V\        P                  ! W3R4      4      # )zqConstruct a translation only Se2 instance.

Args:
    x: the x-axis translation.
    y: the y-axis translation.

Nr$   )
r   r&   r	   r\   r   rÛ   r:   r6   r'   rl   )rÜ   ro   rp   rÓ   r@   s   &&&  r   ÚtransÚ	Se2.trans  ss   € ô 	�Q—W‘W §¡Ñ'Ô(Ü! 1 &Ô)Ü#& q§w¡w£<°!Ô#3�Q—W‘W˜Q–Z¸ˆ
Ü—<’< 
¯H©H°a·g±gÓ>ˆÙ�8œUŸ[š[¨!¨°Ó4Ó5Ð5r   c               ó    € V ^8„  d   QhRRRR/# )r   ro   r   r   r>   r   )r   s   "r   r   rB     ó   € ÷  ñ  ˜ð  ¨ñ  r   c                óP   € \         P                  ! V4      pV P                  W4      # )zGConstruct a x-axis translation.

Args:
    x: the x-axis translation.

©r'   r¥   rö   )rÜ   ro   Úzss   && r   Útrans_xÚSe2.trans_x  s#   € ô ×Ò˜aÓ ˆØ�y‰y˜ÓÐr   c               ó    € V ^8„  d   QhRRRR/# )r   rp   r   r   r>   r   )r   s   "r   r   rB   &  rù   r   c                óP   € \         P                  ! V4      pV P                  W!4      # )zGConstruct a y-axis translation.

Args:
    y: the y-axis translation.

rû   )rÜ   rp   rü   s   && r   Útrans_yÚSe2.trans_y%  s#   € ô ×Ò˜aÓ ˆØ�y‰y˜ÓÐr   c               ó   € V ^8„  d   QhRR/# r‹   r   )r   s   "r   r   rB   0  s   € ÷ ñ ˜ñ r   c                ó
  € V P                  4       pVP                  RR pV P                  pVP                  RR V8w  d   VP                  VR,           4      p\        P
                  ! VR,          VR,          ) 3R4      VR&   V# )zÓReturn the adjoint matrix of shape ``(B, 3, 3)``.

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

Nr¶   r$   r[   ri   rh   ).:r   r   Nr   )rà   r&   r   r]   r'   rl   )rM   râ   r`   r   s   &   r   ÚadjointÚSe2.adjoint0  ss   € ð �[‰[‹]ˆØ—(‘(˜3˜B�-ˆØ�F‰FˆØ�7‰7�3�Bˆ<˜7Ô"Ø—‘˜ 4�Ó(ˆAÜŸ+š+ q¨¥y°1°Vµ9°*Ð&=¸rÓBˆˆ;‰Øˆ	r   r„   )NNN)$Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__deepcopy__rF   rU   rb   rs   r   ry   Úpropertyrj   r   r   r@   rA   Ústaticmethodr¢   r¸   rÅ   rÏ   ÚclassmethodrÛ   rà   rç   rë   rñ   rö   rý   r  r  Ú__static_attributes__Ú__classcell__)rO   s   @r   r>   r>   Q   s‚  ø† ñ4ðn *€L÷,=ð ,=õ\<õ,õð Ü-ó Ø-àÜ?ó Ø?õ<ð. ôó ðð ôó ðð ô!ó ð!ð ôó ðð ô!ó ð!ð ô)ó ð)õVPð< ô(ó ð(ð6 ô:ó ð:ð6 ö?ó ð?õ:ð. ôó ðõ,8ð( öEó ðEð6 ô6ó ð6ð ô ó ð ð ô ó ð ÷ó r   r>   ) Ú
__future__r   Útypingr   r   r   r'   Útorch.nn.functionalr   Ú
functionalrÇ   Úkornia.core.checkr   r	   r
   r   Úkornia.core.exceptionsr   r   Úkornia.core.utilsr   r   Úkornia.geometry.liegroup.so2r   Úkornia.geometry.liegroup.so3r   Úkornia.geometry.vectorr   r.   r<   ÚModuler>   r   r   r   Ú<module>r     sN   ðõ( #ç ,Ñ ,ã ß Ð Ý ç lÓ lß >ß KÝ ,Ý FÝ *õ
õ
ô@pˆ"�)‰)ö pr   