+
    i                     a  0 t $ R t^ RIHt ^ RIHtHtHt ^ RIt^ RI	H
t
HtHtHtHt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	IHt ^ R
IHt ^ RI H!t! ^ RI"H#t#H$t$H%t% ^ RI&H't' ^ RI(H)t)H*t* ^ RI+H,t,H-t- ^ RI&H.t.H/t/ ^ RI0H1t1H2t3 ^ RI4H5t5H6t6 ^ RI7t7]'       d   ^ RI8H9t9 ^ RI:H;t; . ROt</ RRbRRbRRbRRbRRbRR bR!R"bR#R$bR%R&bR'R(bR)R*bR+R,bR-R.bR/R0bR1R2bR3R4bR5R6b/ R7R8bR9R:bR;R<bR=R>bR?R@bRARBbRCRDbRERFbRGRHbRIR*bRJRKbRLRBbRMRNbRORPbRQRRbRSRTbRURVbCRWRXRYRZ/Ct=0 Rmt>/ R[R\ bR]R^ bR_R` bRaRb bRcRd bReRf bRgRh bRiRj bRkRl bRmRn bRoRp bRqRr bRsRt bRuRv bRwRx bRyRz bR{R| bR}R~ RR RR RR RR RR RR /Ct?R]@R&   ]A! ]4      tB]7P                  ! R4      ]7P                  ! R4      3tDR R ltE ! R R])4      tFR R ltG]*! ]F4      R 4       tHR tIRR ltJR# )zC
A Printer which converts an expression into its LaTeX equivalent.
)annotations)AnyCallableTYPE_CHECKINGN)AddFloatModMulNumberSSymbolExpr)greeks)Tuple)FunctionAppliedUndef
Derivative)AssocOp)Pow)default_sort_key)SympifyError)trueBooleanTrueBooleanFalse)precedence_traditional)Printerprint_function)split_super_subrequires_partial)
precedence
PRECEDENCE)prec_to_dpsto_str)has_varietysift)	NDimArray)BasisDependentAlphaz
\mathrm{A}Betaz
\mathrm{B}Gamma\GammaDeltaz\DeltaEpsilonz
\mathrm{E}Zetaz
\mathrm{Z}Etaz
\mathrm{H}Thetaz\ThetaIotaz
\mathrm{I}Kappaz
\mathrm{K}Lambdaz\LambdaMuz
\mathrm{M}Nuz
\mathrm{N}Xiz\XiomicronoOmicronz
\mathrm{O}Piz\PiRhoz
\mathrm{P}Sigmaz\SigmaTauz
\mathrm{T}Upsilonz\UpsilonPhiz\PhiChiz
\mathrm{X}Psiz\PsiOmegaz\Omegalamdaz\lambdaLamdakhiz\chiKhi
varepsilonz\varepsilonvarkappaz	\varkappavarphiz\varphivarpiz\varpivarrhoz\varrhovarsigmaz	\varsigmavarthetaz	\varthetamathringc                "    R V ,           R,           # )z
\mathring{} ss   &R/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/printing/latex.py<lambda>rT   [   s    -/$.    ddddotc                "    R V ,           R,           # )z\ddddot{rO   rP   rQ   s   &rS   rT   rT   \   s    Ad*rU   dddotc                "    R V ,           R,           # )z\dddot{rO   rP   rQ   s   &rS   rT   rT   ]       z!|D(rU   ddotc                "    R V ,           R,           # )z\ddot{rO   rP   rQ   s   &rS   rT   rT   ^   s    ik$&rU   dotc                "    R V ,           R,           # )z\dot{rO   rP   rQ   s   &rS   rT   rT   _       XaZ_rU   checkc                "    R V ,           R,           # )z\check{rO   rP   rQ   s   &rS   rT   rT   `   rZ   rU   brevec                "    R V ,           R,           # )z\breve{rO   rP   rQ   s   &rS   rT   rT   a   rZ   rU   acutec                "    R V ,           R,           # )z\acute{rO   rP   rQ   s   &rS   rT   rT   b   rZ   rU   gravec                "    R V ,           R,           # )z\grave{rO   rP   rQ   s   &rS   rT   rT   c   rZ   rU   tildec                "    R V ,           R,           # )z\tilde{rO   rP   rQ   s   &rS   rT   rT   d   rZ   rU   hatc                "    R V ,           R,           # )z\hat{rO   rP   rQ   s   &rS   rT   rT   e   r_   rU   barc                "    R V ,           R,           # )z\bar{rO   rP   rQ   s   &rS   rT   rT   f   r_   rU   vecc                "    R V ,           R,           # )z\vec{rO   rP   rQ   s   &rS   rT   rT   g   r_   rU   primec                "    R V ,           R,           # {z}'rP   rQ   s   &rS   rT   rT   h   s    s1uTzrU   prmc                "    R V ,           R,           # rr   rP   rQ   s   &rS   rT   rT   i   s    SU4ZrU   boldc                "    R V ,           R,           # z\boldsymbol{rO   rP   rQ   s   &rS   rT   rT   k   s    oa',rU   bmc                "    R V ,           R,           # rx   rP   rQ   s   &rS   rT   rT   l   s    OA%d*rU   calc                "    R V ,           R,           # )z	\mathcal{rO   rP   rQ   s   &rS   rT   rT   m       \!^D(rU   scrc                "    R V ,           R,           # )z	\mathscr{rO   rP   rQ   s   &rS   rT   rT   n   r}   rU   frakc                "    R V ,           R,           # )z
\mathfrak{rO   rP   rQ   s   &rS   rT   rT   o   s    mAod*rU   normc                "    R V ,           R,           # )z\left\|{z	}\right\|rP   rQ   s   &rS   rT   rT   q   s    k!mL0rU   avgc                "    R V ,           R,           # )z\left\langle{z}\right\ranglerP   rQ   s   &rS   rT   rT   r   s    %a'(99rU   absc                "    R V ,           R,           # z\left|{z}\right|rP   rQ   s   &rS   rT   rT   s       Z\+-rU   magc                "    R V ,           R,           # r   rP   rQ   s   &rS   rT   rT   t   r   rU   zdict[str, Callable[[str], str]]modifier_dictz[0-9][} ]*$z(\d|\\frac{\d+}{\d+})c                    V ^8  d   QhRRRR/#    rR   strreturnrP   )formats   "rS   __annotate__r      s      C C rU   c                    V P                  RR4      p R F  pV P                  VRV,           4      p K  	  V P                  RR4      p V P                  RR4      p V # )z
Escape a string such that latex interprets it as plaintext.

We cannot use verbatim easily with mathjax, so escaping is easier.
Rules from https://tex.stackexchange.com/a/34586/41112.
\z\textbackslashz&%$#_{}~z\textasciitilde^z\textasciicircum)replace)rR   cs   & rS   latex_escaper      sZ     	
		$)*AIIa" 			#)*A			#*+AHrU   c                    a  ] tR t^t$ Rt/ RRbRRbRRbRRbRR	bR
RbRRbRRbRRbRRbRRbRRbRRbR/ bRRbRRbRRbRRRRRRRRRRR RR!R"R#R$R%R/	CtR&]R'&   ERvR( ltR) R* ltR+ R, lt	ERwR- R. llt
R/ tR0 R1 ltR2 R3 ltR4 R5 ltERwR6 R7 lltR8 R9 ltR: R; ltR< R= ltR> R? ltR@ tRA RB lt]t]tRC tERvRD ltRE tRF tRG tRH tRI tRJ tRK t RL t!RM t"RN t#RO RP lt$RQ t%RR t&RS RT lt'RU RV lt(RW t)RX t*RY t+RZ R[ lt,R\ t-R] t.R^ t/R_ t0R` t1Ra t2Rb t3Rc Rd lt4ERvRe Rf llt5Rg t6Rh t7]8Ri 4       t9Rj t:Rk t;Rl t<ERvRm Rn llt=]=;t>t?ERvRo lt@ERvRp ltAERvRq ltBERvRr ltCERvRs ltDERvRt ltERu tFRv tGRw tHRx tIRy tJERvRz ltKERvR{ ltLERvR| ltMERvR} ltNERvR~ ltOERvR ltPERvR ltQERvR ltRERvR ltSERvR ltTERvR ltUERxR ltVERvR ltWERvR ltXERvR ltYERvR R lltZ]Zt[ERvR lt\ERvR lt]ERvR lt^ERvR lt_ERvR lt`ERvR ltaERvR ltbERvR ltcERvR ltdERvR lteR R ltfR R ltgERvR lthERvR ltiERvR ltjERvR ltkERvR ltlERvR ltmERvR ltnERvR ltoERvR ltpERvR ltqERyR R lltrERyR R lltsERvR lttERvR ltuERvR ltvERvR ltwERvR ltxERvR ltyERvR ltzERvR lt{ERvR lt|ERvR lt}ERvR lt~ERvR ltERvR ltERvR ltERvR ltERvR ltERvR ltERvR ltERvR ltERvR ltERvR ltERvR ltERzR ltERvR ltERvR ltERvR ltERvR ltR tR tER{R R llt]tR R ltER{R R lltR tR tR tR tR tR tR tR tR tR tR tR tR tERvR ltR tR tR tR tR tR tR tR tR tR R ltR R ltR tR tR tR tR tR tR tR tR tERvR ltR tR tR tR tR tR tR tERvR ltERvR ltERvR ltERvR ltERvR ltR tR tR t]tR tERvR ltERvER  ltERvER ltERvER ltERvER ltERvER ltERvER ltERvER ltER t]t]t]tER tER	 tER
 tER tER tER tER tER tER tER tER tER tER tER tER tER tER tER tER tER tER tER tER tER tER  tER! tER" tER# tER$ tER% tER& tER' tER( tER) tER* tER+ tER, tERvER- ltERvER. ltER|ER/ ltER0 tER1 tER2 tER3 Et ER4 EtER5 EtER6 EtER7 EtER8 EtER9 EtER: EtER; EtER< Et	ERvER= lEt
ER> EtER? EtER@ EtERA EtERB EtERC EtERD EtERE EtERF EtERG EtERH EtERI EtERJ EtERK EtE]EtERL EtERM EtERN EtERO EtERP EtERQ EtERR Et ERS Et!ERT Et"ERU Et#ERV Et$ERW Et%ERX Et&ERY Et'ERZ Et(ER[ Et)ER\ Et*ER] Et+ER^ Et,ER_ Et-ER` Et.ERa Et/ERb Et0ERc Et1ERd Et2ERvERe lEt3ERvERf lEt4ERvERg lEt5ERvERh lEt6ERvERi lEt7ERvERj lEt8ERk Et9ERl Et:ERm Et;ERn Et<ERo Et=ERp Et>ERq Et?ERr Et@ERs EtAV 3ERt lEtBERuEtCV ;EtD# (}  LatexPrinter_latex	full_precFfold_frac_powersfold_func_bracketsfold_short_fracNinv_trig_styleabbreviateditexln_notationlong_frac_ratio	mat_delim[mat_strmodeplain
mul_symbolordersymbol_namesroot_notationTmat_symbol_styleimaginary_unitigothic_re_imdecimal_separatorperiodperm_cyclicparenthesize_superminmaxdiff_operatordadjoint_styledaggerdisable_split_super_subzdict[str, Any]_default_settingsc                	0   \         P                  ! W4       R V P                  9   d(   . R'OpV P                  R ,          V9  d   \        R4      hV P                  R,          f(   V P                  R ,          R8X  d   RV P                  R&   RRRRR	R
RR/p W0P                  R,          ,          V P                  R&    Y0P                  R,          ;'       g    R	,          V P                  R&   RRRR/V n        RRRRRRRRRRRRRR/pV P                  R,          pVP                  WU4      V P                  R&   RR R R R!R"R#R$/pV P                  R%,          pVP                  Ww4      V P                  R&&   R#   \         d$    T P                  R,          T P                  R&    Li ; i  \         dd    T P                  R,          P                  4       R(9   d   TR	,          T P                  R&    ELT P                  R,          T P                  R&    EL'i ; i))r   inlinezB'mode' must be one of 'inline', 'plain', 'equation' or 'equation*'r   NT ldotz \,.\, r]    \cdot times \times r   mul_symbol_latexmul_symbol_latex_numbers()r   ]r   riz
\mathrm{i}tiz\text{i}jrjz
\mathrm{j}tjz\text{j}r   imaginary_unit_latexr   rdz
\mathrm{d}tdz\text{d}r   diff_operator_latex)r   r   equationz	equation*) r   r   z\,z\:\;z\quad)r   __init__	_settings
ValueErrorKeyErrorstrip_delim_dictget)selfsettingsvalid_modesmul_symbol_tableimaginary_unit_table	imag_unitdiff_operator_tabler   s   &&      rS   r   LatexPrinter.__init__   s(   (T^^#(K~~f%[8  "= > > >>+,4v&(204DNN,- $J:[	
	- !=> NN-.

	1 !=!F!FG NN56  c3/ $-+-+ 
 NN#34	1E1I1I)1_-. $-+	
 70C0G0G0e,-I  	-|, NN-.	-  	1|,224BC %U+ 9: NN<0 9:	1s1   &E6 =F' F' 6+F$#F$'AH1 HHc                   V ^8  d   QhRR/# r   r   r   rP   )r   s   "rS   r   LatexPrinter.__annotate__   s     , , ,rU   c                	$    R P                  V4      # )z\left({}\right)r   r   rR   s   &&rS   _add_parensLatexPrinter._add_parens   s    !((++rU   c                   V ^8  d   QhRR/# r   rP   )r   s   "rS   r   r      s     - -s -rU   c                	$    R P                  V4      # )z\left( {}\right)r   r   s   &&rS   _add_parens_lspaceLatexPrinter._add_parens_lspace   s    "))!,,rU   c                   V ^8  d   QhRR/# r   rP   )r   s   "rS   r   r      s     % %s %rU   c                	   \        V4      pV'       d)   V'       d!   V P                  V P                  V4      4      # WR8  g   V'       g'   WR8:  d!   V P                  V P                  V4      4      # V P                  V4      # N)r   r   _print)r   itemlevelis_negstrictprec_vals   &&&&& rS   parenthesizeLatexPrinter.parenthesize   sa    )$/f##DKK$566v83D##DKK$566;;t$$rU   c                    RV9   d<   V P                   R,          '       d   V P                  V4      # RP                  V4      # V# )zt
Protect superscripts in s

If the parenthesize_super option is set, protect with parentheses, else
wrap in braces.
r   r   z{{{}}})r   r   r   r   s   &&rS   r   LatexPrinter.parenthesize_super   s@     !8~~233''**q))rU   c                   V ^8  d   QhRR/# r   rP   )r   s   "rS   r   r   
  s     E Es ErU   c                	,   \         P                  ! W4      pV P                  R ,          R8X  d   V# V P                  R ,          R8X  d
   RV,          # V P                  R,          '       d
   RV,          # V P                  R ,          pRV: RV: RV: R2# )	r   r   r   z$%s$r   z$$%s$$z\begin{rO   z\end{)r   doprintr   )r   exprtexenv_strs   &&  rS   r  LatexPrinter.doprint
  su    ood)>>&!W,J^^F#x/S= ^^F##s?"nnV,G.5sGDDrU   c                   V ^8  d   QhRR/# r   r   boolrP   )r   s   "rS   r   r     s     K Kt KrU   c                    VP                   ;'       d    VP                  ;'       g=    VP                  ;'       d)    V\        P                  J;'       d    VP
                  RJ '       * # )z
Returns True if the expression needs to be wrapped in brackets when
printed, False otherwise. For example: a + b => True; a => False;
10 => False; -10 => True.
F)
is_Integeris_nonnegativeis_Atomr   NegativeOneis_Rationalr   r  s   &&rS   _needs_bracketsLatexPrinter._needs_brackets  si     __<<)<)< J J I I$amm*C +H +H.2.>.>%.GK 	KrU   c                   V ^8  d   QhRR/# r  rP   )r   s   "rS   r   r   !  s       rU   c                0   V P                  V4      '       g   R# VP                  '       d   V P                  V4      '       g   R# VP                  '       d   V P	                  V4      '       g   R# VP
                  '       g   VP                  '       d   R# R# )aX  
Returns True if the expression needs to be wrapped in brackets when
passed as an argument to a function, False otherwise. This is a more
liberal version of _needs_brackets, in that many expressions which need
to be wrapped in brackets when added/subtracted/raised to a power do
not need them when passed to a function. Such an example is a*b.
FT)r  is_Mul_mul_is_cleanis_Pow_pow_is_cleanis_Addis_Functionr  s   &&rS   _needs_function_brackets%LatexPrinter._needs_function_brackets!  sl     ##D)) {{{4#5#5d#;#;T%7%7%=%= 0 0 0rU   c                   V ^8  d   QhRR/# r  rP   )r   s   "rS   r   r   8  s      D rU   c                P  a ^ RI Hp ^ RIHp ^ RIHp SP                  '       d"   V'       g   SP                  4       '       d   R# M1\        S4      \        R,          8  d   R# SP                  '       d   R# SP                  '       d   R# \        ;QJ d$    V3R l\        3 4       F  '       g   K   RM	  RM! V3R l\        3 4       4      '       d   R# V'       gG   \        ;QJ d!    V3R lWdV3 4       F  '       g   K   RM	  RM! V3R lWdV3 4       4      '       d   R# R# )	a  
Returns True if the expression needs to be wrapped in brackets when
printed as part of a Mul, False otherwise. This is True for Add,
but also for some container objects that would not need brackets
when appearing last in a Mul, e.g. an Integral. ``last=True``
specifies that this expr is the last to appear in a Mul.
``first=True`` specifies that this expr is the first to appear in
a Mul.
)Product)Sum)IntegralTr	   c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   has.0xr  s   & rS   	<genexpr>3LatexPrinter._needs_mul_brackets.<locals>.<genexpr>O       +Fqtxx{{F   !Fc              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   r#  r%  s   & rS   r(  r)  R  s     B)AADHHQKK)Ar+  )sympy.concrete.productsr  sympy.concrete.summationsr   sympy.integrals.integralsr!  r  could_extract_minus_signr   r    is_Relationalis_Piecewiseanyr   )r   r  firstlastr  r   r!  s   &f&&   rS   _needs_mul_brackets LatexPrinter._needs_mul_brackets8  s     	416;;;T::<<#D)Ju,==3+SF+333+SF+++B(S)ABB(S)ABBBrU   c                   V ^8  d   QhRR/# r  rP   )r   s   "rS   r   r   W  s      4 rU   c                   a SP                   '       d   R# \        ;QJ d$    V3R l\        3 4       F  '       g   K   RM	  RM! V3R l\        3 4       4      '       d   R# SP                  '       d   R# R# )z
Returns True if the expression needs to be wrapped in brackets when
printed as part of an Add, False otherwise.  This is False for most
things.
Tc              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   r#  r%  s   & rS   r(  3LatexPrinter._needs_add_brackets.<locals>.<genexpr>_  r*  r+  F)r1  r3  r   r  r  s   &frS   _needs_add_brackets LatexPrinter._needs_add_bracketsW  sK     3+SF+333+SF+++;;;rU   c                   V ^8  d   QhRR/# r  rP   )r   s   "rS   r   r   e  s      T rU   c                	V    VP                    F  pVP                  '       g   K   R # 	  R# )FT)argsr  r   r  args   && rS   r  LatexPrinter._mul_is_cleane  s!    99C  rU   c                   V ^8  d   QhRR/# r  rP   )r   s   "rS   r   r   k  s     3 3T 3rU   c                	B    V P                  VP                  4      '       * # r   )r  baser  s   &&rS   r  LatexPrinter._pow_is_cleank  s    ''		222rU   c                   V ^8  d   QhRR/# )r   r  r   rP   )r   s   "rS   r   r   n  s       rU   c                	$    Ve   RV: RV: R2# V# )N\left(	\right)^{rO   rP   r   r  exps   &&&rS   _do_exponentLatexPrinter._do_exponentn  s    ?.2C88KrU   c                	4   V P                  VP                  P                  4      pVP                  '       dM   VP                   Uu. uF  q0P	                  V4      NK  	  ppR pVP                  VRP                  V4      4      # RP                  V4      # u upi )z"\operatorname{{{}}}\left({}\right), z\text{{{}}})_deal_with_super_sub	__class____name__r@  r   r   join)r   r  namer7   lsrR   s   &&    rS   _print_BasicLatexPrinter._print_Basict  sw    (()@)@A999*.))4)Q++a.)B45A88D$))B-00!((..	 5s   Bc                   V ^8  d   QhRR/# )r   ez!bool | BooleanTrue | BooleanFalserP   )r   s   "rS   r   r   }  s        >  rU   c                	    R V,          # 	\text{%s}rP   r   r[  s   &&rS   _print_boolLatexPrinter._print_bool}      arU   c                	    R V,          # r]  rP   r_  s   &&rS   _print_NoneTypeLatexPrinter._print_NoneType  rb  rU   c                	0   V P                  WR 7      pRp\        V4       Fr  w  rVV^ 8X  d   M,VP                  4       '       d   VR,          pV) pM	VR,          pV P                  V4      pV P	                  V4      '       d
   RV,          pWG,          pKt  	  V# ))r   r    -  + \left(%s\right))_as_ordered_terms	enumerater0  r   r<  )r   r  r   termsr  r   termterm_texs   &&&     rS   
_print_AddLatexPrinter._print_Add  s    &&t&9 'GAAv..00uuu{{4(H''---8OC ( 
rU   c                	z   ^ RI Hp VP                  ^ 8X  d   R# V! V4      pVP                  pVP                  pVP                  R
,          V^,
          8X  d   W4^,
          ..,           pRpV F%  pV\        V4      P                  RR4      ,          pK'  	  VP                  RR4      pVP                  RR	4      pV# )    Permutation\left( \right)r   ,r   r   \left( r   \right)) sympy.combinatorics.permutationsrt  sizecyclic_form
array_formr   r   )r   r  rt  	expr_permsizrn  r   s   &&     rS   _print_CycleLatexPrinter._print_Cycle  s    @99>$4 $$	ii??2#')!AgYK/IAAsE22H ##C4##C4rU   c                	.   ^ RI Hp ^ RIHp VP                  pVe   V! RV R2RR^R7       MV P
                  P                  RR	4      pV'       d   V P                  V4      # VP                  ^ 8X  d   R
# VP                   Uu. uF  qPP                  V4      NK  	  pp\        \        V4      4       Uu. uF  qPP                  V4      NK  	  ppRP                  V4      pRP                  V4      p	RP                  W34      p
RV
,          # u upi u upi )rr  rs  )sympy_deprecation_warningzw
                Setting Permutation.print_cyclic is deprecated. Instead use
                init_printing(perm_cyclic=z).
                z1.6z#deprecated-permutation-print_cyclic)deprecated_since_versionactive_deprecations_target
stacklevelr   Tru   &  \\ z \begin{pmatrix} %s \end{pmatrix})rz  rt  sympy.utilities.exceptionsr  print_cyclicr   r   r  r{  r}  r   rangelenrU  )r   r  rt  r  r   rB  lowerupperrow1row2mats   &&         rS   _print_PermutationLatexPrinter._print_Permutation  s    @H!.."%++6- 8 */+P ..,,]DAK$$T**99>$-1__=_cS!_=-23u:->?->cS!->?zz% zz% llD<(2S88 >?s   D5Dc                	p    VP                   w  r#R V P                  V4      : RV P                  V4      : R2# )z\sigma_{z}(r   r@  r   )r   r  permvars   &&  rS   _print_AppliedPermutation&LatexPrinter._print_AppliedPermutation  s,    II	c%)[[%6C8HIIrU   c                	   \        VP                  4      pV P                  R ,          '       d   RMRpRV P                  9   d   V P                  R,          MRpRV P                  9   d   V P                  R,          MRp\        VP                  W#WER7      pV P                  R,          pRV9   db   VP                  R4      w  rV	^ ,          R	8X  d
   V	R
