added gate_expand_3toN for expanding 3-qubit operators to N qubit spaces