# Transforming a vector in a loop without modifying the original vector

How can we apply a duty on elements of vectors but they remain unchanged for the next processes:

For instance we have a process governed by these lines. However, in one loop process some elements of Ai's replace by zero (if they equal to 1) but in the start of the next loop, we must have the same Ai as the first of the previous loop (original Ai).

Subscript[A, 1] = {{0}, {0}}; Subscript[A, 2] = {{0}, {1}};
Subscript[A, 3] = {{1}, {0}}; Subscript[A, 4] = {{1}, {1}};

Do[
Do[
Do[
If[
Subscript[A, i][[j]] = Subscript[A, i][[j + 1]] == 1,,
Subscript[A, i][[j]] = Subscript[A, i][[j + 1]] = 0;
matrix[[k, i]] += delta[Subscript[A, k], Subscript[A, i]];

],
{j, 1, nn - 1}]
, {i, 1, 2^nn}
]
, {l, 1, 2^nn}]


Prevent to being more ambiguous, matrix is not important to be shown.

• If the answer below answered your questions, please accept it by clicking the grey arrow! – march Jun 22 '15 at 14:49
• @march, By the way, your comment about change all variables with subscripts to variables such as v[i] with no subscripts, has so helped me. Thanks a bunch for those comments. – Unbelievable Jun 23 '15 at 16:52

You're code does not run but I think I understand what you are trying to do. You can make use of Module to make copies of the $A_i$ for use in the calculation.
If[Subscript[A, i][[j]] = Subscript[A, i][[j + 1]] == 1,

a is manipulated leaving $A_i$ untouched.