
    oVh                         d dl mZmZ d dlmZ d dlmZ d dlmZm	Z	m
Z
 d Zd Z G d de
      Z G d	 d
e	e      Z G d dee      Z G d de
      Z G d de	e      Z G d dee      Zd Zy)    )IInteger)InnerProduct)Dagger)BraKet	StateBasec                     t        d      } t        d      }t        ||       }t        |t              sJ |j                  |k(  sJ |j
                  | k(  sJ || z  t        ||       k(  sJ | || z  z  |z  | t        ||       z  |z  k(  sJ t        ||       j                  |t        |             t        |       | z  k(  sJ y Nkb)r   r   r   
isinstancebraketsubsr   r   r   ips      ]/home/dcms/DCMS/lib/python3.12/site-packages/sympy/physics/quantum/tests/test_innerproduct.pytest_innerproductr      s    CACA	a	Bb,'''66Q;;66Q;;Q3,q!$$$$ac719,q!,,Q....1""1fQi0F1IaK???    c                      t        d      } t        d      }|| z  }t        |      t        |       t        |      z  k(  sJ y r   )r   r   r   r   s      r   test_innerproduct_daggerr      s<    CACA	
1B":6!9,,,,r   c                       e Zd Zy)FooStateN__name__
__module____qualname__ r   r   r   r          r   r   c                   (    e Zd Zed        Zd Zd Zy)FooKetc                     t         S N)FooBraselfs    r   
dual_classzFooKet.dual_class!       r   c                     t        d      S )N   )r   r'   r   s     r   _eval_innerproduct_FooBraz FooKet._eval_innerproduct_FooBra%   s    qzr   c                     t         S r$   )r   r,   s     r   _eval_innerproduct_BarBraz FooKet._eval_innerproduct_BarBra(   s    r   N)r   r   r   classmethodr(   r-   r/   r   r   r   r"   r"      s     r   r"   c                       e Zd Zed        Zy)r%   c                     t         S r$   )r"   r&   s    r   r(   zFooBra.dual_class-   r)   r   Nr   r   r   r0   r(   r   r   r   r%   r%   ,        r   r%   c                       e Zd Zy)BarStateNr   r   r   r   r6   r6   2   r    r   r6   c                       e Zd Zed        Zy)BarKetc                     t         S r$   )BarBrar&   s    r   r(   zBarKet.dual_class7   r)   r   Nr3   r   r   r   r8   r8   6   r4   r   r8   c                       e Zd Zed        Zy)r:   c                     t         S r$   )r8   r&   s    r   r(   zBarBra.dual_class=   r)   r   Nr3   r   r   r   r:   r:   <   r4   r   r:   c                  D   t        d      } t        d      }t        ||       j                         t        k(  sJ t        t        |       t        |            j                         t         k(  sJ t        t        |       |       j                         t        d      k(  sJ y )Nfoobarr+   )r"   r:   r   doitr   r   r   )fr   s     r   	test_doitrB   B   s    uAuA1""$)))q	6!9-224:::q	1%**,
:::r   N)sympy.core.numbersr   r   "sympy.physics.quantum.innerproductr   sympy.physics.quantum.daggerr   sympy.physics.quantum.stater   r   r	   r   r   r   r"   r%   r6   r8   r:   rB   r   r   r   <module>rG      st    + ; / ; ;	@-	y 	
S( 
S( 	y 	S( S( ;r   