Skip to main content

Open source implementation of multiple minimum Monte Carlo

Project description

Multiple Minimum Monte Carlo

pypi Ruff

This package will help you perform a multiple minumum Monte Carlo conformer search as described in Chang et al., 1989. It is built to be used with an ASE calculator and ASE optimization tools but user-defined optimization strategies can be employed as well.

Installation

This package can be installed with pip

pip install multiple-minimum-monte-carlo

Tutorial

To run a search, you need to initialize Conformer, Calculation, and ConformerEnsemble objects. Conformer objects require either an input xyz or SMILES string. The default Calculation object is ASEOptimization which requires an ASE optimization routine (like FIRE) and an ASE calculator (the example below uses the aimnet calculator which will need to be installed separately from this package). ConformerEnsemble objects require a Conformer and Calculation object.

from ase.optimize.fire import FIRE
from ase.io import write
from aimnet.calculators import AIMNet2ASE
from multiple_minimum_monte_carlo.conformer import Conformer
from multiple_minimum_monte_carlo.calculation import ASEOptimization
from multiple_minimum_monte_carlo.conformer_ensemble import ConformerEnsemble

smiles = "CC(=O)Oc1ccccc1C(=O)O"
conformer = Conformer(smiles=smiles)
optimizer = ASEOptimization(calc=AIMNet2ASE(), optimizer=FIRE)
conformer_ensemble = ConformerEnsemble(conformer=conformer, calc=optimizer)

To run the search, call run_monte_carlo with the ConformerEnsemble object

final_ensemble = conformer_ensemble.run_monte_carlo()

final_ensemble will be a list of coordinate arrays that arranged by their energy (lowest energy first). To read out the minimum energy compound, do this

from ase.io import write
conformer.atoms.set_positions(final_ensemble[0])
write("lowest_energy_conformer.xyz", conformer.atoms, format="xyz")

User-Defined Calculation

To define a Calculation object, a class will need three function: init, run, and energy. init initializes the class with whatever information is necessary. run performs an optimization. It takes an ase.Atoms object and a list of atoms to constrain and returns an np array of cartesian coordinates (in angstroms) and a float with the energy of the conformation (in kcal/mol). energy calculates the energy of a conformer. It takes an ase.Atoms object and returns a float the with energy (in kcal/mol)

Planned future work

Include support for batched optimization (parallel calculations currently supported)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multiple_minimum_monte_carlo-0.0.5.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multiple_minimum_monte_carlo-0.0.5-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file multiple_minimum_monte_carlo-0.0.5.tar.gz.

File metadata

File hashes

Hashes for multiple_minimum_monte_carlo-0.0.5.tar.gz
Algorithm Hash digest
SHA256 d6d0f41c06c15511ee8722fa808bc27a6eaba35f918ced5cdee7d70d068fecfa
MD5 92cc5afa3f986a8b10189eae9dc7b1d5
BLAKE2b-256 dedd9d2c795af4372e0beac5e4e57b27c40a288a6393931666a836d49d324f53

See more details on using hashes here.

File details

Details for the file multiple_minimum_monte_carlo-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for multiple_minimum_monte_carlo-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2bb97df8929af0a32973b4af851671a5b7d4868e0f2c5eb4bd53de0db2a8af56
MD5 4d045b5b74d6fba17b22d9b9635b7742
BLAKE2b-256 72ef90ad58b68811f066485575f7b66bc3249f96c44c2f5ae6ade00ccaf91d8b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page