,          p	V P                  R,          R8X  d   VP                  RR4      pV: V: RV	: R2# VR8X  d   R# VR8X  d   R# V P                  R,          R8X  d   VP                  RR4      pV# )r   FTr   Nr   )strip_zeros	min_fixed	max_fixedr   r[  +   NNr   comma.z{,}z10^{rO   z+infz\inftyz-infz- \infty)r!   _precr   mlib_to_str_mpf_splitr   )
r   r  dpsr   lowhighstr_real	separatormantrM  s
   &&        rS   _print_FloatLatexPrinter._print_Float  s   $**%44$','>dnnU#D(-(?t~~e$Ttzz3Sa NN#=>	(?"..-KT1v}"g~~12g=||C.%)9c::~~12g=#++C6OrU   c                	    VP                   pVP                  pV P                  V\        R ,          4      : RV P                  V\        R ,          4      : 2# )r	   r   _expr1_expr2r   r    r   r  vec1vec2s   &&  rS   _print_CrossLatexPrinter._print_Cross  sJ    {{{{"&"3"3D*U:K"L"&"3"3D*U:K"LN 	NrU   c                	b    VP                   pR V P                  V\        R,          4      ,          # )z\nabla\times %sr	   _exprr   r    r   r  rn   s   && rS   _print_CurlLatexPrinter._print_Curl  s(    jj!D$5$5c:e;L$MMMrU   c                	b    VP                   pR V P                  V\        R,          4      ,          # )z\nabla\cdot %sr	   r  r  s   && rS   _print_DivergenceLatexPrinter._print_Divergence  s(    jj 4#4#4S*U:K#LLLrU   c                	    VP                   pVP                  pV P                  V\        R ,          4      : RV P                  V\        R ,          4      : 2# )r	   r   r  r  s   &&  rS   
