Phase-independent optical logic gates