A python implement of Atom2Vec: a simple way to describe atoms for machine learning
Project description
Atom2Vec
A python implement of Atom2Vec: a simple way to describe atoms for machine learning
(Updated 06/21/2021: We refactored the code with pymatgen
, you can find old version in branch old_version
. Now the code is fully typed and tested.)
Background
Atom2Vec is first proposed on Zhou Q, Tang P, Liu S, et al. Learning atoms for materials discovery[J]. Proceedings of the National Academy of Sciences, 2018, 115(28): E6411-E6417.
Demo
Installation
pip install atom2vec
Usage
Generating atom vectors and atom similarity matrix
We use pymatgen.core.Structure
to store all the structures.
from atom2vec import AtomSimilarity
from pymatgen.core import Structure
from typing import List
structures: List[Structure]
atom_similarity = AtomSimilarity.from_structures(structures,
k_dim=100, max_elements=3)
Query atom vectors
from atom2vec import AtomSimilarity
from pymatgen.core import Element
from typing import List
atom_similarity: AtomSimilarity
atom_vector: List[float]
atom_vector = atom_similarity.get_atom_vector(1) # atomic index
atom_vector = atom_similarity.get_atom_vector("H") # atom's name
atom_vector = atom_similarity.get_atom_vector(Element("H")) # pymatgen Element Enum
Query atom similarity
from atom2vec import AtomSimilarity
from pymatgen.core import Element
atom_similarity: AtomSimilarity
similarity: float
similarity = atom_similarity["Ca", "Sr"]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file atom2vec-1.1.0.tar.gz
.
File metadata
- Download URL: atom2vec-1.1.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0655301b87c831102b609149e7267f2a03f962866803f61ef7d8011a9723cec |
|
MD5 | 95a05315753837b61ede0bf977dbdcef |
|
BLAKE2b-256 | d9dc085e2083d603006e1e22fd125ec11f01babd8ca3d40789f04d173f20b19b |
File details
Details for the file atom2vec-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: atom2vec-1.1.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2a1229d94b0af56dadcfb2772fb718dab6583e65f9182871779e744218bfc62 |
|
MD5 | e961a831a4e3b20d05bdbff5e5b95d93 |
|
BLAKE2b-256 | 52f88024b047558fd47b49521de8d62a9071b3d5da75cef8c6ff8367d93d81c2 |