a
    khS
                     @   s   d dl mZmZmZmZmZmZmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d dlmZ dd Zd	d
 Zdd Zdd Zdd Zdd Zdd ZdS )    )HilbertSpaceComplexSpaceL2	FockSpaceTensorProductHilbertSpaceDirectSumHilbertSpaceTensorPowerHilbertSpace)oo)Symbol)srepr)sstr)Intervalc                  C   s8   t  } t| t sJ t| dks$J t| dks4J d S )NHzHilbertSpace())r   
isinstancer   r   )Zhs r   V/var/www/auris/lib/python3.9/site-packages/sympy/physics/quantum/tests/test_hilbert.pytest_hilbert_space   s    r   c                  C   s   t d} t| t sJ | jdks$J t| dks4J t| dksDJ td}t |}t|t sbJ |j|kspJ t|dksJ t|dksJ ||dt dksJ d S )N   zC(2)zComplexSpace(Integer(2))nzC(n)zComplexSpace(Symbol('n')))r   r   	dimensionr   r   r
   subs)Zc1r   c2r   r   r   test_complex_space   s    r   c                  C   s   t tt d} t| t sJ | jtu s,J | jtt dksBJ tddd}tddd}t t||}|jtu svJ |jt||ksJ ||dt td|ksJ d S )N   xT)realy)r   r   r	   r   r   intervalr
   r   )b1r   r   b2r   r   r   test_L2$   s    r!   c                  C   s8   t  } t  }t| t sJ | jtu s(J | |ks4J d S )N)r   r   r   r	   )f1f2r   r   r   test_fock_space2   s
    r$   c                  C   s   t d} td}t| }|| }t|ts.J |jd|  ks@J |j||fksRJ || }t|tshJ |j|ksvJ |jdksJ |j| d ksJ t	 }|| | }|jt
u sJ d S Nr   r   )r
   r   r   r   r   spacesr   baseexpr   r	   r   hs1hs2hfr   r   r   test_tensor_product:   s    r.   c                  C   s   t d} td}t| }|d }t|ts.J |j|ks<J |jdksJJ |jdksXJ |d }t|tsnJ |j|ks|J |jdksJ |j| d ksJ d S )Nr   r         )r
   r   r   r   r'   r(   r   )r   r*   r+   r,   r   r   r   test_tensor_powerO   s    r1   c                  C   s   t d} td}t| }|| }t|ts.J |jd|  ks@J |j||fksRJ t }|| | }|jtu srJ |j|||fksJ d S r%   )r
   r   r   r   r   r&   r   r	   r)   r   r   r   test_direct_suma   s    r2   N)Zsympy.physics.quantum.hilbertr   r   r   r   r   r   r   Zsympy.core.numbersr	   Zsympy.core.symbolr
   Zsympy.printing.reprr   Zsympy.printing.strr   Zsympy.sets.setsr   r   r   r!   r$   r.   r1   r2   r   r   r   r   <module>   s   $