pymatgen_diffusion/neb/full_path_mapper.py
def map_hop_sc2uc(sc_hop, fpm_uc):
    """
    Map a given hop in the SC onto the UC.

    Args:
        sc_hop: MigrationPath object form pymatgen-diffusion.
        fpm_uc: FullPathMapper object from pymatgen-diffusion.

    Note:
        For now assume that the SC is exactly 2x2x2 of the UC.
        Can add in the parsing of different SC's later

        For a migration event in the SC from (0.45,0,0)-->(0.55,0,0)
        the UC hop might be (0.9,0,0)-->(0.1,0,0)[img:100]
        for the inverse of (0.1,0,0)-->(-0.1,0,0) the code needs to account for both those cases
    """
    for u, v, d in fpm_uc.s_graph.graph.edges(data=True):
        chk_res = check_uc_hop(sc_hop=sc_hop, uc_hop=d["hop"])
        if chk_res is not None:
            assert almost(d["hop"].length, sc_hop.length)
            return dict(
                uc_u=u,
                uc_v=v,
                hop=d["hop"],
                shift=chk_res[0],
                flip=chk_res[1],
                hop_label=d["hop_label"],
            )
    raise AssertionError("Looking for a SC hop without a matching UC hop")

    Map a given hop in the SC onto the UC.

    Args:
        sc_hop: MigrationPath object form pymatgen-diffusion.
        fpm_uc: FullPathMapper object from pymatgen-diffusion.

    Note:
        For now assume that the SC is exactly 2x2x2 of the UC.
        Can add in the parsing of different SC's later

        For a migration event in the SC from (0.45,0,0)-->(0.55,0,0)
        the UC hop might be (0.9,0,0)-->(0.1,0,0)[img:100]
        for the inverse of (0.1,0,0)-->(-0.1,0,0) the code needs to account for both those cases
    
Map a given hop in the SC onto the UC.
Map a given hop in the SC onto the UC .
def map_hop_sc2uc(sc_hop, fpm_uc):
    for u, v, d in fpm_uc.s_graph.graph.edges(data=True):
        chk_res = check_uc_hop(sc_hop=sc_hop, uc_hop=d["hop"])
        if chk_res is not None:
            assert almost(d["hop"].length, sc_hop.length)
            return dict(
                uc_u=u,
                uc_v=v,
                hop=d["hop"],
                shift=chk_res[0],
                flip=chk_res[1],
                hop_label=d["hop_label"],
            )
    raise AssertionError("Looking for a SC hop without a matching UC hop")
def map_hop_sc2uc ( sc_hop , fpm_uc ) : for u , v , d in fpm_uc . s_graph . graph . edges ( data = True ) : chk_res = check_uc_hop ( sc_hop = sc_hop , uc_hop = d [ "hop" ] ) if chk_res is not None : assert almost ( d [ "hop" ] . length , sc_hop . length ) return dict ( uc_u = u , uc_v = v , hop = d [ "hop" ] , shift = chk_res [ 0 ] , flip = chk_res [ 1 ] , hop_label = d [ "hop_label" ] , ) raise AssertionError ( "Looking for a SC hop without a matching UC hop" )
Map a given hop in the SC onto the UC.
Map a given hop in the SC onto the UC .
"""
    Map a given hop in the SC onto the UC.

    Args:
        sc_hop: MigrationPath object form pymatgen-diffusion.
        fpm_uc: FullPathMapper object from pymatgen-diffusion.

    Note:
        For now assume that the SC is exactly 2x2x2 of the UC.
        Can add in the parsing of different SC's later

        For a migration event in the SC from (0.45,0,0)-->(0.55,0,0)
        the UC hop might be (0.9,0,0)-->(0.1,0,0)[img:100]
        for the inverse of (0.1,0,0)-->(-0.1,0,0) the code needs to account for both those cases
    """
sc_hop
MigrationPath object form pymatgen-diffusion.
MigrationPath object form pymatgen - diffusion .
fpm_uc
FullPathMapper object from pymatgen-diffusion.
FullPathMapper object from pymatgen - diffusion .