shapePot
index
shapePot.py

Shape Potential term
 
This term includes potential terms to constrain the shape tensor of a
atom selection. The shape tensor is defined as
 
            ( y_i^2+z_i^2  -x_i*y_i      -x_i*z_i     )
            (  -x_i*y_i    x_i^2+z_i^2   -y_i*z_i     )
            (  -x_i*z_i    -y_i*z_i     x_i^2+y_i^2   )
 
where (x_i,y_i,z_i) is the position of atom i relative to the center
of the atom selection. Thus, the shape tensor is analogous to the
inertia tensor: only it contains no mass information.
 
  There are separate potential terms which target the eigen values of
this tensor (which correspond to size), and the eigenvectors of the
tensor, which contain orientational information.
 
Constructor:
  ShapePot(name, sel, sim)   with arguments: 
    name - a name for this potential term
    sel  - (optional) an atomSel.AtomSel. Defaults to all atoms
    sim  - (optional) a simulation.Simulation Object. 
           Defaults to simulation.currentSimulation.
 
 
Methods:
  calcEnergy()                    - calcs energy
  calcEnergyAndDerivs(DerivList)  - calcs energy and derivative info
    note that these routines also update all other potential-specific data.
 
Read-Write accessors:
  sizeScale         - scale factor for the size term
  orientScale       - scale factor for the orientation term
  targetSel         - atom selection for target. Used if targetType=='molecule'
  sizeTol           - error in size term. Used if sizePotType=='square'
  orientTol         - error (in degrees) in orient term. 
                      Used if orientPotType=='square'
  targetType        - specifies the target tensor
                        'molecule' : target specified by targetSel
                        'average'  : target is the ensemble average of
                                      the shape tensor.
                        'pairwise' : the pairwise difference of the shape
                                     tensor between each ensemble member is
                                     minimized.
  sizePotType       - potential type for size term: 'harmonic' or 'square'
  orientPotType     - potential type for orient term: 'harmonic' or 'square'
  degenerateTol     - if the difference between eigenvalues drops below this
                      number, eigenvalue/eigenvector pairs are sorted such 
                      that the eigenvector overlap with the target is 
                      maximized, instead of by eigenvalue.
 
 
Read-only accessors
  simulation()   - simulation used by this shape term. Is an EnsembleSimulation
  atomSel()      - atom selection defining the shape tensor.
 
  qCenter(index) - center of the atomSelection for ensemble given by index.
  qCenterTarget()- center position of the target selection.
  rotation(index)- rotation angle (in degrees) of shape tensor to target. 
                   The optional argument specifies the ensemble member 
                   (defaults to the current ensemble).
 
  getContrib(index,i)
                 - get EigenPair for ensemble member index, number i.
  getTarget(i)   - get EigenPair target shape tensor. EigenPair
                   objects contain two members:
                     value, vector
 
  info()         - return string synopsis of potential info.
  showValues()   - return pretty-printed eigenvalue info.
  showVectors()  - return pretty-printed eigenvector info.
 
 
The potential term is defined as
 
  E = sizeScale * ( V(ds_x,sizeTol) +
                    V(ds_y,sizeTol) +
                    V(ds_z,sizeTol) ) +
      orientScale * V(dTheta,orienTol)
 
where
  ds_i = eigenValue(i) - target_eigenValue(i)
  dTheta = overall rotation of shapeTensor, relative to target
 
and
  V(x,tol) = x^2             if potType=='harmonic'
             (abs(x)-tol)^2  if potType=='square'
 

 
Classes
       
__builtin__.object
Modified
ModifiedPtr
ModifiedBase
ModifiedBasePtr
ShapePot
ShapePotPtr
ShapePot_EigenPair
ShapePot_EigenPairPtr
ShapePot_LetterClass
ShapePot_LetterClassPtr

 
class Modified(__builtin__.object)
     Methods defined here:
