SymmetrySite¶
- class openmm.openmm.SymmetrySite(*args)¶
This is a VirtualSite that applies a rotation and translation to the position of a single other particle. It is useful for creating multiple copies of a molecule that are symmetrically arranged either with respect to each other or to the periodic box.
The transformation is defined by a rotation matrix R (specified by its rows Rx, Ry, and Rz). and a translation vector v. The position r’ of the virtual site is computed from the position r of the original particle as
r’x = Rxxrx + Rxyry + Rxzrz + vx
r’x = Ryyrx + Ryyry + Ryzrz + vy
r’x = Rzzrx + Rzyry + Rzzrz + vz
It can be applied in two different modes. When useBoxVectors is false the transformation is performed in Cartesian coordinates. When useBoxVectors is true it is performed in fractional coordinates as defined by the periodic box, which means that v acts as a set of scale factors for the periodic box vectors. This latter mode is convenient for building crystallographic unit cells composed of multiple symmetric molecules. It should be used with care: if R represents a rotation by any angle other than 0 or 180 degrees, performing the rotation in fractional coordinates can distort the molecule.
- __init__(self, particle, Rx, Ry, Rz, v, useBoxVectors) SymmetrySite ¶
- __init__(self, other) SymmetrySite
Create a new SymmetrySite virtual site.
The arguments Rx, Ry, and Rz must form an orthogonal matrix (its transpose is its inverse).
- Parameters:
particle (int) – the index of the particle the site depends on
Rx (Vec3) – the first row of the rotation matrix
Ry (Vec3) – the second row of the rotation matrix
Rz (Vec3) – the third row of the rotation matrix
v (Vec3) – the offset vector
useBoxVectors (bool) – specifies whether the transformation is performed in Cartesian or fractional coordinates
Methods
__init__
(-> SymmetrySite)Create a new SymmetrySite virtual site.
getNumParticles
(self)Get the number of particles this virtual site depends on.
getOffsetVector
(self)Get the offset vector.
getParticle
(self, particle)Get the index of a particle this virtual site depends on.
getRotationMatrix
(self)Get the rotation matrix.
getUseBoxVectors
(self)Get whether whether the transformation is performed in Cartesian or fractional coordinates.
Attributes
The membership flag
- property thisown¶
The membership flag
- getRotationMatrix(self)¶
Get the rotation matrix.
- getUseBoxVectors(self) bool ¶
Get whether whether the transformation is performed in Cartesian or fractional coordinates.
- getNumParticles(self) int ¶
Get the number of particles this virtual site depends on.
- getParticle(self, particle) int ¶
Get the index of a particle this virtual site depends on.
- Parameters:
particle (int) – the particle to get (between 0 and getNumParticles())
- Returns:
the index of the particle in the System
- Return type:
int