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

def rl_op ( left , right ) : if ( len ( right ) > 0 ) : rl_gate = right [ 0 ] rl_gate_is_unitary = is_scalar_matrix ( ( Dagger ( rl_gate ) , rl_gate ) , _get_min_qubits ( rl_gate ) , True ) if ( ( len ( right ) > 0 ) and rl_gate_is_unitary ) : new_right = right [ 1 : len ( right ) ] new_left = ( ( Dagger ( rl_gate ) , ) + left ) return ( new_left , new_right ) return None
perform a rl operation .