megnet.data.qm9 module

Simple qm9 utils, kept here for historical reasons

class AtomNumberToTypeConverter(mapping={'1': 1, '6': 2, '7': 4, '8': 6, '9': 8})[source]

Bases: monty.json.MSONable

Convert atomic number Z into the atomic type in the QM9 dataset. This is specifically used for this problem, do not use it elsewhere. The code is here for historical reasons.

Atomic number to atomic type converter :param mapping: mapping dictionary :type mapping: dict

convert(z_list: list) list[source]

Convert the atomic number list to atomic type list :param z_list: atomic number list :type z_list: list of integer

Returns: list of integer, atomic type list

ring_to_vector(z_list: list, max_size: int = 9) list[source]

Convert the ring sizes vector to a fixed length vector For example, l can be [3, 5, 5], meaning that the atom is involved in 1 3-sized ring and 2 5-sized ring. This function will convert it into [ 0, 0, 1, 0, 2, 0, 0, 0, 0, 0]. :param z_list: (list of integer) ring_sizes attributes :param max_size: (int) maximum number of atoms in the ring

Returns

(list of integer) fixed size list with the i-1 th element indicates number of

i-sized ring this atom is involved in.