Qubit, your environment for chemical machine learning and deep learning.

Qubit aims to provide a better work environment for chemical machine learning and deep learning. It will provide a wide range of tools from dataset construction to feature generation.

class qubit.parsing.Parser[source]

Parent class for all parsers.

load()[source]

Placeholder

Raises

NotImplementedError

write()[source]

Placeholder

Raises

NotImplementedError

class qubit.parsing.XYZ[source]

Parser for parsing XYZ files.

load(file)[source]

Load the molecule from an XYZ file.

Parameters

file (string) – Name of the file or path to were it is located.

Returns

Returns a list of atoms and a 2D list of coordinates.

Return type

(list, list)

class qubit.descriptors.CoulombMatrix[source]

Provides functionality to generate the Coulomb Matrix (1).

(1) Montavon, G.; Hansen, K.; Fazli, S.; Rupp, M.; Biegler, F.; Ziehe, A.; Tkatchenko, A.; Lilienfeld, A.; Müller, K.-R. Learning Invariant Representations of Molecules for Atomization Energy Prediction. In Advances in Neural Information Processing Systems; Pereira, F., Burges, C. J. C., Bottou, L., Weinberger, K. Q., Eds.; Curran Associates, Inc., 2012; Vol. 25.

generate(xyz, randomize=False)[source]

Generates the Coulomb Matrix (1).

(1) Montavon, G.; Hansen, K.; Fazli, S.; Rupp, M.; Biegler, F.; Ziehe, A.; Tkatchenko, A.; Lilienfeld, A.; Müller, K.-R. Learning Invariant Representations of Molecules for Atomization Energy Prediction. In Advances in Neural Information Processing Systems; Pereira, F., Burges, C. J. C., Bottou, L., Weinberger, K. Q., Eds.; Curran Associates, Inc., 2012; Vol. 25.

Parameters
  • atoms (list) – A list of atoms.

  • xyz (2D list) – A list of 3D coordinates.

Returns

The Coulomb Matrix.

Return type

2D list

normalize(phi=1, negative_dimensions=0, positive_dimensions=0)[source]

Normalizes the Coulomb Matrix by tensorizing it. May require padding. This method is an adaption from (1).

(1) Montavon, G.; Hansen, K.; Fazli, S.; Rupp, M.; Biegler, F.; Ziehe, A.; Tkatchenko, A.; Lilienfeld, A.; Müller, K.-R. Learning Invariant Representations of Molecules for Atomization Energy Prediction. In Advances in Neural Information Processing Systems; Pereira, F., Burges, C. J. C., Bottou, L., Weinberger, K. Q., Eds.; Curran Associates, Inc., 2012; Vol. 25.

Parameters
  • coulomb_matrix (2D list) – The Coulomb Matrix.

  • phi (int, optional) – Equivalent to an offset. Defaults to 1.

  • negative_dimensions (int, optional) – The amount of negative dimensions describing the tensor. Defaults to 0.

  • positive_dimension (int, optional) – The amount of positive dimensions describing the tensor. Defaults to 0.

Returns

Tensorized Coulomb Matrix.

Return type

2D list

pad_matrix(size)[source]

Applies padding to a matrix.

You can use this function to scale a matrix to a given size. The empty space is filled with zeros.

Example: Can be used to pad the Coulomb Matrix.

Parameters
  • matrix (2D np.array) – Matrix to pad in a nested list format.

  • size (int) – The size to scale the matrix to.

Returns

The padded matrix.

Return type

ndarray

randomize()[source]

Randomizes the Coulomb Matrix as described in (1).

(1) Montavon, G.; Hansen, K.; Fazli, S.; Rupp, M.; Biegler, F.; Ziehe, A.; Tkatchenko, A.; Lilienfeld, A.; Müller, K.-R. Learning Invariant Representations of Molecules for Atomization Energy Prediction. In Advances in Neural Information Processing Systems; Pereira, F., Burges, C. J. C., Bottou, L., Weinberger, K. Q., Eds.; Curran Associates, Inc., 2012; Vol. 25.

Parameters

coulomb_matrix (2D list) – The Coulomb Matrix as generated in generate()

Returns

The randomized Coulomb Matrix.

Return type

2D list

class qubit.descriptors.CoulombVector[source]

Provides functionality to generate the Coulomb Vector.

generate(xyz)[source]

Placeholder

Raises

NotImplementedError

normalize(phi=1, negative_dimensions=0, positive_dimensions=0)[source]

Placeholder

Raises

NotImplementedError

pad_vector(size)[source]

Applies padding to a vector.

You can use this function to scale a vector to a given size. The empty space is filled with zeros.

Example: Can be used to pad the Coulomb Vector.

Parameters
  • matrix (2D np.array) – Matrix to pad in a nested list format.

  • size (int) – The size to scale the matrix to.

Returns

The padded vector.

Return type

ndarray

randomize()[source]

Randomizes the Coulomb Vector.

class qubit.descriptors.Descriptor[source]

Parent class for all descriptors

generate()[source]

Placeholder

Raises

NotImplementedError

normalize()[source]

Placeholder

Raises

NotImplementedError

class qubit.utilities.gaussian.Extractor(filepath, labels=None)[source]

This class supports data extraction from gaussian output files. It provides functionality to extract all the implemented data at once or custom extraction can be set up by using its public methods.

check_frequencies()[source]

Check for negative (imaginary) frequencies.

Returns

Returns True if no negative frequencies are found.

Return type

(bool)

Raises

Exception – Raises when negative frequencies are found.

check_normal_execution()[source]

Checks for normal execution

Checks for normal execution of the gaussian output file. Use this first when writing custom extraction methods to check the validity of the calculations.

Returns

Returns True when a calculation has normal execution.

Return type

(bool)

extract_optimized_geometry()[source]

Extracts the optimized geometry

Extracts the optimized geometry from the gaussian output file.

Returns

tuple containing:

atoms (list) : Atom numbers coördinates (list): Cartesian coordinates in a 2D list

Return type

(tuple)

Indices and tables