<s> from sympy . core import symbols , S <EOL> from sympy . functions import adjoint , conjugate , transpose <EOL> from sympy . matrices . expressions import MatrixSymbol , Adjoint , trace , Transpose <EOL> from sympy . matrices import eye , Matrix <EOL> n , m , l , k , p = symbols ( '<STR_LIT>' , integer = True ) <EOL> A = MatrixSymbol ( '<STR_LIT:A>' , n , m ) <EOL> B = MatrixSymbol ( '<STR_LIT:B>' , m , l ) <EOL> C = MatrixSymbol ( '<STR_LIT:C>' , n , n ) <EOL> def test_adjoint ( ) : <EOL> Sq = MatrixSymbol ( '<STR_LIT>' , n , n ) <EOL> assert Adjoint ( A ) . shape == ( m , n ) <EOL> assert Adjoint ( A * B ) . shape == ( l , n ) <EOL> assert adjoint ( Adjoint ( A ) ) == A <EOL> assert isinstance ( Adjoint ( Adjoint ( A ) ) , Adjoint ) <EOL> assert conjugate ( Adjoint ( A ) ) == Transpose ( A ) <EOL> assert transpose ( Adjoint ( A ) ) == Adjoint ( Transpose ( A ) ) <EOL> assert Adjoint ( eye ( <NUM_LIT:3> ) ) . doit ( ) == eye ( <NUM_LIT:3> ) <EOL> assert Adjoint ( S ( <NUM_LIT:5> ) ) . doit ( ) == S ( <NUM_LIT:5> ) <EOL> assert Adjoint ( Matrix ( [ [ <NUM_LIT:1> , <NUM_LIT:2> ] , [ <NUM_LIT:3> , <NUM_LIT:4> ] ] ) ) . doit ( ) == Matrix ( [ [ <NUM_LIT:1> , <NUM_LIT:3> ] , [ <NUM_LIT:2> , <NUM_LIT:4> ] ] ) <EOL> assert adjoint ( trace ( Sq ) ) == conjugate ( trace ( Sq ) ) <EOL> assert trace ( adjoint ( Sq ) ) == conjugate ( trace ( Sq ) ) <EOL> assert Adjoint ( Sq ) [ <NUM_LIT:0> , <NUM_LIT:1> ] == conjugate ( Sq [ <NUM_LIT:1> , <NUM_LIT:0> ] ) <EOL> assert Adjoint ( A * B ) . doit ( ) == Adjoint ( B ) * Adjoint ( A ) </s>
