def ll_op(left, right):
 if (len(left) > 0):
  ll_gate = left[0]
  ll_gate_is_unitary = is_scalar_matrix((Dagger(ll_gate), ll_gate), _get_min_qubits(ll_gate), True)
 if ((len(left) > 0) and ll_gate_is_unitary):
  new_left = left[1:len(left)]
  new_right = ((Dagger(ll_gate),) + right)
  return (new_left, new_right)
 return None

def ll_op ( left , right ) : if ( len ( left ) > 0 ) : ll_gate = left [ 0 ] ll_gate_is_unitary = is_scalar_matrix ( ( Dagger ( ll_gate ) , ll_gate ) , _get_min_qubits ( ll_gate ) , True ) if ( ( len ( left ) > 0 ) and ll_gate_is_unitary ) : new_left = left [ 1 : len ( left ) ] new_right = ( ( Dagger ( ll_gate ) , ) + right ) return ( new_left , new_right ) return None
perform a ll operation .