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

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.3.tar.gz (32.1 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.3-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kimvv-0.1.3.tar.gz
  • Upload date:
  • Size: 32.1 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.3.tar.gz
Algorithm Hash digest
SHA256 c91a128c2038a366636ee04efb10a6fe9c21591499261183e68f2a3a4ae0e0b3
MD5 2e196b510c2ee7e3fc4296070563dd66
BLAKE2b-256 dab0c74604dc2e926209e9fe4ea5470e2ba58fe3fb268e7d2fc59adc308c315e

See more details on using hashes here.

Provenance

The following attestation bundles were made for kimvv-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: kimvv-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 33.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5eb470bb9a9e731c2490433a57a291614b6a72c7f942a0b94c49bf48d25b3339
MD5 4be5f446ab5d291fa5c4903b0d164ab5
BLAKE2b-256 ed7baa2c6e94a1d190e13f617a5de818881210c0c0b815ec3376da34a636875c

See more details on using hashes here.

Provenance

The following attestation bundles were made for kimvv-0.1.3-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