Skip to main content

OpenKIM material property computations for arbitrary crystal structures as Python classes

Project description

Testing PyPI

This package allows the user to run any OpenKIM Test Drivers written using the kim-tools package locally. A “Test Driver” is a computational protocol that reports one or more material properties using the KIM Properties Framework

List of included Test Drivers:

  • EquilibriumCrystalStructure

  • ElasticConstantsCrystal

  • CrystalStructureAndEnergyVsPressure

Currently, all Test Drivers require the AFLOW software to be installed and in your PATH. See https://kim-tools.readthedocs.io/en/stable/#doc-standalone-installation for installation info.

Basic usage example:

from kimvv import ElasticConstantsCrystal
from ase.build import bulk
from json import dumps

# The Test Driver must be instantiated with an ASE Calculator object
# or a string indicating a KIM model name
relax = ElasticConstantsCrystal('LennardJones_Ar')

# To perform the computation, call the Test Driver object. The first argument
# to most Test Drivers is the crystal structure to perform the compuation on.
# To see the additonal arguments, use .printdoc() to print the docstring
relax.printdoc()

# Let's compute the elastic constants with the "stress-condensed" method.
# The crystal structure can be specified as an Atoms object. Any dependencies
# (e.g. relaxing the crystal structure with EquilibriumCrystalStructure) are
# automatically run.
results = relax(bulk('Ar','fcc',5.0), method="stress-condensed")

# Each Test Driver computes a list of one or more dictionaries, each defining
# a material property in the format specified by the KIM Properties Framework.
# The name of the property is in the "property-id" key. See
# https://openkim.org/properties for the definition of each property.
print(dumps(results, indent=2))

Usage example 2

Querying for all DFT-relaxed structures for a given combination of elements in OpenKIM and relaxing them with your potential

from kimvv import EquilibriumCrystalStructure
from kim_tools import (
  query_crystal_structures,
  get_deduplicated_property_instances
)
from json import dumps
from ase.calculators.lj import LennardJones

# Query for all relaxed Argon reference data in OpenKIM
raw_structs = query_crystal_structures(stoichiometric_species=["Ar"])

# Deduplicate them
unique_structs = get_deduplicated_property_instances(raw_structs, allow_rotation=True)

# Instantiate the Driver with your model
relax = EquilibriumCrystalStructure(LennardJones(sigma=3.4,epsilon=0.0104,rc=8.15))

# Run the Driver with each structure. As this is run, the driver internally accumulates
# Property Instances
for struct in unique_structs:
  relax(struct)

# In addition to returning the Property Instances for the current run, Test Drivers
# accumulate all computed Property Instances. They can be accessed like this:
print(dumps(relax.property_instances, indent=2))

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

kimvv-0.1.4.tar.gz (40.0 kB view details)

Uploaded Source

Built Distribution

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

kimvv-0.1.4-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file kimvv-0.1.4.tar.gz.

File metadata

  • Download URL: kimvv-0.1.4.tar.gz
  • Upload date:
  • Size: 40.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for kimvv-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a1eac1338532fcf4558ca95a780a84a5dd7df09c6ccf29b51b6cc5c3e3140fc9
MD5 a4fa71ba0fa576a707f5835c965396a9
BLAKE2b-256 84be07190b74087ae1adeb38a21dbf01e4ee500758512b4a30f787420e3cf846

See more details on using hashes here.

Provenance

The following attestation bundles were made for kimvv-0.1.4.tar.gz:

Publisher: release.yml on openkim/kimvv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kimvv-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: kimvv-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 42.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for kimvv-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6905729227683355f641b4dc016fe03d768b64a3e474582fbcec3fec3d176d70
MD5 683255f9ab0a13f5b2a6a57bc654fa67
BLAKE2b-256 4ad6d6552f245ca26b9d81dd0b04e93a412ee1ea9733d0abe1c8a7575d183748

See more details on using hashes here.

Provenance

The following attestation bundles were made for kimvv-0.1.4-py3-none-any.whl:

Publisher: release.yml on openkim/kimvv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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