Have you done any “homework” on your own to find out where the problem is? For instance, try seeing what the manual says about the quantities the compute commands work with. . . .
Yes, I wrote a loop in my script that I sent to you some lines of it. I try to see all of the variables in my script and I knew that compute stress outputs are not calculated. As you see my script is the same as the example that it is in the manual but I don’t know the reason of the Error.
This is a separate issue. k-space contributions do not get incorporated into the stress/atom compounds, However, LAMMPS will not crash because of this—it will only give you a warning.
The issue that you’re using the wrong kind of variable—or making a reference to data that does not exist in a vector—is a completely separate one.
However, it should also be pointed out that you’re using a very strange definition for transverse pressure. I’ve never seen a pressure defined as a root-mean-square quantity using the off-diagonal components. (So what you’re doing doesn’t really seem to make a lot of sense from a physical perspective.)