Skip to main content

Nanoworks:Nanoscale Python scripts for DFT, MD and ML works

Project description

[!IMPORTANT] gpaw-tools has evolved and is now called Nanoworks! The gpaw-tools project began as a script that utilized only ASE and GPAW. Still, over the course of four years, it evolved into code that leverages multiple libraries, including ASAP3, Phonopy, Elastic, OpenKIM, and others. It is now being rewritten to > incorporate modern Machine Learning capabilities (MACE, CHGNet, SevenNet) into its structure.

Nanoworks is still in beta. Please continue to use gpaw-tools until further notice.

Nanoworks

License: MIT Issues: Pull requests: Latest version: Release date: Commits: Last Commit:

Introduction

Nanoworks is a powerful and user-friendly python command-line user interface tool for conducting Density Functional Theory (DFT) and molecular dynamics (MD) calculations. Our goal is to make DFT and MD calculations more accessible and easy to use for individuals and small groups by providing a simple command-line interface.

The Nanoworks package is built on top of the ASE, ASAP3, KIM-API, PHONOPY, and GPAW libraries, which are well-established and widely used in the scientific community. It allows users to simulate the properties of materials, optimize structures, investigate chemical reactions and processes, and perform calculations on systems with many atoms. With Nanoworks, researchers, students, and engineers in various fields, including materials science, chemistry, physics, and engineering, can easily conduct DFT and MD calculations and explore the electronic, optical, and phonon structure of material systems. We are constantly working to improve and expand the capabilities of Nanoworks, and we welcome feedback and contributions from the community.

Nanoworks has:

  1. The main solver code dftsolve.py can run in PW or LCAO mode. It can perform structure optimization, equation of state, and elastic tensor calculations, use several different XCs (as well as hybrid XCs) for spin-polarized DOS and band structure calculations, electron densities, phonon calculations, and optical properties (RPA and BSE). In addition to calculations, it can draw DOS and band structures, save all data, and present the results in an ordered way.
  2. A force-field quick optimization script mdsolve.py for MD calculations using ASAP3 with OpenKIM potentials.
  3. To choose better cut-off energy, lattice parameter, and k-points, there are 4 scripts called optimize_cutoff.py, optimize_kpoints.py, optimize_kptsdensity.py, and optimize_latticeparam.py.

Usage

Installation

dftsolve.py

This is the main code for easy and ordered PW/LCAO Calculations with ASE/GPAW. It can run as a command.

Command line usage: dftsolve.py -v -e -d -h -i <inputfile.py> -g <geometryfile.cif>

Argument list:

-g, --geometry    : Use a CIF file for geometry
-i, --input       : Use an input file for variables (input.py). If you do not use this argument, parameters 
                    will be taken from the related lines of dftsolve.py. Visit the "Input File Keywords" webpage for more.
-e, --energymeas  : Energy consumption measurement. This feature only works with Intel CPUs after the Sandy Bridge generation.
                    Results will be written in a file in the results folder (as kWh!).
-h, --help        : Help
-v, --version     : Version information of running code and the latest stable code. Also gives a download link.

Instead of using a geometry file, you can put an ASE Atoms object into your input file for the geometry. As an example, please note the example at: examples\Bulk-GaAs-noCIF folder.

How to run?

Change <core_number> with the core numbers to use. To get maximum performance from your PC, you can use total number of cores - 1 or total RAM/2Gb as a <core_number>. For CPUs supporting hyperthreading, users can use more than one instance of dftsolve.py to achieve maximum efficiency.

Usage: $ mpirun -np <core_number> dftsolve.py <args>

or

$ gpaw -P<core_number> python /path/to/dftsolve.py -- <args>

mdsolve.py

The inter-atomic potential is a useful tool to perform a quick geometric optimization of the studied system before starting a precise DFT calculation. The mdsolve.py script is written for geometric optimizations with inter-atomic potentials. The bulk configuration of atoms can be provided by the user, given as a CIF file. A general potential is given for any calculation. However, the user can provide the necessary OpenKIM potential by changing the related line in the input file.

Mainly, mdsolve.py is not related to GPAW. However, it is dependent on ASAP3/OpenKIM and Kimpy.

The main usage is:

$ mdsolve.py <args>

Arguments

mdsolve.py -v -h -i <inputfile.py> -g <geometryfile.cif>

Argument list:

-g, --geometry   : Use a CIF file for geometry
-i, --input      : Use an input file for variables (input.py) 

-h --help        : Help
-v --version     : Version information of running code and the latest stable code. It also gives a download link.

optimizations/optimize_cutoff (and kpoints)(and kptsdensity)(and latticeparam).py

Users must provide an ASE Atoms object and simply insert the object inside these scripts. With the scripts, the user can do convergence tests for cut-off energy, k-points, and k-point density and can calculate the energy-dependent lattice parameter values. These codes are mainly based on Prof. J. Kortus, and R. Wirnata's Electr. Structure & Properties of Solids course notes and GPAW's tutorials. Scripts can easily be called with MPI:

gpaw -P<core_number> python optimize_cutoff.py -- Structure.cif
gpaw -P<core_number> python optimize_kpoints.py -- Structure.cif
gpaw -P<core_number> python optimize_kptsdensity.py -- Structure.cif
gpaw -P<core_number> python optimize_latticeparam.py -- Structure.cif

optimize_latticeparam.py can perform simultaneous calculation for lattice parameters a and c. And can also draw a 3D contour graph for Energy versus lattice parameters (a and c).

examples/

There are some example calculations given with different usage scenarios. Please send us more calculations to include in this folder.

Input File Keywords

Release notes

Release notes are listed here.

Citing

Please do not forget that Nanoworks is an user interface software. For the main DFT calculations, it uses ASE and GPAW. It also uses the Elastic Python package for elastic tensor solutions and ASAP with the KIM database for interatomic interaction calculations, and Phonopy for the phonon calculations. Therefore, you must know what you use and cite them properly. Here, the basic citation information of each package is given.

ASE

GPAW

KIM

Elastic

Phonopy

And for Nanoworks usage, please use the following citation:

Many other packages need to be cited. With GPAW, you may need to cite LibXC or cite for LCAO, TDDFT, and linear-response calculations. Please visit their pages for many other citation possibilities. For more you can visit https://wiki.fysik.dtu.dk/ase/faq.html#how-should-i-cite-ase, https://wiki.fysik.dtu.dk/gpaw/faq.html#citation-how-should-i-cite-gpaw, and https://openkim.org/how-to-cite/.

Licensing

This project is licensed under the terms of the MIT license.

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

nanoworks-0.0.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

nanoworks-0.0.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file nanoworks-0.0.1.tar.gz.

File metadata

  • Download URL: nanoworks-0.0.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nanoworks-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f8dca1a66fde36e001a449b88b824767ab70136a72e21f685ba1fff6b4f3f50c
MD5 1d29d4fb029214accf8e880977069a4b
BLAKE2b-256 1d7ca26b76a2076180d95b30718bbab3b1e47b0898abbb6f81b654c8008446d6

See more details on using hashes here.

File details

Details for the file nanoworks-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: nanoworks-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nanoworks-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 995abbcecfd1b04b12f73aaedb8d1fb88e4281fea277fd8b9b706f0d60e55a10
MD5 e683b727eafec096d3d39d9c88bf64e8
BLAKE2b-256 bb959229f5a0a8aa29ddb3f8cd876a27f35867c82d081cada4f8e77491210065

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