Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add /connectivity group #61

Open
PythonFZ opened this issue Jun 5, 2023 · 1 comment
Open

add /connectivity group #61

PythonFZ opened this issue Jun 5, 2023 · 1 comment

Comments

@PythonFZ
Copy link
Member

PythonFZ commented Jun 5, 2023

A group of either time dependent or time independent data:

/connectivity/
  • bonds
  • bond_order ?
  • particle_group

see https://h5md.nongnu.org/h5md.html#connectivity-group

class Atoms(ase.Atoms):
    bonds

    def get_graph() -> networkx

also see https://github.com/imagdau/aseMolec

@PythonFZ
Copy link
Member Author

Add a custom NLTool to the io - some preprocessor maybe?

import ase.neighborlist as nl
import networkx as nx
import numpy as np

cutoffs = nl.natural_cutoffs(atoms) # scale for bond order
neighbor_list = nl.NeighborList(cutoffs, self_interaction=False, bothways=False)
neighbor_list.update(atoms)
matrix = neighbor_list.get_connectivity_matrix()
g = nx.from_scipy_sparse_array(matrix)
np.array(g.edges)

RDKit might also have some very handy tools on hand to compute bond order or some ML toolset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant