Git Product home page Git Product logo

atomisticreversemontecarlo's Introduction

Atomistic Reverse Monte-Carlo

PyPI Version PyPI Downloads

OVITO Python modifier to generate bulk crystal structures with target Warren-Cowley parameters.

Usage

Here's an example on how to use the code to create the fcc_wc.dump file which has Warren-Cowley parameters that falls within a 1% difference of the targeted ones:

from ovito.io import export_file, import_file

from AtomisticReverseMonteCarlo import AtomisticReverseMonteCarlo

mod = AtomisticReverseMonteCarlo(
    nneigh=12,                                                          # number of neighbors to compute WC parameters (12 1NN in fcc)
    T=1e-9,                                                             # rMC temperature
    target_wc=[                                                         # wc target 1-pij/cj
        [0.32719603, -0.19925471, -0.12794131],
        [-0.19925471, 0.06350427, 0.13575045],
        [-0.12794131, 0.13575045, -0.00762235],
    ],
    tol_percent_diff=[                                                  # max percent tolerence allowed before stopping
        [1, 1, 1],
        [1, 1, 1],
        [1, 1, 1],
    ],                          
    save_rate=1000,                                                    # save rate
    seed=123,
    max_iter=None,                                                     # infinity number of iterations
)

# Load the intial snapshot 
pipeline = import_file("fcc_random.dump")
pipeline.modifiers.append(mod)
data = pipeline.compute()

# Load data of the last trajectory
data = pipeline.compute(-1)
print(f'Target Warren-Cowley parameters: \n {data.attributes["Target Warren-Cowley parameters"]}')
print(f'Warren-Cowley parameters: \n {data.attributes["Warren-Cowley parameters"]}')
print(f'Warren-Cowley Percent error: \n {data.attributes["Warren-Cowley percent error"]}')

export_file(
    data,
    "fcc_wc.dump",
    "lammps/dump",
    columns=[
        "Particle Identifier",
        "Particle Type",
        "Position.X",
        "Position.Y",
        "Position.Z",
    ],
)

The script can be found in the examples directory.

Installation

For a standalone Python package or Conda environment, please use:

pip install --user AtomisticReverseMonteCarlo

For OVITO PRO built-in Python interpreter, please use:

ovitos -m pip install --user AtomisticReverseMonteCarlo

If you want to install the lastest git commit, please replace AtomisticReverseMonteCarlo with git+https://github.com/killiansheriff/AtomisticReverseMonteCarlo.

Contact

If any questions, feel free to contact me (ksheriff at mit dot edu).

References & Citing

If you use this repository in your work, please cite:

@article{sheriff2023quantifying,
  title={Quantifying chemical short-range order in metallic alloys},
  author={Sheriff, Killian and Cao, Yifan and Smidt, Tess and Freitas, Rodrigo},
  journal={arXiv preprint arXiv:2311.01545},
  year={2023}
}

atomisticreversemontecarlo's People

Contributors

killiansheriff avatar nnn911 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.