No project description provided
Project description
Graph ID
Graph ID is a universal identifier system for atomistic structures including crystals and molecules. It generates unique, deterministic identifiers based on the topological and compositional properties of atomic structures, enabling efficient structure comparison, database indexing, and materials discovery.
Overview
Graph ID works by:
- Converting atomic structures into graph representations where atoms are nodes and bonds are edges
- Analyzing the local chemical environment around each atom using compositional sequences
- Computing a hash-based identifier that captures both topology and composition
- Supporting various modes including topology-only comparisons and Wyckoff position analysis
Features
- Universal Structure Identification: Generate unique IDs for any crystal or molecular structure
- Topological Analysis: Option to generate topology-only IDs for structure type comparison
- Wyckoff Position Support: Include crystallographic symmetry information in ID generation
- Distance Clustering: Advanced clustering-based analysis for complex structures
- C++ Performance: High-performance C++ backend with Python bindings
- Multiple Neighbor Detection: Support for various neighbor-finding algorithms (MinimumDistanceNN, CrystalNN, etc.)
Installation
From PyPI
pip install graph-id-core
pip install graph-id-db # optional database component
From Source
git clone https://github.com/kmu/graph-id-core.git
cd graph-id-core
git submodule update --init --recursive
pip install -e .
Quick Start
Basic Usage
from pymatgen.core import Structure, Lattice
from graph_id import GraphIDMaker
# Create a structure (NaCl)
structure = Structure.from_spacegroup(
"Fm-3m",
Lattice.cubic(5.692),
["Na", "Cl"],
[[0, 0, 0], [0.5, 0.5, 0.5]]
)
# Generate Graph ID
maker = GraphIDMaker()
graph_id = maker.get_id(structure)
print(graph_id) # Output: NaCl-88c8e156db1b0fd9
Loading from Files
from pymatgen.core import Structure
from graph_id_cpp import GraphIDGenerator
# Load structure from file
structure = Structure.from_file("path/to/structure.cif")
generator = GraphIDGenerator()
graph_id = generator.get_id(structure)
Advanced Configuration
from graph_id_cpp import GraphIDGenerator
from pymatgen.analysis.local_env import CrystalNN
# Topology-only comparison (ignores composition)
topo_gen = GraphIDGenerator(topology_only=True)
topo_id = topo_gen.get_id(structure)
# Include Wyckoff positions
wyckoff_gen = GraphIDGenerator(wyckoff=True)
wyckoff_id = wyckoff_gen.get_id(structure)
# Use different neighbor detection
crystal_gen = GraphIDGenerator(nn=CrystalNN()) # Faster CrystalNN using C++ is also available
crystal_id = crystal_gen.get_id(structure)
Search Structures from Database
Use graph-id-db to search structures in the Materials Project using precomputed Graph ID stored in graph-id-db
# pip install graph-id-db
from graph_id_cpp import GraphIDGenerator
from pymatgen.core import Structure, Lattice
structure = Structure.from_spacegroup(
"Fm-3m",
Lattice.cubic(5.692),
["Na", "Cl"],
[[0, 0, 0], [0.5, 0.5, 0.5]]
).get_primitive_structure()
gen = GraphIDGenerator()
graph_id = gen.get_id(structure)
print(f"Graph ID of NaCl is {graph_id}")
from graph_id_db import Finder
# Search for structures in graph-id-db using GraphID
finder = Finder()
finder.find(graph_id)
Examples
More comprehensive examples can be found in the tests/ and examples/ directories.
Applications
Graph ID is particularly useful for:
- Materials Databases: Efficient indexing and deduplication of structure databases
- High-throughput Screening: Rapid identification of unique structures in computational workflows
- Polymorph Identification: Distinguishing between different polymorphs of the same composition
Web Service (experimental)
You can search materials using Graph ID at matfinder.net.
Developer's notes
Installation
- Clone the repository:
git clone https://github.com/kmu/graph-id-core.git
cd graph-id-core
- Initialize git submodules (required for the C++ build):
git submodule update --init --recursive
- Install the package and dependencies using Poetry:
poetry install
- Install
pre-commit
pre-commit install
Note: The git submodules (library/pybind11, library/eigen, library/gtl) are required for building the C++ extension. Without them, the installation will fail during the CMake build step.
Testing
poetry run pytest
If you changed C++ codes, poetry install again to reflect the changes.
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 Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file graph_id_core-0.1.12.tar.gz.
File metadata
- Download URL: graph_id_core-0.1.12.tar.gz
- Upload date:
- Size: 5.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e2704b56df1ddd1c6b2af3378ddf2171680c5058233e91fc1db0219babe1f99
|
|
| MD5 |
bfdc673ef49432a45ae917ae36fa9404
|
|
| BLAKE2b-256 |
18055c1bf8172af96023bb273cb720cd91b93e7c16ef07ac23a506fa5b27e383
|
Provenance
The following attestation bundles were made for graph_id_core-0.1.12.tar.gz:
Publisher:
release.yml on kmu/graph-id-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_id_core-0.1.12.tar.gz -
Subject digest:
8e2704b56df1ddd1c6b2af3378ddf2171680c5058233e91fc1db0219babe1f99 - Sigstore transparency entry: 724419315
- Sigstore integration time:
-
Permalink:
kmu/graph-id-core@806254228e481fd309657613a25fc115d203d51b -
Branch / Tag:
refs/heads/release - Owner: https://github.com/kmu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@806254228e481fd309657613a25fc115d203d51b -
Trigger Event:
push
-
Statement type:
File details
Details for the file graph_id_core-0.1.12-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: graph_id_core-0.1.12-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 261.6 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d47b3d081a0e1bf8ec7baf6fd96aa9278c2b2e5b1e898e6cb53c78c569e616c
|
|
| MD5 |
062a3056b9d3f44a69694deb62a455c0
|
|
| BLAKE2b-256 |
3350d7249b79590343aa40ae42bfa1ad7d94cbc1773d51d25c2a1e39aff821f7
|
Provenance
The following attestation bundles were made for graph_id_core-0.1.12-cp312-cp312-win_amd64.whl:
Publisher:
release.yml on kmu/graph-id-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_id_core-0.1.12-cp312-cp312-win_amd64.whl -
Subject digest:
8d47b3d081a0e1bf8ec7baf6fd96aa9278c2b2e5b1e898e6cb53c78c569e616c - Sigstore transparency entry: 724419317
- Sigstore integration time:
-
Permalink:
kmu/graph-id-core@806254228e481fd309657613a25fc115d203d51b -
Branch / Tag:
refs/heads/release - Owner: https://github.com/kmu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@806254228e481fd309657613a25fc115d203d51b -
Trigger Event:
push
-
Statement type:
File details
Details for the file graph_id_core-0.1.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: graph_id_core-0.1.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 304.8 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8808598adfeee1f6393510c204124092dcca4163b15a05df82b69a0f2290f0eb
|
|
| MD5 |
562f72d51b423cf9ea9df2dd8072989e
|
|
| BLAKE2b-256 |
132e1bdbdfcf456b96a6d413d592bc5743543d9a522fa3ade075adca358e49f0
|
Provenance
The following attestation bundles were made for graph_id_core-0.1.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on kmu/graph-id-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_id_core-0.1.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
8808598adfeee1f6393510c204124092dcca4163b15a05df82b69a0f2290f0eb - Sigstore transparency entry: 724419324
- Sigstore integration time:
-
Permalink:
kmu/graph-id-core@806254228e481fd309657613a25fc115d203d51b -
Branch / Tag:
refs/heads/release - Owner: https://github.com/kmu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@806254228e481fd309657613a25fc115d203d51b -
Trigger Event:
push
-
Statement type:
File details
Details for the file graph_id_core-0.1.12-cp312-cp312-macosx_15_0_arm64.whl.
File metadata
- Download URL: graph_id_core-0.1.12-cp312-cp312-macosx_15_0_arm64.whl
- Upload date:
- Size: 251.5 kB
- Tags: CPython 3.12, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9688e18bef5510a6feabc7895d321148235dc6a84f320237be1fdaadda326e4
|
|
| MD5 |
6753571bfb4834a670753ebac05b3000
|
|
| BLAKE2b-256 |
ffd879f923be0dfeae4c392bf01eb6260c2f8072da5a85380aeb4f4d1c3b6e2e
|
Provenance
The following attestation bundles were made for graph_id_core-0.1.12-cp312-cp312-macosx_15_0_arm64.whl:
Publisher:
release.yml on kmu/graph-id-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_id_core-0.1.12-cp312-cp312-macosx_15_0_arm64.whl -
Subject digest:
b9688e18bef5510a6feabc7895d321148235dc6a84f320237be1fdaadda326e4 - Sigstore transparency entry: 724419330
- Sigstore integration time:
-
Permalink:
kmu/graph-id-core@806254228e481fd309657613a25fc115d203d51b -
Branch / Tag:
refs/heads/release - Owner: https://github.com/kmu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@806254228e481fd309657613a25fc115d203d51b -
Trigger Event:
push
-
Statement type:
File details
Details for the file graph_id_core-0.1.12-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: graph_id_core-0.1.12-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 261.1 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dab184cccacb6b201ab199d6ab1216e7405d49179be9795040281b8d8e4e464b
|
|
| MD5 |
80d77303e22232d55eddaa4df0793886
|
|
| BLAKE2b-256 |
9974d9f9f87556b61b73221ab06a533fa9ddb0e7a3569f038d0bf0c90ccefc32
|
Provenance
The following attestation bundles were made for graph_id_core-0.1.12-cp311-cp311-win_amd64.whl:
Publisher:
release.yml on kmu/graph-id-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_id_core-0.1.12-cp311-cp311-win_amd64.whl -
Subject digest:
dab184cccacb6b201ab199d6ab1216e7405d49179be9795040281b8d8e4e464b - Sigstore transparency entry: 724419326
- Sigstore integration time:
-
Permalink:
kmu/graph-id-core@806254228e481fd309657613a25fc115d203d51b -
Branch / Tag:
refs/heads/release - Owner: https://github.com/kmu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@806254228e481fd309657613a25fc115d203d51b -
Trigger Event:
push
-
Statement type:
File details
Details for the file graph_id_core-0.1.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: graph_id_core-0.1.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 306.4 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a32afb7be85020cdfc0185cf2d6cdd285aeede6ad00368df566499140db22e9
|
|
| MD5 |
3d3b49a4ff748d3bf5f232fcf63f4c34
|
|
| BLAKE2b-256 |
2c944ce97a0c02d3efc1cd0a81bb1cd634902e0c591ecbfbb53281bcfca7ea37
|
Provenance
The following attestation bundles were made for graph_id_core-0.1.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on kmu/graph-id-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_id_core-0.1.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
4a32afb7be85020cdfc0185cf2d6cdd285aeede6ad00368df566499140db22e9 - Sigstore transparency entry: 724419319
- Sigstore integration time:
-
Permalink:
kmu/graph-id-core@806254228e481fd309657613a25fc115d203d51b -
Branch / Tag:
refs/heads/release - Owner: https://github.com/kmu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@806254228e481fd309657613a25fc115d203d51b -
Trigger Event:
push
-
Statement type:
File details
Details for the file graph_id_core-0.1.12-cp311-cp311-macosx_15_0_arm64.whl.
File metadata
- Download URL: graph_id_core-0.1.12-cp311-cp311-macosx_15_0_arm64.whl
- Upload date:
- Size: 252.2 kB
- Tags: CPython 3.11, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ef8f98face2f3415dbbc69d1aa65495c7aa0aadcdb88743c5ca10ecf230742c
|
|
| MD5 |
f6a08d161c98f3cd1544868c78f9f764
|
|
| BLAKE2b-256 |
607b1cb4e6cfff0405b588f27cbf27849b746b97777c2c3b9e38e88b45d88e0f
|
Provenance
The following attestation bundles were made for graph_id_core-0.1.12-cp311-cp311-macosx_15_0_arm64.whl:
Publisher:
release.yml on kmu/graph-id-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_id_core-0.1.12-cp311-cp311-macosx_15_0_arm64.whl -
Subject digest:
4ef8f98face2f3415dbbc69d1aa65495c7aa0aadcdb88743c5ca10ecf230742c - Sigstore transparency entry: 724419322
- Sigstore integration time:
-
Permalink:
kmu/graph-id-core@806254228e481fd309657613a25fc115d203d51b -
Branch / Tag:
refs/heads/release - Owner: https://github.com/kmu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@806254228e481fd309657613a25fc115d203d51b -
Trigger Event:
push
-
Statement type: