Create a Lattice from a dictionary containing the a, b, c, alpha, beta,
        and gamma parameters if fmt is None.

        If fmt == "abivars", the function build a `Lattice` object from a
        dictionary with the Abinit variables `acell` and `rprim` in Bohr.
        If acell is not given, the Abinit default is used i.e. [1,1,1] Bohr

        Example:

            Lattice.from_dict(fmt="abivars", acell=3*[10], rprim=np.eye(3))

def from_dict(cls, d: Dict, fmt: str = None, **kwargs):
        """
        Create a Lattice from a dictionary containing the a, b, c, alpha, beta,
        and gamma parameters if fmt is None.

        If fmt == "abivars", the function build a `Lattice` object from a
        dictionary with the Abinit variables `acell` and `rprim` in Bohr.
        If acell is not given, the Abinit default is used i.e. [1,1,1] Bohr

        Example:

            Lattice.from_dict(fmt="abivars", acell=3*[10], rprim=np.eye(3))
        """
        if fmt == "abivars":
            from pymatgen.io.abinit.abiobjects import lattice_from_abivars

            kwargs.update(d)
            return lattice_from_abivars(cls=cls, **kwargs)

        if "matrix" in d:
            return cls(d["matrix"])
        else:
            return cls.from_parameters(
                d["a"], d["b"], d["c"], d["alpha"], d["beta"], d["gamma"]
            )