psiresp.charge.MoleculeChargeConstraints

pydantic model psiresp.charge.MoleculeChargeConstraints[source]
Fields:
field charge_equivalence_constraints: List[ChargeEquivalenceConstraint] = []
field charge_sum_constraints: List[ChargeSumConstraint] = []
field constrain_methyl_hydrogens_between_conformers: bool = False

Whether to constrain methyl/ene hydrogens as equivalent between conformers. This has no effect if split_conformers=False.

field molecules: List[Molecule] = []
field split_conformers: bool = False

Treat conformers separately, instead of combining the restraint matrices

field unconstrained_atoms: List[Atom] = []
add_charge_equivalence_constraint(atoms=[])
add_charge_equivalence_constraint_for_molecule(molecule, indices=[])
add_charge_sum_constraint(charge, atoms=[])
add_charge_sum_constraint_for_molecule(molecule, charge=0, indices=[])
add_charge_sum_constraint_from_indices(charge, indices=[])[source]
add_constraints_from_charges(charges)[source]

Add ChargeSumConstraints restraining atoms to the given charges, if they are not in existing charge equivalence constraints, and not in self.unconstrained_atoms.

Parameters:

charges (np.ndarray of floats) – Charges of atoms. This should be at least as long as the total number of atoms in self.molecules

add_sp3_equivalences(accepted_n_hs=(2, 3))[source]

Add ChargeEquivalenceConstraints for the hydrogens attached to sp3 carbons

This will add methyls if 2 is in accepted_n_hs, and and methylenes if 3 is in accepted_n_hs.

Parameters:

accepted_n_hs (Tuple[int, ...]) – Number of Hs around a carbon to symmetrize

add_symmetry_equivalences()[source]
clean_charge_equivalence_constraints()

Clean the ChargeEquivalence constraints.

  1. Join charge equivalence constraints with overlapping atoms

  2. Remove atoms from charge equivalences if they are constrained

    to different charges, and remove charge equivalence constraints if all atoms are constrained to the same charge (so it is redundant)

clean_charge_sum_constraints()
classmethod from_charge_constraints(charge_constraints, molecules=[])[source]
get_hash()
get_sp3_equivalences(accepted_n_hs=(2, 3))[source]
Parameters:

accepted_n_hs (Tuple[int, ...]) –

iter_constraints()
prepare_stage_1_constraints()[source]
prepare_stage_2_constraints()[source]
to_a_col_constraints()[source]
Return type:

List[ndarray]

to_b_constraints()[source]
property n_atoms
property n_constraints