__call__(*args)
__del__(self, destroy=<built-in function delete_Modified>)
__getattr__ lambda self, name
__init__(self, *args)
__repr__(self)
__setattr__ lambda self, name, value
clear(*args)
set(*args)
update(*args)
value(*args)

Data and other attributes defined here:
MOD_SELF = 1
MOD_SIMULATION = 2
__dict__ = <dictproxy object at 0x1345440>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'Modified' objects>
list of weak references to the object (if defined)

 
class ModifiedBase(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_ModifiedBase>)
__getattr__ lambda self, name
__init__(self)
__repr__(self)
__setattr__ lambda self, name, value
registerTo(*args)
unRegister(*args)
updateValues(*args)

Properties defined here:
modified
get = ModifiedBase_modified_get(...)
set = ModifiedBase_modified_set(...)
registeredSimulations
get = ModifiedBase_registeredSimulations_get(...)
set = ModifiedBase_registeredSimulations_set(...)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0x13452b8>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'modified': <built-in function ModifiedBase_modified_get>, 'registeredSimulations': <built-in function ModifiedBase_registeredSimulations_get>}
__swig_setmethods__ = {'modified': <built-in function ModifiedBase_modified_set>, 'registeredSimulations': <built-in function ModifiedBase_registeredSimulations_set>}
__weakref__ = <attribute '__weakref__' of 'ModifiedBase' objects>
list of weak references to the object (if defined)

 
class ModifiedBasePtr(ModifiedBase)
    
Method resolution order:
ModifiedBasePtr
ModifiedBase
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from ModifiedBase:
__del__(self, destroy=<built-in function delete_ModifiedBase>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value
registerTo(*args)
unRegister(*args)
updateValues(*args)

Properties inherited from ModifiedBase:
modified
get = ModifiedBase_modified_get(...)
set = ModifiedBase_modified_set(...)
registeredSimulations
get = ModifiedBase_registeredSimulations_get(...)
set = ModifiedBase_registeredSimulations_set(...)

Data and other attributes inherited from ModifiedBase:
__dict__ = <dictproxy object at 0x13450c0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'modified': <built-in function ModifiedBase_modified_get>, 'registeredSimulations': <built-in function ModifiedBase_registeredSimulations_get>}
__swig_setmethods__ = {'modified': <built-in function ModifiedBase_modified_set>, 'registeredSimulations': <built-in function ModifiedBase_registeredSimulations_set>}
__weakref__ = <attribute '__weakref__' of 'ModifiedBase' objects>
list of weak references to the object (if defined)

 
class ModifiedPtr(Modified)
    
