question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

radius_graph for periodic structure

See original GitHub issue

❓ Questions & Help

Do you have a radius_graph function for periodic structure? Otherwise I will think how I can implement one and propose a PR, any suggestions? So far we are using pymatgen.core.structure.Structure.get_all_neighbors to do that.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mariogeigercommented, Nov 30, 2020

Yes I will try to make something. I plan to look at it this week or maybe the week after. I’d love to contribute

0reactions
APJansencommented, Aug 19, 2022

Any update on this issue? I would also like to create a radius graph that takes into account periodic boundary conditions. It is possible to do so by several times shifting the original positions and remapping them to the original domain, and computing the edges for each shift.

More elegant, and perhaps with unrelated applications as well, would be if one can provide a custom difference function to radius_graph. For example below is a difference for a box with periodicity in all directions.

I don’t know if that’s feasible though as I don’t know how radius_graph works internally, and found it very difficult to track down, as there are several imports between torch geometric and torch_cluster and vice versa.

def periodic_difference(x_i, x_j, domain):
    """
    Compute x_i - x_j taking into account the periodic boundary conditions.
    """
    diff = x_i - x_j
    smaller_one = x_i < x_j  # component-wise check which is bigger
    domain_shift = (1 - 2 * smaller_one) * domain
    diff_shifted = diff - domain_shift
    # boolean indicating in which component to use the original difference
    use_original = torch.abs(diff) < torch.abs(diff_shifted)
    periodic_diff = use_original * diff + ~use_original * diff_shifted
    return periodic_diff
Read more comments on GitHub >

github_iconTop Results From Across the Web

6.15: Periodic Trends- Atomic Radius - Chemistry LibreTexts
Atomic radius is determined as half the distance between the nuclei of two identical atoms bonded together. · The atomic radius of atoms ......
Read more >
radius_graph for periodic structure · Issue #1862 - GitHub
I would like to implement a SchNet nn with a periodic cell, and thus have the radius_graph with periodic boundary conditions. Is it...
Read more >
Atomic Radius (Calculated) of the elements in table chart ...
Element Atomic Number Element Symbol Element Name Element Atomic Radius (Calculat... 1 H Hydrogen 53 2 He Helium 31 3 Li Lithium 167
Read more >
Periodicity » Atomic radius (empirical) » bar chart
These values derived by J.C. Slater are an empirical set of atomic radii derived by the careful comparison of bond lengths in over...
Read more >
Atomic Radius Trend - YouTube
A video explaining the atomic radius trend from plotted data as well as a scientific explaination for why the trend in AR behaves...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found