#NEWLINE# def test_grover_iteration_2( ) : #NEWLINE# #INDENT# numqubits = 4 #NEWLINE# basis_states = superposition_basis ( numqubits ) #NEWLINE# v = OracleGate ( numqubits , return_one_on_two ) #NEWLINE# iterated = grover_iteration ( basis_states , v ) #NEWLINE# iterated = qapply ( iterated ) #NEWLINE# iterated = grover_iteration ( iterated , v ) #NEWLINE# iterated = qapply ( iterated ) #NEWLINE# iterated = grover_iteration ( iterated , v ) #NEWLINE# iterated = qapply ( iterated ) #NEWLINE# expected = ( ( ( ( - 13 ) * basis_states ) / 64 ) + ( ( 264 * IntQubit ( 2 , numqubits ) ) / 256 ) ) #NEWLINE# assert ( qapply ( expected ) == iterated )