Method resolution order:
ModifiedPtr
Modified
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from Modified:
__call__(*args)
__del__(self, destroy=<built-in function delete_Modified>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value
clear(*args)
set(*args)
update(*args)
value(*args)

Data and other attributes inherited from Modified:
MOD_SELF = 1
MOD_SIMULATION = 2
__dict__ = <dictproxy object at 0x13450c0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'Modified' objects>
list of weak references to the object (if defined)

 
class ShapePot(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_ShapePot>)
__deref__(*args)
__getattr__ lambda self, name
__init__(self, *args)
__mul__(*args)
__oldinit__ = __init__(self, *args)
__repr__(self)
__setattr__ lambda self, name, value
atomSel(*args)
calcEnergy(*args)
calcEnergyAndDerivs(*args)
degenerateTol(*args)
energyMaybeDerivs0(*args)
energyMaybeDerivs1(*args)
energyMaybeDerivs2(*args)
energyMaybeDerivs3(*args)
energyMaybeDerivs4(*args)
getContrib(*args)
getTarget(*args)
help(*args)
incrRefCount(*args)
info(*args)
instanceData(*args)
instanceName(*args)
numRestraints(*args)
orientPotType(*args)
orientScale(*args)
orientTol(*args)
pointer(*args)
potName(*args)
qCenter(*args)
qCenterTarget(*args)
registerInstanceData(*args)
registerTo(*args)
resetPotName(*args)
rms(*args)
rotation(*args)
scale(*args)
setDegenerateTol(*args)
setOrientPotType(*args)
setOrientScale(*args)
setOrientTol(*args)
setScale(*args)
setSizePotType(*args)
setSizeScale(*args)
setSizeTol(*args)
setTargetSel(*args)
setTargetType(*args)
setThreshold(*args)
showValues(*args)
showVectors(*args)
simulation(*args)
sizePotType(*args)
sizeScale(*args)
sizeTol(*args)
targetSel(*args)
targetType(*args)
threshold(*args)
unRegister(*args)
updateValues(*args)
violations(*args)

Properties defined here:
contrib
get = ShapePot_contrib_get(...)
set = ShapePot_contrib_set(...)
cosTheta
get = ShapePot_cosTheta_get(...)
set = ShapePot_cosTheta_set(...)
instanceData_
get = ShapePot_instanceData__get(...)
set = ShapePot_instanceData__set(...)
modified
get = ShapePot_modified_get(...)
set = ShapePot_modified_set(...)
qc
get = ShapePot_qc_get(...)
set = ShapePot_qc_set(...)
qc_target
get = ShapePot_qc_target_get(...)
set = ShapePot_qc_target_set(...)
registeredSimulations
get = ShapePot_registeredSimulations_get(...)
set = ShapePot_registeredSimulations_set(...)
theta
get = ShapePot_theta_get(...)
set = ShapePot_theta_set(...)
valuesVectors
get = ShapePot_valuesVectors_get(...)
set = ShapePot_valuesVectors_set(...)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0x1345440>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'contrib': <built-in function ShapePot_contrib_get>, 'cosTheta': <built-in function ShapePot_cosTheta_get>, 'instanceData_': <built-in function ShapePot_instanceData__get>, 'modified': <built-in function ShapePot_modified_get>, 'qc': <built-in function ShapePot_qc_get>, 'qc_target': <built-in function ShapePot_qc_target_get>, 'registeredSimulations': <built-in function ShapePot_registeredSimulations_get>, 'theta': <built-in function ShapePot_theta_get>, 'valuesVectors': <built-in function ShapePot_valuesVectors_get>}
__swig_setmethods__ = {'contrib': <built-in function ShapePot_contrib_set>, 'cosTheta': <built-in function ShapePot_cosTheta_set>, 'instanceData_': <built-in function ShapePot_instanceData__set>, 'modified': <built-in function ShapePot_modified_set>, 'qc': <built-in function ShapePot_qc_set>, 'qc_target': <built-in function ShapePot_qc_target_set>, 'registeredSimulations': <built-in function ShapePot_registeredSimulations_set>, 'theta': <built-in function ShapePot_theta_set>, 'valuesVectors': <built-in function ShapePot_valuesVectors_set>}
__weakref__ = <attribute '__weakref__' of 'ShapePot' objects>
list of weak references to the object (if defined)

 
class ShapePotPtr(ShapePot)
    
Method resolution order:
ShapePotPtr
ShapePot
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from ShapePot:
__del__(self, destroy=<built-in function delete_ShapePot>)
__deref__(*args)
__getattr__ lambda self, name
__mul__(*args)
__oldinit__ = __init__(self, *args)
__repr__(self)
__setattr__ lambda self, name, value
atomSel(*args)
calcEnergy(*args)
calcEnergyAndDerivs(*args)
degenerateTol(*args)
energyMaybeDerivs0(*args)
energyMaybeDerivs1(*args)
energyMaybeDerivs2(*args)
energyMaybeDerivs3(*args)
energyMaybeDerivs4(*args)
getContrib(*args)
getTarget(*args)
help(*args)
incrRefCount(*args)
info(*args)
instanceData(*args)
instanceName(*args)
numRestraints(*args)
orientPotType(*args)
orientScale(*args)
orientTol(*args)
pointer(*args)
potName(*args)
qCenter(*args)
qCenterTarget(*args)
registerInstanceData(*args)
registerTo(*args)
resetPotName(*args)
rms(*args)
rotation(*args)
scale(*args)
setDegenerateTol(*args)
setOrientPotType(*args)
setOrientScale(*args)
setOrientTol(*args)
setScale(*args)
setSizePotType(*args)
setSizeScale(*args)
setSizeTol(*args)
setTargetSel(*args)
setTargetType(*args)
setThreshold(*args)
showValues(*args)
showVectors(*args)
simulation(*args)
sizePotType(*args)
sizeScale(*args)
sizeTol(*args)
targetSel(*args)
targetType(*args)
threshold(*args)
unRegister(*args)
updateValues(*args)
violations(*args)

