Python: module ensWeights
 
ensWeights
index

variable weights for ensemble members
 
EnsWeights allows optimizing ensemble weights for calculations
involving ensembleSimulation.EnsembleSimulations. EnsWeights
objects are normally created using the create_EnsWeights helper in the
ensWeightsTools modules. An energy is associated with each
EnsWeights term's deviation from the specified target values.
 
 
Constructor:
  EnsWeights(name,
             members,
             bondAngles,
             derivedSpecs,
             simulation)   - The first two arguments are required. The first
                             is an identifying string which should be unique. 
                             The members argument is a list of
                             integers which identifies which ensemble
                             members are to have their weights
                             controlled by this object. Multiple
                             EnsWeights objects can be simultaneously
                             active to describe different
                             subpopulations of ensemble members. The bondAngles
                             argument is a sequence of bondAngle.BondAngle
                             involving pseudoatoms. The size of the bondAngles
                             argument must be len(members)-1. 
 
                             The weights of one or more ensemble
                             members can be dependent on others using the 
                             optional derivedSpecs argument: a list of tuples
                             with three arguments each. For an
                             ensemble with Ne members, Ne_base = Ne -
                             len(derivedSpecs), and the populations of
                             the first Ne_base members are
                             independent. The populations of the
                             dependent (derived) wieghts is
 
                                    w = A * w_b + w_b^T * B * w_b
 
                             The first entry should be a nonnegative integer 
                             less than Ne (this argument may disappear). The 
                             second gives the nonzero members of the A vector 
                             in the equation above in the form [index, value]. 
                             The third entry gives the nonzero values of the B 
                             matrix in the form [index1, index2, value].
 
                             The final Simulation argument is optional.
                             
 
Methods:
 
  simulation()             - return the associated EnsembleSimulation.
 
  weights()                - return a map of (ensemble index,weight). This
                             function calls 
                             ensembleSimulation.EnsembleSimulation.barrier()
                             so it must always be called by all ensemble
                             members.
 
  setWeights(map)          - set ensemble weights to specified values. This
                             will modify pseudoatom coordinates. The map 
                             must have the same keys as specified by the
                             members argument of the constructor which specify 
                             the identities of the ensemble members. The
                             minimum settable weight is 1e-7.
  setWeights(list)         - in this version, vals must be the full size of 
                             ensemble
 
  targetWeights()          - return the current values of target weights.
  setTargetWeights(vals)   - set the target ensemble weights from a 
                             sequence of length Ne, where is the ensemble
                             size. Default: 1/Ne.
 
  targetWidths()           - return the current values of target widths. A
                             nonzero targetWitdh corresponds to a flat-bottom
                             potential.
  setTargetWidths(vals)    - set the target ensemble widths from a 
                             sequence of length Ne, where is the ensemble
                             size. Default: 0.
 
  baseWeights()            - return a sequence of base weights - that is
                             weights not specified by derivedSpecs.
 
  derivedSpecs ()          - return the derivedSpecs argument given in the
                             constructor.
 
  minFrac                  - the fraction of 1/Ne
                             corresponding to the minimal allowed
                             weight. For instance, if minFrac=0.1,
                             wMin would be 0.1/Ne. Default: 0.
  setMinFrac(val)          - set the minFrac value.
 
  members()                - return a list of indices which identify the
                             ensemble members for which this object sets
                             weights.
 
  angles()                 - return a list of bondAngle.BondAngle objects
                             which are used to encode ensemble weights.
 
  weightsFromAngles(angles)- return a list of ensemble weights from the Ne-1
                             specified angle values (in radians). The actual
                             weights can be set by calling setWeights on the
                             return value.
 
  freedom()                - return the freedom specification.
  setFreedom(string)          - set the freedom specification. This is
                             queried by ensWeightsTools.topologySetup()
                             to correctly handle the IVM setup for
                             pseudoatoms. Valid values are "vary", 
                             "fix", "ignore". This should usually be left
                             at the default value of "vary". The value of
                             "bend" is equivalent to "vary".
 
  computeWeights(modified) - recompute ensemble weights from pseudoatom 
                             positions. Chose a modified  argument value of 
                             True.
 
 
 info()   - return a string describing the current state of the object.
 
 
energy = scale * sum_i (diff_i)^2
 
            / abs(w_i - tw_i) - td_i   ; if   w_i - tw_i > td_i
   diff_i = | abs(w_i - tw_i) + td_i   ; if -(w_i - tw_i) > td_i
            \    0                     ; otherwise
 
where w_i is an ensemble member weight, tw_i is the corresponding
target weight, and td_i is the corresponding target width.
 
Ensemble weights take values between wMin and wMax, such that their
sum is unity. wMin can be given a nonzero value using the setMinFrac
accessor.
 
 
 
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

 
Classes
       
