<jupyter_start><jupyter_text><NAME><jupyter_code>species = ['Ar', 'Ar']
xyz = [(0., 0., 0.), (4., 0., 0.)]/bohr
alpha_0, C6, R_vdw = pymbd.get_free_atom_data(species)
omega = mbd.omega_eff(C6, alpha_0)
mbd.get_single_mbd_energy(
    '', 'fermi,dip',
    xyz, alpha_0, omega,
    r_vdw=R_vdw, beta=1., a=6.
)[0]
mbd.get_single_rpa_energy(
    '', 'fermi,dip',
    xyz, mbd.alpha_dynamic_ts_all('C', mbd.n_grid_omega, alpha_0, c6=C6),
    r_vdw=R_vdw, beta=1., a=6.
)[0]
mbd.get_ts_energy(
    '', 'fermi2',
    xyz, C6, alpha_0,
    r_vdw=R_vdw, s_r=1., d=6.
)<jupyter_output><empty_output><jupyter_text>Linear argon chain<jupyter_code>species = ['Ar']
xyz = [(0., 0., 0.)]/bohr
uc = np.array([(4., 0., 0.), (0., 10., 0.), (0., 0., 10.)])/bohr
mbd.param_vacuum_axis = (False, True, True)
mbd.param_k_grid_shift = 0
alpha_0, C6, R_vdw = pymbd.get_free_atom_data(species)
omega = mbd.omega_eff(C6, alpha_0)
k_grid = mbd.make_k_grid(mbd.make_g_grid(200, 1, 1), uc)
omegas = mbd.get_reciprocal_mbd_energy(
    'REV', 'dip,gg',
    xyz, alpha_0, omega, k_grid, uc,
    r_vdw=R_vdw, beta=1., a=6.
)[1]
plt.plot(*chain.from_iterable(
    (*zip(*sorted(zip(k_grid[:, 0], omegas[:, i]))), 'b-')
    for i in range(omegas.shape[1])
))
ns_kpt = [4, 8, 12, 20, 40, 80]
enes_periodic = []
for n_kpt in ns_kpt:
    k_grid = mbd.make_k_grid(mbd.make_g_grid(n_kpt, 1, 1), uc)
    ene = mbd.get_reciprocal_mbd_energy(
        'R', 'fermi,dip',
        xyz, alpha_0, omega, k_grid, uc,
        r_vdw=R_vdw, beta=1., a=6.
    )[0]
    enes_periodic.append(ene)
ns_cell = [4, 8, 12, 20, 40, 80]
enes_supercell = []
for n_cell in ns_cell:
    ene = mbd.get_supercell_mbd_energy(
        'C', 'fermi,dip',
        xyz, alpha_0, omega, uc, (n_cell, 1, 1),
        r_vdw=R_vdw, beta=1., a=6.
    )[0]
    enes_supercell.append(ene)
plt.plot(
    ns_cell, enes_supercell, 'b',
    ns_kpt, enes_periodic, 'r'
)
mbd.get_ts_energy('C', 'fermi2', xyz, C6, alpha_0, r_vdw=R_vdw, s_r=1., d=6., unit_cell=uc)
(enes_supercell[-1], enes_periodic[-1])<jupyter_output><empty_output><jupyter_text>Linear argon chain (2 atoms in cell)<jupyter_code>species = ['Ar', 'Ar']
xyz = [(0., 0., 0.), (4., 0., 0.)]/bohr
uc = np.array([(8., 0., 0.), (0., 10., 0.), (0., 0., 10.)])/bohr
mbd.param_vacuum_axis = (False, True, True)
alpha_0, C6, R_vdw = pymbd.get_free_atom_data(species)
omega = mbd.omega_eff(C6, alpha_0)
k_grid = mbd.make_k_grid(mbd.make_g_grid(200, 1, 1), uc)
omegas = mbd.get_reciprocal_mbd_energy(
    'REV', 'fermi,dip',
    xyz, alpha_0, omega, k_grid, uc,
    r_vdw=R_vdw, beta=1., a=6.
)[1]
plt.plot(*chain.from_iterable((
    *zip(*sorted(zip(k_grid[:, 0], omegas[:, i]))),
    'b-',
    *zip(*sorted(zip(k_grid[:, 0]+2*np.pi/8*bohr, omegas[:, i]))),
    'b-'
) for i in range(omegas.shape[1])))
ns_kpt = [4, 8, 12, 20, 40, 80]
enes_periodic = []
for n_kpt in ns_kpt:
    k_grid = mbd.make_k_grid(mbd.make_g_grid(n_kpt, 1, 1), uc)
    ene = mbd.get_reciprocal_mbd_energy(
        'R', 'fermi,dip',
        xyz, alpha_0, omega, k_grid, uc,
        r_vdw=R_vdw, beta=1., a=6.
    )[0]
    enes_periodic.append(ene)
