+
    
þÎj[%  ã                   óT  € R t ^ RIHtHtHtHtHtHtHt ^ RI	H
t
 ^ RIHtHtHt ^ RIHtHtHtHtHtHtHt RR.t]]! ]]34      ]]! ]]34      ]]! ]]34      ]]
]]! ]]]34      ]]]]/t]P5                  4        U Uu/ uF  w  rWbK	  	  upp tR tR tR	 tR
 tR t R t!R# u upp i )a  A module for mapping operators to their corresponding eigenstates
and vice versa

It contains a global dictionary with eigenstate-operator pairings.
If a new state-operator pair is created, this dictionary should be
updated as well.

It also contains functions operators_to_state and state_to_operators
for mapping between the two. These can handle both classes and
instances of operators and states. See the individual function
descriptions for details.

TODO List:
- Update the dictionary with a complete list of state-operator pairs
)ÚXOpÚYOpÚZOpÚXKetÚPxOpÚPxKetÚPositionKet3D)ÚOperator)Ú	StateBaseÚBraBaseÚKet)ÚJxOpÚJyOpÚJzOpÚJ2OpÚJxKetÚJyKetÚJzKetÚoperators_to_stateÚstate_to_operatorsc                ó¾  € \        V \        \        34      '       g"   \        V \        4      '       g   \	        R4      h\        V \        4      '       dà   V  F<  p\        V\        4      '       d   K  \        V\        4      '       d   K3  \	        R4      h	  \        V 4      pV\        9   d:    V Uu. uF	  qD! 4       NK  	  pp\        \        V,          \        V4      3/ VB pV# V Uu. uF  p\        V4      NK  	  pp\        V4      p	V	\        9   d   \        \        V	,          V3/ VB pV# RpV# V \        9   d#    V ! 4       p
\        \        V ,          V
3/ VB pV# \        V 4      \        9   d"   \        \        \        V 4      ,          V 3/ VB # R# u upi   \         d    \        T,          p T# i ; iu upi   \         d    \        T ,          p T# i ; i)a‰  Returns the eigenstate of the given operator or set of operators

A global function for mapping operator classes to their associated
states. It takes either an Operator or a set of operators and
returns the state associated with these.

This function can handle both instances of a given operator or
just the class itself (i.e. both XOp() and XOp)

There are multiple use cases to consider:

1) A class or set of classes is passed: First, we try to
instantiate default instances for these operators. If this fails,
then the class is simply returned. If we succeed in instantiating
default instances, then we try to call state._operators_to_state
on the operator instances. If this fails, the class is returned.
Otherwise, the instance returned by _operators_to_state is returned.

2) An instance or set of instances is passed: In this case,
state._operators_to_state is called on the instances passed. If
this fails, a state class is returned. If the method returns an
instance, that instance is returned.

In both cases, if the operator class or set does not exist in the
state_mapping dictionary, None is returned.

Parameters
==========

arg: Operator or set
     The class or instance of the operator or set of operators
     to be mapped to a state

Examples
========

>>> from sympy.physics.quantum.cartesian import XOp, PxOp
>>> from sympy.physics.quantum.operatorset import operators_to_state
>>> from sympy.physics.quantum.operator import Operator
>>> operators_to_state(XOp)
|x>
>>> operators_to_state(XOp())
|x>
>>> operators_to_state(PxOp)
|px>
>>> operators_to_state(PxOp())
|px>
>>> operators_to_state(Operator)
|psi>
>>> operators_to_state(Operator())
|psi>
z%Argument is not an Operator or a set!zSet is not all Operators!N)	Ú
isinstancer	   ÚsetÚ
issubclassÚNotImplementedErrorÚ	frozensetÚ
op_mappingÚ
_get_stateÚtype)Ú	operatorsÚoptionsÚsÚopsÚopÚop_instancesÚretÚoÚtmpÚclassesÚop_instances   &,         ÚW/opt/data/home/.local/lib/python3.14/site-packages/sympy/physics/quantum/operatorset.pyr   r   /   s®  € ôl �y¤8¬S /×2Ò2´jÀÌH×6UÒ6UÜ!Ð"IÓJÐJä�)œS×!Ò!ÛˆAÜ˜q¤(×+Ô+Ü  ¤H×-Ô-Ü)Ð*EÓFÐFñ ô
 ˜	Ó"ˆà”*Ôð&Ù/2Ó3©s¨ ¦©s�Ð3Ü ¤¨C¥´#°lÓ2CÑOÀwÑO�ð ˆJá$'Ó(¡C˜q”4˜–7¡CˆCÐ(Ü “nˆGàœ*Ô$Ü ¤¨GÕ!4°cÑE¸WÑE�ð ˆJð �àˆJàœ