_print_DotLatexPrinter._print_Dot  sJ    {{{{!%!2!24E9J!K!%!2!24E9J!KM 	MrU   c                	b    VP                   pR V P                  V\        R,          4      ,          # )z	\nabla %sr	   r  r   r  funcs   && rS   _print_GradientLatexPrinter._print_Gradient   (    zzd//j6GHHHrU   c                	b    VP                   pR V P                  V\        R,          4      ,          # )z	\Delta %sr	   r  r  s   && rS   _print_LaplacianLatexPrinter._print_Laplacian  r  rU   c                   V ^8  d   QhRR/# )r   r  r   rP   )r   s   "rS   r   r     s     q qt qrU   c                	x  a aaa ^ RI Hp S P                  R,          oS P                  R,          oR VV 3R llpR VV V3R llo\        V\        4      '       dx   VP
                  pV^ ,          \        P                  J gI   \        ;QJ d#    R VR	,           4       F  '       g   K   R
M	  RM! R VR	,           4       4      '       d	   S! V4      # RpVP                  4       '       d$   V) pRpVP                  '       d   VR,          pR
pMRpV! VR
R7      w  rxV\        P                  J d.   \        ^RRR7      VP
                  9  d   Wc! V4      ,          pEMLV! V4      p	V! V4      p
\        V
P                  4       4      pS P                  R,          pS P                  R,          '       dL   V^8:  dE   RV
9  d>   S P                  VRR7      '       d   VRV	: RV
: 2,          pEMWi: RV
: 2,          pEMVEe   \        V	P                  4       4      W,          8  Edq   S P                  VR
R7      '       d   VRV
: RS: RV	: R2,          pEMQVP                  '       Ed   \        P                  p\        P                  pVP
                   F  pS P                  VRR7      '       gU   \        V! W,          4      P                  4       4      W,          8  g%   VP                   VP                   u;J d   RJ d   M M
W,          pKz  W,          pK  	  S P                  VR
R7      '       d(   VRV! V4      : RV
: RS: RV! V4      : R2	,          pMLVRV! V4      : RV
: RS: V! V4      : 2,          pM'VRV
: RS: V	: 2,          pMVRV	: RV
: R2,          pV'       d
   VR,          pV# )rr  )fractionr   r   c                   V ^8  d   QhRR/# r   rP   )r   s   "rS   r   -LatexPrinter._print_Mul.<locals>.__annotate__  s     	A 	AS 	ArU   c                8  < V P                   '       g   \        SP                  V 4      4      # SP                  R9  d   V P	                  4       pM\        V P                  4      p\        VR RR7      w  r#\        VR RR7      w  rBS! W4,           V,           4      # )oldc                    \        V R 4      ;'       gC    \        V R4      ;'       g/    \        V \        4      ;'       d    \        V P                  R4      # )_scale_factoris_physical_constant)hasattr
isinstancer   rF  r'  s   &rS   rT   :LatexPrinter._print_Mul.<locals>.convert.<locals>.<lambda>  sW    ?8S 8H8yW^_`bxWy 8H 8H)!S1  G  G&qvv/EF8HrU   T)binaryc                    \        V R 4      # )r  )r  r  s   &rS   rT   r    s    ?8SrU   )r  none)r  r   r   r   as_ordered_factorslistr@  r$   )r  r@  unitsnonunitsprefixesconvert_argsr   s   &    rS   convert(LatexPrinter._print_Mul.<locals>.convert  s    ;;;4;;t,--::_4224D		?D #'t .HPT#V #'u.S\`"a#H$7%$?@@rU   c                   V ^8  d   QhRR/# r   rP   )r   s   "rS   r   r    s     	 	# 	rU   c           	       < R ;r\        V 4       F  w  r4SP                  V4      p\        VR4      '       g   \        VR4      '       g   SP                  WC^ 8H  V\	        V 4      ^,
          8H  R7      '       d
   RV,          p\
        ^ ,          P                  V4      '       d-   \
        ^,          P                  V4      '       d   VS,          pM#V'       d
   VS,          pMV'       d
   VS,          pW,          pTpK  	  V# )r   r  r  )r4  r5  ri  )rk  r   r  r6  r  _between_two_numbers_psearchmatch)	r@  _texlast_term_texr   rm  rn  	numbersepr   r  s	   &     rS   r  -LatexPrinter._print_Mul.<locals>.convert_args  s    #%%D$T?;;t,o66'$H^:_:_//!V673t9q=6H 0 K K#5#@.q188GG.q177AA	)	)I%D  (# +$ KrU   c              3  B   "   T F  p\        V\        4      x  K  	  R # 5ir   )r  r
   )r&  rB  s   & rS   r(  *LatexPrinter._print_Mul.<locals>.<genexpr>;  s     &S(3z#v'>'>(s   r  TF- r   r   )exact)evaluater   r   r   )r5  rJ  z
\right) / z / z	\frac{1}{rO   rx  \frac{}{r   ry  )sympy.simplifyr  r   r  r	   r@  r   Oner3  r0  r  r   r  r  r6  r  is_commutative)r   r  r  r  r@  include_parensr  numerdenomsnumersdenomldenomratioabr'  r  r  r  s   f&              @@@rS   
_print_MulLatexPrinter._print_Mul  s   +(:;	(BC		A 	A 	 	8 dC  99DAw!%%33&S$r(&S333&S$r(&S#S#S#D))((**5DC{{{s
!%CD1AEE>c!R%8		I 74= C U^FU^F(FNN#45E~~/00Vq[v%++E+>>ffEEC88C"'%,6++E+==!9f6 6C\\\AA"ZZ33AE3BB #GACL$6$6$8 9EL H!"!1!1Q5E5E!N!NFAFA ( ///==&qz69gaj J J &qz69gaj J J &)VLLC66::3JC
rU   c                	    VP                   '       d.   V P                  VP                  4       P                  4       4      # V P                  VP                  4       4      # r   )
is_aliasedr   as_polyas_exprr  s   &&rS   _print_AlgebraicNumber#LatexPrinter._print_AlgebraicNumber{  s>    ???;;t||~55788;;t||~..rU   c                	    V P                  VP                  4      pVP                  '       d   R V R2# V P                  VP                  P	                  4       4      pR V RV R2# )rJ  rx  rQ  )r   pis_inertalphar  )r   r  r  r  s   &&  rS   _print_PrimeIdealLatexPrinter._print_PrimeIdeal  s\    KK===QCw''DJJ..012eWG,,rU   c                   V ^8  d   QhRR/# )r   r  r   rP   )r   s   "rS   r   r     s     +< +<s +<rU   c                	l   VP                   P                  '       Ed   VP                   P                  pVP                   P                  p\	        V4      ^8X  d   V^8w  d   V P
                  R,          '       d   V P                  VP                  4      pV^8X  d   RV,          pM.V P
                  R,          '       d   RW43,          pM
RW43,          pVP                   P                  '       d
   RV,          # V# V P
                  R,          '       d   V^8w  d   V P                  VP                  \        R,          4      pVP                  P                  '       d   V P                  V4      pVP                  P                  '       d%   V P                  VP                  V: R	V: 2R
7      # V: RV: R	V: R2# VP                   P                  '       d   VP                  P                  '       d   VP                  ^8X  d   VP                  : RVP                   : R2# VP                  P                  '       d   VP                  P                  pVP                  P                  pWg,          \	        V4      8X  d?   VP                   R8X  d   RV: RV: R2# RV: RV: R\	        VP                   4      : R2# V P                  V4      # VP                  P                  '       d7   V P                  VP                  V P                  VP                   4      R
7      # RpV P!                  W4      # )r  r   z	\sqrt{%s}r   z\root{%d}{%s}z\sqrt[%d]{%s}z\frac{1}{%s}r   r   /rM  ^{rO   z\frac{1}{\frac{r  }}z\frac{1}{(\frac{z})^{z%s^{%s}ry  )rM  r  r  qr   r   r   rF  is_negativer   r    	is_Symbolr   r  r  r  _helper_print_standard_power)r   r  r  r  rF  r  base_pbase_qs   &&      rS   
_print_PowLatexPrinter._print_Pow  sG   88XXZZAXXZZA1v{qAv$..*I*I{{499-6&-C^^F++*aY6C*aY6C88'''*S00J 233Q((Ju4EF99&&&2248D99(((;;tyyA6F;GG(,a33%%%$))*B*B*B99>)-DHH==99((("&))++F"&))++F#f+588r>AG#PP * IOPVX[\`\d\dXe#fft,,99   ;;tyydkk$((.C;DD00;;rU   c                    V ^8  d   QhRRRR/# )r   templater   r   rP   )r   s   "rS   r   r     s     & &3 &3 &rU   c                	"   V P                  VP                  4      pV P                  VP                  \        R ,          4      pVP                  P
                  '       d   V P                  V4      pMVP                  P                  '       d   RV,          pMp\        VP                  \        4      '       dQ   VP                  R4      '       d:   \        P                  ! RV4      '       d   VP                  R4      '       d   V^R pW$V3,          # )r   z{%s}rJ  z\\left\(\\d?d?dotrx  i)r   rM  r   rF  r    r  r   is_Floatr  r   
startswithrer  endswith)r   r  r  rM  rF  s   &&&  rS   r  )LatexPrinter._helper_print_standard_power  s    kk$((#   Ju,=>99**40DYYT>DJ//	**-t44j))2;D+%%rU   c                	F    V P                  VP                  ^ ,          4      # rr  r   r@  r  s   &&rS   _print_UnevaluatedExpr#LatexPrinter._print_UnevaluatedExpr  s    {{499Q<((rU   c           
     	4  a  \        VP                  4      ^8X  dD   R\        VP                  ^ ,           Uu. uF  pS P                  V4      NK  	  up4      ,          pMBV 3R lpR\        P                  RVP                   Uu. uF
  qT! V4      NK  	  up4      ,          p\        VP                  \        4      '       d,   VRS P                  VP                  4      ,          ,          pV# VS P                  VP                  4      ,          pV# u upi u upi )r  z\sum_{%s=%s}^{%s} c           	        < R \        V ^,          V ^ ,          V ^,          3 Uu. uF  pSP                  V4      NK  	  up4      ,          # u upi z%s \leq %s \leq %stupler   lrR   r   s   & rS   _format_ineq-LatexPrinter._print_Sum.<locals>._format_ineq  I    ,AaD!A$!3EF3Ea4;;q>3EFGH HF   A
z\sum_{\substack{%s}} \\ri  	r  limitsr/  r   r   rU  r  functionr   r   r  r   r  r2  r1  s   f&    rS   
_print_SumLatexPrinter._print_Sum  s    t{{q 't{{1~>~!t{{1~~>?@CH +4;;!G;a,q/;!GHIC dmmS))%DMM(BBBC 
 4;;t}}--C
 ? "H   D
Dc           
     	4  a  \        VP                  4      ^8X  dD   R\        VP                  ^ ,           Uu. uF  pS P                  V4      NK  	  up4      ,          pMBV 3R lpR\        P                  RVP                   Uu. uF
  qT! V4      NK  	  up4      ,          p\        VP                  \        4      '       d,   VRS P                  VP                  4      ,          ,          pV# VS P                  VP                  4      ,          pV# u upi u upi )r  z\prod_{%s=%s}^{%s} c           	        < R \        V ^,          V ^ ,          V ^,          3 Uu. uF  pSP                  V4      NK  	  up4      ,          # u upi r-  r.  r0  s   & rS   r2  1LatexPrinter._print_Product.<locals>._format_ineq  r4  r5  z\prod_{\substack{%s}} r6  ri  r7  r:  s   f&    rS   _print_ProductLatexPrinter._print_Product  s    t{{q (t{{1~>~!t{{1~~>?@CH ,4;;!G;a,q/;!GHIC dmmS))%DMM(BBBC 
 4;;t}}--C
 ? "Hr=  c                   V ^8  d   QhRR/# )r   r  z'BasisDependent'rP   )r   s   "rS   r   r     s      *: rU   c                	   ^ RI Hp . pWP                  8X  d   VP                  P                  # \	        W4      '       d    VP                  4       P                  4       pM^ V3.pV F  w  rV\        VP                  P                  4       4      pVP                  R R7       V F  w  rV	^8X  d%   VP                  RVP                  ,           4       K0  V	R8X  d%   VP                  RVP                  ,           4       K[  RV P                  V	4      ,           R,           p
VP                  RV
,           VP                  ,           4       K  	  K  	  RP                  V4      pV^,          R	8w  d   VR
,          pV# VR,          pV# )rr  )Vectorc                0    V ^ ,          P                  4       # r'  )__str__r  s   &rS   rT   4LatexPrinter._print_BasisDependent.<locals>.<lambda>  s    !A$,,.rU   keyrh  rg  rJ  rx  r   -:   NNr  ry  )sympy.vectorrE  zero_latex_formr  separateitemsr  
componentssortappendr   rU  )r   r  rE  o1rQ  systemvect
inneritemskvarg_stroutstrs   &&          rS   _print_BasisDependent"LatexPrinter._print_BasisDependent  s/   '9999(((d##MMO))+EYKE!LFdoo3356JOO 8O9"6IIeamm34"WIIeamm34'$++a.8:EGIIego=> # " ''"+!9BZF  BZFrU   c                	    V P                  VP                  4      pR V,           R,           RRP                  \        V P                   VP                  4      4      ,          ,           pV# )rs   rO   _{%s}rv  )r   rF  rU  mapindices)r   r  tex_baser  s   &&  rS   _print_IndexedLatexPrinter._print_Indexed  sP    ;;tyy)(l3wT\\**,  , ,
rU   c                	8    V P                  VP                  4      # r   )r   labelr  s   &&rS   _print_IndexedBaseLatexPrinter._print_IndexedBase  s    {{4::&&rU   c                	h   V P                  VP                  4      pVP                  e   V P                  VP                  4      pVP                  e   V P                  VP                  4      pMV P                  \        P
                  4      pRP                  WCR7      pRP                  W%R7      # V# )Nz%{lower}\mathrel{{..}}\nobreak {upper})r  r  z{{{label}}}_{{{interval}}})rg  interval)r   rg  r  r  r   Zeror   )r   r  rg  r  r  rk  s   &&    rS   
_print_IdxLatexPrinter._print_Idx  s    DJJ'::!KK

+Ezz%DJJ/AFF+@GG! H 2H/66 7 4 4 rU   c           	     	J   \        VP                  4      '       d   R pMV P                  R,          pRp^ p\        VP                  4       Fu  w  rVWF,          pV^8X  d!   W2: RV P                  V4      : 2,          pK4  W2: RV P                  V P                  V4      4      : RV P                  V4      : R2,          pKw  	  V^8X  d   RV: RV: R2pMRV: RV P                  V4      : RV: R2p\        ;QJ d&    R	 VP                   4       F  '       g   K   R
M	  RM! R	 VP                   4       4      '       d2   V: RV P                  VP                  \        R,          R
R
R7      : 2# V: RV P                  VP                  \        R,          RR
R7      : 2# )z\partialr   r   r   r  rO   r  r  }}{c              3  @   "   T F  qP                  4       x  K  	  R # 5ir   r0  r&  r   s   & rS   r(  1LatexPrinter._print_Derivative.<locals>.<genexpr>;  s     ?Y))++Y   TFr	   r   r   )r   r  r   reversedvariable_countr   r   r3  r@  r   r    )r   r  diff_symbolr  dimr'  nums   &&     rS   _print_DerivativeLatexPrinter._print_Derivative%  sb   DII&&%K..)>?Kt223FAJCax;A??(,(?(?A(O(,C(8: : 4 !8&137C  ,7C8H#NC3?TYY?333?TYY???"D$5$5dii2<U2C9=9= %6 %? @ @
  1 1$))2<U2C9>9= !2 !? @ 	@rU   c                	   a  VP                   w  r#pS P                  V4      pV 3R  lV 4       pV 3R lV 4       pRP                  R \        Wg4       4       4      pRV: RV: R2# )c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   r   r&  r[  r   s   & rS   r(  +LatexPrinter._print_Subs.<locals>.<genexpr>I       1ST[[^^Sr+  c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   r  r  s   & rS   r(  r  J  r  r+  z\\ c              3  \   "   T F"  q^ ,          R,           V^,          ,           x  K$  	  R# 5i)rr  =NrP   )r&  r[  s   & rS   r(  r  K  s'      !B'@!aD3J1'@s   *,z\left. z \right|_{\substack{ z }})r@  r   rU  zip)	r   subsr  r  new
latex_expr	latex_old	latex_new
latex_subss	   f&       rS   _print_SubsLatexPrinter._print_SubsF  sg    3[[&
1S1	1S1	[[ !B'*9'@!B B
9C9CE 	ErU   c           
     	<   R . r2V P                   R,          p\        VP                  4      ^8:  d   \        ;QJ d&    R VP                   4       F  '       d   K   RM	  RM! R VP                   4       4      '       dl   RR\        VP                  4      ^,
          ,          ,           R,           pVP                   Uu. uF"  pRV: V P	                  V^ ,          4      : 2NK$  	  ppEM&\        VP                  4       EF  pV^ ,          pVR	,          p\        V4      ^8  d   V P                   R
,          R8w  d#   V P                   R,          '       g
   VR,          p\        V4      ^8X  d?   VRV P	                  V^,          4      : RV P	                  V^,          4      : R2,          p\        V4      ^8X  d'   VRV P	                  V^,          4      ,          ,          pVP                  ^ RV: V P	                  V4      : 24       EK  	  V: RT P                  VP                  \        R,          \        ;QJ d&    R VP                   4       F  '       g   K   RM	  RM! R VP                   4       4      RR7      : R P                  V4      : 2# u upi )r   r   c              3  >   "   T F  p\        V4      ^8H  x  K  	  R# 5i)r  N)r  )r&  lims   & rS   r(  /LatexPrinter._print_Integral.<locals>.<genexpr>U  s     (N+3SQ+s   FTz\ir   ntz\, z\intr   r   r   z\limits_{}^{rO   ^{%s}r   r	   c              3  @   "   T F  qP                  4       x  K  	  R # 5ir   rr  rs  s   & rS   r(  r  p  s     >oen`a?Y?Y?[?[enru  rv  )r   r  r8  allr   rw  insertr   r9  r    r3  r@  rU  )r   r  r  symbolsry  symbolr  s   &&     rS   _print_IntegralLatexPrinter._print_IntegralP  s   2Wnn%:; t{{q SS(N$++(NSSS(N$++(N%N%N #s4;;/!344t;C%)[[2%06 &1$++fQi2HI%0  2G  ,Qws8a<~~f-9$(NN6$:$:z)3x1}t{{3q6/B/3{{3q6/B D D3x1}w$++c!f*=>>qT[[=P"QR -" !$"3"3DMM4>u4E;>3>oeienen>o333>oeienen>o;o;? #4 #A  WWW-	/ 	/+2s   >(Jc                	   VP                   w  r#rER V P                  V4      ,          p\        V4      R8X  g&   V\        P                  \        P
                  39   d!   VRV P                  V4      ,          ,          pM.W`P                  V4      : RV P                  V4      : R2,          p\        V\        4      '       d   V: RV P                  V4      : R2# V: RV P                  V4      : 2# )z\lim_{%s \to z+-z%s}r   rO   rJ  rx  r   )r@  r   r   r   InfinityNegativeInfinityr  r   )r   r  r[  zz0dirr  s   &&     rS   _print_LimitLatexPrinter._print_Limitt  s    		bQ/s8trajj!2D2D%EE6DKKO++CBS1ABBCa!!+.A??"DKKN33rU   c                    V ^8  d   QhRRRR/# )r   r  r   r   rP   )r   s   "rS   r   r     s      S S rU   c                   V P                  V4      pVP                  R4      pVP                  R4      pV\        9   d   RV,          pV# \        V4      ^8X  g&   VP	                  R4      '       g   V^8X  g   V^8X  d   TpV# V^ 8  d,   V^ 8  d%   RVR\        W24       : RV\        W24      R : 2pV# V^ 8  d   RVRV : RWR : 2pV# V^ 8  d   RVRV : RWR : 2pV# RV,          pV# )	a;  
Logic to decide how to render a function to latex
  - if it is a recognized latex name, use the appropriate latex command
  - if it is a single letter, excluding sub- and superscripts, just use that letter
  - if it is a longer name, then put \operatorname{} around it and be
    mindful of undercores in the name
r   _z\%sr   \operatorname{NrO   z\operatorname{%s})rR  findaccepted_latex_functionsr  r"  r   )r   r  superscriptidxsubscriptidxrV  s   &&   rS   _hprint_FunctionLatexPrinter._hprint_Function  s!    ((.3yy~++D=D$ # Y!^tt448I^_`M`D   !lQ&6:#l:;\9:;=   !#.))+  !,'')
  ,d2rU   c                    V ^8  d   QhRRRR/# )r   r  r   r   r   rP   )r   s   "rS   r   r     s     J) J)H J)3 J)rU   c                F   VP                   P                  p\        V RV,           4      '       d0   \        V\        4      '       g   \        V RV,           4      ! W4      # VP                   Uu. uF  p\        V P                  V4      4      NK  	  ppV P                  R,          pRpV P                  R,          ;'       d>    \        V4      ^8H  ;'       d(    V P                  VP                  ^ ,          4      '       * p. ROp	W99   dI   VR8X  d   M@VR8X  d"   VR,          R8X  d   RMR	VR
,          ,           pMVR8X  d   VR
,          pRpVe   RpV'       d    V\        9   d   RV,          p
MLRV,          p
MBVe.   V P                  V4      pV P                  V4      pV: RV: R2p
MV P                  V4      p
V'       d    V\        9   d   V
R,          p
MV
R,          p
M	V
R,          p
V'       d   Ve   V
RV,          ,          p
V
RP                  V4      ,          # u upi )a  
Render functions to LaTeX, handling functions that LaTeX knows about
e.g., sin, cos, ... by using the proper LaTeX command (\sin, \cos, ...).
For single-letter function names, render them as regular LaTeX math
symbols. For multi-letter function names that LaTeX does not know
about, (e.g., Li, sech) use \operatorname{} so that the function name
is rendered in Roman font and LaTeX handles spacing properly.

expr is the expression involving the function
exp is an exponent
_print_r   Fr   r   fullhararcr  powerTz\%s^{-1}z\operatorname{%s}^{-1}r  rO   z {%s}%s{\left(%s \right)}r  rv  )asinacosatanacscasecacotasinhacoshatanhacschasechacothry  )r  rT  r  r  r   getattrr@  r   r   r   r  r  r  r  r   rU  )r   r  rM  r  rB  r@  r   inv_trig_power_casecan_fold_bracketsinv_trig_tablerV  func_texs   &&&         rS   _print_FunctionLatexPrinter._print_Function  s    yy!!4T)**t\224T!124==59YY?YcCC()YD? "^^,<=N"' $/C D !@ !@D	Q!@ !@11$))A,?? N %!]2#v-$(HOD$r(JD#w.8D*.' ,1)"33&-D4t;D006228<%-s3,,T2 33 H$DEMD--"s3&#((4.((s @s   -#Hc                	6    V P                  \        V4      4      # r   )r  r   r  s   &&rS   _print_UndefinedFunction%LatexPrinter._print_UndefinedFunction  s    $$SY//rU   c                	|    R V P                  VP                  4      : RV P                  VP                  4      : R2# )rs   z}_{\circ}\left({z}\right))r   r9  r  r  s   &&rS   _print_ElementwiseApplyFunction,LatexPrinter._print_ElementwiseApplyFunction  s,    KK&KK		"
 	
rU   c                	^    ^ RI Hp ^ RIHpHp ^ RIHp ^ RIHp ^ RI	H
p VRVRVRVR	VRVR
/# )rr  )KroneckerDelta)gamma
lowergamma)beta)
DiracDelta)r?   z\deltar*   \gammaz\operatorname{B}z\operatorname{Chi})(sympy.functions.special.tensor_functionsr  'sympy.functions.special.gamma_functionsr  r  &sympy.functions.special.beta_functionsr  'sympy.functions.special.delta_functionsr  'sympy.functions.special.error_functionsr?   )r   r  r  r  r  r  r?   s   &      rS   _special_function_classes&LatexPrinter._special_function_classes  s;    KM?F?		I)I*, 	,rU   c                	    V P                    FF  p\        W4      '       g   K  VP                  VP                  8X  g   K3  V P                   V,          u # 	  V P                  \	        V4      4      # r   )r  
issubclassrT  r  r   )r   r  clss   && rS   _print_FunctionClass!LatexPrinter._print_FunctionClass  sT    11C$$$#,,)F55c:: 2 $$SY//rU   c                	    VP                   w  r!\        V4      ^8X  d   V P                  V^ ,          4      pMV P                  \        V4      4      pRV: RV P                  V4      : R2pV# )r  rw  z	 \mapsto  \right))r@  r  r   r/  )r   r  r  r  s   &&  rS   _print_LambdaLatexPrinter._print_Lambda  sV    		w<1kk'!*-Gkk%.1G18$++d:KL
rU   c                	    R # )z\left( x \mapsto x \right)rP   r  s   &&rS   _print_IdentityFunction$LatexPrinter._print_IdentityFunction  s    ,rU   c                   V ^8  d   QhRR/# r   rP   )r   s   "rS   r   r     s      3 rU   c                	&   \        VP                  \        R 7      pV Uu. uF  pRV P                  V4      ,          NK  	  ppR\	        VP
                  4      P                  4       : RRP                  V4      : R2pVe   V: RV: R2# V# u upi )rI  r  r   rJ  rQ  rx  r  rO   )sortedr@  r   r   r   r  r  rU  )r   r  rM  r@  r  texargsr  s   &&&    rS   _hprint_variadic_function&LatexPrinter._hprint_variadic_function  s|    dii%56=ABT654;;v...TB'*499~';';'='+yy'9;?!$c**J Cs   !Bc                	t    R V P                  VP                  ^ ,          4      ,          pVe   V: RV: R2# V# )z\left\lfloor{%s}\right\rfloorr  rO   r(  r   r  rM  r  s   &&& rS   _print_floorLatexPrinter._print_floor&  s2    .TYYq\1JJ?!$c**JrU   c                	t    R V P                  VP                  ^ ,          4      ,          pVe   V: RV: R2# V# )z\left\lceil{%s}\right\rceilr  rO   r(  r  s   &&& rS   _print_ceilingLatexPrinter._print_ceiling.  s2    ,t{{499Q</HH?!$c**JrU   c                	    V P                   R ,          '       g+   RV P                  VP                  ^ ,          4      ,          pM)RV P                  VP                  ^ ,          4      ,          pVe   V: RV: R2# V# )r   z\log{\left(%s \right)}z\ln{\left(%s \right)}r  rO   )r   r   r@  r  s   &&& rS   
_print_logLatexPrinter._print_log6  s\    ~~m,,+dkk$))A,.GGC*T[[1-FFC?!$c**JrU   c                	t    R V P                  VP                  ^ ,          4      ,          pVe   V: RV: R2# V# )\left|{%s}\right|r  rO   r(  r  s   &&& rS   
_print_AbsLatexPrinter._print_AbsA  s2    "T[[1%>>?!$c**JrU   c                	<   V P                   R ,          '       d7   RV P                  VP                  ^ ,          \        R,          4      ,          pM=RP	                  V P                  VP                  ^ ,          \        R,          4      4      pV P                  W24      # )r   z\Re{%s}Atomz\operatorname{{re}}{{{}}}r   r   r@  r    r   rN  r  s   &&& rS   	_print_reLatexPrinter._print_reI  s    >>.))t001z&?QRRC.55d6G6G		RSV`agVh6ijC  **rU   c                	<   V P                   R ,          '       d7   RV P                  VP                  ^ ,          \        R,          4      ,          pM=RP	                  V P                  VP                  ^ ,          \        R,          4      4      pV P                  W24      # )r   z\Im{%s}r  z\operatorname{{im}}{{{}}}r  r  s   &&& rS   	_print_imLatexPrinter._print_imQ  r  rU   c                	   ^ RI HpHp \        VP                  ^ ,          V4      '       d$   V P                  VP                  ^ ,          R4      # \        VP                  ^ ,          V4      '       d$   V P                  VP                  ^ ,          R4      # VP                  ^ ,          P                  '       d*   RV P                  VP                  ^ ,          4      ,          # RV P                  VP                  ^ ,          4      ,          # )rr  )
EquivalentImpliesz\not\Leftrightarrowz\not\Rightarrowz\neg \left(%s\right)z\neg %s)	sympy.logic.boolalgr  r  r  r@  _print_Equivalent_print_Implies
is_Booleanr   )r   r[  r  r  s   &&  rS   
_print_NotLatexPrinter._print_NotY  s    =affQi,,))!&&)5KLLaffQi))&&qvvay2DEEFF1I   *T[[-CCCAFF1I 666rU   c                	   V^ ,          pVP                   '       d,   VP                  '       g   RV P                  V4      ,          pMRV P                  V4      ,          pVR,           Fj  pVP                   '       d6   VP                  '       g$   VRV: RV P                  V4      : R2,          pKJ  VRV: RV P                  V4      : 2,          pKl  	  V# )rr  ri  r  r  r   z \left(rx  )r  is_Notr   )r   r@  charrB  r  s   &&&  rS   _print_LogOpLatexPrinter._print_LogOpd  s    1g>>>#***$t{{3'77C$++c**C88C~~~cjjjt{{37GHHD$++c*:;;	  
rU   c                	\    \        VP                  \        R 7      pV P                  VR4      # )rI  z\wedger  r@  r   r  r   r[  r@  s   && rS   
_print_AndLatexPrinter._print_Ands  s&    aff"23  y11rU   c                	\    \        VP                  \        R 7      pV P                  VR4      # )rI  z\veer  r  s   && rS   	_print_OrLatexPrinter._print_Orw  s&    aff"23  w//rU   c                	\    \        VP                  \        R 7      pV P                  VR4      # )rI  z\veebarr  r  s   && rS   
_print_XorLatexPrinter._print_Xor{  s&    aff"23  z22rU   c                	N    T P                  VP                  T;'       g    R 4      # )z\Rightarrow)r  r@  )r   r[  altchars   &&&rS   r  LatexPrinter._print_Implies  s!      )B)BNCCrU   c                	n    \        VP                  \        R 7      pT P                  Y2;'       g    R4      # )rI  z\Leftrightarrowr  )r   r[  r%  r@  s   &&& rS   r  LatexPrinter._print_Equivalent  s-    aff"23  'D'D2DEErU   c                	t    R V P                  VP                  ^ ,          4      ,          pVe   V: RV: R2# V# )z\overline{%s}r  rO   r(  r  s   &&& rS   _print_conjugateLatexPrinter._print_conjugate  s2    TYYq\!::?!$c**JrU   c                	    R pRV P                  VP                  ^ ,          4      ,          pVe   V: RV: RV: 2# V: V: 2# )z\operatorname{polar\_lift}r  r  rO   r(  )r   r  rM  r  rB  s   &&&  rS   _print_polar_liftLatexPrinter._print_polar_lift  s?    ,#dkk$))A,&???#'c22"C((rU   c                	v    R V P                  VP                  ^ ,          4      ,          pV P                  W24      # )ze^{%s})r   r@  rN  r  s   &&& rS   _print_ExpBaseLatexPrinter._print_ExpBase  s0     $++diil33  **rU   c                	    R # )r[  rP   rL  s   &&&rS   _print_Exp1LatexPrinter._print_Exp1  s    rU   c                	    R V P                  VP                  ^ ,          4      ,          pVe   RV: RV: 2# RV,          # )ri  zK^{rO   zK%sr(  r  s   &&& rS   _print_elliptic_kLatexPrinter._print_elliptic_k  s7     4;;tyy|#<<?"%s++C<rU   c                	    R V P                  VP                  ^ ,          4      : RV P                  VP                  ^,          4      : R2pVe   RV: RV: 2# RV,          # )rJ  	\middle| rx  zF^{rO   zF%sr(  r  s   &&& rS   _print_elliptic_fLatexPrinter._print_elliptic_f  sK    [[1&DIIaL(AC?"%s++C<rU   c                	N   \        VP                  4      ^8X  dM   RV P                  VP                  ^ ,          4      : RV P                  VP                  ^,          4      : R2pM)RV P                  VP                  ^ ,          4      ,          pVe   RV: RV: 2# RV,          # )r   rJ  r9  rx  ri  zE^{rO   zE%sr  r@  r   r  s   &&& rS   _print_elliptic_eLatexPrinter._print_elliptic_e  sx    tyy>QTYYq\*DKK		!,EGC %t{{499Q<'@@C?"%s++C<rU   c           	     	   \        VP                  4      ^8X  dq   RV P                  VP                  ^ ,          4      : RV P                  VP                  ^,          4      : RV P                  VP                  ^,          4      : R2pMKRV P                  VP                  ^ ,          4      : RV P                  VP                  ^,          4      : R2pVe   RV: RV: 2# RV,          # )rL  rJ  ; r9  rx  z\Pi^{rO   z\Pi%sr=  r  s   &&& rS   _print_elliptic_piLatexPrinter._print_elliptic_pi  s    tyy>QTYYq\*DKK		!,ETYYq\*,C  TYYq\*DKK		!,EGC?$'--c>!rU   c                	    VP                   ^ ,          p\        VP                   4      ^8X  d   VP                   ^ ,          MVP                   ^,          pRV RV R2pVe   RV: RV: 2# RV,          # )rr  rJ  rQ  rx  z\operatorname{B}^{rO   z\operatorname{B}%s)r@  r  )r   r  rM  r'  yr  s   &&&   rS   _print_betaLatexPrinter._print_beta  sd    IIaL		Na/DIIaLTYYq\s"QCw'?14c::(3..rU   c           
     	    VP                    Uu. uF  q@P                  V4      NK  	  ppR V^ ,          : RV^,          : R2pVe%   RV: RV^,          : RV^,          : RV: RV: 2
# RV: RV^,          : RV^,          : RV: 2# u upi )rJ  rQ  rx  r  z}_{(z)}^{rO   z)}r  )r   r  rM  operatorrB  largsr  s   &&&&   rS   _print_betaincLatexPrinter._print_betainc  s    -1YY7YcS!Y7(-a%((;?=EuQxxQVWXQYQY[^`cdd  9A%((ERSHHVYZZ 8s   Bc                	(    V P                  WR R7      # )I)rI  )rK  rL  s   &&&rS   _print_betainc_regularized'LatexPrinter._print_betainc_regularized  s    ""4s";;rU   c                	    R V P                  VP                  ^ ,          4      : RV P                  VP                  ^,          4      : R2pVe   RV: RV: 2# RV,          # )rJ  rQ  rx  z\Gamma^{rO   z\Gamma%sr(  r  s   &&& rS   _print_uppergammaLatexPrinter._print_uppergamma  O    (,DIIaL(A(,DIIaL(AC ?'*C00$$rU   c                	    R V P                  VP                  ^ ,          4      : RV P                  VP                  ^,          4      : R2pVe   RV: RV: 2# RV,          # )rJ  rQ  rx  z\gamma^{rO   \gamma%sr(  r  s   &&& rS   _print_lowergammaLatexPrinter._print_lowergamma  rT  rU   c                   V ^8  d   QhRR/# r   rP   )r   s   "rS   r   r     s     ; ;c ;rU   c                	    R V P                  VP                  ^ ,          4      ,          pVe'   V P                  VP                  4      : RV: RV: 2# V P                  VP                  4      : V: 2# ri  r  rO   )r   r@  r  r  s   &&& rS   _hprint_one_arg_func!LatexPrinter._hprint_one_arg_func  sT     4;;tyy|#<<?#';;tyy#93DD"kk$))4c::rU   c                	    R V P                  VP                  ^ ,          4      ,          pVe   RV: RV: 2# RV,          # )ri  z\operatorname{Chi}^{rO   z\operatorname{Chi}%sr(  r  s   &&& rS   
_print_ChiLatexPrinter._print_Chi  s8     4;;tyy|#<<?36<<*S00rU   c                	    R V P                  VP                  ^,          4      ,          pV P                  VP                  ^ ,          4      pVe   RV: RV: RV: 2# RV: RV: 2# )ri  z\operatorname{E}_{r  rO   r(  )r   r  rM  r  nus   &&&  rS   _print_expintLatexPrinter._print_expint  sW     4;;tyy|#<<[[1&?68#sCC  24S99rU   c                	    R V P                  VP                  ^ ,          4      ,          pVe   RV: RV: 2# RV,          # )ri  zS^{rO   zS%sr(  r  s   &&& rS   _print_fresnelsLatexPrinter._print_fresnels  7     4;;tyy|#<<?"%s++C<rU   c                	    R V P                  VP                  ^ ,          4      ,          pVe   RV: RV: 2# RV,          # )ri  zC^{rO   zC%sr(  r  s   &&& rS   _print_fresnelcLatexPrinter._print_fresnelc  rh  rU   c                	    R V P                  VP                  ^ ,          \        R,          4      ,          pVe   RV: RV: R2# V# )z!%sFuncrJ  rK  rO   r   r@  r    r  s   &&& rS   _print_subfactorial LatexPrinter._print_subfactorial  s;    t((1z&7IJJ?.1377JrU   c                	    R V P                  VP                  ^ ,          \        R,          4      ,          pVe   V: RV: R2# V# )z%s!rm  r  rO   rn  r  s   &&& rS   _print_factorialLatexPrinter._print_factorial#  s;    t((1z&7IJJ?!$c**JrU   c                	    R V P                  VP                  ^ ,          \        R,          4      ,          pVe   V: RV: R2# V# )z%s!!rm  r  rO   rn  r  s   &&& rS   _print_factorial2LatexPrinter._print_factorial2+  s;    ))$))A,
68JKK?!$c**JrU   c                	    R V P                  VP                  ^ ,          4      : RV P                  VP                  ^,          4      : R2pVe   V: RV: R2# V# )z{\binom{r  r  r  rO   r(  r  s   &&& rS   _print_binomialLatexPrinter._print_binomial3  sI    %)[[1%>%)[[1%>@ ?!$c**JrU   c                	    VP                   w  r4R V P                  V\        R,          4      ,          pRV: RV P                  V4      : R2pV P	                  Wb4      # )r  rm  rs   	}^{\left(\right)}r@  r   r    r   rN  )r   r  rM  nrY  rF  r  s   &&&    rS   _print_RisingFactorial#LatexPrinter._print_RisingFactorial<  sL    yyt((Jv,>??+/Q@  **rU   c                	    VP                   w  r4R V P                  V\        R,          4      ,          pRV P                  V4      : RV: R2pV P	                  Wb4      # )r  rm  z{\left(z
\right)}_{rO   r}  )r   r  rM  r~  rY  subr  s   &&&    rS   _print_FallingFactorial$LatexPrinter._print_FallingFactorialD  sL    yyd'':f+=>>+/;;q>3?  **rU   c                    V ^8  d   QhRRRR/# )r   symr   r   rP   )r   s   "rS   r   r   L  s        rU   c                	   R V,          pRpVe$   VP                  R4      R	8X  d   V: RV: R2pMRpV: RV P                  VP                  4      : RV P                  VP                  4      : R2pV'       d   V P	                  WB4      pV# )
r  Fr   r  rO   Tr  }\left(rx  ry  )r  r   r   argumentrN  )r   r  rM  r  r  need_exps   &&&&  rS   _hprint_BesselBaseLatexPrinter._hprint_BesselBaseL  sx    sm?xx}"$'-+.DJJ0G+/;;t}}+EG ##C-C
rU   c                   V ^8  d   QhRR/# r   rP   )r   s   "rS   r   r   ]  s      # rU   c                	    V'       g   R # R pVRR  F"  pVRV P                  V4      ,          ,          pK$  	  W P                  VR,          4      ,          pV# )r   Nz%s, ry  r  )r   rn   rR   r   s   &&  rS   _hprint_vecLatexPrinter._hprint_vec]  sN    SbA$++a.((A 	[[R!!rU   c                	&    V P                  WR 4      # )Jr  rL  s   &&&rS   _print_besseljLatexPrinter._print_besseljf      &&t#66rU   c                	&    V P                  WR 4      # )rN  r  rL  s   &&&rS   _print_besseliLatexPrinter._print_besselii  r  rU   c                	&    V P                  WR 4      # )Kr  rL  s   &&&rS   _print_besselkLatexPrinter._print_besselkl  r  rU   c                	&    V P                  WR 4      # )Yr  rL  s   &&&rS   _print_besselyLatexPrinter._print_besselyo  r  rU   c                	&    V P                  WR 4      # )rE  r  rL  s   &&&rS   	_print_ynLatexPrinter._print_ynr  r  rU   c                	&    V P                  WR 4      # )r   r  rL  s   &&&rS   	_print_jnLatexPrinter._print_jnu  r  rU   c                	&    V P                  WR 4      # )zH^{(1)}r  rL  s   &&&rS   _print_hankel1LatexPrinter._print_hankel1x      &&t)<<rU   c                	&    V P                  WR 4      # )zH^{(2)}r  rL  s   &&&rS   _print_hankel2LatexPrinter._print_hankel2{  r  rU   c                	&    V P                  WR 4      # )zh^{(1)}r  rL  s   &&&rS   
_print_hn1LatexPrinter._print_hn1~  r  rU   c                	&    V P                  WR 4      # )zh^{(2)}r  rL  s   &&&rS   
_print_hn2LatexPrinter._print_hn2  r  rU   c                   V ^8  d   QhRR/# r   rP   )r   s   "rS   r   r     s     - -3 -rU   c                	    R V P                  VP                  ^ ,          4      ,          pVe   V: RV: RV: 2# V: V: 2# r[  r(  r   r  rM  notationr  s   &&&& rS   _hprint_airyLatexPrinter._hprint_airy  s:     4;;tyy|#<<?#+S#66&,,rU   c                   V ^8  d   QhRR/# r   rP   )r   s   "rS   r   r     s     4 4 4rU   c                	    R V P                  VP                  ^ ,          4      ,          pVe   RV: RV: RV: 2# V: RV: 2# )ri  rs   z
^\prime}^{rO   z^\primer(  r  s   &&&& rS   _hprint_airy_primeLatexPrinter._hprint_airy_prime  s:     4;;tyy|#<<?,4c3??%-s33rU   c                	&    V P                  WR 4      # Air  rL  s   &&&rS   _print_airyaiLatexPrinter._print_airyai        D11rU   c                	&    V P                  WR 4      # Bir  rL  s   &&&rS   _print_airybiLatexPrinter._print_airybi  r  rU   c                	&    V P                  WR 4      # r  r  rL  s   &&&rS   _print_airyaiprimeLatexPrinter._print_airyaiprime      &&t$77rU   c                	&    V P                  WR 4      # r  r  rL  s   &&&rS   _print_airybiprimeLatexPrinter._print_airybiprime  r  rU   c                	p   R V P                  \        VP                  4      4      : RV P                  \        VP                  4      4      : RV P	                  VP                  4      : RV P	                  VP                  4      : RV P                  VP
                  4      : R2pVe   RV: RV: R2pV# )	z{{}_{z}F_{}\left(\begin{matrix} r  z \end{matrix}\middle| {
} \right)}rs   r  rO   )r   r  apbqr  r  r  s   &&& rS   _print_hyperLatexPrinter._print_hyper  s{     [[TWW&CL(Atww')9)9$'')Bkk$--(	* ?"%s+C
rU   c                	|   R V P                  \        VP                  4      4      : RV P                  \        VP                  4      4      : RV P                  \        VP                  4      4      : RV P                  \        VP
                  4      4      : RV P                  VP
                  4      : RV P                  VP                  4      : RV P                  VP                  4      : RV P                  VP                  4      : RV P                  VP                  4      : R2pVe   RV: RV: R	2pV# )
z{G_{rQ  r  r  r   \\z \end{matrix} \middle| {r  rs   rO   )
r   r  r  r  ry   anr  aotherbotherr  r  s   &&& rS   _print_meijergLatexPrinter._print_meijerg  s     [[TWW&CL(Akk#dgg,'S\)Btww')9)9$++)Ftww')9)9$++)Fkk$--(* ?"%s+C
rU   c                	    R V P                  VP                  ^ ,          4      ,          pVe   RV: RV: 2# RV,          # )ri  z\eta^{rO   z\eta%sr(  r  s   &&& rS   _print_dirichlet_eta!LatexPrinter._print_dirichlet_eta  s7     4;;tyy|#<<?%(#..3rU   c                	   \        VP                  4      ^8X  d2   R\        \        V P                  VP                  4      4      ,          pM)RV P	                  VP                  ^ ,          4      ,          pVe   RV: RV: 2# RV,          # )r   z\left(%s, %s\right)ri  z\zeta^{rO   z\zeta%sr  r@  r/  ra  r   r  s   &&& rS   _print_zetaLatexPrinter._print_zeta  sf    tyy>Q(5T[[$))1L+MMC$t{{499Q<'@@C?&)3//CrU   c                	   \        VP                  4      ^8X  d2   R\        \        V P                  VP                  4      4      ,          pM)RV P	                  VP                  ^ ,          4      ,          pVe   RV: RV: R2# RV,          # )r   z_{%s}\left(%s\right)r`  r  r  rO   rV  r  r  s   &&& rS   _print_stieltjesLatexPrinter._print_stieltjes  sf    tyy>Q)E#dkk4992M,NNCT[[166C?'*C00S  rU   c                	    R \        \        V P                  VP                  4      4      ,          pVf
   RV,          # RV: RV: 2# )z\left(%s, %s, %s\right)z\Phi%sz\Phi^{rO   )r/  ra  r   r@  r  s   &&& rS   _print_lerchphiLatexPrinter._print_lerchphi  s?    (5T[[$))1L+MM;s?" !$c**rU   c                	    \        V P                  VP                  4      w  r4R V,          pVf   RV: RV: 2# RV: RV: RV: 2# )ri  z\operatorname{Li}_{rO   r  ra  r   r@  )r   r  rM  rR   r  r  s   &&&   rS   _print_polylogLatexPrinter._print_polylog  sD    4;;		* 1$;23S99 34c3??rU   c           	     	    \        V P                  VP                  4      w  r4rVR V: RV: RV: RV: R2	pVe   RV,           RV,          ,           pV# )P_{r{  rv  \right)}\left(rx  rJ  \right)^{%s}r  )r   r  rM  r~  r   r  r'  r  s   &&&     rS   _print_jacobiLatexPrinter._print_jacobi  sG    dii0
a?@!QJ?c/Os$;;C
rU   c                	    \        V P                  VP                  4      w  r4pR V: RV: RV: R2pVe   RV,           RV,          ,           pV# )zC_{r{  r  rx  rJ  r  r  r   r  rM  r~  r   r'  r  s   &&&    rS   _print_gegenbauerLatexPrinter._print_gegenbauer  C    dkk499-a<=q!D?c/Os$;;C
rU   c                	    \        V P                  VP                  4      w  r4R V: RV: R2pVe   RV,           RV,          ,           pV# )zT_{r  rx  rJ  r  r  r   r  rM  r~  r'  r  s   &&&   rS   _print_chebyshevtLatexPrinter._print_chebyshevt  A    4;;		*1*+Q/?c/Os$;;C
rU   c                	    \        V P                  VP                  4      w  r4R V: RV: R2pVe   RV,           RV,          ,           pV# )zU_{r  rx  rJ  r  r  r  s   &&&   rS   _print_chebyshevuLatexPrinter._print_chebyshevu  r  rU   c                	    \        V P                  VP                  4      w  r4R V: RV: R2pVe   RV,           RV,          ,           pV# )r  r  rx  rJ  r  r  r  s   &&&   rS   _print_legendreLatexPrinter._print_legendre  r  rU   c                	    \        V P                  VP                  4      w  r4pR V: RV: RV: R2pVe   RV,           RV,          ,           pV# )r  r{  r  rx  rJ  r  r  r  s   &&&    rS   _print_assoc_legendre"LatexPrinter._print_assoc_legendre   r  rU   c                	    \        V P                  VP                  4      w  r4R V: RV: R2pVe   RV,           RV,          ,           pV# )zH_{r  rx  rJ  r  r  r  s   &&&   rS   _print_hermiteLatexPrinter._print_hermite  r  rU   c                	    \        V P                  VP                  4      w  r4R V: RV: R2pVe   RV,           RV,          ,           pV# )L_{r  rx  rJ  r  r  r  s   &&&   rS   _print_laguerreLatexPrinter._print_laguerre  r  rU   c                	    \        V P                  VP                  4      w  r4pR V: RV: RV: R2pVe   RV,           RV,          ,           pV# )r  r{  r  rx  rJ  r  r  r  s   &&&    rS   _print_assoc_laguerre"LatexPrinter._print_assoc_laguerre  r  rU   c           	     	    \        V P                  VP                  4      w  r4rVR V: RV: RV: RV: R2	pVe   RV,           RV,          ,           pV# )zY_{r  r  rv  rx  rJ  r  r  r   r  rM  r~  mthetaphir  s   &&&     rS   
_print_YnmLatexPrinter._print_Ynm  H    t{{DII6eS23QsC?c/Os$;;C
rU   c           	     	    \        V P                  VP                  4      w  r4rVR V: RV: RV: RV: R2	pVe   RV,           RV,          ,           pV# )zZ_{r  r  rv  rx  rJ  r  r  r  s   &&&     rS   
_print_ZnmLatexPrinter._print_Znm#  r  rU   c           
     	    \        V P                  V4      w  rVpV'       d   R MRpV'       g   RMRV,          pV: V: RV: RV: RV: RV: 2
# )z	^{\prime}r   r  rJ  rQ  rx  )ra  r   )	r   	characterr@  rp   rM  r   r  r  sups	   &&&&&    rS   __print_mathieu_functions&LatexPrinter.__print_mathieu_functions*  s?    dkk4(a#lb33<c1aCPPrU   c                	>    V P                  R VP                  VR7      # )Cr  &_LatexPrinter__print_mathieu_functionsr@  rL  s   &&&rS   _print_mathieucLatexPrinter._print_mathieuc0      --c499#-FFrU   c                	>    V P                  R VP                  VR7      # )r   r  r'  rL  s   &&&rS   _print_mathieusLatexPrinter._print_mathieus3  r+  rU   c                	@    V P                  R VP                  RVR7      # )r&  Trp   rM  r'  rL  s   &&&rS   _print_mathieucprime!LatexPrinter._print_mathieucprime6       --c499Dc-RRrU   c                	@    V P                  R VP                  RVR7      # )r   Tr0  r'  rL  s   &&&rS   _print_mathieusprime!LatexPrinter._print_mathieusprime9  r3  rU   c                	(   VP                   ^8w  dh   RpVP                  pVP                  ^ 8  d   RpV) pV P                  R,          '       d   RW#VP                   3,          # RW#VP                   3,          # V P                  VP                  4      # )r  r   r  r   z	%s%d / %dz%s\frac{%d}{%d})r  r  r   r   )r   r  signr  s   &&  rS   _print_RationalLatexPrinter._print_Rational<  s}    66Q;DAvvzB~~/00#t&777%$&&(999;;tvv&&rU   c                	&   V P                  VP                  4      pVP                  '       dO   \        ;QJ d&    R  VP                   4       F  '       g   K   RM	  RM! R  VP                   4       4      '       g   \	        VP
                  4      ^8  d   VR,          p\	        VP
                  4      ^8  d#   W P                  VP
                  4      ,          pM:VP
                  '       d)   W P                  VP
                  ^ ,          4      ,          pVR,          p\	        VP                  4      ^8  d+   W P                  VP                  4      ,          pRV,          # W P                  VP                  ^ ,          4      ,          pRV,          # )c              3  F   "   T F  q\         P                  8g  x  K  	  R # 5ir   )r   rl  )r&  r  s   & rS   r(  ,LatexPrinter._print_Order.<locals>.<genexpr>K  s     >:a166k:s   !TFrA  \rightarrow zO\left(%s\right))r   r  pointr3  r  	variables)r   r  rR   s   && rS   _print_OrderLatexPrinter._print_OrderI  s
   KK		":::##>4::>###>4::>>>t~~"IA4>>"Q&[[00[[!233 A4::"[[,, #Q&& [[A//"Q&&rU   c                   V ^8  d   QhRR/# )r   r  r   rP   )r   s   "rS   r   r   Y  s     A A& ArU   c                	    V P                   R ,          P                  V4      pVe   V# V P                  VP                  VR7      # )r   style)r   r   rR  rV  )r   r  rF  rV  s   &&& rS   _print_SymbolLatexPrinter._print_SymbolY  s@    NN>266t<K((%(@@rU   c                    V ^8  d   QhRRRR/# )r   rV  r   r   z tuple[str, list[str], list[str]]rP   )r   s   "rS   r   r   b  s     
$ 
$S 
$-M 
$rU   c                	V   Ve   RV9   d   V. . 3# V P                   R,          '       d'   VP                  RR4      P                  RR4      . . r2pM\        V4      w  rp\        V4      pV Uu. uF  p\        V4      NK  	  ppV Uu. uF  p\        V4      NK  	  ppWV3# u upi u upi )Nrs   r   r  z\_r   z\^)r   r   r   	translate)r   rV  supersr  r"  r  s   &&    rS   _split_super_subLatexPrinter._split_super_subb  s    <3$;"b>!^^566"&,,sE":"B"B3"NPRTV$D$!0!6D$,23FS)C.F3*./$3	#$/d## 4/s   -B!B&c                    V ^8  d   QhRRRR/# )r   stringr   r   rP   )r   s   "rS   r   r   n  s      3 # rU   c                	    V P                  V4      w  r4pVR 8X  d   RP                  V4      pV'       d    VRRP                  V4      ,          ,          pV'       d    VRRP                  V4      ,          ,          pV# )rv   \mathbf{{{}}}r  r   r`  )rM  r   rU  )r   rP  rF  rV  rL  r  s   &&&   rS   rR  !LatexPrinter._deal_with_super_subn  sl    !226:d F?#**40D Gchhv...DGchhtn,,DrU   c                	    V P                   R ,          '       d   RpRpMRpRpRRRVRVRRR	R
RR/pV P                  VP                  4      : RWAP                  ,          : RV P                  VP                  4      : 2# )r   z\gtz\lt><z==r  z>=z\geqz<=z\leqz!=z\neqr   )r   r   lhsrel_oprhs)r   r  gtltcharmaps   &&   rS   _print_RelationalLatexPrinter._print_Relational}  s    >>&!!BBBB #'''
 "[[2$[[114;;txx3HJ 	JrU   c           	     	z   VP                   R R  UUu. uF,  w  r#V P                  V4      : RV P                  V4      : 2NK.  	  pppVP                   R,          P                  \        8X  dD   VP	                  RV P                  VP                   R,          P
                  4      ,          4       MlVP	                  V P                  VP                   R,          P
                  4      : RV P                  VP                   R,          P                  4      : 24       RpVRP                  V4      ,          # u uppi )Nz & \text{for}\: z%s & \text{otherwise}z\begin{cases} %s \end{cases}r  ry  )r@  r   condr   rT  r  rU  )r   r  r[  r   ecpairsr  s   &&    rS   _print_PiecewiseLatexPrinter._print_Piecewise  s    #yy"~/-tq /3kk!ndkk!nM- 	 /99R=%NN3;;tyy}'9'9:; < NN KK		"(:(:; KK		"(:(:;= > .V[[)))/s   2D7c                	0   . p\        VP                  4       FI  pTP                  R P                  WR3,           Uu. uF  q@P	                  V4      NK  	  up4      4       KK  	  V P
                  R,          pVf4   V P
                  R,          R8X  d   RpMVP                  ^
8*  RJ d   RpMRpR	pVP                  R
V4      pVR8X  d2   VP                  RRRVP                  ,          ,           R,           4      pVRP                  V4      ,          # u upi )r  :NNNr   r   r   smallmatrixTmatrixarray \begin{%MATSTR%}%s\end{%MATSTR%}%MATSTR%r  rs   r   }%sr6  )r  rowsrT  rU  r   r   colsr   )r   r  linesliner   r   out_strs   &&     rS   _print_matrix_contents#LatexPrinter._print_matrix_contents  s    $))$DLLT']$K][[^]$KLM % ..+?~~f%1'IIO,&G%G5//*g6goodC#dii-,?%,GHGE***! %Ls   Dc                	    V P                  V4      pV P                  R ,          '       dE   V P                  R ,          pV P                  V,          pRV,           V,           R,           V,           pV# )r   \left\right)rp  r   r   )r   r  ro  
left_delimright_delims   &&   rS   _print_MatrixBaseLatexPrinter._print_MatrixBase  sc    --d3>>+&&4J**:6K+g5 "-.GrU   c                	    V P                  VP                  \        R ,          RR7      pV P                  VP                  4       RV P                  VP
                  4       2pRV RV R2# )r  Tr   rv  rs   }_{rO   )r   parentr    r   r   r   )r   r  matrix_part
index_parts   &&  rS   _print_MatrixElement!LatexPrinter._print_MatrixElement  sd    ''Z5GPT'UDFF+,Adkk$&&.A-BC
K=j\44rU   c                	<  a  V 3R  lpS P                  VP                  \        R,          RR7      R,           V! VP                  VP                  P                  4      ,           R,           V! VP
                  VP                  P                  4      ,           R,           # )c                   < \        V 4      p V ^,          ^8X  d   V ^ V ^ ,          ^ 8X  d   RV ^ &   V ^,          V8X  d   RV ^&   RP                  V3R lV  4       4      # )r   N:c              3  P   <"   T F  qe   SP                  V4      MRx  K  	  R # 5iNr   r  )r&  xir   s   & rS   r(  FLatexPrinter._print_MatrixSlice.<locals>.latexslice.<locals>.<genexpr>  s"     RPQ"~DKKO2EPQs   #&)r  rU  )r'  rz  r   s   &&rS   
latexslice3LatexPrinter._print_MatrixSlice.<locals>.latexslice  s\    QAtqyaDtqy!ts{!88RPQRRRrU   r  Trz  \left[rQ  \right])r   r|  r    rowslicerk  colslicerl  )r   r  r  s   f& rS   _print_MatrixSliceLatexPrinter._print_MatrixSlice  s    	S !!$++z&/A$!OR[[4==$++*:*:;<>BC4==$++*:*:;<>HI 	JrU   c                	8    V P                  VP                  4      # r   )r   blocksr  s   &&rS   _print_BlockMatrixLatexPrinter._print_BlockMatrix  s    {{4;;''rU   c                	,   VP                   p^ RIHpHp \	        W#4      '       g<   \	        W$4      '       g+   VP
                  '       d   RV P                  V4      ,          # V P                  V\        V4      R4      pRV9   d
   RV,          # RV,          # )rr  MatrixSymbolBlockMatrixz\left(%s\right)^{T}Tr   z%s^{T})	rB  sympy.matricesr  r  r  is_MatrixExprr   r   r   )r   r  r  r  r  rR   s   &&    rS   _print_TransposeLatexPrinter._print_Transpose  sy    hh<3--3,,1B1B1B)DKK,<<<!!#'=d'CTJAax-11!|#rU   c                	J    VP                   pR V P                  V4      ,          # )z!\operatorname{tr}\left(%s \right))rB  r   r   r  r  s   && rS   _print_TraceLatexPrinter._print_Trace  s    hh3dkk#6FFFrU   c                	   R RRRRR/pVP                  V P                  R,          R4      pVP                  p^ RIHpHp \        WE4      '       g>   \        WF4      '       g-   VP                  '       d   RV P                  V4      : R	V: R
2# V P                  V\        V4      R4      pRV9   d   RV: R	V: R
2# V: RV: R
2# )r   z\daggerstarz\ast	hermitianz
\mathsf{H}r   r  rJ  rK  rO   Tr   r  )r   r   rB  r  r  r  r  r  r   r   r   )r   r  style_to_latexr   r  r  r  rR   s   &&      rS   _print_AdjointLatexPrinter._print_Adjoint  s    

 '**4>>/+JJWhh<3--3,,1B1B1B.2kk#.>NN!!#'=d'CTJAax23]CC%&66rU   c                	:  a aa ^ RI Ho VVV 3R lp\        SP                  4      pSP	                  4       '       dG   V^ ,          R8X  d   VR,          pMV^ ,          ) V^ &   RRP                  \        W#4      4      ,           # RP                  \        W#4      4      # )rr  )MatMulc                   < \        V \        4      '       d$   \        V S4      '       g   SP                  V 4      # SP                  V \	        S4      R 4      # F)r  r	   r   r   r   )r'  r  r  r   s   &rS   rT   ,LatexPrinter._print_MatMul.<locals>.<lambda>  sK    Z3-?-?
STV\H]H]4;;q> Fa!7!=uEFrU   r  r  r   ry  )sympyr  r  r@  r0  rU  ra  )r   r  parensr@  r  s   ff  @rS   _print_MatMulLatexPrinter._print_MatMul  s|     F DII((**Aw"}Bx7(Q#((3v#455588C-..rU   c                	~    \        V4      pVP                  w  r4V P                  W24       R V P                  WB4       2# )r   )r   r@  r   )r   r  r   leftrights   &&   rS   _print_DotProductLatexPrinter._print_DotProduct  s@    &t,ii$$T12'$:K:KE:Y9Z[[rU   c                	   VP                   pVP                  '       dR   ^ RIHp \	        W#4      '       d#   RV P                  VP                  4      ,          # RV P                  V4      ,          # RV P                  V4      ,          # )rr  )r  r  )rB  r  &sympy.matrices.expressions.blockmatrixr  r  rp  r  r   )r   r  r  r  s   &&  rS   _print_DeterminantLatexPrinter._print_Determinant  si    hhJ#+++d.I.I#**.UUU'$++c*:::#d&A&A#&FFFrU   c           	     	   Vel   RV P                  VP                  ^ ,          \        R,          RR7      : RV P                  VP                  ^,          \        R,          RR7      : RV: R2# V P                  VP                  ^ ,          \        R,          RR7      : RV P                  VP                  ^,          \        R,          RR7      : 2# )NrJ  r	   Trz  z \bmod rK  rO   rn  rL  s   &&&rS   
_print_ModLatexPrinter._print_Mod  s    ?""499Q<E1B*. # 0""499Q<E1B*. # 0  "&!2!2499Q<3=e3D:> "3 "@ "&!2!2499Q<3=e3D:> "3 "@A 	ArU   c                	   aa VP                   p\        R ,          oV P                  oRP                  VV3R lV 4       4      # )r   z \circ c              3  :   <"   T F  pS! VSR R7      x  K  	  R# 5iTrz  NrP   r&  rB  r  precs   & rS   r(  6LatexPrinter._print_HadamardProduct.<locals>.<genexpr>,       <tVCd++t   r@  r    r   rU  r   r  r@  r  r  s   && @@rS   _print_HadamardProduct#LatexPrinter._print_HadamardProduct&  s:    yy% ""<t<> 	>rU   c                	x    \        VP                  4      \        R ,          8  d   RpMRpV P                  W4      # )r	   z%s^{\circ \left({%s}\right)}z%s^{\circ {%s}})r   rM  r    r  )r   r  r  s   && rS   _print_HadamardPower!LatexPrinter._print_HadamardPower.  s3    !$((+j.??6H)H00@@rU   c                	   aa VP                   p\        R ,          oV P                  oRP                  VV3R lV 4       4      # )r   	 \otimes c              3  :   <"   T F  pS! VSR R7      x  K  	  R# 5ir  rP   r  s   & rS   r(  7LatexPrinter._print_KroneckerProduct.<locals>.<genexpr>;  r  r  r  r  s   && @@rS   _print_KroneckerProduct$LatexPrinter._print_KroneckerProduct5  s<    yy% ""  <t<> 	>rU   c                	j   VP                   VP                  r2^ RIHp \	        W$4      '       g<   VP
                  '       d*   RV P                  V4      : RV P                  V4      : R2# V P                  V4      pRV9   d   RV: RV P                  V4      : R2# V: RV P                  V4      : R2# )rr  )r  rJ  rK  rO   r   r  )rF  rM  r  r  r  r  r   )r   r  rF  rM  r  base_strs   &&    rS   _print_MatPowLatexPrinter._print_MatPow=  s    IItxxc/$--$2D2D2D/3{{4/@.2kk#.>@ @ {{4(Hh2:DKK<LMM$,dkk#.>??rU   c                	H    V P                  WP                  R ,          R7      # )r   rE  )rG  r   r  s   &&rS   _print_MatrixSymbol LatexPrinter._print_MatrixSymbolJ  s&    !!$nn/ ! ! 	!rU   c                	:    V P                   R ,          R8X  d   R# R# )r   r   0z
\mathbf{0}r   )r   Zs   &&rS   _print_ZeroMatrixLatexPrinter._print_ZeroMatrixN  (    nn #*+s 	>0=	>rU   c                	:    V P                   R ,          R8X  d   R# R# )r   r   1z
\mathbf{1}r  )r   Os   &&rS   _print_OneMatrixLatexPrinter._print_OneMatrixR  r  rU   c                	:    V P                   R ,          R8X  d   R# R# )r   r   z
\mathbb{I}z
\mathbf{I}r  )r   rN  s   &&rS   _print_IdentityLatexPrinter._print_IdentityV  s(     $! #*!+} 	>0=	>rU   c                	X    V P                  VP                  ^ ,          4      pRV,          # )rr  zP_{%s}r(  )r   Pperm_strs   && rS   _print_PermutationMatrix%LatexPrinter._print_PermutationMatrixZ  s#    ;;qvvay)(""rU   c                   V ^8  d   QhRR/# )r   r  r%   rP   )r   s   "rS   r   r   ^  s     5 5Y 5rU   c           
     	   VP                  4       ^ 8X  d   V P                  VR,          4      # V P                  R,          pVfN   V P                  R,          R8X  d   RpM2VP                  4       ^ 8X  g   VP                  R,          ^
8:  d   RpMRpRpVP	                  RV4      pVR8X  d9   VP	                  R	R
RVP                  ^ ,          ,          ,           R,           4      pV P                  R,          '       dE   V P                  R,          pV P
                  V,          pRV,           V,           R,           V,           pVP                  4       ^ 8X  d
   VR,          # \        VP                  4       ^,           4       Uu. uF  p. NK  	  ppVP                   Uu. uF  p\        \        V4      4      NK  	  pp\        P                  ! V!   EFZ  p	VR,          P                  V P                  W,          4      4       Rp
\        VP                  4       ^,
          RR4       EF   p\        W{^,           ,          4      VP                  V,          8  d    K  V
'       d5   W{,          P                  RP                  W{^,           ,          4      4       M}W{,          P                  VRP                  W{^,           ,          4      ,          4       \        W{^,           ,          4      ^8X  d'   RW{,          R,          ,           R,           W{,          R&   V
'       * p
. W{^,           &   EK  	  EK]  	  V^ ,          ^ ,          pVP                  4       ^,          ^8X  d	   W<,          pV# u upi u upi )rr  r   r   r   re  rf  rg  rh  ri  r  rs   r   rj  r   rs  rt  r   Tr  r6  r  r  rP   ry  )rankr   r   shaper   r   r  r  	itertoolsproductrT  r  rU  )r   r  r   	block_strru  rv  r   	level_strshape_rangesouter_ievenback_outer_iro  s   &&           rS   _print_NDimArrayLatexPrinter._print_NDimArray^  s   99;!;;tBx((..+?~~f%1'IIK1$$**R.B*>&G%G7	%%j':	g!))$c$**Q-6G0G%0OPI>>+&&"nn[9J**:6K :-	9!"$/0I 99;!r>!27		a2H%I2HQb2H	%I04

;
1U1X
; ((,7GbM  T]!;<D %diik!mR <ya01DJJ|4LL+22I1n$=>@ +22!UZZ	q.0I%JKM9!^45:6?%3B778:D7E	/3x,.	q.) != 8$ A,q/99;?a)G3 &J;s   M%M*c                   V ^8  d   QhRR/# )r   	index_mapdictrP   )r   s   "rS   r   r     s       rU   c                	   V P                  V4      pR pR pV F  pVP                  pWs9   g	   V'       d   WX8X  d
   VR,          pWX8w  d3   Ve
   VR,          pVP                  '       d   VR,          pM	VR,          pW@P                  VP                  ^ ,          4      ,          pWs9   d*   VR,          pW@P                  W7,          4      ,          pRpMRpTpK  	  Ve
   VR,          pV# )Nrv  rO   z{}^{z{}_{r  TF)r   is_upr@  )	r   rV  rb  r  ro  last_valenceprev_mapindexnew_valences	   &&&&     rS   _printer_tensor_indices$LatexPrinter._printer_tensor_indices  s    ++d#E++K# /3*+sNG;;;v%Gv%G{{5::a=11G!3;;y'788 &L' ( #sNGrU   c                	    VP                   ^ ,          P                   ^ ,          pVP                  4       pV P                  W#/ 4      # r'  )r@  get_indicesr  )r   r  rV  rb  s   &&  rS   _print_TensorLatexPrinter._print_Tensor  s;    yy|  #""$++D2>>rU   c                	    VP                   P                  ^ ,          P                  ^ ,          pVP                   P                  4       pVP                  pV P	                  W#V4      # r'  )r  r@  r  r  r  )r   r  rV  rb  r  s   &&   rS   _print_TensorElement!LatexPrinter._print_TensorElement  sM    yy~~a %%a())'')NN	++D9EErU   c                	    VP                  4       w  r#TR P                  V Uu. uF  q@P                  V\        V4      4      NK  	  up4      ,           # u upi )r   )!_get_args_for_traditional_printerrU  r   r   )r   r  r8  r@  rB  s   &&   rS   _print_TensMulLatexPrinter._print_TensMul  sO    ;;=
bggAEF#sJt$45F
 
 	
Fs   #A
c           	     	    . pVP                   pV F-  pVP                  V P                  V\        V4      4      4       K/  	  VP	                  4        R P                  V4      pVP                  RR4      pV# )rh  z+ -r  )r@  rT  r   r   rS  rU  r   )r   r  r   r@  r'  rR   s   &&    rS   _print_TensAddLatexPrinter._print_TensAdd  sc    yyAHHT&&q*T*:;< 	JJqMIIeT"rU   c                	    R VP                   '       d   RMR: RV P                  VP                  ^ ,          4      : R2# )z{}r   r  rs   rO   )r  r   r@  r  s   &&rS   _print_TensorIndexLatexPrinter._print_TensorIndex  s0    :::C3&KK		!%
 	
rU   c                	   \        VP                  4      ^8X  dR   RV P                  VP                  ^ ,          4      : RV P                  VP                  \
        R,          R4      : R2# R\        VP                  4      : RRP                  VP                   Uu. uF  pRV P                  V4      ,          NK  	  up4      : R	V P                  VP                  \
        R,          R4      : R2# u upi )
r  z\frac{\partial}{\partial {rp  r	   FrO   z\frac{\partial^{r   z\partial {%s}r  )r  r@  r   r   r  r    rU  r   r  r   s   && rS   _print_PartialDerivative%LatexPrinter._print_PartialDerivative  s    t~~!#DNN1-.!!$))Z->F  $ DNN#T^^T^*T[[^;;^TU!!$))Z->F Ts   !C3c                	8    V P                  VP                  4      # r   )r   rV  r  s   &&rS   _print_ArraySymbolLatexPrinter._print_ArraySymbol  s    {{499%%rU   c                	    R V P                  VP                  \        R,          R4      : RRP                  VP                   Uu. uF  q P                  V4       NK  	  up4      : R2# u upi )z{{rm  Tr{  rQ  r  )r   rV  r    rU  rb  r   r  s   && rS   _print_ArrayElement LatexPrinter._print_ArrayElement  sW    diiF);TBIIDLLALq++a.)*LABD 	DAs   A*c                	    R # )z
\mathbb{U}rP   r  s   &&rS   _print_UniversalSet LatexPrinter._print_UniversalSet      rU   c                	    Vf*   RV P                  VP                  ^ ,          4      ,          # RV P                  VP                  ^ ,          4      : RV: R2# )Nz$\operatorname{frac}{\left(%s\right)}z\operatorname{frac}{\left(z
\right)}^{rO   r(  rL  s   &&&rS   _print_fracLatexPrinter._print_frac  sK    ;:T[[ST=VVV  KK		!-s4 4rU   c           
     	   V P                   R ,          R8X  d   RpM&V P                   R ,          R8X  d   RpM\        R4      h\        V4      ^8X  d/   V P                  V P	                  V^ ,          4      V,           4      # T P                  VR,           P                  V Uu. uF  q0P	                  V4      NK  	  up4      4      # u upi )r   r  ;r   rv  Unknown Decimal Separatorz \  )r   r   r  r   r   rU  )r   r  sepr   s   &&  rS   _print_tupleLatexPrinter._print_tuple  s    >>-.'9C^^/0H<C899t9>**4;;tAw+?#+EFF**w$$d%Cdkk!nd%CDF F%Cs   !Cc                	    VP                    Uu. uF  q P                  V4      NK  	  ppR P                  V4      # u upi )r  r@  r   rU  r   r  r   elementss   &&  rS   _print_TensorProduct!LatexPrinter._print_TensorProduct  s6    ,0II6IqKKNI6  ** 7   ;c                	    VP                    Uu. uF  q P                  V4      NK  	  ppR P                  V4      # u upi ) \wedge r-  r.  s   &&  rS   _print_WedgeProduct LatexPrinter._print_WedgeProduct  s6    ,0II6IqKKNI6)) 7r2  c                	$    V P                  V4      # r   )r*  r  s   &&rS   _print_TupleLatexPrinter._print_Tuple	  s      &&rU   c           	     	d   V P                   R ,          R8X  d7   RRP                  V Uu. uF  q P                  V4      NK  	  up4      ,          # V P                   R ,          R8X  d7   RRP                  V Uu. uF  q P                  V4      NK  	  up4      ,          # \        R4      hu upi u upi )r   r  z\left[ %s\right]z; \  r   , \  r(  )r   rU  r   r   r  s   && rS   _print_listLatexPrinter._print_list  s    >>-.'9&t<t!{{1~t<=> >^^/0H<&t<t!{{1~t<=> > 899 = =s   B(
7B-
c                	   \        VP                  4       \        R 7      p. pV FA  pW,          pVP                  V P	                  V4      : RV P	                  V4      : 24       KC  	  RRP                  V4      ,          # )rI  z : z\left\{ %s\right\}r;  )r  keysr   rT  r   rU  )r   r   r?  rQ  rJ  vals   &&    rS   _print_dictLatexPrinter._print_dict  sd    affh$45C&CLLdkk#&6C8HIJ  %x}}U';;;rU   c                	$    V P                  V4      # r   )rA  r  s   &&rS   _print_DictLatexPrinter._print_Dict!  s    %%rU   c                	z   \        VP                  4      ^8X  g   VP                  ^,          ^ 8X  d+   RV P                  VP                  ^ ,          4      ,          pMKRV P                  VP                  ^,          4      : RV P                  VP                  ^ ,          4      : R2pV'       d   RV: RV: R2pV# )r  z\delta\left(%s\right)z\delta^{\left( z \right)}\left( r  rJ  rK  rO   r=  r  s   &&& rS   _print_DiracDeltaLatexPrinter._print_DiracDelta$  s    tyy>Q$))A,!"3*T[[1-FFC #4 DIIaL)4;;tyy|+DFC3-0#6C
rU   c                	    V P                  VP                  ^ ,          VP                  ^,          ,
          4      pV P                  VP                  ^,          4      pRV: RV: R2pVe   RV: RV: RV: R2pV# )rr  z{\left\langle z \right\rangle}^{rO   z{\left({\langle z \rangle}^{z}\right)}^{r(  )r   r  rM  shiftr  r  s   &&&   rS   _print_SingularityFunction'LatexPrinter._print_SingularityFunction.  s\    DIIaL499Q<78DIIaL)9>F?FKUTWXC
rU   c                	   a  R P                  V 3R lVP                   4       4      pRV,          pV'       d   RV: RV: R2pV# )rQ  c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   r  r&  rB  r   s   & rS   r(  0LatexPrinter._print_Heaviside.<locals>.<genexpr>7  s     Ajs$++c**jr+  z\theta\left(%s\right)rJ  rK  rO   )rU  pargs)r   r  rM  rQ  r  s   f&&  rS   _print_HeavisideLatexPrinter._print_Heaviside6  s9    		AdjjAA&.3-0#6C
rU   c                	f   V P                  VP                  ^ ,          4      pV P                  VP                  ^,          4      pVP                  ^ ,          P                  '       d0   VP                  ^,          P                  '       d   RV: RV: R2pMRV: RV: R2pVe   RV: RV: R2pV# )rr  z\delta_{r   rO   rQ  rJ  rK  )r   r@  r  )r   r  rM  r   r   r  s   &&&   rS   _print_KroneckerDelta"LatexPrinter._print_KroneckerDelta=  s~    KK		!%KK		!%99Q<DIIaL$8$8$8'(!,C()1-C?-0#6C
rU   c                	j   \        V P                  VP                  4      p\        ;QJ d&    R  VP                   4       F  '       d   K   RM	  RM! R  VP                   4       4      '       d   RRP	                  V4      ,          pMRRP	                  V4      ,          pV'       d   RV: RV: R2pV# )	c              3  8   "   T F  qP                   x  K  	  R # 5ir   )r  )r&  r'  s   & rS   r(  1LatexPrinter._print_LeviCivita.<locals>.<genexpr>J  s     ,)Qyy)s   FTz\varepsilon_{%s}r   rQ  rJ  rK  rO   )ra  r   r@  r  rU  )r   r  rM  rb  r  s   &&&  rS   _print_LeviCivitaLatexPrinter._print_LeviCivitaH  sy    dkk499-3,$)),333,$)),,,%(99C%		'(::C3-0#6C
rU   c                	   \        VR 4      '       d'   RV P                  VP                  4       4      ,           # \        VR4      '       dJ   RV P                  VP                  4      ,           R,           V P                  VP                  4      ,           # \        VR4      '       d#   RV P                  VP                  4      ,           # V P                  R4      # )
as_booleanz\text{Domain: }set \in r  z\text{Domain on }N)r  r   r]  r  r^  )r   r   s   &&rS   _print_RandomDomain LatexPrinter._print_RandomDomainR  s    1l##%ALLN(CCCQ&QYY)??(JKK&' (Q	""'$++aii*@@@;;t$$rU   c                	Z    \        VP                  \        R 7      pV P                  V4      # )rI  )r  r@  r   
_print_setr   rR   rQ  s   && rS   _print_FiniteSetLatexPrinter._print_FiniteSet]  s"    qvv#34u%%rU   c                	R   \        V\        R 7      pV P                  R,          R8X  d/   RP                  \	        V P
                  V4      4      pRV,          # V P                  R,          R8X  d/   RP                  \	        V P
                  V4      4      pRV,          # \        R4      h)rI  r   r  rA  r   rQ  r(  \left\{%s\right\})r  r   r   rU  ra  r   r   rd  s   && rS   rc  LatexPrinter._print_seta  s    q./>>-.'9IIc$++u56E
 $e++	 ^^/0H<IIc$++u56E $e++ 899rU   c                	:  a aa VV 3R  lp\        4       oSP                  P                  '       dJ   SP                  P                  '       d.   SP                  P
                  '       d
   SR^ ^S3pEMS^^ RS3pMSP                  P                  '       d&   SSR,          SP                  ,
          SR,          3pMSP                  P                  '       d$   \        S4      p\        V4      \        V4      S3pMySP                  ee   SP                  ^8  R8X  d   \        S4      pMKSP                  '       d,   \        S4      p\        V4      \        V4      SSR,          3pMV! 4       # V! 4       # RRP                  VV 3R lV 4       4      ,           R,           # )c                   < SP                   ^ ,          ^ 8X  db   SP                   ^,          ^8X  d$   SP                  SP                   ^,          4      p MRP                  V3R lSP                    4       4      p MjSP                   ^,          ^8X  d.   RP                  V3R lSP                   R,           4       4      p M%RP                  V3R lSP                    4       4      p RV  R2# )rr  rQ  c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   r  rO  s   & rS   r(  KLatexPrinter._print_Range.<locals>._print_symbolic_range.<locals>.<genexpr>u       $H#T[[%5%5r+  c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   r  rO  s   & rS   r(  rm  x  s     $L#T[[%5%5r+  :Nr   Nc              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   r  rO  s   & rS   r(  rm  z  rn  r+  z\text{Range}\left(rx  r-  )contrR   r   s    rS   _print_symbolic_range8LatexPrinter._print_Range.<locals>._print_symbolic_rangeo  s    vvayA~66!9>;;qvvay1D99$H$HHD66!9>99$L$LLD99$H$HHD+D6:;rU   T\left\{rQ  c              3  T   <"   T F  qSJd   SP                  V4      MR x  K  	  R# 5iz\ldotsNr  r&  eldotsr   s   & rS   r(  ,LatexPrinter._print_Range.<locals>.<genexpr>  %     _V^PRn4;;r?)KV^   %(\right\}ry  )objectstartis_infinitestopstepis_positiveiternextis_emptyr{  r/  is_iterablerU  )r   rR   rr  printsetitry  s   ff   @rS   _print_RangeLatexPrinter._print_Rangen  sC   	< x77166#5#5#5vv!!!Q4/Ar4/WW   QrUQVV^QrU2HVVaBBxb4/HZZ#
t# 8!W8T"XtQrU:,..(**

_V^__` 	rU   c           
     	   \        VP                  4      ^8X  d   VeS   V: RV P                  VP                  ^ ,          4      : RV: RV P                  VP                  ^,          4      : R2# V: RV P                  VP                  ^ ,          4      : RV P                  VP                  ^,          4      : R2# V: RV P                  VP                  ^ ,          4      : R2pVe   V: RV: R2pV# )r   r  r  r  rx  rO   r  r=  )r   r  letterrM  r  s   &&&& rS   __print_number_polynomial&LatexPrinter.__print_number_polynomial  s    tyy>Q9? KK		!5s KK		!57 7 17DIIaL14;;tyy|3LN N #DKK		!$=>? #S)C
rU   c                	(    V P                  VR V4      # )B&_LatexPrinter__print_number_polynomialrL  s   &&&rS   _print_bernoulliLatexPrinter._print_bernoulli      --dC==rU   c                	(    V P                  VR V4      # )Gr  rL  s   &&&rS   _print_genocchiLatexPrinter._print_genocchi  r  rU   c                	  a  \        VP                  4      ^8X  d   RS P                  VP                  ^ ,          4      : RS P                  VP                  ^,          4      : R2pRRP                  V 3R lVP                  ^,           4       4      ,          pVe   V: RV: RV: 2pV# W4,           pV# S P	                  VRV4      # )rL  zB_{rQ  rO   ri  c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   r  )r&  rx  r   s   & rS   r(  +LatexPrinter._print_bell.<locals>.<genexpr>  s#      3C5Ar 48;;r??5Ar+  r  r  )r  r@  r   rU  r  )r   r  rM  tex1tex2r  s   f&&   rS   _print_bellLatexPrinter._print_bell  s    tyy>Q$(KK		!$= $DIIaL 9;D%

 3C59YYq\3C )C CD&*C6 J kJ--dC==rU   c                	(    V P                  VR V4      # Fr  rL  s   &&&rS   _print_fibonacciLatexPrinter._print_fibonacci  r  rU   c                	t    R V P                  VP                  ^ ,          4      ,          pVe   V: RV: R2pV# )zL_{%s}r  rO   r(  r  s   &&& rS   _print_lucasLatexPrinter._print_lucas  1    $++diil33? #S)C
rU   c                	(    V P                  VR V4      # )Tr  rL  s   &&&rS   _print_tribonacciLatexPrinter._print_tribonacci  r  rU   c                	    Vf*   RV P                  VP                  ^ ,          4      ,          # RV: RV P                  VP                  ^ ,          4      : R2# )Nz\mu\left(%s\right)z\mu^{r  rx  r(  rL  s   &&&rS   _print_mobiusLatexPrinter._print_mobius  sD    ;(4;;tyy|+DDD -0$++diil2KLLrU   c           
     	  a a \        4       o\        VP                  P                  4      ^ 8  g%   \        VP                  P                  4      ^ 8  d   RS P                  VP                  4      : RS P                  VP                  ^ ,          4      : RS P                  VP                  4      : RS P                  VP                  4      : R2	# VP                  \        P                  J df   VP                  pSVP                  V^,
          4      VP                  V^,
          4      VP                  V^,
          4      VP                  V4      3pMUVP                  \        P                  J g   VP                  ^8  d   VR,          pVP                  S4       M\        V4      pRRP                  VV 3R	 lV 4       4      ,           R
,           # )rr  rt  z
\right\}_{r  r  rO   :N   Nr  rQ  c              3  T   <"   T F  qSJd   SP                  V4      MR x  K  	  R# 5irv  r  rw  s   & rS   r(  1LatexPrinter._print_SeqFormula.<locals>.<genexpr>  r{  r|  r  )r~  r  r  free_symbolsr  r   formular@  r   r  coeffr  lengthrT  r/  rU  )r   rR   r  r  ry  s   f&  @rS   _print_SeqFormulaLatexPrinter._print_SeqFormula  sF   xqww##$q(C0C0C,Dq,HAII&AKKN+AGG$AFF#	  77a(((66DaggdQh/1Bq)1774=:HVVqzz!QXX\uHOOD!QxH

_V^__` 	rU   c                	^   VP                   VP                  8X  d#   R V P                  VP                   4      ,          # VP                  '       d   RpMRpVP                  '       d   RpMRpRV: V P                  VP                   4      : RV P                  VP                  4      : RV: 2# )rh  r   r   r   r   rs  rQ  rt  )r  endr   	left_open
right_open)r   r   r  r  s   &&  rS   _print_IntervalLatexPrinter._print_Interval  s    77aee'$++agg*>>> {{{||| $++agg.AEE0BEK KrU   c                	|    R V P                  VP                  4      : RV P                  VP                  4      : R2# )z\left\langle rQ  z\right\rangle)r   r   r   r   r   s   &&rS   _print_AccumulationBounds&LatexPrinter._print_AccumulationBounds  s+    QUU#T[[%79 	9rU   c                	    \        V4      pVP                   Uu. uF  q0P                  W24      NK  	  ppR P                  V4      # u upi )z \cup r   r@  r   rU  r   ur  r   args_strs   &&   rS   _print_UnionLatexPrinter._print_Union  B    %a(89?1%%a.?~~h'' @   Ac                	    \        V4      pVP                   Uu. uF  q0P                  W24      NK  	  ppR P                  V4      # u upi )z \setminus r  r  s   &&   rS   _print_ComplementLatexPrinter._print_Complement 	  D    %a(89?1%%a.?""8,, @r  c                	    \        V4      pVP                   Uu. uF  q0P                  W24      NK  	  ppR P                  V4      # u upi )z \cap r  r  s   &&   rS   _print_Intersection LatexPrinter._print_Intersection	  r  r  c                	    \        V4      pVP                   Uu. uF  q0P                  W24      NK  	  ppR P                  V4      # u upi )z \triangle r  r  s   &&   rS   _print_SymmetricDifference'LatexPrinter._print_SymmetricDifference
	  r  r  c                	Z  a a \        V4      o\        VP                  4      ^8  d`   \        VP                  4      '       gE   S P	                  VP                  ^ ,          S4      R\        VP                  4      ,          ,           # RP                  VV 3R lVP                   4       4      # )r  z^{%d}r   c              3  H   <"   T F  pSP                  VS4      x  K  	  R # 5ir   )r   )r&  r^  r  r   s   & rS   r(  1LatexPrinter._print_ProductSet.<locals>.<genexpr>	  s$       <4:SDc4((Fs   ")r   r  setsr#   r   rU  )r   r  r  s   f&@rS   _print_ProductSetLatexPrinter._print_ProductSet	  s|    %a(qvv;!K$7$7$$QVVAY5#aff+8MMM  <45FF < < 	<rU   c                	    R # )z	\emptysetrP   r_  s   &&rS   _print_EmptySetLatexPrinter._print_EmptySet	  s    rU   c                	    R # )z
\mathbb{N}rP   r   r~  s   &&rS   _print_NaturalsLatexPrinter._print_Naturals	  r"  rU   c                	    R # )z\mathbb{N}_0rP   r  s   &&rS   _print_Naturals0LatexPrinter._print_Naturals0	  s    rU   c                	    R # z
\mathbb{Z}rP   r  s   &&rS   _print_IntegersLatexPrinter._print_Integers	  r"  rU   c                	    R # z
\mathbb{Q}rP   r  s   &&rS   _print_RationalsLatexPrinter._print_Rationals"	  r"  rU   c                	    R # z
\mathbb{R}rP   r  s   &&rS   _print_RealsLatexPrinter._print_Reals%	  r"  rU   c                	    R # z
\mathbb{C}rP   r  s   &&rS   _print_ComplexesLatexPrinter._print_Complexes(	  r"  rU   c                	   a  VP                   P                  pVP                   P                  pV 3R  l\        W1P                  4       4       pRP                  R V 4       4      pRS P                  V4      : RV: R2# )c              3  l   <"   T F)  w  rSP                  V4      SP                  V4      3x  K+  	  R # 5ir   r  )r&  r'  rE  r   s   &  rS   r(  /LatexPrinter._print_ImageSet.<locals>.<genexpr>.	  s*     R<QDAAA/<Qs   14rQ  c              3  4   "   T F  pR V,          x  K  	  R# 5i)	%s \in %sNrP   )r&  xys   & rS   r(  r  /	  s     ;s<",,ss   rt  \; \middle|\; r}  )rB   r  	signaturer  	base_setsrU  r   )r   rR   r  sigxysxinyss   f&    rS   _print_ImageSetLatexPrinter._print_ImageSet+	  sZ    ww||ggRC[[<QR

;s;;7;{{47H%PPrU   c           
     	   R P                  \        VP                  4       Uu. uF  q P                  V4      NK  	  up4      pVP                  \
        P                  J d%   RV: RV P                  VP                  4      : R2# RV: RV: RV P                  VP                  4      : RV P                  VP                  4      : R2	# u upi )rQ  rt  r  	 \right\}r_  r4  )rU  r   r  r   base_setr   UniversalSet	conditionr   rR   r  
vars_prints   &&  rS   _print_ConditionSet LatexPrinter._print_ConditionSet2	  s    YYE!%%LILSC 0LIJ
::'T[[57 7 (
 KK

#KK$	& 	&  Js   C
c                	h    V P                  VP                  ^ ,          4      pRP                  V4      # )rr  z\mathcal{{P}}\left({}\right)r   r@  r   )r   r  	arg_prints   && rS   _print_PowerSetLatexPrinter._print_PowerSet>	  s)    KK		!-	.55i@@rU   c                	    R P                  VP                   Uu. uF  q P                  V4      NK  	  up4      pRV P                  VP                  4      : RV: RV P                  VP                  4      : R2# u upi )rQ  rt  r  r_  r  )rU  r@  r   r  r  r  s   &&  rS   _print_ComplexRegion!LatexPrinter._print_ComplexRegionB	  s]    YYAKKHKSC 0KHI
KKKK! 	!  Is   A;c                	   a  R \         ;QJ d'    . V 3R lVP                   4       F  NK  	  5,          # ! V 3R lVP                   4       4      ,          # )r  c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   r  )r&  r   r   s   & rS   r(  /LatexPrinter._print_Contains.<locals>.<genexpr>J	  s     #CFqDKKNNFr+  )r/  r@  r_  s   f&rS   _print_ContainsLatexPrinter._print_ContainsI	  s5    ee#CAFF#CeCCe#CAFF#CCCCrU   c                	$   VP                   P                  \        P                  J dD   VP                  P                  \        P                  J d   V P                  VP                  4      # V P                  VP                  4       4      R ,           # )z	 + \ldots)	r  r  r   rl  bnr   a0ro  truncater   s   &&rS   _print_FourierSeries!LatexPrinter._print_FourierSeriesL	  sV    44<<166!addllaff&<;;qtt$$qzz|,|;;rU   c                	8    V P                  VP                  4      # r   )ro  infiniter   s   &&rS   _print_FormalPowerSeries%LatexPrinter._print_FormalPowerSeriesQ	  s    qzz**rU   c                	(    R VP                   ,          # )z\mathbb{F}_{%s})modr  s   &&rS   _print_FiniteFieldLatexPrinter._print_FiniteFieldT	  s    !DHH,,rU   c                	    R # r  rP   r  s   &&rS   _print_IntegerRingLatexPrinter._print_IntegerRingW	  r"  rU   c                	    R # r  rP   r  s   &&rS   _print_RationalField!LatexPrinter._print_RationalFieldZ	  r"  rU   c                	    R # r  rP   r  s   &&rS   _print_RealFieldLatexPrinter._print_RealField]	  r"  rU   c                	    R # r  rP   r  s   &&rS   _print_ComplexField LatexPrinter._print_ComplexField`	  r"  rU   c                	    V P                  VP                  4      pR P                  \        V P                   VP                  4      4      pV: RV: R2# )rQ  r  r  r   domainrU  ra  r  r   r  r9  r  s   &&  rS   _print_PolynomialRing"LatexPrinter._print_PolynomialRingc	  <    T[[)))CT\\:;'-w77rU   c                	    V P                  VP                  4      pR P                  \        V P                   VP                  4      4      pV: RV: R2# )rQ  rJ  rx  r8  r:  s   &&  rS   _print_FractionField!LatexPrinter._print_FractionFieldh	  r=  rU   c                	    V P                  VP                  4      pR P                  \        V P                   VP                  4      4      pRpVP
                  '       g   RpV: V: RV: R2# )rQ  r   zS_<^{-1}r  r  )r   r9  rU  ra  r  is_Poly)r   r  r9  r  invs   &&   rS   _print_PolynomialRingBase&LatexPrinter._print_PolynomialRingBasem	  sQ    T[[)))CT\\:;|||C),fg>>rU   c           	     	P   VP                   P                  p. pVP                  4        EF  w  rER p\        V4       Fq  w  rxV^ 8  g   K  V^8X  d+   W`P	                  VP
                  V,          4      ,          pK?  W`P	                  \        VP
                  V,          V4      4      ,          pKs  	  VP                  '       d4   V'       d   RV P	                  V4      ,          p	M~V P	                  V4      p	MlV'       dT   V\        P                  J d   VP                  RV.4       K  V\        P                  J d   VP                  RV.4       EK(  V P	                  V4      p	V'       g   T	p
MV	R,           V,           p
V
P                  R4      '       d   VP                  RV
R,          .4       EK  VP                  RV
.4       EK  	  V^ ,          R9   d,   VP                  ^ 4      pVR8X  d   RV^ ,          ,           V^ &   RP                  V4      p\        \!        V P                  VP
                  4      4      pRV P	                  VP#                  4       4      ,          pRP                  V.V,           V.,           4      pV\$        9   d   RV: R	V: R
2pV# RV: RV: R
2pV# )r   ri  r  rK  r   r  z	domain=%srQ  r    {\left(z	 \right)}r  z	}{\left( )rK  r  )rS  rT  rl  rk  r   genspowr  r   r  extendr  r"  poprU  r  ra  
get_domainr  )r   polyr  rl  monomr  s_monomr   rM  s_coeffs_termmodifierr  rH  r9  r@  r  s   &&               rS   _print_PolyLatexPrinter._print_Polyu	  s   nn%% JJLLEG#E*7ax;;tyy|#<<;;s499Q</E#FF + |||04;;u3EEG"kk%0G~c7^4 -c7^4 ++e,  30  %%c6":./c6]+E )H 8z!yy|H3q>axxCTYY/0t{{4??+<==yy$$&12**/2D9C 
 + >A$GC
rU   c                	    VP                   P                  pVR 8X  d   RpV P                  VP                  4      pVP                  pV\
        9   d   RW#V3,          # RW#V3,          # )ComplexRootOfCRootOfz\%s {\left(%s, %d\right)}z'\operatorname{%s} {\left(%s, %d\right)})rS  rT  r   r  r   r  )r   rootr  r  r   s   &&   rS   _print_ComplexRootOf!LatexPrinter._print_ComplexRootOf	  sm    nn%%/!C{{499%

**/3e2DDD=AFAH H HrU   c                	t   VP                   P                  pV P                  VP                  4      .pVP                  \
        P                  Jd+   VP                  V P                  VP                  4      4       V\        9   d   R V: RRP                  V4      : R2# RV: RRP                  V4      : R2# )r   rG  rQ  r|  r  z	} {\left()
rS  rT  r   r  funr   IdentityFunctionrT  r  rU  )r   r  r  r@  s   &&  rS   _print_RootSumLatexPrinter._print_RootSum	  s    nn%%DII&'881---KKDHH-.**/2DIIdODD + >A=AYYt_N NrU   c                	    R # )\omegarP   r  s   &&rS   _print_OrdinalOmega LatexPrinter._print_OrdinalOmega	  s    rU   c                	    VP                   w  r#V^8w  d*   V^8w  d   RP                  W24      # RP                  V4      # V^8w  d   RP                  V4      # R# )r  z{} \omega^{{{}}}z	{} \omegaz\omega^{{{}}}ra  )r@  r   )r   r  rM  muls   &&  rS   _print_OmegaPowerLatexPrinter._print_OmegaPower	  sX    99!8ax*11#;;#**3//ax'..s33 rU   c                	~    R P                  VP                   Uu. uF  q P                  V4      NK  	  up4      # u upi rh  )rU  r@  r   rA  s   && rS   _print_OrdinalLatexPrinter._print_Ordinal	  s.    zztyyAy;;s+yABBAs   :c                	X    V P                   R ,          pVP                  V \        RV4      # )r   z	{%s}^{%d})r   r   r    )r   rM  r   s   && rS   _print_PolyElementLatexPrinter._print_PolyElement	  s&    ^^$67
xxj+zBBrU   c                	    VP                   ^8X  d   V P                  VP                  4      # V P                  VP                  4      pV P                  VP                   4      pRV: RV: R2# )r  r  r  rO   )r  r   r  )r   fracr  r  s   &&  rS   _print_FracElementLatexPrinter._print_FracElement	  sO    ::?;;tzz**KK

+EKK

+E',e44rU   c                	   \        VP                  4      ^8X  d   VP                  ^ ,          R3MVP                  w  r4RV P                  V4      ,          pVe   V: RV: R2pVe   V: RV P                  V4      : R2pV# )r  NzE_{%s}r  rO   rJ  rx  r=  )r   r  rM  r  r'  r  s   &&&   rS   _print_eulerLatexPrinter._print_euler	  sh    '*499~':		!d#		$++a.(? #S)C=*-t{{1~>C
rU   c                	t    R V P                  VP                  ^ ,          4      ,          pVe   V: RV: R2pV# )zC_{%s}r  rO   r(  r  s   &&& rS   _print_catalanLatexPrinter._print_catalan	  r  rU   c           
     	    R P                  Y#'       d   RMRV P                  VP                  ^,          4      V P                  VP                  ^ ,          4      V P                  VP                  ^,          4      4      # )z5\mathcal{{{}}}{}_{{{}}}\left[{}\right]\left({}\right)z^{-1}r   r   r   r@  )r   r  rR   inverses   &&&&rS   _print_UnifiedTransform$LatexPrinter._print_UnifiedTransform	  s    GNNq]dRYjlnrnynyz~  {D  {D  EF  {G  oH  JN  JU  JU  VZ  V_  V_  `a  Vb  Jc  ei  ep  ep  qu  qz  qz  {|  q}  e~    	rU   c                	&    V P                  VR 4      # )Mr|  r  s   &&rS   _print_MellinTransform#LatexPrinter._print_MellinTransform	      ++D#66rU   c                	(    V P                  VR R4      # )r  Tr  r  s   &&rS   _print_InverseMellinTransform*LatexPrinter._print_InverseMellinTransform	      ++D#t<<rU   c                	&    V P                  VR 4      # )Lr  r  s   &&rS   _print_LaplaceTransform$LatexPrinter._print_LaplaceTransform	  r  rU   c                	(    V P                  VR R4      # )r  Tr  r  s   &&rS   _print_InverseLaplaceTransform+LatexPrinter._print_InverseLaplaceTransform
  r  rU   c                	&    V P                  VR 4      # r  r  r  s   &&rS   _print_FourierTransform$LatexPrinter._print_FourierTransform
  r  rU   c                	(    V P                  VR R4      # )r  Tr  r  s   &&rS   _print_InverseFourierTransform+LatexPrinter._print_InverseFourierTransform
  r  rU   c                	&    V P                  VR 4      # )SINr  r  s   &&rS   _print_SineTransform!LatexPrinter._print_SineTransform

      ++D%88rU   c                	(    V P                  VR R4      # )r  Tr  r  s   &&rS   _print_InverseSineTransform(LatexPrinter._print_InverseSineTransform
      ++D%>>rU   c                	&    V P                  VR 4      # )COSr  r  s   &&rS   _print_CosineTransform#LatexPrinter._print_CosineTransform
  r  rU   c                	(    V P                  VR R4      # )r  Tr  r  s   &&rS   _print_InverseCosineTransform*LatexPrinter._print_InverseCosineTransform
  r  rU   c                	     VP                   e+   V P                  VP                   P                  V4      4      #  V P                  \	        V4      4      #   \         d     L'i ; ir   )ringr   to_sympyr   reprr   r  s   &&rS   
_print_DMPLatexPrinter._print_DMP
  s[    	vv!{{166??1#566 "
 {{47##  		s   7A A#"A#c                	$    V P                  V4      # r   )r  r  s   &&rS   
_print_DMFLatexPrinter._print_DMF
  s    q!!rU   c                	J    V P                  \        VP                  4      4      # r   )r   r   rV  )r   r~  s   &&rS   _print_ObjectLatexPrinter._print_Object"
  s    {{6&++.//rU   c                	   V P                  VP                  ^ ,          4      pVe   RV: R2MRp\        VP                  4      ^8X  d   RV: RV: R2pV# V P                  VP                  ^,          4      pRP                  W%V4      pV# )rr  r  rO   r   WrJ  rx  zW{0}_{{{1}}}\left({2}\right))r   r@  r  r   )r   r  rM  arg0resultarg1s   &&&   rS   _print_LambertWLatexPrinter._print_LambertW%
  sv    {{499Q<(#&?#tyy>Q.148F  ;;tyy|,D5<<SMFrU   c                	d    R P                  V P                  VP                  ^ ,          4      4      # )z!\operatorname{{E}}\left[{}\right]rz  r  s   &&rS   _print_ExpectationLatexPrinter._print_Expectation/
  %    3::4;;tyyQR|;TUUrU   c                	d    R P                  V P                  VP                  ^ ,          4      4      # )z#\operatorname{{Var}}\left({}\right)rz  r  s   &&rS   _print_VarianceLatexPrinter._print_Variance2
  s%    5<<T[[ST=VWWrU   c                	l   a  R P                  RP                  V 3R lVP                   4       4      4      # )z#\operatorname{{Cov}}\left({}\right)rQ  c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   r  rO  s   & rS   r(  1LatexPrinter._print_Covariance.<locals>.<genexpr>6
  s!     Fmcl\_t{{SVGWGWclr+  )r   rU  r@  r  s   f&rS   _print_CovarianceLatexPrinter._print_Covariance5
  s*    5<<TYYFmcgclclFm=mnnrU   c                	d    R P                  V P                  VP                  ^ ,          4      4      # )z!\operatorname{{P}}\left({}\right)rz  r  s   &&rS   _print_ProbabilityLatexPrinter._print_Probability8
  r  rU   c                	    V P                  VP                  4      pV P                  VP                  4      pV: R V: 2# )r>  )r   r9  codomain)r   morphismr9  r  s   &&  rS   _print_MorphismLatexPrinter._print_Morphism;
  s3    X__-;;x001&,h77rU   c                	    V P                  VP                  4      V P                  VP                  4      r2R V: RV: R2# )r  r  rO   )r   r{  den)r   r  r{  r  s   &&  rS   _print_TransferFunction$LatexPrinter._print_TransferFunction@
  s.    ;;txx($++dhh*?S#&,,rU   c                	r   a a \        SP                  4      pVV 3R  lpRP                  \        W24      4      # )c                <   < SP                  V \        S4      R 4      # r  )r   r   )r'  r  r   s   &rS   rT   ,LatexPrinter._print_Series.<locals>.<lambda>F
  s    4,,Q0Ft0L,13rU   r   )r  r@  rU  ra  )r   r  r@  r  s   ff  rS   _print_SeriesLatexPrinter._print_SeriesD
  s+    DII3xxF)**rU   c                	   a aa ^ RI Ho \        SP                  4      RRR1,          pVVV 3R lpRP	                  \        W24      4      # )rr  )MIMOParallelNc                   < \        V S4      '       d   SP                  V \        S4      R 4      # SP                  V 4      # r  )r  r   r   r   )r'  r  r  r   s   &rS   rT   0LatexPrinter._print_MIMOSeries.<locals>.<lambda>M
  sH    7A!\7R7R  ,,Q0Ft0L-24 gX\XcXcdeXfgrU   z\cdotry  )sympy.physics.control.ltir  r  r@  rU  ra  )r   r  r@  r  r  s   ff  @rS   _print_MIMOSeriesLatexPrinter._print_MIMOSeriesJ
  s8    :DIItt$g}}S.//rU   c                	`    R P                  \        V P                  VP                  4      4      # ri  rU  ra  r   r@  r  s   &&rS   _print_ParallelLatexPrinter._print_ParallelQ
       zz#dkk499566rU   c                	`    R P                  \        V P                  VP                  4      4      # ri  r  r  s   &&rS   _print_MIMOParallel LatexPrinter._print_MIMOParallelT
  r  rU   c           	     	    ^ RI HpHp VP                  V! ^^VP                  4      rT\        WC4      '       d   \        VP                  4      MV.p\        VP                  V4      '       d    \        VP                  P                  4      MVP                  .pTp\        WC4      '       d)   \        VP                  V4      '       d   V! . VOVO5!  p	M\        WC4      '       dL   \        VP                  V4      '       d0   VP                  V8X  d   V! V!  p	MWS! . VOVP                  N5!  3p	Mu\        WB4      '       d5   \        VP                  V4      '       d   WE8X  d   V! V!  p	M;V! V.VO5!  p	M0WE8X  d   V! V!  p	M#VP                  V8X  d   V! V!  p	MV! . VOVO5!  p	V P                  V4      p
V P                  V4      pV P                  V	4      pVP                  R8X  d   RMRpRV
: RV: RV: RV: R2	# )	rr  )TransferFunctionSeriesr  rK  r  r  r   rO   ry  )sympy.physics.controlr  r  sys1r  r  r  r@  sys2r   r8  )r   r  r  r  r{  tfnum_arg_listden_arg_list
den_term_1
den_term_2r  denom_1denom_2_signs   &&            rS   _print_FeedbackLatexPrinter._print_FeedbackW
  s   B))-aDHH=R)3C)@)@tCHH~setyy&)) DIINN+04		{ 	
c""z$))V'D'D===J$$DII?O)P)PyyB#\2
!A!Atyy!AA
..:dii3P3Py#\2
#C7,7
y#\2
b#\2
#A\ALA
C ++j)++j)yyBC).HHrU   c                	    ^ RI Hp V P                  V! VP                  VP                  4      4      pV P                  VP                  4      pVP
                  R8X  d   RMRpRV: RV: RV: 2# )rr  )
