Added method to apply single qubit gates to variable number of qubits