def find_data(filename="log.lammps", verbose=False):
    """
    Extract data from a LAMMPs log file.

    Parameters
    ----------
    filename: str, optional
        Name of LAMMPs log fil.
        Default: log.lammps.
    verbose: bool, optional
        If True, the header of each chunk will
        be printed. Default: False.

    Returns
    -------
    data: dict
        Dictionary where the keys are the headers
        in the log file, and the values are lists
        of data.
    """

    with open(filename, "r") as infile:
        lines = infile.readlines()
    N = len(lines)
    data = {}

    if verbose:
        print("Reading " + filename)

    for i in range(N):
        line = lines[i]
        if "Per MPI rank memory" in line:
            i = i + 1
            line = lines[i]
            if verbose:
                print(line)
            headers = line.split()
            for word in headers:
                if word not in data.keys():
                    data[word] = []
            i += 1
            while i < N and "Loop time" not in lines[i]:
                word = lines[i].split()
                if len(word) != len(headers):
                    return data
                for j in range(len(word)):
                    data[headers[j]].append(float(word[j]))
                i += 1
    return data