def write_xyz_file(name, names, positions):
    """Create an xyz file

    Parameters
    ----------
    name : str
      output file name
    names : list
      atom names
    positions : np.ndarray
      positions of atoms
    """
    with open(name, 'w') as out:
        out.write('{}\n\n'.format(len(positions)))
        for nm, (x, y, z) in zip(names, positions):
            out.write('{} {} {} {}\n'.format(nm, x, y, z))
