# How does application of a gate on one qubit/amplitude affects the rest of the multi-qubit system

Hadamard and Toffoli Gates form a universal set of gates, thus all quantum circuits can be created out of them. My question is assume any circuit with some $$N$$ inputs and $$K$$ gates.

For any such circuit we add gates one by one to extend this circuit. Let us add a $$N+1^{th}$$ gate which by definition can either be a Hadamard or Toffoli gate. These gates have the form:

• Toffolli: Input:3 Output:3

Since each gates inputs 1 or 3 amplitudes, and modify 1 amplitude in both cases:

Query 1: Does that mean if we were to measure any single/subgroup of qubits in the rest of the system (other than the qubit whose amplitude is being modified) before and after the application of $$N+1^{th}$$ gate the probability of collapse to each of the states stays unchanged?

If not can someone explain what happens with an explicit non trivial example (let $$N>3$$) consisting of the application of a single $$N+1^{th}$$ gate?

I am trying to get a conceptual idea if/how application of a gate on a single qubit does to the rest of the system (with an example). I am new to quantum computing.

Each gate acts on a certain number of input qubits. They can affect every amplitude of the whole system (depending on the basis in which you express it). For example, if I start with a state of 3 qubits $$\sum_{x\in\{0,1\}^3}\alpha_x|x\rangle$$ and act Hadamard on just the first qubit, I get an output state with amplitudes $$\beta_y$$ satisfying $$\beta_y=(\alpha_{0y_2y_3}+(-1)^{y_1}\alpha_{1y_2y_3})/\sqrt{2}.$$ Generically, every single one of the 8 amplitudes changes.
Query 1: Does that mean if we were to measure any single/subgroup of qubits in the rest of the system (other than the qubit whose amplitude is being modified) before and after the application of $$N+1$$th gate the probability of collapse to each of the states stays unchanged?