Ô"ð,Ù'›k�Ü ¤¨IÕ!6¸ÑOÀwÑO�ð ˆJÜ�)‹_¤
Ô*Üœj¬¨i«Õ9¸9ÑPÈÑPÐPáùò9  4øä&ô &Ü  •o‘àˆJð&üò
 )øô 'ô ,Ü  Õ+‘àˆJð,ús<   Â-F Â1FÃ #F Ã)F;Ä?G  ÆF ÆF8Æ7F8Ç GÇGc           	     ó¸  € \        V \        4      '       g"   \        V \        4      '       g   \        R4      hV \        9   d0   \        V 4      p \        V\        \        V ,          4      3/ VB pEM	\        V 4      \        9   d,   \        V \        \        \        V 4      ,          4      3/ VB pMÊ\        V \        4      '       dI   V P                  4       \        9   d0   \        V \        \        V P                  4       ,          4      4      pMl\        V \        4      '       dU   V P                  4       \        9   d<   \        V 4      p \        V\        \        V P                  4       ,          4      4      pMRp\        V4      #   \        \        3 d    \        T ,          p L+i ; i  \        \        3 d    \        T P                  4       ,          p L]i ; i)a§  Returns the operator or set of operators corresponding to the
given eigenstate

A global function for mapping state classes to their associated
operators or sets of operators. It takes either a state class
or instance.

This function can handle both instances of a given state or just
the class itself (i.e. both XKet() and XKet)

There are multiple use cases to consider:

1) A state class is passed: In this case, we first try
instantiating a default instance of the class. If this succeeds,
then we try to call state._state_to_operators on that instance.
If the creation of the default instance or if the calling of
_state_to_operators fails, then either an operator class or set of
operator classes is returned. Otherwise, the appropriate
operator instances are returned.

2) A state instance is returned: Here, state._state_to_operators
is called for the instance. If this fails, then a class or set of
operator classes is returned. Otherwise, the instances are returned.

In either case, if the state's class does not exist in
state_mapping, None is returned.

Parameters
==========

arg: StateBase class or instance (or subclasses)
     The class or instance of the state to be mapped to an
     operator or set of operators

Examples
========

>>> from sympy.physics.quantum.cartesian import XKet, PxKet, XBra, PxBra
>>> from sympy.physics.quantum.operatorset import state_to_operators
>>> from sympy.physics.quantum.state import Ket, Bra
>>> state_to_operators(XKet)
X
>>> state_to_operators(XKet())
X
>>> state_to_operators(PxKet)
Px
>>> state_to_operators(PxKet())
Px
>>> state_to_operators(PxBra)
Px
>>> state_to_operators(XBra)
X
>>> state_to_operators(Ket)
O
>>> state_to_operators(Bra)
O
zArgument is not a state!N)r   r
   r   r   Ústate_mappingÚ_make_defaultÚ_get_opsÚ	_make_setÚ	TypeErrorr   r   Ú