MIMOSeriesr  rK  z\left(I_{\tau} r   z\right)^{-1} \cdot ry  )r  r  r   r  r  r8  )r   r  r  inv_matr  r  s   &&    rS   _print_MIMOFeedback LatexPrinter._print_MIMOFeedback{
  sR    4++jDII>?{{499%yyBC?DgtTTrU   c                	J    V P                  VP                  4      pR V,          # )z%s_\tau)r   	_expr_matr  s   && rS   _print_TransferFunctionMatrix*LatexPrinter._print_TransferFunctionMatrix
  s    kk$..)CrU   c                	b    R P                  VP                  P                  VP                  4      # )z\text{{{}}}_{{{}}})r   rS  rT  r~  r  s   &&rS   
_print_DFTLatexPrinter._print_DFT
  s#    $++DNN,C,CTVVLLrU   c                	~    V P                  \        VP                  4      4      pV P                  V4      pV: R V: 2# )r  )r   r   rV  r  )r   r  pretty_namepretty_morphisms   &&  rS   _print_NamedMorphism!LatexPrinter._print_NamedMorphism
  s4    kk&"78..x8%77rU   c                	h    ^ RI Hp V P                  V! VP                  VP                  R4      4      # )rr  )NamedMorphismid)sympy.categoriesr  r  r9  r  )r   r  r  s   && rS   _print_IdentityMorphism$LatexPrinter._print_IdentityMorphism
  s0    2((OOX..*6 7 	7rU   c                	   VP                    Uu. uF'  pV P                  \        VP                  4      4      NK)  	  ppVP	                  4        R P                  V4      R,           pV P                  V4      pWE,           # u upi )z\circ r  )rR  r   r   rV  reverserU  r  )r   r  	componentcomponent_names_listcomponent_namesr  s   &&    rS   _print_CompositeMorphism%LatexPrinter._print_CompositeMorphism
  s}     .6-@-@ B-@	 !%F9>>,B C-@ 	  B$$&#..)=>D..x800 Bs   -A?c                	h    R P                  V P                  \        VP                  4      4      4      # rR  )r   r   r   rV  )r   r  s   &&rS   _print_CategoryLatexPrinter._print_Category
  s%    &&t{{6(--3H'IJJrU   c                	   VP                   '       g    V P                  \        P                  4      # V P                  VP                   4      pVP                  '       d*   VR V P                  VP                  4      ,          ,          pV# )z\Longrightarrow %s)premisesr   r   EmptySetconclusions)r   diagramlatex_results   && rS   _print_DiagramLatexPrinter._print_Diagram
  sm    ;;qzz**{{7#3#341 KK(;(;<= =L rU   c                	   R RVP                   ,          ,          p\        VP                  4       F  p\        VP                   4       FX  pWV3,          '       d   V\        WV3,          4      ,          pVR,          pWAP                   ^,
          8w  g   KO  VR,          pKZ  	  W1P                  ^,
          8w  d
   VR,          pVR,          pK  	  VR,          pV# )z\begin{array}{%s}
r   r   & r6  
z\end{array}
)widthr  heightlatex)r   gridr  r   r   s   &&   rS   _print_DiagramGridLatexPrinter._print_DiagramGrid
  s    -tzz1ABt{{#A4::&1:: E$!t*$55L#

Q& D(L ' KK!O#&D L $ 	((rU   c                	    R P                  V P                  VP                  4      V P                  VP                  4      4      # )z{{{}}}^{{{}}})r   r   r  r  r   r  s   &&rS   _print_FreeModuleLatexPrinter._print_FreeModule
  s/    %%dkk!&&&94;;qvv;NOOrU   c                	X   a  R P                  RP                  V 3R lV 4       4      4      # )\left[ {} \right]rv  c              3  b   <"   T F$  pR SP                  V4      ,           R,           x  K&  	  R# 5irs   rO   Nr  r&  r'  r   s   & rS   r(  8LatexPrinter._print_FreeModuleElement.<locals>.<genexpr>
  s)      43011C$++a. 3&&   ,/)r   rU  )r   r  s   f&rS   _print_FreeModuleElement%LatexPrinter._print_FreeModuleElement
  s.    #**388 430143 ,3 4 	4rU   c                	(  aa VP                    UUu. uF;  q" Uu. uF,  q0P                  VP                  P                  V4      4      NK.  	  upNK=  	  pppR  oR oRP	                  VV3R lV 4       4      pRP                  V4      # u upi u uppi )c                "    R V ,           R,           # )rs   rO   rP   r7   s   &rS   rT   /LatexPrinter._print_SubModule.<locals>.<lambda>
  s    $(T/rU   c                "    R V ,           R,           # )z\left[ z \right]rP   r7  s   &rS   rT   r8  
  s    :>K7rU   rv  c           	   3  r   <"   T F,  pS! S! R P                  V3R lV 4       4      4      4      x  K.  	  R# 5i)rv  c              3  4   <"   T F  pS! V4      x  K  	  R # 5ir   rP   )r&  r'  curlys   & rS   r(  :LatexPrinter._print_SubModule.<locals>.<genexpr>.<genexpr>
  s     3HaE!HHas   N)rU  )r&  gr<  squares   & rS   r(  0LatexPrinter._print_SubModule.<locals>.<genexpr>
  s/     YTXqeF3883Ha3H+H$IJJTXs   47\left\langle {} \right\rangle)rH  r   r  r  rU  r   )r   r  r>  r'  rH  
gens_latexr<  r?  s   &&    @@rS   _print_SubModuleLatexPrinter._print_SubModule
  sv    FGffMf!<!QQVV__Q/0!<fM)7XXYTXYY
/66zBB	 =Ms   B2B	B	Bc           	     	    R P                  VP                   Uu. uF"  pRV P                  V4      ,           R,           NK$  	  up4      pRP                  V4      # u upi )rv  rs   rO   rA  )rU  rH  r   r   )r   r  r>  rB  s   &&  rS   _print_SubQuotientModule%LatexPrinter._print_SubQuotientModule
  sO    XX166J6asT[[^3c996JK
/66zBB Ks   (Ac                	   a  VP                   P                   Uu. uF  w  q!P                  P                  V4      NK!  	  ppR P	                  V 3R lV 4       4      pRP                  V4      # u upi )rv  c              3  b   <"   T F$  pR SP                  V4      ,           R,           x  K&  	  R# 5ir/  r  r0  s   & rS   r(  =LatexPrinter._print_ModuleImplementedIdeal.<locals>.<genexpr>
  s&     G$QcDKKN2S88$r2  rA  )_modulerH  r  r  rU  r   )r   r  r'  rH  rB  s   f&   rS   _print_ModuleImplementedIdeal*LatexPrinter._print_ModuleImplementedIdeal
  sV    ./iinn=ns"n=XXG$GG
/66zBB >s   %A-c           	     	2   VP                    Uu. uF"  pV P                  V\        R ,          RR7      NK$  	  ppV^ ,          .\        VR,          R4       UUu. uF  w  r$VR,           V,           NK  	  upp,           pRP	                  V4      # u upi u uppi )r	   Trz  r  ijkr   rh  )r@  r   r    r  rU  )r   r  r   rR   r   r   s   &&    rS   _print_QuaternionLatexPrinter._print_Quaternion
  s     ii! q*U"3DA 	
 !qTF#aeU*;<*;$!aeAgg*;<<zz!}!<s   (BBc                	    R P                  V P                  VP                  4      V P                  VP                  4      4      # z\frac{{{}}}{{{}}})r   r   r  
base_ideal)r   Rs   &&rS   _print_QuotientRing LatexPrinter._print_QuotientRing
  s4    #**4;;qvv+>Q\\*, 	,rU   c                	    V P                  VP                  P                  V4      4      pR P                  VV P                  VP                  P                  4      4      # ){{{}}} + {{{}}})r   r  r  r   rT  )r   r'  x_latexs   && rS   _print_QuotientRingElement'LatexPrinter._print_QuotientRingElement
  sH    ++affooa01!((QVV../1 	1rU   c                	F  a  VP                    Uu. uF'  q!P                  P                  P                  V4      NK)  	  ppR P	                  RP                  V 3R lV 4       4      4      pRP	                  VS P                  VP                  P                  4      4      # u upi )r-  rv  c              3  b   <"   T F$  pR SP                  V4      ,           R,           x  K&  	  R# 5ir/  r  r0  s   & rS   r(  <LatexPrinter._print_QuotientModuleElement.<locals>.<genexpr>
  s)      :6041C$++a. 3&&r2  rY  )datamoduler  r  r   rU  r   killed_module)r   r  r'  r`  
data_latexs   f&   rS   _print_QuotientModuleElement)LatexPrinter._print_QuotientModuleElement
  s    3466:6a&&q)6:)00 :604:6 26 7