ns_cell = [4, 8, 12, 20, 40, 80]
enes_supercell = []
for n_cell in ns_cell:
    ene = mbd.get_supercell_mbd_energy(
        'C', 'fermi,dip',
        xyz, alpha_0, omega, uc, (n_cell, 1, 1),
        r_vdw=R_vdw, beta=1., a=6.
    )[0]
    enes_supercell.append(ene)
plt.plot(
    ns_cell, enes_supercell, 'b',
    ns_kpt, enes_periodic, 'r'
)
mbd.get_ts_energy('C', 'fermi2', xyz, C6, alpha_0, r_vdw=R_vdw, s_r=1., d=6., unit_cell=uc)/2
(enes_supercell[-1]/2, enes_periodic[-1]/2)<jupyter_output><empty_output><jupyter_text>Two parallel argon chains<jupyter_code>species = ['Ar', 'Ar']
xyz = [(0., 0., 0.), (0., 0., 4.)]/bohr
uc = np.array([(4., 0., 0.), (0., 10., 0.), (0., 0., 10.)])/bohr
mbd.param_vacuum_axis = (False, True, True)
alpha_0, C6, R_vdw = pymbd.get_free_atom_data(species)
omega = mbd.omega_eff(C6, alpha_0)
k_grid = mbd.make_k_grid(mbd.make_g_grid(200, 1, 1), uc)
omegas = mbd.get_reciprocal_mbd_energy(
    'REV', 'fermi,dip',
    xyz, alpha_0, omega, k_grid, uc,
    r_vdw=R_vdw, beta=1., a=6.
)[1]
plt.plot(*chain.from_iterable(
    (*zip(*sorted(zip(k_grid[:, 0], omegas[:, i]))), 'b-')
    for i in range(omegas.shape[1])
))
ns_kpt = [4, 8, 12, 20, 40, 80]
enes_periodic = []
for n_kpt in ns_kpt:
    k_grid = mbd.make_k_grid(mbd.make_g_grid(n_kpt, 1, 1), uc)
    ene = mbd.get_reciprocal_mbd_energy(
        'R', 'fermi,dip',
        xyz, alpha_0, omega, k_grid, uc,
        r_vdw=R_vdw, beta=1., a=6.
    )[0]
    enes_periodic.append(ene)
ns_cell = [4, 8, 12, 20, 40, 80]
enes_supercell = []
for n_cell in ns_cell:
    ene = mbd.get_supercell_mbd_energy(
        'C', 'fermi,dip',
        xyz, alpha_0, omega, uc, (n_cell, 1, 1),
        r_vdw=R_vdw, beta=1., a=6.
    )[0]
    enes_supercell.append(ene)