builtins.object
AWeights
CDSList_DerivedSpec
DerivedSpec
EnsWeights
EnsemblePot
EnsWeights_LetterClass(EnsemblePot, AWeights)
Modified
ModifiedBase
VarEnsWeights
rc_EnsemblePot

 
class AWeights(builtins.object)
    AWeights(*args)
 

 
  Methods defined here:
__init__(self, *args)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
accumDerivs(self, *args, **kwargs) -> 'void'
angles(self, *args, **kwargs) -> 'CDSList< BondAngle >'
baseWeights(self, *args, **kwargs) -> 'CDSVector< float_type >'
computeWeights(self, *args, **kwargs) -> 'void'
derivedSpecs(self, *args, **kwargs) -> 'CDSList< AWeights::DerivedSpec >'
freedom(self, *args, **kwargs) -> 'String const'
info(self, *args, **kwargs) -> 'String'
members(self, *args, **kwargs) -> 'CDSList< int > const &'
minFrac(self, *args, **kwargs) -> 'float_type const'
setFreedom(self, *args, **kwargs) -> 'void'
setMinFrac(self, *args, **kwargs) -> 'void'
setWeights(self, *args, **kwargs) -> 'void'
setWeights_noBarrier(self, *args, **kwargs) -> 'void'
weights(self, *args, **kwargs) -> 'CDSMap< int,float_type >'
weightsFromAngles(self, *args, **kwargs) -> 'CDSVector< float_type >'
weightsRaw(self, *args, **kwargs) -> 'CDSVector< float_type > const &'

