+
    i                     t   R t ^ RIHtHtHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHtHtHt  ! R R4      t]! ^]! R^4      RR	7      t]! 4       t]P%                  R
]
! ^^ .^ ^..4      4       ]P%                  R]
! ^ ^ .^ ^..4      4       ]P%                  R]
! ^^ .^ ^ ..4      4       ]P%                  R]
! ^ ^ .^^ ..4      4       ]P%                  R]
! ^ ^.^ ^ ..4      4       ]P%                  R]
! ^ ^.^^ ..4      4       ]P%                  R]
! ^ ]) .]^ ..4      4       ]P%                  R]
! ^^ .^ R..4      4       ]P%                  R]
! ^^ .^ ]..4      4       ]P%                  R]
! ^^ .^ ]! ]],          ^,          4      ..4      4       ]P%                  R]]
! ^^.^R..4      ,          4       ]P%                  R]
! ^^.^R..4      4       ]P%                  R]
! . RO. RO. RO. RO.4      4       ]P%                  R]]
! ^^.^R..4      ,          4       ]P%                  R]
! ]^ .^ ]) ..4      4       R# )z7A cache for storing small matrices in multiple formats.)IRationalpi)Pow)exp)Matrix)to_sympyto_numpyto_scipy_sparsec                   R   a  ] tR t^t o RtRR ltR tR tR tR t	R t
R tR	tV tR
# )MatrixCachea
  A cache for small matrices in different formats.

This class takes small matrices in the standard ``sympy.Matrix`` format,
and then converts these to both ``numpy.matrix`` and
``scipy.sparse.csr_matrix`` matrices. These matrices are then stored for
future recovery.
c                     / V n         Wn        R # N_cachedtype)selfr   s   &&ځ/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/physics/quantum/matrixcache.py__init__MatrixCache.__init__   s    
    c                     V P                  W4        V P                  W4        V P                  W4       R#   \         d     L3i ; i  \         d     L2i ; i  \         d     R# i ; i)zCache a matrix by its name.

Parameters
----------
name : str
    A descriptive name for the matrix, like "identity2".
m : list of lists
    The raw matrix data as a SymPy Matrix.
N)_sympy_matrixImportError_numpy_matrix_scipy_sparse_matrixr   namems   &&&r   cache_matrixMatrixCache.cache_matrix   su    	t'	t'	%%d.  		  		  		s1   9 A
 A AA
AAA*)A*c                n    V P                   P                  W34      pVe   V# \        RV: RV: R24      h)zGet a cached matrix by name and format.

Parameters
----------
name : str
    A descriptive name for the matrix, like "identity2".
format : str
    The format desired ('sympy', 'numpy', 'scipy.sparse')
zMatrix with name z and format z is not available.)r   getNotImplementedErrorr   r   formatr   s   &&& r   
get_matrixMatrixCache.get_matrix1   s9     KKOOTN+=H!6
 	
r   c                $    W0P                   W3&   R # r   )r   r$   s   &&&&r   _store_matrixMatrixCache._store_matrixC   s    &'TN#r   c                >    V P                  VR \        V4      4       R# )sympyN)r)   r   r   s   &&&r   r   MatrixCache._sympy_matrixF   s    4(1+6r   c                X    \        W P                  R 7      pV P                  VRV4       R# )r   numpyN)r	   r   r)   r   s   &&&r   r   MatrixCache._numpy_matrixI   s"    Qjj)4!,r   c                X    \        W P                  R 7      pV P                  VRV4       R# )r/   zscipy.sparseN)r
   r   r)   r   s   &&&r   r    MatrixCache._scipy_sparse_matrixM   s$     AZZ043r   r   N)complex)__name__
__module____qualname____firstlineno____doc__r   r   r&   r)   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s2     .
$(7-4 4r   r   F)evaluateeye2op11op00op10op01XYZSTHHsqrt2SWAPZXZYN)       rO   rO   )rO   rO   rN   rO   )rO   rN   rO   rO   )rO   rO   rO   rN   )r9   sympy.core.numbersr   r   r   sympy.core.powerr   &sympy.functions.elementary.exponentialr   sympy.matrices.denser   !sympy.physics.quantum.matrixutilsr   r	   r
   r   	sqrt2_invmatrix_cacher    r   r   <module>rX      sf   = 0 0   6 ' 
D4 D4N 8B?U3	 }   &&1a&1a&)9": ;   &&1a&1a&)9": ;   &&1a&1a&)9": ;   &&1a&1a&)9": ;   &&1a&1a&)9": ;   #v1v1v&67 8   #vA2wA&78 9   #v1v2w&78 9   #v1v1v&67 8   #v1v3qtAv;/?&@A B   #y!Q!R0A)BB C   (FQFQG+<$= >   
FL,lKLN   $	&1a&1b'1B*C C D   $AQB'8 9 :r   