plt.plot(ns_cell, enes_supercell, 'b', ns_kpt, enes_periodic, 'r')
mbd.get_ts_energy('C', 'fermi2', xyz, C6, alpha_0, r_vdw=R_vdw, s_r=1., d=6., unit_cell=uc)
(enes_supercell[-1], enes_periodic[-1])<jupyter_output><empty_output><jupyter_text>Argon crystal<jupyter_code>species = ['Ar']
xyz = [(0., 0., 0.)]/bohr
uc = np.array([(4., 0., 0.), (0., 4., 0.), (0., 0., 4.)])/bohr
mbd.param_vacuum_axis = (False, False, False)
alpha_0, C6, R_vdw = pymbd.get_free_atom_data(species)
omega = mbd.omega_eff(C6, alpha_0)
k_grid = mbd.make_k_grid(mbd.make_g_grid(200, 1, 1), uc)
omegas = mbd.get_reciprocal_mbd_energy(
    'REV', 'fermi,dip',
    xyz, alpha_0, omega, k_grid, uc,
    r_vdw=R_vdw, beta=1., a=6.
)[1]
plt.plot(*chain.from_iterable(
    (*zip(*sorted(zip(k_grid[:, 0], omegas[:, i]))), 'b-')
    for i in range(omegas.shape[1])
))
mbd.param_k_grid_shift = 0.5
ns_kpt = [3, 4, 5, 6, 7, 8]
enes_periodic = []
for n_kpt in ns_kpt:
    k_grid = mbd.make_k_grid(mbd.make_g_grid(n_kpt, n_kpt, n_kpt), uc)
    ene = mbd.get_reciprocal_mbd_energy(
        'R', 'fermi,dip',
        xyz, alpha_0, omega, k_grid, uc,
        r_vdw=R_vdw, beta=1., a=6.
    )[0]
    enes_periodic.append(ene)
ns_cell = [3, 4, 5, 6, 7]
enes_supercell = []
for n_cell in ns_cell:
    ene = mbd.get_supercell_mbd_energy(
        'C', 'fermi,dip',
        xyz, alpha_0, omega, uc, (n_cell, n_cell, n_cell),
        r_vdw=R_vdw, beta=1., a=6.
    )[0]
    enes_supercell.append(ene)
plt.plot(ns_cell, enes_supercell, 'b', ns_kpt, enes_periodic, 'r')
mbd.get_ts_energy('C', 'fermi2', xyz, C6, alpha_0, r_vdw=R_vdw, s_r=1., d=6., unit_cell=uc)<jupyter_output><empty_output><jupyter_text>Graphene<jupyter_code>species = ['C', 'C']
xyz = [(0., 0., 0.), (2.46000413, 1.42034734, 0.)]/bohr
uc = np.array([
    (2.45999892, 0.00000000, 0.00000000),
    (1.22999946, 2.13042155, 0.00000000),
    (0.00000000, 0.00000000, 100.00000000)
])/bohr
mbd.param_vacuum_axis = (False, False, True)
mbd.param_k_grid_shift = 0.
alpha_0, C6, R_vdw = pymbd.get_free_atom_data(species)
omega = mbd.omega_eff(C6, alpha_0)
k_grid = mbd.make_k_grid(mbd.make_g_grid(200, 1, 1), uc)
omegas = mbd.get_reciprocal_mbd_energy(
    'REV', 'fermi,dip',
    xyz, alpha_0, omega, k_grid, uc,
    r_vdw=R_vdw, beta=1., a=6.
)[1]
plt.plot(*chain.from_iterable(
    (*zip(*sorted(zip(k_grid[:, 0], omegas[:, i]))), 'b-')
    for i in range(omegas.shape[1])
))
ns_kpt = [4, 6, 8, 10, 15, 20, 30]
enes_periodic = []
for n_kpt in ns_kpt:
    k_grid = mbd.make_k_grid(mbd.make_g_grid(n_kpt, n_kpt, 1), uc)
    ene = mbd.get_reciprocal_mbd_energy(
        'R', 'fermi,dip',
        xyz, alpha_0, omega, k_grid, uc,
        r_vdw=R_vdw, beta=1., a=6.
    )[0]
    enes_periodic.append(ene)
ns_cell = [5, 7, 9, 11, 13, 17]
enes_supercell = []
for n_cell in ns_cell:
    ene = mbd.get_supercell_mbd_energy(
        'C', 'fermi,dip',
        xyz, alpha_0, omega, uc, (n_cell, n_cell, 1),
        r_vdw=R_vdw, beta=1., a=6.
    )[0]
    enes_supercell.append(ene)
plt.plot(ns_cell, enes_supercell, 'b', ns_kpt, enes_periodic, 'r')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1950632911392405, 'fraction_numerical': 0.05658227848101266, 'mean_word_length': 3.8651477832512313, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '16831', 'license': 'MIT', 'n_tokens_mistral': 4215, 'n_tokens_neox': 3790, 'n_words': 722, 'path': 'examples/advanced.ipynb', 'repo_name': 'nickcafferry/Machine-Learning-in-the-Molecular-Sciences', 'size': '7905'}