4.2. Molecule Type structure¶
Here is a list of all the possible attribute of an MT object.
Note
These object should not be added directly since special function are defined for this purpose. However, at the end of the file, you can open this MT object in a python environment in order to check these attributes.
4.2.1. Core information¶
To create the MT, you need to define the two following attributes: MoleculeType.name and MoleculeType.where_are_molecules. To do so, create the MT using:
myMT = MoleculeType(GP, name, where_are_molecules)
See this page for more informations.
- MoleculeType.name
Type [string]
Name of the molecule type given when creating the instance (molecule_type_name argument). It is very important that this name refer to a molecule module defined in the frog library - for exemple, WaterTIP4P with the module WaterTIP4P.py. The name can be completly different from the one used during the MD simulation.
Note
Defined directly by the user when creating a new Molecule Type object. The name is the second input parameter
- MoleculeType.where_are_molecules
Type [string or list]
Defined what molecule of the MD are considerated as a molecule of this type. 2 way of defining this is defined:
‘all’: to assign all the molecule available in the MD to this Molecule Type.
- A list of the first and the last molecule number. It is very important to note that only concecutivelly labelled molecule can be assign to be part of the same molecule type.
Example: [1, 1700] to assign from the 1st molecule to the 1700th molecule, including the 1700th molecule.
Note
Defined directly by the user when creating a new Molecule Type object. where_are_molecules is the third input parameter
4.2.2. Internal information¶
These attributes are used by during the procedure. There are created according to the MoleculeType.name and MoleculeType.where_are_molecules attributes.
- MoleculeType.L_key_mol
Type [list of integer]
A list where every integer is the tag of a molecule of this Molecule Type. For instance, L_key_mol = [1, 2, 3] means that in the topology file, the molecule number 1, 2 and 3 are of this molecule type.
- MoleculeType.L_key_selection_traj
Type [integer, integer]
The first and the last atom (labelling from the topology file) of the molecule type ensemble.
- MoleculeType.population
Type [integer]
Number of molecule of this type.
Warning
The number of molecule and the topology shall not change during the MD.
4.2.3. Molecule Type Parameter¶
The MoleculeTypeParameter object (MoleculeType.mtparameter) contains the parameters and important information relative to the MT. The mtparameter of an MT does not change after the initialization and is the same for every frame.
- MoleculeType.mtparameter
Type [MoleculeTypeParameter]
The object containing the properties of this molecule type: what analysis should be perform with this molecule type as well as usefull information regarding the expected caracteristics of this molecule type. See the other object involves like SingleMoleculeParameter, DiagramParameter or OpticalParameter.
The mtparameter object contains the parameters relative to several part of . There are:
SingleMoleculeParameter: This object is fully defined in the molecular library file and contains information relative to the geometry of the molecule for instance. The SingleMoleculeParameter object is presented here.
DiagramParameter: The parameters relative to the diagrams of this MT. The DiagramParameter object is presented here
OpticalParameter: The parameters relative to the optical analysis and QM calculations. The OpticalParameter object is presented here.
Note
To call an attribute from the dparameter, like L_diagram, use: myMT.mtparameter.dparameter.L_diagram.
- MoleculeTypeParameter.smparameter
Type [SingleMoleculeParameter]
Contains the SingleMoleculeParameter of this MT. See The SingleMoleculeParameter object for more information.
- MoleculeTypeParameter.dparameter
Type [DiagramParameter]
Contains the DiagramParameter of this MT. See The DiagramParameter object for more information.
- MoleculeTypeParameter.optparameter
Type [OpticalParameter]
Contains the OpticalParameter of this MT. See The OpticalParameter object for more information.
4.2.4. List of the molecule¶
All the molecule at this time step are stored in the list: L_molecule. Each molecules are described using an object from the class SingleMolecule REF – the object are usually called singlemolecule.
- MoleculeType.L_molecule
Type [list of SingleMolecule]
A list of every molecule of this MT for a given time step. These object contains all the molecular properties computed by the software. For instance the molecule’s position, orientation, beta… See the SingleMolecule object.
Note
If you want to perform by yourself extra post-analysis, you may want to use this list. You can acces every molecule using myMT.L_molecule[molecule_number].whatever_individual_property. For instance, myMT.L_molecule[100].electric_field_PE to acces the electric field felt by the 101th molecule of this MT at this time step.
You can call a molecule using: singlemolecule=myMT.L_molecule[2] to have the third molecule of this MT. If you want to refer to the general labeling (for instance the molecule number 1000 from the MD may be the 2nd molecule of this Molecule Type ensemble), let’s say the label number is general_label, use:
singlemolecule=myMT.L_molecule[general_label - myMT.L_key_mol[0]]
During the initialization, the list of the attribute of all these molecule will be update according to the analysis to perform. For instance, if the molecular orientation has to be computed, the attribute molecular_orientation will be initialized to False for every molecule. During the first step of the run, the value will be computed and update to the molecules. If you want to know all attribute defined for these molecules use the attribute L_attribute of a SingleMolecule object: singlemolecule.L_attribute. Each diagram will create new attribute depending of the analysis required, see HERE for more details.
4.2.5. Single Molecule Object¶
Mettre: mean position et comment on les as layer et comment on les as et les assignements de pytim -> frog rot matrix et comment on les as
Pour le reste, mettre un lien vers les diagrams. C est la bas qu on defini les smolecule attribute qui sont cree par chaque analyse.
Todo
todo
4.2.6. Diagrams¶
Each diagrams are directly added in the MT object using its own name as attribute name. In order to have the full list of the available diagrams, see the object myMT.dparameter.L_diagram. ADD LINK. These diagram are part of the general class Diagram. Each diagram has its own class defined, for instance Dia_density for the density, which inherite from the class Diagram. Using this architecture, each diagram as its own set of function defines.
To call and use the diagram, see HERE
Todo
Dans le MT on stacke directement les diagram avec comme nom d attribute le nom du diagram. Je trouve cela pratique, mais c est pas super propre. QUoique c est vraiment du details. A voir si on remet cela autre part?
Todo
Refaire ce paragraph in fois la partie diagram bien termine.