Properties inherited from ShapePot:
contrib
get = ShapePot_contrib_get(...)
set = ShapePot_contrib_set(...)
cosTheta
get = ShapePot_cosTheta_get(...)
set = ShapePot_cosTheta_set(...)
instanceData_
get = ShapePot_instanceData__get(...)
set = ShapePot_instanceData__set(...)
modified
get = ShapePot_modified_get(...)
set = ShapePot_modified_set(...)
qc
get = ShapePot_qc_get(...)
set = ShapePot_qc_set(...)
qc_target
get = ShapePot_qc_target_get(...)
set = ShapePot_qc_target_set(...)
registeredSimulations
get = ShapePot_registeredSimulations_get(...)
set = ShapePot_registeredSimulations_set(...)
theta
get = ShapePot_theta_get(...)
set = ShapePot_theta_set(...)
valuesVectors
get = ShapePot_valuesVectors_get(...)
set = ShapePot_valuesVectors_set(...)

Data and other attributes inherited from ShapePot:
__dict__ = <dictproxy object at 0x1345328>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'contrib': <built-in function ShapePot_contrib_get>, 'cosTheta': <built-in function ShapePot_cosTheta_get>, 'instanceData_': <built-in function ShapePot_instanceData__get>, 'modified': <built-in function ShapePot_modified_get>, 'qc': <built-in function ShapePot_qc_get>, 'qc_target': <built-in function ShapePot_qc_target_get>, 'registeredSimulations': <built-in function ShapePot_registeredSimulations_get>, 'theta': <built-in function ShapePot_theta_get>, 'valuesVectors': <built-in function ShapePot_valuesVectors_get>}
__swig_setmethods__ = {'contrib': <built-in function ShapePot_contrib_set>, 'cosTheta': <built-in function ShapePot_cosTheta_set>, 'instanceData_': <built-in function ShapePot_instanceData__set>, 'modified': <built-in function ShapePot_modified_set>, 'qc': <built-in function ShapePot_qc_set>, 'qc_target': <built-in function ShapePot_qc_target_set>, 'registeredSimulations': <built-in function ShapePot_registeredSimulations_set>, 'theta': <built-in function ShapePot_theta_set>, 'valuesVectors': <built-in function ShapePot_valuesVectors_set>}
__weakref__ = <attribute '__weakref__' of 'ShapePot' objects>
list of weak references to the object (if defined)

 
class ShapePot_EigenPair(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_ShapePot_EigenPair>)
__getattr__ lambda self, name
__init__(self, *args)
__repr__(self)
__setattr__ lambda self, name, value

Properties defined here:
value
get = ShapePot_EigenPair_value_get(...)
set = ShapePot_EigenPair_value_set(...)
vector
get = ShapePot_EigenPair_vector_get(...)
set = ShapePot_EigenPair_vector_set(...)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0x1345280>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'value': <built-in function ShapePot_EigenPair_value_get>, 'vector': <built-in function ShapePot_EigenPair_vector_get>}
__swig_setmethods__ = {'value': <built-in function ShapePot_EigenPair_value_set>, 'vector': <built-in function ShapePot_EigenPair_vector_set>}
__weakref__ = <attribute '__weakref__' of 'ShapePot_EigenPair' objects>
list of weak references to the object (if defined)

 
class ShapePot_EigenPairPtr(ShapePot_EigenPair)
    