dual_class)Ústater    Ú
state_instr%   s   &,  r*   r   r   “   s�  € ôv �uœi×(Ò(¬J°u¼i×,HÒ,HÜ!Ð"<Ó=Ð=à”ÔÜ" 5Ó)ˆ
ð	'Ü˜:Ü$¤]°5Õ%9Ó:ñGØ>EñGŠCô 
ˆe‹œÔ	%Ü�uÜ ¤¬t°E«{Õ!;Ó<ñIØ@GñI‰ä	�Eœ7×	#Ò	#¨×(8Ñ(8Ó(:¼mÔ(KÜ�uÜ ¤¨u×/?Ñ/?Ó/AÕ!BÓCóE‰ä	�Eœ7×	#Ò	#¨×(8Ñ(8Ó(:¼mÔ(KÜ" 5Ó)ˆ
ð	4Ü˜:Ü$¤]°5×3CÑ3CÓ3EÕ%FÓGóI‰Cð
 ˆä�S‹>Ðøô% $¤YÐ/ô 	'Ü Õ&ŠCð	'ûô $¤YÐ/ô 	4Ü × 0Ñ 0Ó 2Õ3ŠCð	4ús$   Á!F Å
.F* ÆF'Æ&F'Æ*,GÇGc                 ó>   €  V ! 4       pV#   \          d    T p T# i ; i©N)r0   )Úexprr%   s   & r*   r-   r-   ë   s0   € ðÙ‹fˆð €Jøô ô Ø‰à€Jðús   ‚ ‹›c                 óh   €  V P                   ! V3/ VB pV#   \         d    \        T 4      p T# i ; ir5   )Ú_operators_to_stater   r-   )Ústate_classr"   r    r%   s   &&, r*   r   r   ÷   sC   € ð)Ø×-Ò-¨cÑ=°WÑ=ˆð €Jøô ô )Ü˜KÓ(‰à€Jð)ús   ‚ —1°1c                 ób  €  V P                   ! V3/ VB p\        T\        4      '       d   \        T4      ^8X  d
   T^ ,          # T#   \         d^    \        T\        \        \
        34      '       d/   \        ;QJ d    . R  T 4       F  NK  	  5M! R  T 4       4      p L‹\        T4      p L˜i ; i)c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5ir5   )r-   )Ú.0Úxs   & r*   Ú	<genexpr>Ú_get_ops.<locals>.<genexpr>	  s   é € Ð=±*¨Qœ a×(Ð(³*ùs   ‚)Ú_state_to_operatorsr   r   r   Útupler   r-   Úlen)r3   Ú
op_classesr    r%   s   &&, r*   r.   r.     s�   € ð,Ø×,Ò,¨ZÑC¸7ÑCˆô �#”s×Ò¤ C£¨A¤Ø�1�vˆà€Jøô ô ,Ü�j¤3¬¬yÐ"9×:Ò:ß”%Ñ=±*Ó=—%‘%Ñ=±*Ó=Ó=ŠCä 
Ó+ŠCð	,ús   ‚A Á6B.Á=!B.Â B.Â-B.c                 ó^   € \        V \        \        \        34      '       d   \	        V 4      # V # r5   )r   rA   Úlistr   r   )r"   s   &r*   r/   r/     s$   € Ü�#œœt¤YÐ/×0Ò0Ü�3‹xˆàˆ
ó    N)"Ú__doc__Úsympy.physics.quantum.cartesianr   r   r   r   r   r   r   Úsympy.physics.quantum.operatorr	   Úsympy.physics.quantum.stater
   r   r   Úsympy.physics.quantum.spinr   r   r   r   r   r   r   Ú__all__r   r,   Úitemsr   r   r   r-   r   r.   r/   )ÚkÚvs   00r*   Ú<module>rP      sß   ðñ÷ <÷ <ñ <å 3ß ?Ñ ?÷/÷ /ñ /ð Øð€ð ™ D¨$ <Ó0Ø™ D¨$ <Ó0Ø™ D¨$ <Ó0Ø�xØ¡¨C°°c¨?Ó!;Ø˜Ø˜ð€ð  -×2Ñ2Ô4Ô5Ñ4‘t�qˆaŠdÑ4Ò5€
òaòHUòp	òòô"ùóO 6s   Á?B$