!((QXX3346 	6 ;s   -Bc                	    R P                  V P                  VP                  4      V P                  VP                  4      4      # rS  )r   r   rF  rb  r)  s   &&rS   _print_QuotientModule"LatexPrinter._print_QuotientModule
  s4    #**4;;qvv+>Q__-/ 	/rU   c                	    R P                  V P                  VP                  4       4      V P                  VP                  4      V P                  VP                  4      4      # )z{{{}}} : {{{}}} \to {{{}}})r   r   _sympy_matrixr9  r  )r   r  s   &&rS   _print_MatrixHomomorphism&LatexPrinter._print_MatrixHomomorphism
  sF    ,33DKK@Q4RKK!4;;qzz#:< 	<rU   c                	   V P                  VP                  P                  4      w  r#pR V,          pV'       d    VRRP                  V4      ,          ,          pV'       d    VRRP                  V4      ,          ,          pV# )r^  r  r   r`  )rM  rV  rU  )r   manifoldrV  rL  r  s   &&   rS   _print_ManifoldLatexPrinter._print_Manifold
  se    !228==3E3EFdd"Gchhv...DGchhtn,,DrU   c                	|    R V P                  VP                  4      : RV P                  VP                  4      : R2# )\text{r{  rO   )r   rV  rn  )r   patchs   &&rS   _print_PatchLatexPrinter._print_Patch  s'    $(KK

$;T[[=XYYrU   c                	    R V P                  VP                  4      : RV P                  VP                  P                  4      : RV P                  VP                  4      : R2# )rr  z	}^{\text{z}}_{rO   )r   rV  rs  rn  )r   coordsyss   &&rS   _print_CoordSystemLatexPrinter._print_CoordSystem  sC    KK&HNN4G4G(H$++V^VgVgJh
 	
rU   c                	F    R V P                  VP                  4      ,          # )z\mathbb{\nabla}_{%s})r   _wrt)r   cvds   &&rS   _print_CovarDerivativeOp%LatexPrinter._print_CovarDerivativeOp  s    &SXX)>>>rU   c                	    VP                   P                  VP                  ,          P                  pR P	                  V P                  \        V4      4      4      # r  
_coord_sysr  _indexrV  r   r   r   r   fieldrP  s   && rS   _print_BaseScalarField#LatexPrinter._print_BaseScalarField  s@    !!))%,,7<<&&t{{6&>'BCCrU   c                	    VP                   P                  VP                  ,          P                  pR P	                  V P                  \        V4      4      4      # )z\partial_{{{}}}r  r  s   && rS   _print_BaseVectorField#LatexPrinter._print_BaseVectorField  s@    !!))%,,7<<!((VF^)DEErU   c                	6   VP                   p\        VR 4      '       d[   VP                  P                  VP                  ,          P
                  pRP                  V P                  \        V4      4      4      # V P                  V4      pRP                  V4      # )r  z\operatorname{{d}}{}z!\operatorname{{d}}\left({}\right))	_form_fieldr  r  r  r  rV  r   r   r   )r   diffr  rP  s   &&  rS   _print_Differential LatexPrinter._print_Differential  sw      5,''%%--ell;@@F*11$++fVn2MNN[['F7>>vFFrU   c                	h    V P                  VP                  ^ ,          4      pRP                  V4      # )rr  z"\operatorname{{tr}}\left({}\right)r  )r   r  contentss   && rS   	_print_TrLatexPrinter._print_Tr!  s)    ;;qvvay)4;;HEErU   c                	    Ve,   RV P                  VP                  ^ ,          4      : RV: R2# RV P                  VP                  ^ ,          4      ,          # )Nz\left(\phi\left(\right)\right)^{rO   z\phi\left(%s\right)r(  rL  s   &&&rS   _print_totientLatexPrinter._print_totient&  sC    ?TYYq\*C1 1%DIIaL(AAArU   c                	    Ve,   RV P                  VP                  ^ ,          4      : RV: R2# RV P                  VP                  ^ ,          4      ,          # )Nz\left(\lambda\left(r  rO   z\lambda\left(%s\right)r(  rL  s   &&&rS   _print_reduced_totient#LatexPrinter._print_reduced_totient,  sC    ?TYYq\*C1 1(4;;tyy|+DDDrU   c           	     	L   \        VP                  4      ^8X  dL   R\        \        V P                  VP                  ^,          VP                  ^ ,          34      4      ,          pM)RV P	                  VP                  ^ ,          4      ,          pVe   RV: RV: 2# RV,          # )r   _%s\left(%s\right)ri  z\sigma^{rO   z\sigma%sr  r  s   &&& rS   _print_divisor_sigma!LatexPrinter._print_divisor_sigma2  s    tyy>Q'%DKK151tyy|0L1N +O OC %t{{499Q<'@@C?'*C00S  rU   c           	     	L   \        VP                  4      ^8X  dL   R\        \        V P                  VP                  ^,          VP                  ^ ,          34      4      ,          pM)RV P	                  VP                  ^ ,          4      ,          pVe   RV: RV: 2# RV,          # )r   r  ri  z
\sigma^*^{rO   z
\sigma^*%sr  r  s   &&& rS   _print_udivisor_sigma"LatexPrinter._print_udivisor_sigma<  s    tyy>Q'%DKK151tyy|0L1N +O OC %t{{499Q<'@@C?),c22s""rU   c                	    Ve,   RV P                  VP                  ^ ,          4      : RV: R2# RV P                  VP                  ^ ,          4      ,          # )Nz\left(\nu\left(r  rO   z\nu\left(%s\right)r(  rL  s   &&&rS   _print_primenuLatexPrinter._print_primenuF  sC    ?TYYq\*C1 1$t{{499Q<'@@@rU   c                	    Ve,   RV P                  VP                  ^ ,          4      : RV: R2# RV P                  VP                  ^ ,          4      ,          # )Nz\left(\Omega\left(r  rO   z\Omega\left(%s\right)r(  rL  s   &&&rS   _print_primeomegaLatexPrinter._print_primeomegaL  sC    ?TYYq\*C1 1'$++diil*CCCrU   c                	,    \        VP                  4      # r   )r   rV  r   s   &&rS   
_print_StrLatexPrinter._print_StrR  s    166{rU   c                	6    V P                  \        V4      4      # r   )r   r   r  s   &&rS   _print_floatLatexPrinter._print_floatU  s    {{5;''rU   c                	    \        V4      # r   r   r  s   &&rS   
_print_intLatexPrinter._print_intX      4yrU   c                	    \        V4      # r   r  r  s   &&rS   
_print_mpzLatexPrinter._print_mpz[  r  rU   c                	    \        V4      # r   r  r  s   &&rS   
_print_mpqLatexPrinter._print_mpq^  r  rU   c                	    \        V4      # r   r  r  s   &&rS   _print_fmpzLatexPrinter._print_fmpza  r  rU   c                	    \        V4      # r   r  r  s   &&rS   _print_fmpqLatexPrinter._print_fmpqd  r  rU   c                	\    R P                  \        \        VP                  4      4      4      # )z"\operatorname{{Q}}_{{\text{{{}}}}})r   r   r   rV  r  s   &&rS   _print_PredicateLatexPrinter._print_Predicateg  s     4;;LTYY<XYYrU   c                	    VP                   pVP                  pV P                  V4      pR P                  V Uu. uF  qPP                  V4      NK  	  up4      pV: RV: R2# u upi )rQ  r   r   )r9  	argumentsr   rU  )r   r  predr@  
pred_latexr   
args_latexs   &&     rS   _print_AppliedPredicate$LatexPrinter._print_AppliedPredicatej  sU    }}~~[[&
YY=1A=>
%z22  >s   A#c                	F   < \         SV `  V4      pR \        V4      ,          # )z\mathtt{\text{%s}})superemptyPrinterr   )r   r  rR   rS  s   && rS   r  LatexPrinter.emptyPrinterq  s!    G &$|A66rU   )r   r   )FF)Nr  r  )FN)r   r  (E  rT  
__module____qualname____firstlineno__printmethodr   __annotations__r   r   r   r   r   r  r  r  r6  r<  r  r  rN  rX  r`  _print_BooleanTrue_print_BooleanFalserd  ro  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r)  r;  rA  r]  rd  rh  rm  r|  r  r  r  r  r  r  r  propertyr  r  r  r  r  
_print_Min
_print_Maxr  r  r  r   r  r	  r  r  r  r  r"  r  r  r*  r-  r0  r3  r6  r:  r>  rB  rF  rK  rO  rR  rW  r\  _print_gammar_  rc  rf  rj  ro  rr  ru  rx  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r  r  r  r  r  r(  r)  r-  r1  r5  r9  rA  rG  _print_RandomSymbolrM  rR  r]  rb  rp  rw  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r  r  r  r  r  r  r   r$  r*  r0  r5  r8  r<  rA  rD  rG  rK  rR  rU  rZ  r`  re  rc  _print_frozensetr  r  r  r  r  r  r  r  r  r  _print_SeqPer_print_SeqAdd_print_SeqMulr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r!  r%  r)  r,  r/  r2  r5  r;  r?  rD  rS  rY  r^  rb  rf  rj  rm  rq  rt  rw  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  _print_IDFTr  r
  r  r  r  r&  r*  r3  rC  rF  rL  rP  rV  r[  rd  rg  rk  ro  rt  rx  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  __static_attributes____classcell__)rS  s   @rS   r   r      s   K)U)E) 	e) 	4	)
 	-) 	) 	u) 	4) 	S) 	4) 	) 	d) 	) 	) 	)  	G!)" 	##)$ 	Xtdtt!55)~ :;fz,-% %EK. >3/  %% & 9BJ<NNMMIIqf/-+<Z&")&&<'@BE"/H4@J) J)X0
 , ,0
