BCCGenerator
- class openff.recharge.charges.bcc.BCCGenerator[source]
Bases:
object
A class for generating the bond charge corrections which should be applied to a molecule.
Methods
__init__
()applied_corrections
(*molecules, bcc_collection)Returns the bond charge corrections which will be applied to a given molecule.
apply_assignment_matrix
(assignment_matrix, ...)Applies an assignment matrix to a list of bond charge corrections yield the final bond-charge corrections for a molecule.
build_assignment_matrix
(molecule, bcc_collection)Generates a matrix that specifies which bond charge corrections have been applied to which atoms in the molecule.
generate
(molecule, bcc_collection)Generate a set of charge increments for a molecule.
- classmethod applied_corrections(*molecules: Molecule, bcc_collection: BCCCollection) List[BCCParameter] [source]
Returns the bond charge corrections which will be applied to a given molecule.
- Parameters
molecules – The molecule which the bond charge corrections would be applied to.
bcc_collection – The bond charge correction parameters which may be assigned.
- classmethod apply_assignment_matrix(assignment_matrix: ndarray, bcc_collection: BCCCollection) ndarray [source]
Applies an assignment matrix to a list of bond charge corrections yield the final bond-charge corrections for a molecule.
- Parameters
assignment_matrix – The bond-charge correction matrix constructed using
build_assignment_matrix
which describes how the bond charge corrections should be applied. This should have shape=(n_atoms, n_bond_charge_corrections)bcc_collection – The bond charge correction parameters which may be assigned.
- Return type
The bond-charge corrections with shape=(n_atoms, 1).
- classmethod build_assignment_matrix(molecule: Molecule, bcc_collection: BCCCollection) ndarray [source]
Generates a matrix that specifies which bond charge corrections have been applied to which atoms in the molecule.
The matrix takes the form [atom_index, bcc_index] where atom_index is the index of an atom in the molecule and bcc_index is the index of a bond charge correction. Each value in the matrix can either be positive or negative depending on the direction the BCC was applied in.
- Parameters
molecule – The molecule to assign the bond charge corrections to.
bcc_collection – The bond charge correction parameters that may be assigned.
- Returns
The assignment matrix with shape=(n_atoms, n_bond_charge_corrections)
where n_atoms is the number of atoms in the molecule and
n_bond_charge_corrections is the number of bond charges corrections
to apply.
- classmethod generate(molecule: Molecule, bcc_collection: BCCCollection) ndarray [source]
Generate a set of charge increments for a molecule.
- Parameters
molecule – The molecule to generate the bond-charge corrections for.
bcc_collection – The bond charge correction parameters which may be assigned.
- Returns
The bond-charge corrections which should be applied to the
molecule.
- classmethod build_assignment_matrix(molecule: Molecule, bcc_collection: BCCCollection) ndarray [source]
Generates a matrix that specifies which bond charge corrections have been applied to which atoms in the molecule.
The matrix takes the form [atom_index, bcc_index] where atom_index is the index of an atom in the molecule and bcc_index is the index of a bond charge correction. Each value in the matrix can either be positive or negative depending on the direction the BCC was applied in.
- Parameters
molecule – The molecule to assign the bond charge corrections to.
bcc_collection – The bond charge correction parameters that may be assigned.
- Returns
The assignment matrix with shape=(n_atoms, n_bond_charge_corrections)
where n_atoms is the number of atoms in the molecule and
n_bond_charge_corrections is the number of bond charges corrections
to apply.
- classmethod apply_assignment_matrix(assignment_matrix: ndarray, bcc_collection: BCCCollection) ndarray [source]
Applies an assignment matrix to a list of bond charge corrections yield the final bond-charge corrections for a molecule.
- Parameters
assignment_matrix – The bond-charge correction matrix constructed using
build_assignment_matrix
which describes how the bond charge corrections should be applied. This should have shape=(n_atoms, n_bond_charge_corrections)bcc_collection – The bond charge correction parameters which may be assigned.
- Return type
The bond-charge corrections with shape=(n_atoms, 1).
- classmethod applied_corrections(*molecules: Molecule, bcc_collection: BCCCollection) List[BCCParameter] [source]
Returns the bond charge corrections which will be applied to a given molecule.
- Parameters
molecules – The molecule which the bond charge corrections would be applied to.
bcc_collection – The bond charge correction parameters which may be assigned.
- classmethod generate(molecule: Molecule, bcc_collection: BCCCollection) ndarray [source]
Generate a set of charge increments for a molecule.
- Parameters
molecule – The molecule to generate the bond-charge corrections for.
bcc_collection – The bond charge correction parameters which may be assigned.
- Returns
The bond-charge corrections which should be applied to the
molecule.