Giter Site home page Giter Site logo

Comments (3)

QQQsupermans avatar QQQsupermans commented on May 26, 2024

The result of (0 1 0)-oriented supercells is right. However, I have the same problem when I use (2 1 0)-oriented supercells. The 40-atom supercells should have 40*3=120 Ni-Al bonds. The screenshot, yaml file and POSCAR are attached as follows:

The screenshot file:
image

yaml file:
rtol: 0.05
shell_weights:
1: 1.0
prefactor_mode: set
prefactors: -1

POSCAR file:
Ni3Al-POSCAR-(2 1 0)
3.569
1.0000000000 0.0000000000 0.0000000000
0.0000000000 2.2360999584 0.0000000000
0.0000000000 0.0000000000 4.4720997810
Al Ni
10 30
Direct
0.000000000 0.000000000 0.000000000
0.000000000 0.600000024 0.100000001
0.000000000 0.200000003 0.200000003
0.000000000 0.800000012 0.300000012
0.000000000 0.400000006 0.400000006
0.000000000 0.000000000 0.500000000
0.000000000 0.600000024 0.600000024
0.000000000 0.200000003 0.699999988
0.000000000 0.800000012 0.800000012
0.000000000 0.400000006 0.899999976
0.500000000 0.500000000 0.000000000
0.500000000 0.100000001 0.100000001
0.500000000 0.699999988 0.200000003
0.500000000 0.300000012 0.300000012
0.500000000 0.899999976 0.400000006
0.500000000 0.500000000 0.500000000
0.500000000 0.100000001 0.600000024
0.500000000 0.699999988 0.699999988
0.500000000 0.300000012 0.800000012
0.500000000 0.899999976 0.899999976
0.000000000 0.300000012 0.050000001
0.000000000 0.899999976 0.150000006
0.000000000 0.500000000 0.250000000
0.000000000 0.100000001 0.349999994
0.000000000 0.699999988 0.449999988
0.000000000 0.300000012 0.550000012
0.000000000 0.899999976 0.649999976
0.000000000 0.500000000 0.750000000
0.000000000 0.100000001 0.850000024
0.000000000 0.699999988 0.949999988
0.500000000 0.800000012 0.050000001
0.500000000 0.400000006 0.150000006
0.500000000 0.000000000 0.250000000
0.500000000 0.600000024 0.349999994
0.500000000 0.200000003 0.449999988
0.500000000 0.800000012 0.550000012
0.500000000 0.400000006 0.649999976
0.500000000 0.000000000 0.750000000
0.500000000 0.600000024 0.850000024
0.500000000 0.200000003 0.949999988

from sqsgenerator.

dgehringer avatar dgehringer commented on May 26, 2024

Dear @QQQsupermans!

At first sorry for my delayed reply! I have had a look at your problems!

Unfortunately, I cannot reproduce what you say! But let's go step by step!
Coming to your first problem!

Firstly, as you rightly point out, the inacuracies due to the floating point representation are relatively small (see figure below) and you tack it using rtol = 0.05 which is actually an good idea. Nevertheless, for me personally atol = 0.05 is more intuitive.

hist

Nevertheless, I cannot reproduce the number you report in your first comment!
I have tried to come up with an Python implementation, which reproduces your reported numbers!

Please see below!

import numpy as np
from collections import Counter
from pymatgen.io.vasp import Poscar
from typing import *

# ni3al is your Poscar
structure = Poscar.from_file("ni3al.vasp").structure

# helper method computes the coordination shell
# to compute the distance we rely on pymatgen.distance_matrix
def make_shell_matrix(s: Structure, prec: int = 3) -> np.ndarray:
    d2 = s.distance_matrix
    d2_round = np.round(d2, prec)
    S = np.zeros_like(d2, dtype=int)
    get_shell_index = np.sort(np.unique(d2_round)).tolist().index
    for i in range(len(s)):
        for j in range(i+1, len(s)):
            S[i, j] = get_shell_index(d2_round[i, j])
            S[j, i] = S[i, j]  # the shell-matrix must be symmetric
    return S


shells: np.ndarray = make_shell_matrix(structure, 1)  #we round to only one digits
species: List[str] = [site.species_string for site in structure]  #retrieve species in correct order

# find nearest neighbors only using 1st coordination shell (shells == 1)
Counter(frozenset((species[i], species[j])) for i, j in np.argwhere(shells == 1) if j > i)

Nevertheless, the code spits out the following result

Counter({frozenset({'Ni'}): 198, frozenset({'Al', 'Ni'}): 198}), which means there are 198 Ni - Ni and 198 Ni - Al bonds, which is exactly what sqsgenerator has printed to your screen.

Also, counting all pairs $2.51 < |\mathbf{r}_{ij}| < 2.53 ; \mathrm{A}$ (see Fig. above) using the following snippet

d = structure.distance_matrix
Counter(frozenset((species[i], species[j])) for i, j in np.argwhere(np.logical_and(d2 > 2.51, d2 < 2.53)) if j > i)

results in the same answer, namely Counter({frozenset({'Ni'}): 198, frozenset({'Al', 'Ni'}): 198})

Sadly, also for your second snippet the $(210)$ orientation, both snippets from above yield consitently

Counter({frozenset({'Al', 'Ni'}): 80, frozenset({'Ni'}): 80}) which is again in-line with the output of sqsgenerator

I hope that helps and best regards

from sqsgenerator.

QQQsupermans avatar QQQsupermans commented on May 26, 2024

I really appreciate all your help! I am still checking the results. In addition, I use Ovito software to check the bond number of the first POSCAR. The number is also 216*2=432, which shows as follows. I'm not sure what causes the different result. If I find the reason, I will send it to you.
image

from sqsgenerator.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.