-  87J	++	7203DF)+  	 "	/[<%%; ; (L1:  ++"777777====- -4 42288	 !+@QGGSS'' A A (
$ J(*+,5
J($G7&/"\
GA>A>@!>>>#5n8?
F

&D
4F+*':<&		%&, "(T>>>>>M
. &M%M%MK$9(
-
(
-
<Q
&A!D<
+-8
8
?7r
HN!CC57=7=7=9?9?$"0VXoV8
-+077"IHU MK8
7
	1K
$P4
CCC
,
1
6/
<	Z

?DFGF
BE!#AD(Z37 7 7rU   r   c                    V ^8  d   QhRRRR/# r   rP   )r   s   "rS   r   r   x  s        rU   c           
        \         P                  V 4      pV'       d   V# V P                  4       \        9   d   RV P                  4       ,           # V \        9   d
   RV ,           # \        \        P                  4       \        RR7       Fn  pV P                  4       P                  V4      '       g   K*  \        V 4      \        V4      8  g   KE  \        V,          ! \        V R\        V4      )  4      4      u # 	  V # )aj  
Check for a modifier ending the string.  If present, convert the
modifier to latex and translate the rest recursively.

Given a description of a Greek letter or other special character,
return the appropriate latex.

Let everything else pass as given.

>>> from sympy.printing.latex import translate
>>> translate('alphahatdotprime')
"{\\dot{\\hat{\\alpha}}}'"
r   T)rJ  r  N)tex_greek_dictionaryr   r  greek_letters_setother_symbolsr  r   r?  r  r$  rK  )rR   r  rJ  s   &  rS   rK  rK  x  s     
"
"1
%C

	
'	'aggi	
m	ax -,,.CFCwwy!!#&&3q6CH+<$S))AjCyM*BCC G rU   c                6    \        V4      P                  V 4      # )a"  Convert the given expression to LaTeX string representation.

Parameters
==========
full_prec: boolean, optional
    If set to True, a floating point number is printed with full precision.
fold_frac_powers : boolean, optional
    Emit ``^{p/q}`` instead of ``^{\frac{p}{q}}`` for fractional powers.
fold_func_brackets : boolean, optional
    Fold function brackets where applicable.
fold_short_frac : boolean, optional
    Emit ``p / q`` instead of ``\frac{p}{q}`` when the denominator is
    simple enough (at most two terms and no powers). The default value is
    ``True`` for inline mode, ``False`` otherwise.
inv_trig_style : string, optional
    How inverse trig functions should be displayed. Can be one of
    ``'abbreviated'``, ``'full'``, or ``'power'``. Defaults to
    ``'abbreviated'``.
itex : boolean, optional
    Specifies if itex-specific syntax is used, including emitting
    ``$$...$$``.
ln_notation : boolean, optional
    If set to ``True``, ``\ln`` is used instead of default ``\log``.
long_frac_ratio : float or None, optional
    The allowed ratio of the width of the numerator to the width of the
    denominator before the printer breaks off long fractions. If ``None``
    (the default value), long fractions are not broken up.
mat_delim : string, optional
    The delimiter to wrap around matrices. Can be one of ``'['``, ``'('``,
    or the empty string ``''``. Defaults to ``'['``.
mat_str : string, optional
    Which matrix environment string to emit. ``'smallmatrix'``,
    ``'matrix'``, ``'array'``, etc. Defaults to ``'smallmatrix'`` for
    inline mode, ``'matrix'`` for matrices of no more than 10 columns, and
    ``'array'`` otherwise.
mode: string, optional
    Specifies how the generated code will be delimited. ``mode`` can be one
    of ``'plain'``, ``'inline'``, ``'equation'`` or ``'equation*'``.  If
    ``mode`` is set to ``'plain'``, then the resulting code will not be
    delimited at all (this is the default). If ``mode`` is set to
    ``'inline'`` then inline LaTeX ``$...$`` will be used. If ``mode`` is
    set to ``'equation'`` or ``'equation*'``, the resulting code will be
    enclosed in the ``equation`` or ``equation*`` environment (remember to
    import ``amsmath`` for ``equation*``), unless the ``itex`` option is
    set. In the latter case, the ``$$...$$`` syntax is used.
mul_symbol : string or None, optional
    The symbol to use for multiplication. Can be one of ``None``,
    ``'ldot'``, ``'dot'``, or ``'times'``.
order: string, optional
    Any of the supported monomial orderings (currently ``'lex'``,
    ``'grlex'``, or ``'grevlex'``), ``'old'``, and ``'none'``. This
    parameter does nothing for `~.Mul` objects. Setting order to ``'old'``
    uses the compatibility ordering for ``~.Add`` defined in Printer. For
    very large expressions, set the ``order`` keyword to ``'none'`` if
    speed is a concern.
symbol_names : dictionary of strings mapped to symbols, optional
    Dictionary of symbols and the custom strings they should be emitted as.
root_notation : boolean, optional
    If set to ``False``, exponents of the form 1/n are printed in fractonal
    form. Default is ``True``, to print exponent in root form.
mat_symbol_style : string, optional
    Can be either ``'plain'`` (default) or ``'bold'``. If set to
    ``'bold'``, a `~.MatrixSymbol` A will be printed as ``\mathbf{A}``,
    otherwise as ``A``.
imaginary_unit : string, optional
    String to use for the imaginary unit. Defined options are ``'i'``
    (default) and ``'j'``. Adding ``r`` or ``t`` in front gives ``\mathrm``
    or ``\text``, so ``'ri'`` leads to ``\mathrm{i}`` which gives
    `\mathrm{i}`.
gothic_re_im : boolean, optional
    If set to ``True``, `\Re` and `\Im` is used for ``re`` and ``im``, respectively.
    The default is ``False`` leading to `\operatorname{re}` and `\operatorname{im}`.
decimal_separator : string, optional
    Specifies what separator to use to separate the whole and fractional parts of a
    floating point number as in `2.5` for the default, ``period`` or `2{,}5`
    when ``comma`` is specified. Lists, sets, and tuple are printed with semicolon
    separating the elements when ``comma`` is chosen. For example, [1; 2; 3] when
    ``comma`` is chosen and [1,2,3] for when ``period`` is chosen.
parenthesize_super : boolean, optional
    If set to ``False``, superscripted expressions will not be parenthesized when
    powered. Default is ``True``, which parenthesizes the expression when powered.
min: Integer or None, optional
    Sets the lower bound for the exponent to print floating point numbers in
    fixed-point format.
max: Integer or None, optional
    Sets the upper bound for the exponent to print floating point numbers in
    fixed-point format.
diff_operator: string, optional
    String to use for differential operator. Default is ``'d'``, to print in italic
    form. ``'rd'``, ``'td'`` are shortcuts for ``\mathrm{d}`` and ``\text{d}``.
adjoint_style: string, optional
    String to use for the adjoint symbol. Defined options are ``'dagger'``
    (default),``'star'``, and ``'hermitian'``.

Notes
=====

Not using a print statement for printing, results in double backslashes for
latex commands since that's the way Python escapes backslashes in strings.

>>> from sympy import latex, Rational
>>> from sympy.abc import tau
>>> latex((2*tau)**Rational(7,2))
'8 \\sqrt{2} \\tau^{\\frac{7}{2}}'
>>> print(latex((2*tau)**Rational(7,2)))
8 \sqrt{2} \tau^{\frac{7}{2}}

Examples
========

>>> from sympy import latex, pi, sin, asin, Integral, Matrix, Rational, log
>>> from sympy.abc import x, y, mu, r, tau

Basic usage:

>>> print(latex((2*tau)**Rational(7,2)))
8 \sqrt{2} \tau^{\frac{7}{2}}

``mode`` and ``itex`` options:

>>> print(latex((2*mu)**Rational(7,2), mode='plain'))
8 \sqrt{2} \mu^{\frac{7}{2}}
>>> print(latex((2*tau)**Rational(7,2), mode='inline'))
$8 \sqrt{2} \tau^{7 / 2}$
>>> print(latex((2*mu)**Rational(7,2), mode='equation*'))
\begin{equation*}8 \sqrt{2} \mu^{\frac{7}{2}}\end{equation*}
>>> print(latex((2*mu)**Rational(7,2), mode='equation'))
\begin{equation}8 \sqrt{2} \mu^{\frac{7}{2}}\end{equation}
>>> print(latex((2*mu)**Rational(7,2), mode='equation', itex=True))
$$8 \sqrt{2} \mu^{\frac{7}{2}}$$
>>> print(latex((2*mu)**Rational(7,2), mode='plain'))
8 \sqrt{2} \mu^{\frac{7}{2}}
>>> print(latex((2*tau)**Rational(7,2), mode='inline'))
$8 \sqrt{2} \tau^{7 / 2}$
>>> print(latex((2*mu)**Rational(7,2), mode='equation*'))
\begin{equation*}8 \sqrt{2} \mu^{\frac{7}{2}}\end{equation*}
>>> print(latex((2*mu)**Rational(7,2), mode='equation'))
\begin{equation}8 \sqrt{2} \mu^{\frac{7}{2}}\end{equation}
>>> print(latex((2*mu)**Rational(7,2), mode='equation', itex=True))
$$8 \sqrt{2} \mu^{\frac{7}{2}}$$

Fraction options:

>>> print(latex((2*tau)**Rational(7,2), fold_frac_powers=True))
8 \sqrt{2} \tau^{7/2}
>>> print(latex((2*tau)**sin(Rational(7,2))))
\left(2 \tau\right)^{\sin{\left(\frac{7}{2} \right)}}
>>> print(latex((2*tau)**sin(Rational(7,2)), fold_func_brackets=True))
\left(2 \tau\right)^{\sin {\frac{7}{2}}}
>>> print(latex(3*x**2/y))
\frac{3 x^{2}}{y}
>>> print(latex(3*x**2/y, fold_short_frac=True))
3 x^{2} / y
>>> print(latex(Integral(r, r)/2/pi, long_frac_ratio=2))
\frac{\int r\, dr}{2 \pi}
>>> print(latex(Integral(r, r)/2/pi, long_frac_ratio=0))
\frac{1}{2 \pi} \int r\, dr

Multiplication options:

>>> print(latex((2*tau)**sin(Rational(7,2)), mul_symbol="times"))
\left(2 \times \tau\right)^{\sin{\left(\frac{7}{2} \right)}}

Trig options:

>>> print(latex(asin(Rational(7,2))))
\operatorname{asin}{\left(\frac{7}{2} \right)}
>>> print(latex(asin(Rational(7,2)), inv_trig_style="full"))
\arcsin{\left(\frac{7}{2} \right)}
>>> print(latex(asin(Rational(7,2)), inv_trig_style="power"))
\sin^{-1}{\left(\frac{7}{2} \right)}

Matrix options:

>>> print(latex(Matrix(2, 1, [x, y])))
\left[\begin{matrix}x\\y\end{matrix}\right]
>>> print(latex(Matrix(2, 1, [x, y]), mat_str = "array"))
\left[\begin{array}{c}x\\y\end{array}\right]
>>> print(latex(Matrix(2, 1, [x, y]), mat_delim="("))
\left(\begin{matrix}x\\y\end{matrix}\right)

Custom printing of symbols:

>>> print(latex(x**2, symbol_names={x: 'x_i'}))
x_i^{2}

Logarithms:

>>> print(latex(log(10)))
\log{\left(10 \right)}
>>> print(latex(log(10), ln_notation=True))
\ln{\left(10 \right)}

``latex()`` also supports the builtin container types :class:`list`,
:class:`tuple`, and :class:`dict`:

>>> print(latex([2/x, y], mode='inline'))
$\left[ 2 / x, \  y\right]$

Unsupported types are rendered as monospaced plaintext:

>>> print(latex(int))
\mathtt{\text{<class 'int'>}}
>>> print(latex("plain % text"))
\mathtt{\text{plain \% text}}

See :ref:`printer_method_example` for an example of how to override
this behavior for your own types by implementing ``_latex``.

.. versionchanged:: 1.7.0
    Unsupported types no longer have their ``str`` representation treated as valid latex.

)r   r  r  r   s   &,rS   r$  r$    s    n !))$//rU   c                0    \        \        V 3/ VB 4       R# )z\Prints LaTeX representation of the given expression. Takes the same
settings as ``latex()``.N)printr$  r  s   &,rS   print_latexr  q  s     
%
!
!"rU   c           
     .   \        R/ VB pVR8X  d   RpRpRp	Rp
