#NEWLINE# def test_pauli_states( ) : #NEWLINE# #INDENT# ( sx , sz ) = ( SigmaX ( ) , SigmaZ ( ) ) #NEWLINE# up = SigmaZKet ( 0 ) #NEWLINE# down = SigmaZKet ( 1 ) #NEWLINE# assert ( qapply ( ( sx * up ) ) == down ) #NEWLINE# assert ( qapply ( ( sx * down ) ) == up ) #NEWLINE# assert ( qapply ( ( sz * up ) ) == up ) #NEWLINE# assert ( qapply ( ( sz * down ) ) == ( - down ) ) #NEWLINE# up = SigmaZBra ( 0 ) #NEWLINE# down = SigmaZBra ( 1 ) #NEWLINE# assert ( qapply ( ( up * sx ) , dagger = True ) == down ) #NEWLINE# assert ( qapply ( ( down * sx ) , dagger = True ) == up ) #NEWLINE# assert ( qapply ( ( up * sz ) , dagger = True ) == up ) #NEWLINE# assert ( qapply ( ( down * sz ) , dagger = True ) == ( - down ) ) #NEWLINE# assert ( Dagger ( SigmaZKet ( 0 ) ) == SigmaZBra ( 0 ) ) #NEWLINE# assert ( Dagger ( SigmaZBra ( 1 ) ) == SigmaZKet ( 1 ) )