VirtualSiteType

class openff.toolkit.typing.engines.smirnoff.parameters.VirtualSiteType(**kwargs)

Store virtual site parameters (geometry and electrostatics) and vdW interactions.

__init__(**kwargs)

Create a ParameterType.

Parameters:
  • smirks – The SMIRKS match for the provided parameter type.

  • allow_cosmetic_attributes – Whether to permit non-spec kwargs (“cosmetic attributes”). If True, non-spec kwargs will be stored as an attribute of this parameter which can be accessed and written out. Otherwise an exception will be raised.

Methods

__init__(**kwargs)

Create a ParameterType.

add_cosmetic_attribute(attr_name, attr_value)

Add a cosmetic attribute to this object.

attribute_is_cosmetic(attr_name)

Determine whether an attribute of this object is cosmetic.

delete_cosmetic_attribute(attr_name)

Delete a cosmetic attribute from this object.

to_dict([discard_cosmetic_attributes, ...])

Convert this object to dict format.

type_to_parent_index(type_)

Returns the index of the atom matched by the SMIRKS pattern that should be considered the 'parent' to a given type of virtual site.

Attributes

charge_increment

distance

epsilon

id

inPlaneAngle

match

name

outOfPlaneAngle

parent_id

parent_index

Returns the index of the atom matched by the SMIRKS pattern that should be considered the 'parent' to the virtual site.

rmin_half

sigma

smirks

type

add_cosmetic_attribute(attr_name, attr_value)

Add a cosmetic attribute to this object.

This attribute will not have a functional effect on the object in the OpenFF Toolkit, but can be written out during output.

Warning

The API for modifying cosmetic attributes is experimental and may change in the future (see issue #338).

Parameters:
  • attr_name – Name of the attribute to define for this object.

  • attr_value – The value of the attribute to define for this object.

attribute_is_cosmetic(attr_name)

Determine whether an attribute of this object is cosmetic.

Warning

The API for modifying cosmetic attributes is experimental and may change in the future (see issue #338).

Parameters:

attr_name – The attribute name to check

Returns:

is_cosmetic – Returns True if the attribute is defined and is cosmetic. Returns False otherwise.

delete_cosmetic_attribute(attr_name)

Delete a cosmetic attribute from this object.

Warning

The API for modifying cosmetic attributes is experimental and may change in the future (see issue #338).

Parameters:

attr_name – Name of the cosmetic attribute to delete.

property parent_index: int

Returns the index of the atom matched by the SMIRKS pattern that should be considered the ‘parent’ to the virtual site. A value of 0 corresponds to the atom matched by the :1 selector in the SMIRKS pattern, a value 2 the atom matched by :2 and so on.

to_dict(discard_cosmetic_attributes=False, duplicate_attributes=None)

Convert this object to dict format.

The returning dictionary contains all the ParameterAttribute and IndexedParameterAttribute as well as cosmetic attributes if discard_cosmetic_attributes is False.

Parameters:
  • discard_cosmetic_attributes – Whether to discard non-spec attributes of this object

  • duplicate_attributes – A list of names of attributes that redundantly decsribe data and should be discarded during serializaiton

Returns:

smirnoff_dict – The SMIRNOFF-compliant dict representation of this object.

classmethod type_to_parent_index(type_: Literal['BondCharge', 'MonovalentLonePair', 'DivalentLonePair', 'TrivalentLonePair']) int

Returns the index of the atom matched by the SMIRKS pattern that should be considered the ‘parent’ to a given type of virtual site. A value of 0 corresponds to the atom matched by the :1 selector in the SMIRKS pattern, a value 2 the atom matched by :2 and so on.