Method resolution order:
ShapePot_EigenPairPtr
ShapePot_EigenPair
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from ShapePot_EigenPair:
__del__(self, destroy=<built-in function delete_ShapePot_EigenPair>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value

Properties inherited from ShapePot_EigenPair:
value
get = ShapePot_EigenPair_value_get(...)
set = ShapePot_EigenPair_value_set(...)
vector
get = ShapePot_EigenPair_vector_get(...)
set = ShapePot_EigenPair_vector_set(...)

Data and other attributes inherited from ShapePot_EigenPair:
__dict__ = <dictproxy object at 0x13452b8>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'value': <built-in function ShapePot_EigenPair_value_get>, 'vector': <built-in function ShapePot_EigenPair_vector_get>}
__swig_setmethods__ = {'value': <built-in function ShapePot_EigenPair_value_set>, 'vector': <built-in function ShapePot_EigenPair_vector_set>}
__weakref__ = <attribute '__weakref__' of 'ShapePot_EigenPair' objects>
list of weak references to the object (if defined)

 
class ShapePot_LetterClass(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_ShapePot_LetterClass>)
__getattr__ lambda self, name
__init__(self, *args)
__repr__(self)
__setattr__ lambda self, name, value
atomSel(*args)
degenerateTol(*args)
energyMaybeDerivs0(*args)
energyMaybeDerivs1(*args)
energyMaybeDerivs2(*args)
energyMaybeDerivs3(*args)
getContrib(*args)
getTarget(*args)
help(*args)
info(*args)
numRestraints(*args)
orientPotType(*args)
orientScale(*args)
orientTol(*args)
qCenter(*args)
qCenterTarget(*args)
rms(*args)
rotation(*args)
setDegenerateTol(*args)
setOrientPotType(*args)
setOrientScale(*args)
setOrientTol(*args)
setSizePotType(*args)
setSizeScale(*args)
setSizeTol(*args)
setTargetSel(*args)
setTargetType(*args)
showValues(*args)
showVectors(*args)
simulation(*args)
sizePotType(*args)
sizeScale(*args)
sizeTol(*args)
targetSel(*args)
targetType(*args)
violations(*args)

Properties defined here:
contrib
get = ShapePot_LetterClass_contrib_get(...)
set = ShapePot_LetterClass_contrib_set(...)
cosTheta
get = ShapePot_LetterClass_cosTheta_get(...)
set = ShapePot_LetterClass_cosTheta_set(...)
qc
get = ShapePot_LetterClass_qc_get(...)
set = ShapePot_LetterClass_qc_set(...)
qc_target
get = ShapePot_LetterClass_qc_target_get(...)
set = ShapePot_LetterClass_qc_target_set(...)
theta
get = ShapePot_LetterClass_theta_get(...)
set = ShapePot_LetterClass_theta_set(...)
valuesVectors
get = ShapePot_LetterClass_valuesVectors_get(...)
set = ShapePot_LetterClass_valuesVectors_set(...)

Data and other attributes defined here:
AverageTarget = 1
FixedTarget = 3
HARMONIC = 0
MoleculeTarget = 2
PairwiseTarget = 0
SQUARE = 1
__dict__ = <dictproxy object at 0x1345408>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'contrib': <built-in function ShapePot_LetterClass_contrib_get>, 'cosTheta': <built-in function ShapePot_LetterClass_cosTheta_get>, 'qc': <built-in function ShapePot_LetterClass_qc_get>, 'qc_target': <built-in function ShapePot_LetterClass_qc_target_get>, 'theta': <built-in function ShapePot_LetterClass_theta_get>, 'valuesVectors': <built-in function ShapePot_LetterClass_valuesVectors_get>}
__swig_setmethods__ = {'contrib': <built-in function ShapePot_LetterClass_contrib_set>, 'cosTheta': <built-in function ShapePot_LetterClass_cosTheta_set>, 'qc': <built-in function ShapePot_LetterClass_qc_set>, 'qc_target': <built-in function ShapePot_LetterClass_qc_target_set>, 'theta': <built-in function ShapePot_LetterClass_theta_set>, 'valuesVectors': <built-in function ShapePot_LetterClass_valuesVectors_set>}
__weakref__ = <attribute '__weakref__' of 'ShapePot_LetterClass' objects>
list of weak references to the object (if defined)

 
class ShapePot_LetterClassPtr(ShapePot_LetterClass)
    
