pymatgen_diffusion/neb/full_path_mapper.py
def check_uc_hop(sc_hop, uc_hop):
    """
    See if hop in the 2X2X2 supercell and a unit cell hop
    are equilvalent under lattice translation

    Args:
        sc_hop: MigrationPath object form pymatgen-diffusion.
        uc_hop: MigrationPath object form pymatgen-diffusion.
    Return:
        image vector of lenght 3
        Is the UC hop flip of the SC hop

    """

    directions = np.array(
        [
            [0, 0, 0],
            [1, 0, 0],
            [0, 1, 0],
            [0, 0, 1],
            [0, 1, 1],
            [1, 0, 1],
            [1, 1, 0],
            [1, 1, 1],
        ]
    )

    sc_ipos = [icoord * 2 for icoord in sc_hop.isite.frac_coords]
    sc_epos = [icoord * 2 for icoord in sc_hop.esite.frac_coords]
    sc_mpos = [icoord * 2 for icoord in sc_hop.msite.frac_coords]

    uc_ipos = uc_hop.isite.frac_coords
    uc_epos = uc_hop.esite.frac_coords
    uc_mpos = uc_hop.msite.frac_coords

    for idir in directions:
        tmp_m = uc_mpos + idir
        if almost(tmp_m, sc_mpos):
            tmp_i = uc_ipos + idir
            tmp_e = uc_epos + idir
            if almost(tmp_i, sc_ipos) and almost(tmp_e, sc_epos):
                return idir, False
            elif almost(tmp_e, sc_ipos) and almost(tmp_i, sc_epos):
                return idir, True
    return None

    See if hop in the 2X2X2 supercell and a unit cell hop
    are equilvalent under lattice translation

    Args:
        sc_hop: MigrationPath object form pymatgen-diffusion.
        uc_hop: MigrationPath object form pymatgen-diffusion.
    Return:
        image vector of lenght 3
        Is the UC hop flip of the SC hop

    
See if hop in the 2X2X2 supercell and a unit cell hop
are equilvalent under lattice translation
See if hop in the 2X2X2 supercell and a unit cell hop are equilvalent under lattice translation
def check_uc_hop(sc_hop, uc_hop):
    directions = np.array(
        [
            [0, 0, 0],
            [1, 0, 0],
            [0, 1, 0],
            [0, 0, 1],
            [0, 1, 1],
            [1, 0, 1],
            [1, 1, 0],
            [1, 1, 1],
        ]
    )
    sc_ipos = [icoord * 2 for icoord in sc_hop.isite.frac_coords]
    sc_epos = [icoord * 2 for icoord in sc_hop.esite.frac_coords]
    sc_mpos = [icoord * 2 for icoord in sc_hop.msite.frac_coords]
    uc_ipos = uc_hop.isite.frac_coords
    uc_epos = uc_hop.esite.frac_coords
    uc_mpos = uc_hop.msite.frac_coords
    for idir in directions:
        tmp_m = uc_mpos + idir
        if almost(tmp_m, sc_mpos):
            tmp_i = uc_ipos + idir
            tmp_e = uc_epos + idir
            if almost(tmp_i, sc_ipos) and almost(tmp_e, sc_epos):
                return idir, False
            elif almost(tmp_e, sc_ipos) and almost(tmp_i, sc_epos):
                return idir, True
    return None
def check_uc_hop ( sc_hop , uc_hop ) : directions = np . array ( [ [ 0 , 0 , 0 ] , [ 1 , 0 , 0 ] , [ 0 , 1 , 0 ] , [ 0 , 0 , 1 ] , [ 0 , 1 , 1 ] , [ 1 , 0 , 1 ] , [ 1 , 1 , 0 ] , [ 1 , 1 , 1 ] , ] ) sc_ipos = [ icoord * 2 for icoord in sc_hop . isite . frac_coords ] sc_epos = [ icoord * 2 for icoord in sc_hop . esite . frac_coords ] sc_mpos = [ icoord * 2 for icoord in sc_hop . msite . frac_coords ] uc_ipos = uc_hop . isite . frac_coords uc_epos = uc_hop . esite . frac_coords uc_mpos = uc_hop . msite . frac_coords for idir in directions : tmp_m = uc_mpos + idir if almost ( tmp_m , sc_mpos ) : tmp_i = uc_ipos + idir tmp_e = uc_epos + idir if almost ( tmp_i , sc_ipos ) and almost ( tmp_e , sc_epos ) : return idir , False elif almost ( tmp_e , sc_ipos ) and almost ( tmp_i , sc_epos ) : return idir , True return None
See if hop in the 2X2X2 supercell and a unit cell hop
are equilvalent under lattice translation
See if hop in the 2X2X2 supercell and a unit cell hop are equilvalent under lattice translation
"""
    See if hop in the 2X2X2 supercell and a unit cell hop
    are equilvalent under lattice translation

    Args:
        sc_hop: MigrationPath object form pymatgen-diffusion.
        uc_hop: MigrationPath object form pymatgen-diffusion.
    Return:
        image vector of lenght 3
        Is the UC hop flip of the SC hop

    """
sc_hop
MigrationPath object form pymatgen-diffusion.
MigrationPath object form pymatgen - diffusion .
uc_hop
MigrationPath object form pymatgen-diffusion.
MigrationPath object form pymatgen - diffusion .