-
Notifications
You must be signed in to change notification settings - Fork 5
Style guide
Marcus Wieder edited this page Jul 16, 2024
·
7 revisions
We try to use explicit and informative variable names that reflect intended use and/or what the variable contains. If the variable is a tensor we try to document the shape of the tensor in code and in function/method signatures. In the following style guide, we will use the term entity
when we describe the physical or physically motivated object that a property is bound to. That can be an atom, atom pair, molecule, system or conformation.
Some general rules about shape:
- if a tensor describes a per-entity property, the shape is (nr of entities, nr of features for property). E.g., per_atom_energy has shape
(nr_of_atoms, 1)
. - If a tensor is used to index, we use flat tensors. E.g., the pairlist has the shape
(2, nr_of_atom_pairs)
. The indexing array is used to index the entities, not the features.
We are using the following standards for variable names:
- [per_entity]_[property] internally, i.e.
per_atom_energy
describes the atomic energies. Following the convention outlined above about the shape of the representation we can infer that the shape is(nr_of_atoms, 1)
- the following variable names are used to define the shape of tensors:
nr_of_atoms
,nr_of_atom_pairs
,nr_of_atom_features
- the following properties are exceptions to the naming conventions:
atomic_numbers
,positions