RpM>VR8X  d   RpRpRp	Rp
RpM,VR	8X  d   RpR
pRp	Rp
RpM\        RP                  V4      4      hRpV'       d   RpVP                  4       p\	        V4      p^p\        V4       F  pVV,          pRpRpRpW8  d   V'       d   RpMRp^pW8X  d(   VV^,
          8  d   W,           R,           R,           pMRpVP                  4       ^ ,          R8X  d   RV,          pRpV^ 8X  dE   VR8X  d   RpVRP                  VP                  V 4      VVVP                  V4      V4      ,          pM*VRP                  VVVP                  V4      V4      ,          pV^,          pK  	  Wz,          pV# )a  
This function generates a LaTeX equation with a multiline right-hand side
in an ``align*``, ``eqnarray`` or ``IEEEeqnarray`` environment.

Parameters
==========

lhs : Expr
    Left-hand side of equation

rhs : Expr
    Right-hand side of equation

terms_per_line : integer, optional
    Number of terms per line to print. Default is 1.

environment : "string", optional
    Which LaTeX wnvironment to use for the output. Options are "align*"
    (default), "eqnarray", and "IEEEeqnarray".

use_dots : boolean, optional
    If ``True``, ``\\dots`` is added to the end of each line. Default is ``False``.

Examples
========

>>> from sympy import multiline_latex, symbols, sin, cos, exp, log, I
>>> x, y, alpha = symbols('x y alpha')
>>> expr = sin(alpha*y) + exp(I*alpha) - cos(log(y))
>>> print(multiline_latex(x, expr))
\begin{align*}
x = & e^{i \alpha} \\
& + \sin{\left(\alpha y \right)} \\
& - \cos{\left(\log{\left(y \right)} \right)}
\end{align*}

Using at most two terms per line:
>>> print(multiline_latex(x, expr, 2))
\begin{align*}
x = & e^{i \alpha} + \sin{\left(\alpha y \right)} \\
& - \cos{\left(\log{\left(y \right)} \right)}
\end{align*}

Using ``eqnarray`` and dots:
>>> print(multiline_latex(x, expr, terms_per_line=2, environment="eqnarray", use_dots=True))
\begin{eqnarray}
x & = & e^{i \alpha} + \sin{\left(\alpha y \right)} \dots\nonumber\\
& & - \cos{\left(\log{\left(y \right)} \right)}
\end{eqnarray}

Using ``IEEEeqnarray``:
>>> print(multiline_latex(x, expr, environment="IEEEeqnarray"))
\begin{IEEEeqnarray}{rCl}
x & = & e^{i \alpha} \nonumber\\
& & + \sin{\left(\alpha y \right)} \nonumber\\
& & - \cos{\left(\log{\left(y \right)} \right)}
\end{IEEEeqnarray}

Notes
=====

All optional parameters from ``latex`` can also be used.

eqnarrayr!  z& = &z	\nonumberz
\end{eqnarray}TIEEEeqnarrayz
\end{IEEEeqnarray}align*z= &r   z
\end{align*}FzUnknown environment: {}z\dotsr  z& & r   r6  rK  z{:s} {:s}{:s} {:s} {:s}z{:s}{:s} {:s} {:s}rP   z\begin{eqnarray}
z\begin{IEEEeqnarray}{rCl}
z\begin{align*}
ry  )r   r   r   as_ordered_termsr  r  r  r  )rW  rY  terms_per_lineenvironmentuse_dotsr   r1  r  
first_termnonumberend_termdoubleetry  rl  n_terms
term_countr   rm  
term_startterm_endr8  s   &&&&&,               rS   multiline_latexr  x  s   F 	 x Aj +
&		&4
*		 )
%299+FGGD  "E%jGJ7^Qx
&#
!
J'719}?U2T9""$Q'2-d7DD6s{077		#"D!))D/8E EF +22:t		$3 3Fa
= > FMrU   )arcsinarccosarctansincostansinhcoshtanhsqrtlnlogseccsccotcothr#  imrp  rX  rB  >
   wpellethmhobethhbaralephgimeldalethhslash)r  r  F)K__conditional_annotations____doc__
