mchammer.Optimizer
- class mchammer.Optimizer(step_size, target_bond_length, num_steps, bond_epsilon=50, nonbond_epsilon=20, nonbond_sigma=1.2, nonbond_mu=3, beta=2, random_seed=1000)[source]
Bases:
objectOptimize target bonds using MC algorithm.
A Metropolis MC algorithm is applied to perform rigid translations of the subunits separatred by the target bonds.
Methods
Compute the potential of a molecule.
Get final result of optimization run on mol.
Get trajectory of optimization run on mol.
- Parameters:
- get_result(mol, bond_pair_ids, subunits)[source]
Get final result of optimization run on mol.
- Parameters:
mol (Molecule) – The molecule to be optimized.
bond_pair_ids (list) –
iterableoftupleofintsIterable of pairs of atom ids with bond between them to optimize.subunits (dict) – The subunits of mol split by bonds defined by bond_pair_ids. Key is subunit identifier, Value is
iterableof atom ids in subunit.
- Returns:
The optimized molecule.
- result:
The result of the final optimization step.
- Return type:
mol
- get_trajectory(mol, bond_pair_ids, subunits)[source]
Get trajectory of optimization run on mol.
- Parameters:
mol (Molecule) – The molecule to be optimized.
bond_pair_ids (list[tuple]) –
iterableoftupleofintsIterable of pairs of atom ids with bond between them to optimize.subunits (dict) – The subunits of mol split by bonds defined by bond_pair_ids. Key is subunit identifier, Value is
iterableof atom ids in subunit.
- Returns:
The optimized molecule.
- result:
The result of the optimization including all steps.
- Return type:
mol