Method resolution order:
ShapePot_LetterClassPtr
ShapePot_LetterClass
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from ShapePot_LetterClass:
__del__(self, destroy=<built-in function delete_ShapePot_LetterClass>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value
atomSel(*args)
degenerateTol(*args)
energyMaybeDerivs0(*args)
energyMaybeDerivs1(*args)
energyMaybeDerivs2(*args)
energyMaybeDerivs3(*args)
getContrib(*args)
getTarget(*args)
help(*args)
info(*args)
numRestraints(*args)
orientPotType(*args)
orientScale(*args)
orientTol(*args)
qCenter(*args)
qCenterTarget(*args)
rms(*args)
rotation(*args)
setDegenerateTol(*args)
setOrientPotType(*args)
setOrientScale(*args)
setOrientTol(*args)
setSizePotType(*args)
setSizeScale(*args)
setSizeTol(*args)
setTargetSel(*args)
setTargetType(*args)
showValues(*args)
showVectors(*args)
simulation(*args)
sizePotType(*args)
sizeScale(*args)
sizeTol(*args)
targetSel(*args)
targetType(*args)
violations(*args)

Properties inherited from ShapePot_LetterClass:
contrib
get = ShapePot_LetterClass_contrib_get(...)
set = ShapePot_LetterClass_contrib_set(...)
cosTheta
get = ShapePot_LetterClass_cosTheta_get(...)
set = ShapePot_LetterClass_cosTheta_set(...)
qc
get = ShapePot_LetterClass_qc_get(...)
set = ShapePot_LetterClass_qc_set(...)
qc_target
get = ShapePot_LetterClass_qc_target_get(...)
set = ShapePot_LetterClass_qc_target_set(...)
theta
get = ShapePot_LetterClass_theta_get(...)
set = ShapePot_LetterClass_theta_set(...)
valuesVectors
get = ShapePot_LetterClass_valuesVectors_get(...)
set = ShapePot_LetterClass_valuesVectors_set(...)

Data and other attributes inherited from ShapePot_LetterClass:
AverageTarget = 1
FixedTarget = 3
HARMONIC = 0
MoleculeTarget = 2
PairwiseTarget = 0
SQUARE = 1
__dict__ = <dictproxy object at 0x1345398>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'contrib': <built-in function ShapePot_LetterClass_contrib_get>, 'cosTheta': <built-in function ShapePot_LetterClass_cosTheta_get>, 'qc': <built-in function ShapePot_LetterClass_qc_get>, 'qc_target': <built-in function ShapePot_LetterClass_qc_target_get>, 'theta': <built-in function ShapePot_LetterClass_theta_get>, 'valuesVectors': <built-in function ShapePot_LetterClass_valuesVectors_get>}
__swig_setmethods__ = {'contrib': <built-in function ShapePot_LetterClass_contrib_set>, 'cosTheta': <built-in function ShapePot_LetterClass_cosTheta_set>, 'qc': <built-in function ShapePot_LetterClass_qc_set>, 'qc_target': <built-in function ShapePot_LetterClass_qc_target_set>, 'theta': <built-in function ShapePot_LetterClass_theta_set>, 'valuesVectors': <built-in function ShapePot_LetterClass_valuesVectors_set>}
__weakref__ = <attribute '__weakref__' of 'ShapePot_LetterClass' objects>
list of weak references to the object (if defined)

 
Functions
       
help(...)