Static methods defined here:
__swig_destroy__ = delete_AWeights(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag
wMin

 
wScale

 

 
class CDSList_DerivedSpec(builtins.object)
    CDSList_DerivedSpec(*args)
 

 
  Methods defined here:
__delitem__(self, *args, **kwargs) -> 'void'
__getitem__(self, *args) -> 'CDSList< DerivedSpec >'
__getslice__(self, *args, **kwargs) -> 'CDSList< DerivedSpec >'
__init__(self, *args)
Initialize self.  See help(type(self)) for accurate signature.
__len__(self, *args, **kwargs) -> 'int'
__repr__ = _swig_repr(self)
__setitem__(self, *args, **kwargs) -> 'void'
append(self, *args, **kwargs) -> 'void'
help(self, *args, **kwargs) -> 'String'
remove(self, *args, **kwargs) -> 'void'
removeAll(self, *args, **kwargs) -> 'void'

Static methods defined here:
__swig_destroy__ = delete_CDSList_DerivedSpec(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
class DerivedSpec(builtins.object)
    DerivedSpec(*args, **kwargs)
 

 
  Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)

Static methods defined here:
__swig_destroy__ = delete_DerivedSpec(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
a

 
b

 
c

 
thisown

 
The membership flag

 
class EnsWeights_LetterClass(EnsemblePot, AWeights)
    EnsWeights_LetterClass(*args, **kwargs)
 

 
 
Method resolution order:
EnsWeights_LetterClass
EnsemblePot
AWeights
builtins.object

Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
accumDerivs(self, *args, **kwargs) -> 'void'
energyMaybeDerivs0(self, *args, **kwargs) -> 'float_type'
info(self, *args, **kwargs) -> 'String'
numRestraints(self, *args, **kwargs) -> 'int'
pyXplorHelp(self, *args, **kwargs) -> 'String'
rms(self, *args, **kwargs) -> 'float_type'
setTargetWeights_list(self, *args, **kwargs) -> 'void'
setTargetWidths(self, *args, **kwargs) -> 'void'
targetWeights(self, *args, **kwargs) -> 'CDSVector< float_type > const'
targetWidths(self, *args, **kwargs) -> 'CDSVector< float_type > const'
violations(self, *args, **kwargs) -> 'float_type'

Static methods defined here:
__swig_destroy__ = delete_EnsWeights_LetterClass(...)

Data descriptors defined here:
thisown

 
The membership flag

Methods inherited from EnsemblePot:
addEnsWeights(self, *args, **kwargs) -> 'void'
calcEnergy(self, *args, **kwargs) -> 'float_type'
calcEnergyAndDerivs(self, *args, **kwargs) -> 'float_type'
calcWDerivs(self, *args, **kwargs) -> 'bool const'
clearEnsWeights(self, *args, **kwargs) -> 'void'
energyMaybeDerivs1(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivs2(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivs3(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivs4(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivsPost(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivsPre(self, *args, **kwargs) -> 'float_type'
ensWeight(self, *args, **kwargs) -> 'float_type'
ensWeights(self, *args, **kwargs) -> 'CDSList< float_type >'
ensWeightsInfo(self, *args, **kwargs) -> 'String'
getEnsWeights(self, *args, **kwargs) -> 'CDSList< VarEnsWeights > &'
setCalcWDerivs(self, *args, **kwargs) -> 'void'
setEnsWeights(self, *args, **kwargs) -> 'void'
setUseSimEnsWeights(self, *args, **kwargs) -> 'void'
simulation(self, *args) -> 'EnsembleSimulationBase const *'
updateEnsWeights(self, *args, **kwargs) -> 'void'
useSimEnsWeights(self, *args, **kwargs) -> 'bool const'

Data descriptors inherited from EnsemblePot:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

Methods inherited from AWeights:
angles(self, *args, **kwargs) -> 'CDSList< BondAngle >'
baseWeights(self, *args, **kwargs) -> 'CDSVector< float_type >'
computeWeights(self, *args, **kwargs) -> 'void'
derivedSpecs(self, *args, **kwargs) -> 'CDSList< AWeights::DerivedSpec >'
freedom(self, *args, **kwargs) -> 'String const'
members(self, *args, **kwargs) -> 'CDSList< int > const &'
minFrac(self, *args, **kwargs) -> 'float_type const'
setFreedom(self, *args, **kwargs) -> 'void'
setMinFrac(self, *args, **kwargs) -> 'void'
setWeights(self, *args, **kwargs) -> 'void'
setWeights_noBarrier(self, *args, **kwargs) -> 'void'
weights(self, *args, **kwargs) -> 'CDSMap< int,float_type >'
weightsFromAngles(self, *args, **kwargs) -> 'CDSVector< float_type >'
weightsRaw(self, *args, **kwargs) -> 'CDSVector< float_type > const &'

Data descriptors inherited from AWeights:
wMin

 
wScale

 

 
class EnsemblePot(builtins.object)
    EnsemblePot(*args, **kwargs)
 

 
  Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
addEnsWeights(self, *args, **kwargs) -> 'void'
calcEnergy(self, *args, **kwargs) -> 'float_type'
calcEnergyAndDerivs(self, *args, **kwargs) -> 'float_type'
calcWDerivs(self, *args, **kwargs) -> 'bool const'
clearEnsWeights(self, *args, **kwargs) -> 'void'
energyMaybeDerivs0(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivs1(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivs2(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivs3(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivs4(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivsPost(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivsPre(self, *args, **kwargs) -> 'float_type'
ensWeight(self, *args, **kwargs) -> 'float_type'
ensWeights(self, *args, **kwargs) -> 'CDSList< float_type >'
ensWeightsInfo(self, *args, **kwargs) -> 'String'
getEnsWeights(self, *args, **kwargs) -> 'CDSList< VarEnsWeights > &'
setCalcWDerivs(self, *args, **kwargs) -> 'void'
setEnsWeights(self, *args, **kwargs) -> 'void'
setUseSimEnsWeights(self, *args, **kwargs) -> 'void'
simulation(self, *args) -> 'EnsembleSimulationBase const *'
updateEnsWeights(self, *args, **kwargs) -> 'void'
useSimEnsWeights(self, *args, **kwargs) -> 'bool const'

Static methods defined here:
__swig_destroy__ = delete_EnsemblePot(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
class Modified(builtins.object)
    Modified(*args, **kwargs)
 

 
  Methods defined here:
__call__(self, *args, **kwargs) -> 'int'
Call self as a function.
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
asString(self, *args, **kwargs) -> 'String'
assertClear(self, *args, **kwargs) -> 'void'
clear(self, *args, **kwargs) -> 'void'
set(self, *args, **kwargs) -> 'void'
update(self, *args, **kwargs) -> 'void'
value(self, *args, **kwargs) -> 'int'

Static methods defined here:
__swig_destroy__ = delete_Modified(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

Data and other attributes defined here:
MOD_SELF = 1
MOD_SIMULATION = 2

 
class ModifiedBase(builtins.object)
    ModifiedBase(*args, **kwargs)
 

 
  Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
registerTo(self, *args, **kwargs) -> 'void'
unRegister(self, *args, **kwargs) -> 'void'
updateValues(self, *args, **kwargs) -> 'void'

Static methods defined here:
__swig_destroy__ = delete_ModifiedBase(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
modified

 
registeredSimulations

 
thisown

 
The membership flag

 
class VarEnsWeights(builtins.object)
    VarEnsWeights(*args, **kwargs)
 

 
  Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)

Static methods defined here:
__swig_destroy__ = delete_VarEnsWeights(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
ensWeights

 
mult

 
thisown

 
The membership flag

 
class rc_EnsemblePot(builtins.object)
    rc_EnsemblePot(*args, **kwargs)
 

 
  Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)

Static methods defined here:
__swig_destroy__ = delete_rc_EnsemblePot(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
realEnsWeights = class EnsWeights(builtins.object)
    realEnsWeights(*args)
 

 
  Methods defined here:
__deref__(self, *args, **kwargs) -> 'EnsWeights *'
__init__(self, *args)
__oldinit__ = __init__(self, *args, **kwargs)
__ref__(self, *args, **kwargs) -> 'EnsWeights &'
__repr__ = _swig_repr(self)
accumDerivs(self, *args, **kwargs) -> 'void'
addEnsWeights(self, *args, **kwargs) -> 'void'
angles(self, *args, **kwargs) -> 'CDSList< BondAngle >'
baseWeights(self, *args, **kwargs) -> 'CDSVector< float_type >'
calcEnergy(self, *args, **kwargs) -> 'float_type'
calcEnergyAndDerivs(self, *args, **kwargs) -> 'float_type'
calcWDerivs(self, *args, **kwargs) -> 'bool const'
clearEnsWeights(self, *args, **kwargs) -> 'void'
computeWeights(self, *args, **kwargs) -> 'void'
decrRefCnt(self, *args, **kwargs) -> 'void'
derivedSpecs(self, *args, **kwargs) -> 'CDSList< AWeights::DerivedSpec >'
energyMaybeDerivs0(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivs1(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivs2(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivs3(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivs4(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivsPost(self, *args, **kwargs) -> 'float_type'
energyMaybeDerivsPre(self, *args, **kwargs) -> 'float_type'
ensWeight(self, *args, **kwargs) -> 'float_type'
ensWeights(self, *args, **kwargs) -> 'CDSList< float_type >'
ensWeightsInfo(self, *args, **kwargs) -> 'String'
freedom(self, *args, **kwargs) -> 'String const'
getEnsWeights(self, *args, **kwargs) -> 'CDSList< VarEnsWeights > &'
incrRefCnt(self, *args, **kwargs) -> 'void'
info(self, *args, **kwargs) -> 'String'
instanceData(self, *args, **kwargs) -> 'PyObject *'
instanceName(self, *args, **kwargs) -> 'char const *'
members(self, *args, **kwargs) -> 'CDSList< int > const &'
minFrac(self, *args, **kwargs) -> 'float_type const'
numRestraints(self, *args, **kwargs) -> 'int'
potName(self, *args, **kwargs) -> 'char const *'
pyXplorHelp(self, *args, **kwargs) -> 'String'
refCnt(self, *args, **kwargs) -> 'int'
registerInstanceData(self, *args, **kwargs) -> 'void'
registerTo(self, *args, **kwargs) -> 'void'
resetInstanceName(self, *args, **kwargs) -> 'void'
resetPotName(self, *args, **kwargs) -> 'void'
rms(self, *args, **kwargs) -> 'float_type'
scale(self, *args, **kwargs) -> 'float_type const'
setCalcWDerivs(self, *args, **kwargs) -> 'void'
setEnsWeights(self, *args, **kwargs) -> 'void'
setFreedom(self, *args, **kwargs) -> 'void'
setMinFrac(self, *args, **kwargs) -> 'void'
setScale(self, *args, **kwargs) -> 'void'
setTargetWeights(self, arg)
#this version for the envelope class
setTargetWeights_list(self, *args, **kwargs) -> 'void'
setTargetWidths(self, *args, **kwargs) -> 'void'
setThreshold(self, *args, **kwargs) -> 'void'
setUseSimEnsWeights(self, *args, **kwargs) -> 'void'
setWeights(self, list)
setWeights_noBarrier(self, *args, **kwargs) -> 'void'
simulation(self, *args) -> 'EnsembleSimulationBase const *'
targetWeights(self, *args, **kwargs) -> 'CDSVector< float_type > const'
targetWidths(self, *args, **kwargs) -> 'CDSVector< float_type > const'
threshold(self, *args, **kwargs) -> 'float_type const'
unRegister(self, *args, **kwargs) -> 'void'
updateDelta(self, *args, **kwargs) -> 'void'
updateEnsWeights(self, *args, **kwargs) -> 'void'
updateValues(self, *args, **kwargs) -> 'void'
useSimEnsWeights(self, *args, **kwargs) -> 'bool const'
violations(self, *args, **kwargs) -> 'float_type'
weights(self, *args, **kwargs) -> 'CDSMap< int,float_type >'
weightsFromAngles(self, *args, **kwargs) -> 'CDSVector< float_type >'
weightsRaw(self, *args, **kwargs) -> 'CDSVector< float_type > const &'

Static methods defined here:
__swig_destroy__ = delete_EnsWeights(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
instanceDataCleanup

 
instanceDataCreate

 
instanceData_

 
modified

 
registeredSimulations

 
thisown

 
The membership flag
wMin

 
wScale

 

 
Functions
       
EnsWeights(*args)
pyXplorHelp(*args) -> 'String'
realSetWeights = setWeights(self, *args, **kwargs) -> 'void'
setTargetWeights(self, arg)
#this version for the envelope class
setWeights(self, list)