Align: Setting the Center and Basis Set - matthew-hennefarth/CPET GitHub Wiki

The electric field is a vector quantity with an x,y,z component and which is dependent on the basis that we are using. Often times, we are interested in a primary direction of the electric field (along some bond) and as such want to measure the field in this alternative basis set ({x1, x2, x3}) along the trajectory. We can specify the translation and rotation of the standard basis to an alternative basis using the keyword align arg1 arg2 arg3 in the options file. 1 or 3 parameters then follows. The first will be the new center. The second and third option are the new directions for which we should align our basis in, relative to the center just specified. That is, x1 = arg2 - arg1. We then guess x2 to arg3-arg1. Since x1 and x2 are not always orthogonal, we then use the cross-product to determine x3 = x1 x x2. Now, x1 and x3 are orthonal, and we finally complete the orthogonal basis by taking x2 = x3 x x1. All vectors are normalized to createthe orthonormal basis. Some examples:

align 1:5:4

In the above example, we only change the origin to (1,5,4).

align 1:5:4 1:6:4 1:5:5   

In this example, will change the origin to (1,5,4) and set the x1 to (1,6,4) - (1,5,4) = (0,1,0). The x3-direction will be specified by the normal vector to the plane created by (0,1,0) and (1,5,5) - (1,5,4), or (0,0,1). That means, x3 = (1,0,0). To find x2, we take the cross product between (1,0,0) and (0,1,0), which is (0,0,1).

When we specify a new center and basis with the align keyword, all of the commands in the options file will then take place in this new frame. That is,

align 1:5:4
field 0:0:0

will first translate the system to 1:5:4 (the new origin), and then compute the field at 0:0:0 (which is really 1:5:4 in the original pdb coordinates). If we did

align 1:5:4
field 1:0:0

we would be calculating the field at (2,5,4). While this is not too interesting for simple field calculations, it becomes useful for protein trajectories, where we want the field at some atom (which could be moving) and along some bond (which the direction could also be moving). Furthermore, for the more complex options of plot and topology, we use the align section to orient our 3D volumes.

⚠️ **GitHub.com Fallback** ⚠️