__future__r   typingr   r   r   r  
sympy.corer   r   r   r	   r
   r   r   r   sympy.core.alphabetsr   sympy.core.containersr   sympy.core.functionr   r   r   sympy.core.operationsr   sympy.core.powerr   sympy.core.sortingr   sympy.core.sympifyr   r  r   r   r   sympy.printing.precedencer   sympy.printing.printerr   r   sympy.printing.conventionsr   r   r   r    mpmath.libmp.libmpfr!   r"   r  sympy.utilities.iterablesr#   r$   r#  sympy.tensor.arrayr%   sympy.vector.basisdependentr&   r  r  r  r   r  	frozensetr  compiler  r   r   rK  r$  r  r  )r  s   @rS   <module>r*     s   # / /  D D D ' ' B B )   / + ? ? = : H < B 7 	,: %]%
M% Y% Y	%
 }% M% 
=% Y% M% ]% j% 	-% 	-% 	&% s%  }!%" 	&#%$ 
=%%& Y'%( 
=)%* {+%, 
7-%. 
=/%0 
71%2 Y3%4 Z5%6 Z7%8 
79%: 
=;%< .=%> ?%@ jA%B YC%D jE%F I% N,2.2 *2 (	2
 &2 
$2 (2 (2 (2 (2 (2 
$2 
$2 
$2 !2  
!2$ ,%2& 	
*'2( 
(	(
*
0	9	-	-72. < f%  JJ~JJ'( g+77 g+7TW> V0 V0r#~rU   