MoSDeF Cassandra is a Python interface for the Cassandra Monte Carlo software. It offers complete integration with the MoSDeF tools and provides a user-friendly interface for Cassandra.
MoSDeF Cassandra is still in early development (0.x releases). The API may change unexpectedly.
- Reference documentation: Examples, tutorials, guides, and API documentation
- Installation guide: Instructions for installing MoSDeF Cassandra
- GitHub repository: View the source code, contribute, and raise issues
- Cassandra: Home of the Cassandra Monte Carlo package
- MoSDeF tools: A generic collection of tools for constructing systems and applying forcefield parameters for particle-based simulations
Please cite MoSDeF Cassandra, Cassandra, and the MoSDeF suite of tools if you use this tool in your research. Details here.
Complete installation instructions are here. However, for most users we recommend the conda installation:
conda create --name mc mosdef_cassandra -c conda-forge
MoSDeF Cassandra provides a Python interface to Cassandra. The workflow consists of first constructing a system and move set. These two objects are passed to the runner that performs the Monte Carlo simulation with Cassandra. We use classes from the MoSDeF tools to structure some of the simulation inputs. The example below demonstrates an NVT Monte Carlo simulation of OPLS-AA methane. No other input files are required. Everything required to run the Monte Carlo calculation is self-contained in the script below.
import mbuild
import foyer
import unyt as u
import mosdef_cassandra as mc
# Create a methane molecule from a SMILES string
methane = mbuild.load("C", smiles=True)
# Load the forcefield via foyer
ff = foyer.forcefields.load_OPLSAA()
# Apply the forcefield parameters to methane with foyer
methane_ff = ff.apply(methane)
# Define an empty simulation box
box = mbuild.Box([3.0, 3.0, 3.0])
# Define the boxes, species in the system, molecules in the box
ensemble = 'nvt'
box_list = [box]
species_list = [methane_ff]
molecules_to_add = [[100]]
# Create the System
system = mc.System(box_list, species_list, mols_to_add=molecules_to_add)
# Create the MoveSet
moveset = mc.MoveSet(ensemble, species_list)
# Run a Monte Carlo simulation!
mc.run(
system=system,
moveset=moveset,
run_type="equilibration",
run_length=1000,
temperature=300.0 * u.K
)
Development of MoSDeF Cassandra was supported by the National Science Foundation under grant NSF Grant Number 1835874. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.