diff --git a/edrixs/.buildinfo b/edrixs/.buildinfo deleted file mode 100644 index 20e35b6a65..0000000000 --- a/edrixs/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 01a62a0f69c479b31fd5adcdcdd8ecb3 -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/edrixs/.nojekyll b/edrixs/.nojekyll deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/edrixs/_downloads/035c26b1ad9f588aad9be97f7dfeb5dd/example_5_charge_transfer.zip b/edrixs/_downloads/035c26b1ad9f588aad9be97f7dfeb5dd/example_5_charge_transfer.zip deleted file mode 100644 index 0df8bcd62a..0000000000 Binary files a/edrixs/_downloads/035c26b1ad9f588aad9be97f7dfeb5dd/example_5_charge_transfer.zip and /dev/null differ diff --git a/edrixs/_downloads/0364c1895f5affc284d287f8f478b3cd/example_5_transitions.zip b/edrixs/_downloads/0364c1895f5affc284d287f8f478b3cd/example_5_transitions.zip deleted file mode 100644 index dde585f756..0000000000 Binary files a/edrixs/_downloads/0364c1895f5affc284d287f8f478b3cd/example_5_transitions.zip and /dev/null differ diff --git a/edrixs/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip b/edrixs/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip deleted file mode 100644 index 6a9ea8da8e..0000000000 Binary files a/edrixs/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip and /dev/null differ diff --git a/edrixs/_downloads/0a845d61ac6f95bfa21dbe3d1909550a/example_5_Hubbard_dimer.py b/edrixs/_downloads/0a845d61ac6f95bfa21dbe3d1909550a/example_5_Hubbard_dimer.py deleted file mode 100644 index 2e1ef44302..0000000000 --- a/edrixs/_downloads/0a845d61ac6f95bfa21dbe3d1909550a/example_5_Hubbard_dimer.py +++ /dev/null @@ -1,176 +0,0 @@ -#!/usr/bin/env python -""" -Hubbard Dimer -===================================== -This exercise will demonstrate how to handle hopping and multi-site problems within -edrixs using the example of a Hubbard dimer. We want to solve the equation - - .. math:: - \\begin{equation} - \\hat{H} = \\sum_{i,j} \\sum_{\\sigma} t_{i,j} \\hat{f}^{\\dagger}_{i,\\sigma} \\hat{f}_{j, \\sigma} - + U \\sum_{i} \\hat{n}_{i,\\uparrow}\\hat{n}_{i,\\downarrow}, - \\end{equation} - -which involves two sites labeled with indices :math:`i` or :math:`j` with two -electrons of spin :math:`\\sigma\\in{\\uparrow,\\downarrow}`. :math:`t_{i,j}` -is the hopping between sites, :math:`\\hat{f}^{\\dagger}_{i,\\sigma}` is the -creation operators, and -:math:`\\hat{n}^{\\dagger}_{i,\\sigma}=\\hat{f}^{\\dagger}_{i,\\sigma}\\hat{f}_{i,\\sigma}` -is the number operator. The main task is to represent this Hamiltonian and -the related spin operator using the EDRIXS two-fermion and four-fermion form -where :math:`\\alpha,\\beta,\\delta,\\gamma` are the indices of the single -particle basis. - - .. math:: - \\begin{equation} - \\hat{H} = \\sum_{\\alpha,\\beta} t_{\\alpha,\\beta} \\hat{f}^{\\dagger}_{\\alpha} \\hat{f}_{\\beta} - + \\sum_{\\alpha,\\beta,\\gamma,\\delta} U_{\\alpha,\\beta,\\gamma,\\delta} - \\hat{f}^{\\dagger}_{\\alpha}\\hat{f}^{\\dagger}_{\\beta}\\hat{f}_{\\gamma}\\hat{f}_{\\delta}. - \\end{equation} - -""" - -################################################################################ -# Initialize matrices -# ------------------------------------------------------------------------------ -# We start by noting that each of the two sites is like an :math:`l=0` -# :math:`s`-orbital with two spin-orbitals each. We will include -# two electron occupation and build the Fock basis. -import numpy as np -import matplotlib.pyplot as plt -import scipy -import edrixs -np.set_printoptions(precision=4) - - -ll = 0 -case = 's' -norb = 4 -noccu = 2 -basis = edrixs.get_fock_bin_by_N(norb, noccu) - -################################################################################ -# Create function to populate and diagonalize matrices -# ------------------------------------------------------------------------------ -# The Coulomb and hopping matrices :code:`umat` and :code:`emat` will be -# represented by :math:`4\times4\times4\times4` and :math:`4\times4` matrices, -# respectively. Note that we needed to specify -# that these are, in general, complex, although -# they happen to contain only real numbers in this case. We follow the convention -# that these are ordered first by site and then by spin: -# :math:`|0\uparrow>, |0\downarrow>, |1\uparrow>, |1\downarrow>`. -# Consequently the :math:`2\times2` and :math:`2\times2\times2\times2` block -# diagonal structures of the matrices will contain the on-site interactions. -# The converse is true for the hopping between the sites. -# From here let us generate a function to build and diagonalize the Hamiltonian. -# We need to generate the Coulomb matrix for the on-site interactions and -# apply it to the block diagonal. The hopping connects off-site indices with -# the same spin. -def diagonalize(U, t, extra_emat=None): - """Diagonalize 2 site Hubbard Hamiltonian""" - umat = np.zeros((norb, norb, norb, norb), dtype=np.complex128) - emat = np.zeros((norb, norb), dtype=np.complex128) - U_mat_1site = edrixs.get_umat_slater('s', U) - umat[:2, :2, :2, :2,] = umat[2:, 2:, 2:, 2:] = U_mat_1site - emat[2, 0] = emat[3, 1] = emat[0, 2] = emat[1, 3] = t - - if extra_emat is not None: - emat = emat + extra_emat - - H = (edrixs.build_opers(2, emat, basis) - + edrixs.build_opers(4, umat, basis)) - - e, v = scipy.linalg.eigh(H) - return e, v - -################################################################################ -# The large :math:`U` limit -# ------------------------------------------------------------------------------ -# Let us see what happens with :math:`U \gg t`. -e, v = diagonalize(1000, 1) -print("Energies are") -print(e) - -################################################################################ -# To analyze what is going on we can determine the spin expectation values -# of the cluster. Building the operators follows the same form as the -# Hamiltonian and the previous example. -spin_mom_one_site = edrixs.get_spin_momentum(ll) -spin_mom = np.zeros((3, norb, norb), dtype=np.complex128) -spin_mom[:, :2, :2] = spin_mom[:, 2:, 2:] = spin_mom_one_site - -opS = edrixs.build_opers(2, spin_mom, basis) -opS_squared = (np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) - + np.dot(opS[2], opS[2])) - -################################################################################ -# This time let us include a tiny magnetic field along the :math:`z`-axis, so -# that we have a well-defined measurement axis and print out the expectation -# values. -zeeman = np.zeros((norb, norb), dtype=np.complex128) -zeeman[:2, :2] = zeeman[2:, 2:] = 1e-8*spin_mom_one_site[2] -e, v = diagonalize(1000, 1, extra_emat=zeeman) - -Ssq_exp = edrixs.cb_op(opS_squared, v).diagonal().real -Sz_exp = edrixs.cb_op(opS[2], v).diagonal().real - -header = "{:<10s}\t{:<6s}\t{:<6s}" -print(header.format("E", "S(S+1)", "")) -for i in range(len(e)): - print("{:<2f}\t{:.1f}\t{:.1f}".format(e[i], Ssq_exp[i], Sz_exp[i])) - -################################################################################ -# For :math:`U \gg t` the two states with double occupancy acquire an energy of -# approximately :math:`U`. The low energy states are a :math:`S=0` singlet and -# and :math:`S=1` triplet, which are split by :math:`4t^2/U`, which is the -# magnetic exchange term. - -################################################################################ -# :math:`U` dependence -# ------------------------------------------------------------------------------ -# Let us plot the changes in energy with :math:`U`. -plt.figure() - -t = 1 -Us = np.linspace(0.01, 10, 50) -Es = np.array([diagonalize(U, t, extra_emat=zeeman)[0] for U in Us]) - -plt.plot(Us/t, Es/t) -plt.xlabel('U/t') -plt.ylabel('Eigenstate energies/t') -plt.show() - -################################################################################ -# To help interpret this, we can represent the eigenvectors in terms of a sum -# of the single particle states. - -def get_single_particle_repesentations(v): - reps = [] - for i in range(6): - rep = sum([vec*weight for weight, vec - in zip(v[:, i], np.array(basis))]) - reps.append(rep) - - return np.array(reps) - -t = 1 -for U in [10000, 0.0001]: - e, v = diagonalize(U, t, extra_emat=zeeman) - repesentations = get_single_particle_repesentations(v) - print("For U={} t={} states are".format(U, t)) - print(repesentations.round(3).real) - print("\n") - -################################################################################ -# For :math:`U \gg t` the ground state maximizes its magnetic exchange -# energy saving. In the :math:`U \ll t` condition the ground state maximizes -# its kinetic energy saving. Since both states share the same parity, the -# cross-over between them is smooth. This type of physics is at play in current -# research on quantum materials [1]_ [2]_. - -############################################################################## -# -# .. rubric:: Footnotes -# -# .. [1] Y. Wang et al., `Phys. Rev. Lett. 122, 106401 (2019) `_. -# .. [2] A. Revelli et al., `Science Advances 5, eaav4020 (2019) `_. diff --git a/edrixs/_downloads/18e0b10c5dbad68c0748b21d78984496/example_6_Hubbard_dimer.py b/edrixs/_downloads/18e0b10c5dbad68c0748b21d78984496/example_6_Hubbard_dimer.py deleted file mode 100644 index 2e1ef44302..0000000000 --- a/edrixs/_downloads/18e0b10c5dbad68c0748b21d78984496/example_6_Hubbard_dimer.py +++ /dev/null @@ -1,176 +0,0 @@ -#!/usr/bin/env python -""" -Hubbard Dimer -===================================== -This exercise will demonstrate how to handle hopping and multi-site problems within -edrixs using the example of a Hubbard dimer. We want to solve the equation - - .. math:: - \\begin{equation} - \\hat{H} = \\sum_{i,j} \\sum_{\\sigma} t_{i,j} \\hat{f}^{\\dagger}_{i,\\sigma} \\hat{f}_{j, \\sigma} - + U \\sum_{i} \\hat{n}_{i,\\uparrow}\\hat{n}_{i,\\downarrow}, - \\end{equation} - -which involves two sites labeled with indices :math:`i` or :math:`j` with two -electrons of spin :math:`\\sigma\\in{\\uparrow,\\downarrow}`. :math:`t_{i,j}` -is the hopping between sites, :math:`\\hat{f}^{\\dagger}_{i,\\sigma}` is the -creation operators, and -:math:`\\hat{n}^{\\dagger}_{i,\\sigma}=\\hat{f}^{\\dagger}_{i,\\sigma}\\hat{f}_{i,\\sigma}` -is the number operator. The main task is to represent this Hamiltonian and -the related spin operator using the EDRIXS two-fermion and four-fermion form -where :math:`\\alpha,\\beta,\\delta,\\gamma` are the indices of the single -particle basis. - - .. math:: - \\begin{equation} - \\hat{H} = \\sum_{\\alpha,\\beta} t_{\\alpha,\\beta} \\hat{f}^{\\dagger}_{\\alpha} \\hat{f}_{\\beta} - + \\sum_{\\alpha,\\beta,\\gamma,\\delta} U_{\\alpha,\\beta,\\gamma,\\delta} - \\hat{f}^{\\dagger}_{\\alpha}\\hat{f}^{\\dagger}_{\\beta}\\hat{f}_{\\gamma}\\hat{f}_{\\delta}. - \\end{equation} - -""" - -################################################################################ -# Initialize matrices -# ------------------------------------------------------------------------------ -# We start by noting that each of the two sites is like an :math:`l=0` -# :math:`s`-orbital with two spin-orbitals each. We will include -# two electron occupation and build the Fock basis. -import numpy as np -import matplotlib.pyplot as plt -import scipy -import edrixs -np.set_printoptions(precision=4) - - -ll = 0 -case = 's' -norb = 4 -noccu = 2 -basis = edrixs.get_fock_bin_by_N(norb, noccu) - -################################################################################ -# Create function to populate and diagonalize matrices -# ------------------------------------------------------------------------------ -# The Coulomb and hopping matrices :code:`umat` and :code:`emat` will be -# represented by :math:`4\times4\times4\times4` and :math:`4\times4` matrices, -# respectively. Note that we needed to specify -# that these are, in general, complex, although -# they happen to contain only real numbers in this case. We follow the convention -# that these are ordered first by site and then by spin: -# :math:`|0\uparrow>, |0\downarrow>, |1\uparrow>, |1\downarrow>`. -# Consequently the :math:`2\times2` and :math:`2\times2\times2\times2` block -# diagonal structures of the matrices will contain the on-site interactions. -# The converse is true for the hopping between the sites. -# From here let us generate a function to build and diagonalize the Hamiltonian. -# We need to generate the Coulomb matrix for the on-site interactions and -# apply it to the block diagonal. The hopping connects off-site indices with -# the same spin. -def diagonalize(U, t, extra_emat=None): - """Diagonalize 2 site Hubbard Hamiltonian""" - umat = np.zeros((norb, norb, norb, norb), dtype=np.complex128) - emat = np.zeros((norb, norb), dtype=np.complex128) - U_mat_1site = edrixs.get_umat_slater('s', U) - umat[:2, :2, :2, :2,] = umat[2:, 2:, 2:, 2:] = U_mat_1site - emat[2, 0] = emat[3, 1] = emat[0, 2] = emat[1, 3] = t - - if extra_emat is not None: - emat = emat + extra_emat - - H = (edrixs.build_opers(2, emat, basis) - + edrixs.build_opers(4, umat, basis)) - - e, v = scipy.linalg.eigh(H) - return e, v - -################################################################################ -# The large :math:`U` limit -# ------------------------------------------------------------------------------ -# Let us see what happens with :math:`U \gg t`. -e, v = diagonalize(1000, 1) -print("Energies are") -print(e) - -################################################################################ -# To analyze what is going on we can determine the spin expectation values -# of the cluster. Building the operators follows the same form as the -# Hamiltonian and the previous example. -spin_mom_one_site = edrixs.get_spin_momentum(ll) -spin_mom = np.zeros((3, norb, norb), dtype=np.complex128) -spin_mom[:, :2, :2] = spin_mom[:, 2:, 2:] = spin_mom_one_site - -opS = edrixs.build_opers(2, spin_mom, basis) -opS_squared = (np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) - + np.dot(opS[2], opS[2])) - -################################################################################ -# This time let us include a tiny magnetic field along the :math:`z`-axis, so -# that we have a well-defined measurement axis and print out the expectation -# values. -zeeman = np.zeros((norb, norb), dtype=np.complex128) -zeeman[:2, :2] = zeeman[2:, 2:] = 1e-8*spin_mom_one_site[2] -e, v = diagonalize(1000, 1, extra_emat=zeeman) - -Ssq_exp = edrixs.cb_op(opS_squared, v).diagonal().real -Sz_exp = edrixs.cb_op(opS[2], v).diagonal().real - -header = "{:<10s}\t{:<6s}\t{:<6s}" -print(header.format("E", "S(S+1)", "")) -for i in range(len(e)): - print("{:<2f}\t{:.1f}\t{:.1f}".format(e[i], Ssq_exp[i], Sz_exp[i])) - -################################################################################ -# For :math:`U \gg t` the two states with double occupancy acquire an energy of -# approximately :math:`U`. The low energy states are a :math:`S=0` singlet and -# and :math:`S=1` triplet, which are split by :math:`4t^2/U`, which is the -# magnetic exchange term. - -################################################################################ -# :math:`U` dependence -# ------------------------------------------------------------------------------ -# Let us plot the changes in energy with :math:`U`. -plt.figure() - -t = 1 -Us = np.linspace(0.01, 10, 50) -Es = np.array([diagonalize(U, t, extra_emat=zeeman)[0] for U in Us]) - -plt.plot(Us/t, Es/t) -plt.xlabel('U/t') -plt.ylabel('Eigenstate energies/t') -plt.show() - -################################################################################ -# To help interpret this, we can represent the eigenvectors in terms of a sum -# of the single particle states. - -def get_single_particle_repesentations(v): - reps = [] - for i in range(6): - rep = sum([vec*weight for weight, vec - in zip(v[:, i], np.array(basis))]) - reps.append(rep) - - return np.array(reps) - -t = 1 -for U in [10000, 0.0001]: - e, v = diagonalize(U, t, extra_emat=zeeman) - repesentations = get_single_particle_repesentations(v) - print("For U={} t={} states are".format(U, t)) - print(repesentations.round(3).real) - print("\n") - -################################################################################ -# For :math:`U \gg t` the ground state maximizes its magnetic exchange -# energy saving. In the :math:`U \ll t` condition the ground state maximizes -# its kinetic energy saving. Since both states share the same parity, the -# cross-over between them is smooth. This type of physics is at play in current -# research on quantum materials [1]_ [2]_. - -############################################################################## -# -# .. rubric:: Footnotes -# -# .. [1] Y. Wang et al., `Phys. Rev. Lett. 122, 106401 (2019) `_. -# .. [2] A. Revelli et al., `Science Advances 5, eaav4020 (2019) `_. diff --git a/edrixs/_downloads/1fb87beae3a9a15ab459eecd26981314/example_0_ed_calculator.zip b/edrixs/_downloads/1fb87beae3a9a15ab459eecd26981314/example_0_ed_calculator.zip deleted file mode 100644 index 06f2796154..0000000000 Binary files a/edrixs/_downloads/1fb87beae3a9a15ab459eecd26981314/example_0_ed_calculator.zip and /dev/null differ diff --git a/edrixs/_downloads/2e37cda7a0a2ee2e93473633fae9ca50/example_1_crystal_field.zip b/edrixs/_downloads/2e37cda7a0a2ee2e93473633fae9ca50/example_1_crystal_field.zip deleted file mode 100644 index 5a9af076f7..0000000000 Binary files a/edrixs/_downloads/2e37cda7a0a2ee2e93473633fae9ca50/example_1_crystal_field.zip and /dev/null differ diff --git a/edrixs/_downloads/37c91286a883108afd6bd1f2ad87920c/example_3_AIM_XAS.ipynb b/edrixs/_downloads/37c91286a883108afd6bd1f2ad87920c/example_3_AIM_XAS.ipynb deleted file mode 100644 index a092051d69..0000000000 --- a/edrixs/_downloads/37c91286a883108afd6bd1f2ad87920c/example_3_AIM_XAS.ipynb +++ /dev/null @@ -1,453 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Anderson impurity model for NiO XAS\nHere we calculate the $L$-edge XAS spectrum of an Anderson impurity model,\nwhich is sometimes also called a charge-transfer multiplet model. This model\nconsiders a set of correlated orbitals, often called the impurity or metal\nstates, that hybridize with a set of uncorrelated orbitals, often called the\nligands or bath states. Everyone's favorite test case for x-ray spectroscopic\ncalculations of the Anderson impurity model is NiO and we won't risk being\noriginal! This means that our correlated states will\nbe the Ni $3d$ orbitals and the uncorrelated states come from O\n$2p$ orbitals. The fact that we include these interactions means that our\nspectrum can include processes where electrons transition from the bath to the\nimpurity, as such the Anderson Impurity Model is often more accurate than atomic\nmodels, especially if the material has strong covalency.\n\nWhen defining the bath states, it is useful to use the so-called\nsymmetry adapted linear combinations of orbitals as the basis. These states\ntake into account the symmetry relationships between the different bath atom\norbitals and the fact that there are bath orbital combinations that do not\ninteract with the impurity by symmetry. By doing this the problem can be\nrepresented with fewer orbitals, which makes the calculation far more efficient.\nThe standard EDRIXS solver that we will use assumes that the bath states are\nrepresented by an integer number of bath sites set by :code:`nbath`, each of\nwhich hosts the same number of spin-orbits as the impurity e.g. 10 for a\n$d$-electron material.\n\nNiO has a rocksalt structure in which all Ni atoms are surrounded by six O\natoms. This NiO cluster used to simulate the\ncrystal would then contain 10 Ni $3d$ spin-orbitals and $6$\nspin-orbitals per O $\\times 6$ O atoms $=36$ oxygen\nspin-orbitals. As explained by, for example, Maurits Haverkort\net al. in [1]_ symmetry allows us to represent the bath with 10 symmetry\nadapted linear combinations of the different O $p_x, p_y, p_z$ states.\nThe crystal field and hopping parameters for\nsuch a calculation can be obtained by post-processing DFT calculations. We will\nuse values for NiO from [1]_. If you use values from a paper the relevant\nreferences should, of course, be cited.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport numpy as np\nimport matplotlib.pyplot as plt" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Number of electrons\nWhen formulating problems of this type, one usually thinks of a nominal\nvalence for the impurity atom in this case :code:`nd = 8` and assume that the\nbath is full. The solver that we will\nuse can simulate multiple bath sites. In our case we specify\n:code:`nbath = 1` sites. Electrons will be able to transition from O to Ni\nduring our calculation, but the total number of valance electrons\n:code:`v_noccu` will be conserved.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "nd = 8\nnorb_d = 10\nnorb_bath = 10\nnbath = 1\nv_noccu = nd + nbath*norb_d\nshell_name = ('d', 'p') # valence and core shells for XAS calculation" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Coulomb interactions\nThe atomic Coulomb interactions are usually initialized based on Hartree-Fock\ncalculations from, for example,\n[Cowan's code](https://www.tcd.ie/Physics/people/Cormac.McGuinness/Cowan/).\nedrixs has a database of these.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "info = edrixs.utils.get_atom_data('Ni', '3d', nd, edge='L3')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The atomic values are typically scaled to account for screening in the solid.\nHere we use 80% scaling. Let's write these out in full, so that nothing is\nhidden. Values for $U_{dd}$ and $U_{dp}$ are those of Ref. [1]_\nobtained by comparing theory and experiment [2]_ [3]_.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "scale_dd = 0.8\nF2_dd = info['slater_i'][1][1] * scale_dd\nF4_dd = info['slater_i'][2][1] * scale_dd\nU_dd = 7.3\nF0_dd = U_dd + edrixs.get_F0('d', F2_dd, F4_dd)\n\nscale_dp = 0.8\nF2_dp = info['slater_n'][4][1] * scale_dp\nG1_dp = info['slater_n'][5][1] * scale_dp\nG3_dp = info['slater_n'][6][1] * scale_dp\nU_dp = 8.5\nF0_dp = U_dp + edrixs.get_F0('dp', G1_dp, G3_dp)\n\nslater = ([F0_dd, F2_dd, F4_dd], # initial\n [F0_dd, F2_dd, F4_dd, F0_dp, F2_dp, G1_dp, G3_dp]) # with core hole" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Energy of the bath states\nIn the notation used in EDRIXS, $\\Delta$ sets the energy difference\nbetween the bath and impurity states. $\\Delta$ is defined in the atomic\nlimit without crystal field (i.e. in terms of the centers of the impurity and\nbath states before hybridization is considered) as the energy for a\n$d^{n_d} \\rightarrow d^{n_d + 1} \\underline{L}$ transition.\nNote that as electrons are moved one has to pay energy\ncosts associated with the Coulomb interactions. The\nenergy splitting between the bath and impurity is consequently not simply\n$\\Delta$. One must therefore determine the energies by solving\na set of linear equations. See the `edrixs.utils functions `\nfor details. We can call these functions to get the impurity energy\n$E_d$, bath energy $E_L$, impurity energy with a core hole\n$E_{dc}$, bath energy with a core hole $E_{Lc}$ and the\ncore hole energy $E_p$. The\n:code:`if __name__ == '__main__'` code specifies that this command\nshould only be executed if the file is explicitly run.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "Delta = 4.7\nE_d, E_L = edrixs.CT_imp_bath(U_dd, Delta, nd)\nE_dc, E_Lc, E_p = edrixs.CT_imp_bath_core_hole(U_dd, U_dp, Delta, nd)\nmessage = (\"E_d = {:.3f} eV\\n\"\n \"E_L = {:.3f} eV\\n\"\n \"E_dc = {:.3f} eV\\n\"\n \"E_Lc = {:.3f} eV\\n\"\n \"E_p = {:.3f} eV\\n\")\nif __name__ == '__main__':\n print(message.format(E_d, E_L, E_dc, E_Lc, E_p))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The spin-orbit coupling for the valence electrons in the ground state, the\nvalence electrons with the core hole present, and for the core hole itself\nare initialized using the atomic values.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "zeta_d_i = info['v_soc_i'][0]\nzeta_d_n = info['v_soc_n'][0]\nc_soc = info['c_soc']" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Build matrices describing interactions\nedrixs uses complex spherical harmonics as its default basis set. If we want to\nuse another basis set, we need to pass a matrix to the solver, which transforms\nfrom complex spherical harmonics into the basis we use.\nThe solver will use this matrix when implementing the Coulomb interactions\nusing the :code:`slater` list of Coulomb parameters.\nHere it is easiest to\nuse real harmonics. We make the complex harmonics to real harmonics transformation\nmatrix via\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "trans_c2n = edrixs.tmat_c2r('d',True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The crystal field and SOC needs to be passed to the solver by constructing\nthe impurity matrix in the real harmonic basis. For cubic symmetry, we need\nto set the energies of the orbitals along the\ndiagonal of the matrix. These need to be in pairs as there are two\nspin-orbitals for each orbital energy. Python\n[list comprehension](https://realpython.com/list-comprehension-python/)\nand\n[numpy indexing](https://numpy.org/doc/stable/reference/arrays.indexing.html)\nare used here. See `sphx_glr_auto_examples_example_1_crystal_field.py`\nfor more details if needed.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ten_dq = 0.56\nCF = np.zeros((norb_d, norb_d), dtype=complex)\ndiagonal_indices = np.arange(norb_d)\n\norbital_energies = np.array([e for orbital_energy in\n [+0.6 * ten_dq, # dz2\n -0.4 * ten_dq, # dzx\n -0.4 * ten_dq, # dzy\n +0.6 * ten_dq, # dx2-y2\n -0.4 * ten_dq] # dxy)\n for e in [orbital_energy]*2])\n\n\nCF[diagonal_indices, diagonal_indices] = orbital_energies" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The valence band SOC is constructed in the normal way and transformed into the\nreal harmonic basis.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "soc = edrixs.cb_op(edrixs.atom_hsoc('d', zeta_d_i), edrixs.tmat_c2r('d', True))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The total impurity matrices for the ground and core-hole states are then\nthe sum of crystal field and spin-orbit coupling. We further needed to apply\nan energy shift along the matrix diagonal, which we do using the\n:code:`np.eye` function which creates a diagonal matrix of ones.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "E_d_mat = E_d*np.eye(norb_d)\nE_dc_mat = E_dc*np.eye(norb_d)\nimp_mat = CF + soc + E_d_mat\nimp_mat_n = CF + soc + E_dc_mat" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The energy level of the bath(s) is described by a matrix where the row index\ndenotes which bath and the column index denotes which orbital. Here we have\nonly one bath, with 10 spin-orbitals. We initialize the matrix to\n:code:`norb_d` and then split the energies according to :code:`ten_dq_bath`.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ten_dq_bath = 1.44\nbath_level = np.full((nbath, norb_d), E_L, dtype=complex)\nbath_level[0, :2] += ten_dq_bath*.6 # 3z2-r2\nbath_level[0, 2:6] -= ten_dq_bath*.4 # zx/yz\nbath_level[0, 6:8] += ten_dq_bath*.6 # x2-y2\nbath_level[0, 8:] -= ten_dq_bath*.4 # xy\nbath_level_n = np.full((nbath, norb_d), E_Lc, dtype=complex)\nbath_level_n[0, :2] += ten_dq_bath*.6 # 3z2-r2\nbath_level_n[0, 2:6] -= ten_dq_bath*.4 # zx/yz\nbath_level_n[0, 6:8] += ten_dq_bath*.6 # x2-y2\nbath_level_n[0, 8:] -= ten_dq_bath*.4 # xy" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The hybridization matrix describes the hopping between the bath\nand the impurity. This is called either $V$ or $T$ in the\nliterature and matrix sign can either be positive or negative based.\nThis is the same shape as the bath matrix. We take our\nvalues from Maurits Haverkort et al.'s DFT calculations [1]_.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "Veg = 2.06\nVt2g = 1.21\n\nhyb = np.zeros((nbath, norb_d), dtype=complex)\nhyb[0, :2] = Veg # 3z2-r2\nhyb[0, 2:6] = Vt2g # zx/yz\nhyb[0, 6:8] = Veg # x2-y2\nhyb[0, 8:] = Vt2g # xy" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We now need to define the parameters describing the XAS. X-ray polarization\ncan be linear, circular or isotropic (appropriate for a powder).\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "poltype_xas = [('isotropic', 0)]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "edrixs uses the temperature in Kelvin to work out the population of the low-lying\nstates via a Boltzmann distribution.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "temperature = 300" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The x-ray beam is specified by the incident angle and azimuthal angle in radians\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "thin = 0 / 180.0 * np.pi\nphi = 0.0" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "these are with respect to the crystal field $z$ and $x$ axes\nwritten above. (That is, unless you specify the :code:`loc_axis` parameter\ndescribed in the :code:`edrixs.xas_siam_fort` function documentation.)\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The spectrum in the raw calculation is offset by the energy involved with the\ncore hole state, which is roughly $5 E_p$, so we offset the spectrum by\nthis and use :code:`om_shift` as an adjustable parameters for comparing\ntheory to experiment. We also use this to specify :code:`ominc_xas`\nthe range we want to compute the spectrum over. The core hole lifetime\nbroadening also needs to be set via :code:`gamma_c_stat`.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "om_shift = 857.6\nc_level = -om_shift - 5*E_p\nominc_xas = om_shift + np.linspace(-15, 25, 1000)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The final state broadening is specified in terms of half-width at half-maximum\nYou can either pass a constant value or an array the same size as\n:code:`om_shift` with varying values to simulate, for example, different state\nlifetimes for higher energy states.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "gamma_c = np.full(ominc_xas.shape, 0.48/2)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Magnetic field is a three-component vector in eV specified with respect to the\nsame local axis as the x-ray beam. Since we are considering a powder here\nwe create an isotropic normalized vector. :code:`on_which = 'both'` specifies to\napply the operator to the total spin plus orbital angular momentum as is\nappropriate for a physical external magnetic field. You can use\n:code:`on_which = 'spin'` to apply the operator to spin in order to simulate\nmagnetic order in the sample. The value of the Bohr Magneton can\nbe useful for converting here $\\mu_B = 5.7883818012\\times 10^{\u22125}$.\nFor this example, we will account for magnetic order in the sample by\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ext_B = np.array([0.00, 0.00, 0.12])\non_which = 'spin'" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The number crunching uses\n[mpi4py](https://mpi4py.readthedocs.io/en/stable/). You can safely ignore\nthis for most purposes, but see\n[Y. L. Wang et al., Computer Physics Communications 243, 151-165 (2019)](https://doi.org/10.1016/j.cpc.2019.04.018)\nif you would like more details.\nThe main thing to remember is that you should call this script via::\n\n mpirun -n python example_AIM_XAS.py\n\nwhere :code:`` is the number of processors\nyou'd like to us. Running it as normal will work, it will just be slower.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "if __name__ == '__main__':\n from mpi4py import MPI\n comm = MPI.COMM_WORLD\n rank = comm.Get_rank()\n size = comm.Get_size()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Calling the :code:`edrixs.ed_siam_fort` solver will find the ground state and\nwrite input files, *hopping_i.in*, *hopping_n.in*, *coulomb_i.in*, *coulomb_n.in*\nfor following XAS (or RIXS) calculation. We need to specify :code:`siam_type=0`\nwhich says that we will pass *imp_mat*, *bath_level* and *hyb*.\nWe need to specify :code:`do_ed = 1`. For this example, we cannot use\n:code:`do_ed = 0` for a ground state search as we have set the impurity and\nbath energy levels artificially, which means edrixs will have trouble to know\nwhich subspace to search to find the ground state.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "if __name__ == '__main__':\n do_ed = 1\n eval_i, denmat, noccu_gs = edrixs.ed_siam_fort(\n comm, shell_name, nbath, siam_type=0, imp_mat=imp_mat, imp_mat_n=imp_mat_n,\n bath_level=bath_level, bath_level_n=bath_level_n, hyb=hyb, c_level=c_level,\n c_soc=c_soc, slater=slater, ext_B=ext_B,\n on_which=on_which, trans_c2n=trans_c2n, v_noccu=v_noccu, do_ed=do_ed,\n ed_solver=2, neval=50, nvector=3, ncv=100, idump=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let's check that we have all the electrons we think we have and print how\nthe electron are distributed between the Ni (impurity) and O (bath).\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "if __name__ == '__main__':\n assert np.abs(noccu_gs - v_noccu) < 1e-6\n impurity_occupation = np.sum(denmat[0].diagonal()[0:norb_d]).real\n bath_occupation = np.sum(denmat[0].diagonal()[norb_d:]).real\n print('Impurity occupation = {:.6f}\\n'.format(impurity_occupation))\n print('Bath occupation = {:.6f}\\n'.format(bath_occupation))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We see that 0.18 electrons move from the O to the Ni in the ground state.\n\nWe can now construct the XAS spectrum edrixs by applying a transition\noperator to create the excited state. We need to be careful to specify how\nmany of the low energy states are thermally populated. In this case\n:code:`num_gs=3`. This can be determined by inspecting the function output.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "if __name__ == '__main__':\n xas, xas_poles = edrixs.xas_siam_fort(\n comm, shell_name, nbath, ominc_xas, gamma_c=gamma_c, v_noccu=v_noccu, thin=thin,\n phi=phi, num_gs=3, nkryl=200, pol_type=poltype_xas, temperature=temperature\n )" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let's plot the data and save it just in case\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "if __name__ == '__main__':\n fig, ax = plt.subplots()\n\n ax.plot(ominc_xas, xas)\n ax.set_xlabel('Energy (eV)')\n ax.set_ylabel('XAS intensity')\n ax.set_title('Anderson impurity model for NiO')\n plt.show()\n\n np.savetxt('xas.dat', np.concatenate((np.array([ominc_xas]).T, xas), axis=1))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ".. rubric:: Footnotes\n\n.. [1] Maurits Haverkort et al\n [Phys. Rev. B 85, 165113 (2012)](https://doi.org/10.1103/PhysRevB.85.165113).\n.. [2] A. E. Bocquet et al.,\n [Phys. Rev. B 53, 1161 (1996)](https://doi.org/10.1103/PhysRevB.53.1161).\n.. [3] Arata Tanaka, and Takeo Jo,\n [J. Phys. Soc. Jpn. 63, 2788-2807(1994)](https://doi.org/10.1143/JPSJ.63.2788).\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.16" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/38cb8f43c9613932eb75463a927ea53c/example_4_GS_analysis.py b/edrixs/_downloads/38cb8f43c9613932eb75463a927ea53c/example_4_GS_analysis.py deleted file mode 100644 index 8ed75d13f0..0000000000 --- a/edrixs/_downloads/38cb8f43c9613932eb75463a927ea53c/example_4_GS_analysis.py +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/env python -""" -Ground state analysis for NiO -================================================================================ -This example follows the :ref:`sphx_glr_auto_examples_example_3_AIM_XAS.py` -example and considers the same model. This time we show how to analyze -the wavevectors in terms of a -:math:`\\alpha |d^8L^{10}> + \\beta |d^9L^9> \\gamma |d^{10}L^8>` -representation. - -In doing this we will go through the exercise of building and diagonalizing -the Hamiltonian in a way that hopefully clarifies how to analyze other -properties of the model. -""" -import edrixs -import numpy as np -import matplotlib.pyplot as plt -import scipy -import example_3_AIM_XAS -import importlib -_ = importlib.reload(example_3_AIM_XAS) - -################################################################################ -# Hamiltonian -# ------------------------------------------------------------------------------ -# edrixs builds model Hamiltonians based on two fermion and four fermion terms. -# The four fermion terms come from Coulomb interactions and will be -# assigned to :code:`umat`. All other interactions contribute to two fermion -# terms in :code:`emat`. -# -# .. math:: -# \begin{equation} -# \hat{H}_{i} = \sum_{\alpha,\beta} t_{\alpha,\beta} -# \hat{f}^{\dagger}_{\alpha} \hat{f}_{\beta} -# + \sum_{\alpha,\beta,\gamma,\delta} U_{\alpha,\beta,\gamma,\delta} -# \hat{f}^{\dagger}_{\alpha}\hat{f}^{\dagger}_{\beta} -# \hat{f}_{\gamma}\hat{f}_{\delta}, -# \end{equation} -# - -################################################################################ -# Import parameters -# ------------------------------------------------------------------------------ -# Let's get the parammeters we need from the -# :ref:`sphx_glr_auto_examples_example_3_AIM_XAS.py` example. We need to -# consider :code:`ntot=20` spin-orbitals -# for this problem. - -from example_3_AIM_XAS import (F0_dd, F2_dd, F4_dd, - nd, norb_d, norb_bath, v_noccu, - imp_mat, bath_level, - hyb, ext_B, trans_c2n) -ntot = 20 -################################################################################ -# Four fermion matrix -# ------------------------------------------------------------------------------ -# The Coulomb interactions in the :math:`d` shell of this problem are described -# by a :math:`10\times10\times10\times10` matrix. We -# need to specify a :math:`20\times20\times20\times 20` matrix since we need to -# include the full problem with :code:`ntot=20` spin-orbitals. The edrixs -# convention is to put the :math:`d` orbitals first, so we assign them to the -# first :math:`10\times10\times10\times 10` indices of the matrix. edrixs -# creates this matrix in the complex harmmonic basis by default. -umat_delectrons = edrixs.get_umat_slater('d', F0_dd, F2_dd, F4_dd) -umat = np.zeros((ntot, ntot, ntot, ntot), dtype=complex) -umat[:norb_d, :norb_d, :norb_d, :norb_d] += umat_delectrons - - -################################################################################ -# Two fermion matrix -# ------------------------------------------------------------------------------ -# Previously we made a :math:`10\times10` two-fermion matrix describing the -# :math:`d`-shell interactions. Keep in mind we did this in the real harmonic -# basis. We need to specify the two-fermion matrix for -# the full problem :math:`20\times20` spin-orbitals in size. -emat_rhb = np.zeros((ntot, ntot), dtype='complex') -emat_rhb[0:norb_d, 0:norb_d] += imp_mat - -################################################################################ -# The :code:`bath_level` energies need to be applied to the diagonal of the -# last :math:`10\times10` region of the matrix. -indx = np.arange(norb_d, norb_d*2) -emat_rhb[indx, indx] += bath_level[0] - -################################################################################ -# The :code:`hyb` terms mix the impurity and bath states and are therefore -# applied to the off-diagonal terms of :code:`emat`. -indx1 = np.arange(norb_d) -indx2 = np.arange(norb_d, norb_d*2) -emat_rhb[indx1, indx2] += hyb[0] -emat_rhb[indx2, indx1] += np.conj(hyb[0]) - -################################################################################ -# We now need to transform into the complex harmonic basis. We assign -# the two diagonal blocks of a :math:`20\times20` matrix to the -# conjugate transpose of the transition matrix. -tmat = np.eye(ntot, dtype=complex) -for i in range(2): - off = i * norb_d - tmat[off:off+norb_d, off:off+norb_d] = np.conj(np.transpose(trans_c2n)) - -emat_chb = edrixs.cb_op(emat_rhb, tmat) - -################################################################################ -# The spin exchange is built from the spin operators and the effective field -# is applied to the :math:`d`-shell region of the matrix. -v_orbl = 2 -sx = edrixs.get_sx(v_orbl) -sy = edrixs.get_sy(v_orbl) -sz = edrixs.get_sz(v_orbl) -zeeman = ext_B[0] * (2 * sx) + ext_B[1] * (2 * sy) + ext_B[2] * (2 * sz) -emat_chb[0:norb_d, 0:norb_d] += zeeman - -################################################################################ -# Build the Fock basis and Hamiltonain and Diagonalize -# ------------------------------------------------------------------------------ -# We create the fock basis and build the Hamiltonian using the full set of -# :math:`20` spin orbitals, specifying that they are occuplied by :math:`18` -# electrons. See the :ref:`sphx_glr_auto_examples_example_0_ed_calculator.py` -# example for more details if needed. We also set the ground state to zero -# energy. -basis = np.array(edrixs.get_fock_bin_by_N(ntot, v_noccu)) -H = (edrixs.build_opers(2, emat_chb, basis) - + edrixs.build_opers(4, umat, basis)) - -e, v = scipy.linalg.eigh(H) -e -= e[0] - -################################################################################ -# State analysis -# ------------------------------------------------------------------------------ -# Now we have all the eigenvectors in the Fock basis, we need to pick out the -# states that have 8, 9 and 10 :math:`d`-electrons, respectively. -# The modulus squared of these coeffcients need to be added up to get -# :math:`\alpha`, :math:`\beta`, and :math:`\gamma`. - -num_d_electrons = basis[:, :norb_d].sum(1) - -alphas = np.sum(np.abs(v[num_d_electrons==8, :])**2, axis=0) -betas = np.sum(np.abs(v[num_d_electrons==9, :])**2, axis=0) -gammas = np.sum(np.abs(v[num_d_electrons==10, :])**2, axis=0) - -################################################################################ -# The ground state is the first entry. -message = "Ground state\nalpha={:.3f}\tbeta={:.3f}\tgamma={:.3f}" -print(message.format(alphas[0], betas[0], gammas[0])) - -################################################################################ -# Plot -# ------------------------------------------------------------------------------ -# Let's look how :math:`\alpha`, :math:`\beta`, and :math:`\gamma` vary with -# energy. - -fig, ax = plt.subplots() - -ax.plot(e, alphas, label=r'$\alpha$ $d^8L^{10}$') -ax.plot(e, betas, label=r'$\beta$ $d^9L^{9}$') -ax.plot(e, gammas, label=r'$\gamma$ $d^{10}L^{8}$') - -ax.set_xlabel('Energy (eV)') -ax.set_ylabel('Population') -ax.set_title('NiO') -ax.legend() -plt.show() - -################################################################################ -# We see that the ligand states are mixed into the ground state, but the -# majority of the weight for the :math:`L^9` and :math:`L^8` states -# live at :math:`\Delta` and :math:`2\Delta`. With a lot of additional -# structure from the other interactions. diff --git a/edrixs/_downloads/3c5626e47a8dbeace785112f693da4eb/example_1_crystal_field.ipynb b/edrixs/_downloads/3c5626e47a8dbeace785112f693da4eb/example_1_crystal_field.ipynb deleted file mode 100644 index 816163e15e..0000000000 --- a/edrixs/_downloads/3c5626e47a8dbeace785112f693da4eb/example_1_crystal_field.ipynb +++ /dev/null @@ -1,305 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Crystal fields\nThis example explains how to implement crystal fields in edrixs.\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We need to import these modules.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport numpy as np\nimport scipy\n\nnp.set_printoptions(precision=2, suppress=True, linewidth=90)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Crystal field matrices\nLet us start by considering the common case of a $d$ atomic shell in a\ncubic crystal field. This is controlled by parameter $10D_q$ and is\ndescribed in terms of a matrix which we will assign to :code:`cfmat`. edrixs\ncan make this matrix via.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ten_dq = 10\ncfmat = edrixs.angular_momentum.cf_cubic_d(ten_dq)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Note this matrix is in a complex harmonic basis $Y^m_l$ where $m$\ngoes from $-l,-l+1,...,l-1, l$. There is an up spin and a down\nspin for each $Y^m_l$. This matrix is not diagonal in the complex\nharmonic basis, but it would be diagonal in the real harmonic basis\n$d_{3z^2-r^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}$.\nLet us diagonalize this matrix as a check and print out the energies\nand their degeneracies.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "e, v = scipy.linalg.eigh(cfmat)\ne = e.round(decimals=6)\nunique_e = np.unique(e)\ndegeneracies = [sum(evalue == e) for evalue in unique_e]\n\nprint(\"E \\tDegeneracy\")\nfor evalue, degenvalue in zip(unique_e, degeneracies):\n print(\"{:.1f}\\t{:.0f}\".format(evalue, degenvalue))\nprint(\"{} distinct energies\".format(len(unique_e)))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This makes sense! We see two different energies split by $10D_q=10$. Let\nus look at the six columns corresponding to the lower energy eigenvalues.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "print(v[:, :6].real)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "These are the set of so-called $t_{2g}$ orbitals, composed of\n$Y^2_2, Y^{-2}_2, Y^{1}_2, Y^{-1}_2$. The rest of the eigenvectors\n(the last four) are\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "print(v[:, 6:].real)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "These are the set of so-called $e_{g}$ orbitals, composed of\n$Y^2_2, Y^{-2}_2, Y^{0}_2$. We can use edrixs to prove that\n:code:`cfmat` would be diagonal in the real\nharmonic basis. An operator $\\hat{O}$ can be transformed into an\noperator in another basis $\\hat{O}^{\\prime}$ using a unitary\ntransformation matrix $T$ as\n\n .. math::\n\n \\hat{O}^{\\prime} = (T)^{\\dagger} \\hat{O} (T).\n\nThis is computed as follows\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "cfmat_rhb = edrixs.cb_op(cfmat, edrixs.tmat_c2r('d', ispin=True))\nprint(cfmat_rhb.real)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "where :code:`edrixs.tmat_c2r('d', ispin=True)` is the transformation matrix.\nWe needed to tell edrixs that we are working with a $d$-shell and that it\nshould include spin. We could also have transformed :code:`v` to see how these\neignevectors are composed of the real harmonic basis. We will see an example\nof this later.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Crystal field on an atom\nTo simulate the solid state, we need to combine the crystal field with Coulomb\ninteractions. Let us choose an atomic model for Ni.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "l = 2\nnorb = 10\nnoccu = 8\nbasis = edrixs.get_fock_bin_by_N(norb, noccu)\nslater = edrixs.get_atom_data('Ni', '3d', noccu, edge='L3')['slater_i']" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let us implement a tetragonal crystal field, for which we need to pass\n:code:`d1` the splitting of $d_{yz}/d_{zx}$ and $d_{xy}$ and\n:code:`d3` the splitting of $d_{3z^2-r^2}$ and $d_{x^2-y^2}$.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ten_dq, d1, d3 = 2.5, 0.9, .2" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To determine the eigenvalues and eigenvectors we need to transform both our\nCoulomb matrix and our crystal field matrix into the same basis. See the\nexample on exact diagonalization if needed. In this case, we put this\nprocedure into a function, with the option to scale the Coulomb interactions.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "def diagonlize(scaleU=1):\n umat = edrixs.get_umat_slater('d',\n slater[0][1]*scaleU,\n slater[1][1]*scaleU,\n slater[2][1]*scaleU)\n cfmat = edrixs.angular_momentum.cf_tetragonal_d(ten_dq=ten_dq, d1=d1, d3=d3)\n H = edrixs.build_opers(2, cfmat, basis) + edrixs.build_opers(4, umat, basis)\n e, v = scipy.linalg.eigh(H)\n e = e - np.min(e) # define ground state as zero energy\n return e, v" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let us look what happens when we run the function with the Coulomb\ninteractions switched off and check the degeneracy of the output. Look at this\npython\n[string formatting tutorial](https://realpython.com/python-formatted-output/)\nif the code is confusing.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "e, v = diagonlize(scaleU=0)\ne = e.round(decimals=6)\nunique_e = np.unique(e)\ndegeneracies = [sum(evalue == e) for evalue in unique_e]\n\nprint(\"E \\tDegeneracy\")\nfor evalue, degenvalue in zip(unique_e, degeneracies):\n print(\"{:.1f}\\t{:.0f}\".format(evalue, degenvalue))\nprint(\"{} distinct energies\".format(len(unique_e)))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We see 10 distinct energies, which is the number of ways one can arrange\ntwo holes among 4 energy levels -- which makes sense as the tetragonal field\ninvolves four levels $zx/zy, xy, 3z^2-r^2, x^2-y^2$. To see what is going\non in more detail, we can also calculate the expectation\nvalues of the occupancy number of the orbitals\n$3z^2-r^2, zx, zy, x^2-y^2, xy$.\nTo create the operator, first write the matrix in the real harmonics basis\n$|3z^2-r^2,\\uparrow>$, $|3z^2-r^2,\\downarrow>$,\n$|zx,\\uparrow>$, $|zx,\\downarrow>$, etc.\nIn this basis, they take a simple form: only the diagonal terms have element\n1. We therefore make a 3D empty array and assign the diagonal as 1. Check\nout the\n[numpy indexing notes](https://numpy.org/doc/stable/reference/arrays.indexing.html)\nif needed.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "nd_real_harmoic_basis = np.zeros((norb, norb, norb), dtype=complex)\nindx = np.arange(norb)\nnd_real_harmoic_basis[indx, indx, indx] = 1" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Recalling the necessity to put everything in the same basis, we transform\ninto the complex harmonic basis and then transform into our Fock basis\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "nd_complex_harmoic_basis = edrixs.cb_op(nd_real_harmoic_basis,\n edrixs.tmat_r2c('d', True))\nnd_op = edrixs.build_opers(2, nd_complex_harmoic_basis, basis)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We apply the operator and print out as follows. Check the\n[numpy docs](https://numpy.org/doc/1.18/reference/generated/numpy.reshape.html)\nif the details of how the spin pairs have been added up is not immediately\ntransparent.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "nd_expt = np.array([edrixs.cb_op(nd_vec, v).diagonal().real for nd_vec in nd_op])\n\nmessage = \"{:>3s}\" + \"\\t{:>6s}\"*5\nprint(message.format(*\"E 3z2-r2 zx zy x2-y2 xy\".split(\" \")))\n\nmessage = \"{:>3.1f}\" + \"\\t{:>6.1f}\"*5\nfor evalue, row in zip(e, nd_expt.T):\n spin_pairs = row.reshape(-1, 2).sum(1)\n print(message.format(evalue, *spin_pairs))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The lowest energy state involves putting both holes in the $x^2-y^2$\norbital, which makes sense. Now, let us redo the proceedure including Coulomb\nrepulsion, which imposes an energy cost to putting multiple electrons in the\nsame orbital.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "e, v = diagonlize(scaleU=1)\n\nnd_expt = np.array([edrixs.cb_op(nd_vec, v).diagonal().real for nd_vec in nd_op])\n\nmessage = \"{:>3s}\" + \"\\t{:>6s}\"*5\nprint(message.format(*\"E 3z2-r2 zx zy x2-y2 xy\".split(\" \")))\n\nmessage = \"{:>3.1f}\" + \"\\t{:>6.1f}\"*5\nfor evalue, row in zip(e, nd_expt.T):\n spin_pairs = row.reshape(-1, 2).sum(1)\n print(message.format(evalue, *spin_pairs))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now the lowest energy state involves splitting the holes between the two\nhighest energy $x^2-y^2$ and $3z^2-r^2$ orbitals. i.e. we have\ngone from low-spin to high spin. Working out the balance between these two\nstates is often one of the first things one wants to determine upon the\ndiscovery of an interesting new material [1]_.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ".. rubric:: Footnotes\n\n.. [1] M. Rossi et al., [arXiv:2011.00595 (2021)](https://arxiv.org/abs/2011.00595).\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.16" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/3d289608165bb541cc547b18d44b95f6/example_8_Coulomb.zip b/edrixs/_downloads/3d289608165bb541cc547b18d44b95f6/example_8_Coulomb.zip deleted file mode 100644 index db96ac6f96..0000000000 Binary files a/edrixs/_downloads/3d289608165bb541cc547b18d44b95f6/example_8_Coulomb.zip and /dev/null differ diff --git a/edrixs/_downloads/446e22cbcbecf4fa0157b2310264e7cc/example_6_Coulomb.ipynb b/edrixs/_downloads/446e22cbcbecf4fa0157b2310264e7cc/example_6_Coulomb.ipynb deleted file mode 100644 index 82a91c9c2e..0000000000 --- a/edrixs/_downloads/446e22cbcbecf4fa0157b2310264e7cc/example_6_Coulomb.ipynb +++ /dev/null @@ -1,226 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "%matplotlib inline" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Coulomb interactions\nIn this example we provide more details on how Coulomb interactions are\nimplemented in multiplet calculations and EDRIXS in particular. We aim\nto clarify the form of the matrices, how they are parametrized,\nand how the breaking of spherical symmetry can switch on additional elements\nthat one might not anticipate. Our example is based on a $d$ atomic shell.\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Create matrix\nThe Coulomb interaction between two particles can be written as\n\n .. math::\n \\begin{equation}\n \\hat{H} = \\frac{1}{2}\n \\int d\\mathbf{r} \\int d\\mathbf{r}^\\prime\n \\Sigma_{\\sigma, \\sigma^\\prime}\n |\\hat{\\psi}^\\sigma(\\mathbf{r})|^2 \\frac{e^2}{R}\n |\\hat{\\psi}^{\\sigma^\\prime}(\\mathbf{r})|^2,\n \\end{equation}\n\nwhere $\\hat{\\psi}^\\sigma(\\mathbf{r})$ is the electron wavefunction, with\nspin $\\sigma$, and $R=|r-r^\\prime|$ is the electron separation.\nSolving our problem in this form is difficult due to the need to symmeterize\nthe wavefunction to follow fermionic statistics.\nUsing second quantization, we can use operators to impose the required\nparticle exchange statistics and write the equation in terms of\na tensor $U$\n\n .. math::\n \\begin{equation}\n \\hat{H} = \\sum_{\\alpha,\\beta,\\gamma,\\delta,\\sigma,\\sigma^\\prime}\n U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\gamma\\sigma^\\prime,\\delta\\sigma}\n \\hat{f}^{\\dagger}_{\\alpha\\sigma}\n \\hat{f}^{\\dagger}_{\\beta\\sigma^\\prime}\n \\hat{f}_{t\\sigma^\\prime}\\hat{f}_{\\delta\\sigma},\n \\end{equation}\n\nwhere $\\alpha$, $\\beta$, $\\gamma$, $\\delta$ are\norbital indices and $\\hat{f}^{\\dagger}$\n($\\hat{f}$) are the creation (anihilation) operators.\nFor a $d$-electron system, we have $10$ distinct spin-orbitals\n($5$ orbitals each with $2$ spins), which makes matrix the\n$10\\times10\\times10\\times10$ in total size.\nIn EDRIXS the matrix can be created as follows:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport numpy as np\nimport scipy\nimport matplotlib.pyplot as plt\nimport itertools\n\nF0, F2, F4 = 6.94, 14.7, 4.41\numat_chb = edrixs.get_umat_slater('d', F0, F2, F4)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We stored this under variable :code:`umat_chb` where \"cbh\" stands for\ncomplex harmonic basis, which is the default basis in EDRIXS.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Parameterizing interactions\nEDRIXS parameterizes the interactions in $U$ via Slater integral\nparameters $F^{k}$. These relate to integrals of various spherical\nHarmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients,\nand Wigner 3J symbols. Textbooks such as [1]_ can be used for further\nreference. If you are interested in the details of how\nEDRIXS does this (and you probably aren't) function :func:`.umat_slater`,\nconstructs the required matrix via Gaunt coeficents from\n:func:`.get_gaunt`. Two alternative parameterizations are common.\nThe first are the Racah parameters, which are\n\n .. math::\n \\begin{eqnarray}\n A &=& F^0 - \\frac{49}{441} F^4 \\\\\n B &=& \\frac{1}{49}F^2 - \\frac{5}{441}F^4 \\\\\n C &=& \\frac{35}{441}F^4.\n \\end{eqnarray}\n\nor an alternative form for the Slater integrals\n\n .. math::\n \\begin{eqnarray}\n F_0 &=& F^0 \\\\\n F_2 &=& \\frac{1}{49}F^2 \\\\\n F_4 &=& \\frac{1}{441}F^4,\n \\end{eqnarray}\n\nwhich involves different normalization parameters.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Basis transform\nIf we want to use the real harmonic basis, we can use a tensor\ntransformation, which imposes the following orbital order\n$3z^2-r^2, xz, yz, x^2-y^2, xy$, each of which involves\n$\\uparrow, \\downarrow$ spin pairs. Let's perform this transformation and\nstore a list of these orbitals.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True))\norbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy']" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Interactions\nTensor $U$ is a series of matrix\nelements\n\n .. math::\n \\begin{equation}\n \\langle\\psi_{\\gamma,\\delta}^{\\bar{\\sigma},\\bar{\\sigma}^\\prime}\n |\\hat{H}|\n \\psi_{\\alpha,\\beta}^{\\sigma,\\sigma^\\prime}\\rangle\n \\end{equation}\n\nthe combination of which defines the energetic cost of pairwise\nelectron-electron interactions between states $\\alpha,\\sigma$\nand $\\beta,\\sigma^\\prime$. In EDRIXS we follow the convention of\nsumming over all orbital pairs. Some other texts count each pair of\nindices only once. The matrix elements here will consequently\nbe half the magnitude of those in other references.\nWe can express the interactions in terms of\nthe orbitals involved. It is common to distinguish \"direct Coulomb\" and\n\"exchange\" interactions. The former come from electrons in the same orbital\nand the later involve swapping orbital labels for electrons. We will use\n$U_0$ and $J$ as a shorthand for distinguishing these.\n\nBefore we describe the different types of interactions, we note that since\nthe Coulomb interaction is real, and due to the spin symmmetry properties\nof the process $U$ always obeys\n\n .. math::\n \\begin{equation}\n U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\gamma\\sigma^\\prime,\\delta\\sigma} =\n U_{\\beta\\sigma,\\alpha\\sigma^\\prime,\\delta\\sigma^\\prime,\\gamma\\sigma} =\n U_{\\delta\\sigma,\\gamma\\sigma^\\prime,\\beta\\sigma^\\prime,\\alpha\\sigma} =\n U_{\\gamma\\sigma,\\delta\\sigma^\\prime,\\alpha\\sigma^\\prime,\\beta\\sigma}.\n \\end{equation}\n\n\n### 1. Intra orbital\nThe direct Coulomb energy cost to double-occupy an orbital comes from terms\nlike $U_{\\alpha\\sigma,\\alpha\\bar\\sigma,\\alpha\\bar\\sigma,\\alpha\\sigma}$.\nIn this notation, we use $\\sigma^\\prime$ to denote that the matrix\nelement is summed over all pairs and $\\bar{\\sigma}$ to denote sums\nover all opposite spin pairs. Due to rotational symmetry, all these\nelements are the same and equal to\n\n .. math::\n \\begin{eqnarray}\n U_0 &=& \\frac{A}{2} + 2B + \\frac{3C}{2}\\\\\n &=& \\frac{F_0}{2} + 2F_2 + 18F_4\n \\end{eqnarray}\n\nLet's print these to demonstrate where these live in the array\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i in range(0, 5):\n val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real\n print(f\"{orbitals[i]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 2. Inter orbital Coulomb interactions\nDirect Coulomb repulsion between different orbitals depends on terms like\n$U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\beta\\sigma^\\prime,\\alpha\\sigma}$.\nExpresions for these parameters are provided in column $U$ in\n`table_2_orbital`. We can print the values from :code:`umat`\nlike this:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i, j in itertools.combinations(range(5), 2):\n val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 3. Inter-orbital exchange interactions\nExchange terms exist with the form\n$U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\alpha\\sigma^\\prime,\\beta\\sigma}$.\nExpresions for these parameters are provided in column $J$ of\n`table_2_orbital`. These come from terms like this in the matrix:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i, j in itertools.combinations(range(5), 2):\n val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 4. Pair hopping term\nTerms that swap pairs of electrons exist as\n$(1-\\delta_{\\sigma\\sigma'})U_{\\alpha\\sigma,\\alpha\\bar\\sigma,\\beta\\bar\\sigma,\\beta\\sigma}$\nand depend on exchange interactions column $J$ from\n`table_2_orbital`\nand here in the matrix.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i, j in itertools.combinations(range(5), 2):\n val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 5. Three orbital\nAnother set of terms that one might not immediately anticipate involve three\norbitals like\n\n .. math::\n \\begin{equation}\n U_{\\alpha\\sigma, \\gamma\\sigma', \\beta\\sigma', \\gamma\\sigma} \\\\\n U_{\\alpha\\sigma, \\gamma\\sigma', \\gamma\\sigma', \\beta\\sigma} \\\\\n (1-\\delta_{\\sigma\\sigma'})\n U_{\\alpha\\sigma, \\beta\\sigma', \\gamma\\sigma', \\gamma\\sigma}\n \\end{equation}\n\nfor $\\alpha=3z^2-r^2, \\beta=x^2-y^2, \\gamma=xz/yz$.\nThese are needed to maintain the rotational symmetry of the interations.\nSee `table_3_orbital` for the expressions. We can print some of\nthese via:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ijkl = [[0, 1, 3, 1],\n [0, 2, 3, 2],\n [1, 0, 3, 1],\n [1, 1, 3, 0],\n [2, 0, 3, 2],\n [2, 2, 3, 0]]\n\nfor i, j, k, l in ijkl:\n val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t\"\n f\"{orbitals[k]:<8} \\t {orbitals[l]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 6. Four orbital\nFuther multi-orbital terms include\n$U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\gamma\\sigma^\\prime,\\delta\\sigma}$.\nWe can find these here in the matrix:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ijkl = [[0, 1, 2, 4],\n [0, 1, 4, 2],\n [0, 2, 1, 4],\n [0, 2, 4, 1],\n [0, 4, 1, 2],\n [0, 4, 2, 1],\n [3, 1, 4, 2],\n [3, 2, 4, 1],\n [3, 4, 1, 2],\n [3, 4, 2, 1]]\n\nfor i, j, k, l in ijkl:\n val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {orbitals[k]:<8}\"\n f\"\\t {orbitals[l]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Effects of multi-orbital terms\nTo test the effects of the multi-orbital terms, let's plot the eigenenergy\nspectra with and without multi-orbital terms switched on for system with and\nwithout a cubic crystal field. We will use a $d$-shell with two\nelectrons.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ten_dqs = [0, 2, 4, 12]\n\ndef diagonalize(ten_dq, umat):\n emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq),\n edrixs.tmat_c2r('d', ispin=True))\n H = (edrixs.build_opers(4, umat, basis)\n + edrixs.build_opers(2, emat, basis))\n e, v = scipy.linalg.eigh(H)\n return e - e.min()\n\nbasis = edrixs.get_fock_bin_by_N(10, 2)\numat_no_multiorbital = np.copy(umat)\nB = F2/49 - 5*F4/441\nfor val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]:\n umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0\n\nfig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3))\n\nfor cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)):\n ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1,\n label='on', color=f'C{cind}')\n ax.hlines(diagonalize(ten_dq, umat_no_multiorbital),\n xmin=1.5, xmax=2.5,\n label='off',\n linestyle=':', color=f'C{cind}')\n ax.set_title(f\"$10D_q={ten_dq}$\")\n ax.set_ylim([-.5, 20])\n ax.set_xticks([])\n ax.legend()\n\nfig.suptitle(\"Eigenvalues with 3&4-orbital effects on/off\")\nfig.subplots_adjust(wspace=.3)\naxs[0].set_ylabel('Eigenvalues (eV)')\nfig.subplots_adjust(top=.8)\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "On the left of the plot Coulomb interactions in spherical symmetry cause\nsubstantial mxing between $t_{2g}$ and $e_{g}$ orbitals in the\neigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the\nthe right eigenenergies. As $10D_q$ get large, this mixing is switched\noff and the spectra start to become independent of whether the 3 & 4 orbital\norbital terms are included or not.\n\n\n\n.. table:: Table of 2 orbital interactions\n\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |Orbitals $\\alpha,\\beta$|$U_0$ Racah | $U_0$ Slater |$J$ Racah |$J$ Slater |\n +=============================+==================+=======================+================+====================+\n |$3z^2-r^2, xz$ |$A/2+B+C/2$ |$F_0/2+F_2-12F_4$| $B/2+C/2$|$F_2/2+15F_4$ |\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$3z^2-r^2, yz$ |$A/2+B+C/2$ |$F_0/2+F_2-12F_4$| $B/2+C/2$|$F_2/2+15F_4$ |\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$3z^2-r^2, x^2-y^2$ |$A/2-2B+C/2$|$F_0/2-2F_2+3F_4$|$2B+C/2$ |$2F_2+15F_4/2$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$3z^2-r^2, xy$ |$A/2-2B+C/2$|$F_0/2-2F_2+3F_4$|$2B+C/2$ |$2F_2+15F_4/2$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$xz, yz$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$xz, x^2-y^2$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$xz, xy$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$yz, x^2-y^2$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$yz, xy$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$x^2-y^2, xy$ |$A/2+2B+C/2$|$F_0+4F_2-34F_4$ | $C/2$ |$35F_4/2$ |\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n\n\n.. table:: Table of 3 orbital interactions\n\n +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+\n |Orbitals $\\alpha,\\beta,\\gamma,\\delta$|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Racah|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Slater|\n +=============================+=============+====================================================+=====================================================+\n |$3z^2-r^2, xz, x^2-y^2, xz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, yz, x^2-y^2, yz$ | $-\\sqrt{3}B/2$ | $-\\sqrt{3}F_2/2+5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$xz, 3z^2-r^2, x^2-y^2, xz$ | $-\\sqrt{3}B$ | $-\\sqrt{3}F_2+5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$xz, xz, x^2-y^2, 3z^2-r^2$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$yz, 3z^2-r^2, x^2-y^2, yz$ | $\\sqrt{3}B$ | $\\sqrt{3}F_2-5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$yz, yz, x^2-y^2, 3z^2-r^2$ | $-\\sqrt{3}B/2$ | $-\\sqrt{3}F_2/2+5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n\n\n.. table:: Table of 4 orbital interactions\n\n +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+\n |Orbitals $\\alpha,\\beta,\\gamma,\\delta$|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Racah|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Slater|\n +=============================+=============+====================================================+=====================================================+\n |$3z^2-r^2, xz, yz, xy$ | $-\\sqrt{3}B$ | $-\\sqrt{3}F_2+5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, xz, xy, yz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, yz, xz, xy$ | $-\\sqrt{3}B$ | $-\\sqrt{3}F_2+5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, yz, xy, xz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, xy, xz, yz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, xy, yz, xz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , xz, xy, yz$ | $-3B/2$ | $-3F_2/2+15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , yz, xy, xz$ | $3B/2$ | $3F_2/2-15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , xy, xz, yz$ | $-3B/2$ | $-3F_2/2+15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , xy, yz, xz$ | $3B/2$ | $3F_2/2-15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n\n\n.. rubric:: Footnotes\n\n.. [1] MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of\n Transition-Metal Ions in Crystals. Academic Press, New York and London.\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.12" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/459c0482b0e43beaf4cd18b2100f6bba/helloworld.py b/edrixs/_downloads/459c0482b0e43beaf4cd18b2100f6bba/helloworld.py deleted file mode 100644 index 7eb3ecd6b9..0000000000 --- a/edrixs/_downloads/459c0482b0e43beaf4cd18b2100f6bba/helloworld.py +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env python - -import numpy as np -import matplotlib.pyplot as plt -import matplotlib as mpl -import edrixs - -# Setup parameters -# ---------------- -# Number of occupancy of 3d shell -noccu = 8 - -res = edrixs.get_atom_data('Ni', v_name='3d', v_noccu=noccu, edge='L23') -name_i, slat_i = [list(i) for i in zip(*res['slater_i'])] -name_n, slat_n = [list(i) for i in zip(*res['slater_n'])] - -# Slater integrals for initial Hamiltonian without core-hole -si = edrixs.rescale(slat_i, ([1, 2], [0.65]*2)) -si[0] = edrixs.get_F0('d', si[1], si[2]) # F0_dd - -# Slater integrals for intermediate Hamiltonian with core-hole -sn = edrixs.rescale(slat_n, ([1, 2, 4, 5, 6], [0.65, 0.65, 0.95, 0.7, 0.7])) -sn[0] = edrixs.get_F0('d', sn[1], sn[2]) # F0_dd -sn[3] = edrixs.get_F0('dp', sn[5], sn[6]) # F0_dp - -slater = (si, sn) - -# Spin-orbit coupling strengths -zeta_d_i = res['v_soc_i'][0] # valence 3d electron without core-hole -zeta_d_n = res['v_soc_n'][0] # valence 3d electron with core-hole -# E_{L2} - E_{L3} = 1.5 * zeta_p -zeta_p_n = (res['edge_ene'][0] - res['edge_ene'][1]) / 1.5 # core 2p electron - -# Tetragonal crystal field -cf = edrixs.cf_tetragonal_d(ten_dq=1.3, d1=0.05, d3=0.2) - -# Level shift of the core shell -off = 857.4 - -# Life time broadening -gamma_c = res['gamma_c'][1] # core hole -gamma_f = 0.1 # final states - -# Incident, scattered, azimuthal angles -# See Figure 1 of Y. Wang et al., -# `Computer Physics Communications 243, 151-165 (2019) -# `_ -# for the defintion of the scattering angles. -thin, thout, phi = 15 / 180.0 * np.pi, 75 / 180.0 * np.pi, 0.0 - -# Polarization types -poltype_xas = [('isotropic', 0.0)] # for XAS -poltype_rixs = [('linear', 0, 'linear', 0), ('linear', 0, 'linear', np.pi/2.0)] # for RIXS - -# Energy grid -ominc_xas = np.linspace(off - 10, off + 20, 1000) # for XAS -ominc_rixs_L3 = np.linspace(-5.9 + off, -0.9 + off, 100) # incident energy at L3 edge -ominc_rixs_L2 = np.linspace(10.4 + off, 14.9 + off, 100) # incident energy at L3 edge -eloss = np.linspace(-0.5, 5.0, 1000) # energy loss for RIXS - -# Run ED -eval_i, eval_n, trans_op = edrixs.ed_1v1c_py( - ('d', 'p'), shell_level=(0.0, -off), v_soc=(zeta_d_i, zeta_d_n), - c_soc=zeta_p_n, v_noccu=noccu, slater=slater, v_cfmat=cf -) - -# Run XAS -xas = edrixs.xas_1v1c_py( - eval_i, eval_n, trans_op, ominc_xas, gamma_c=gamma_c, thin=thin, phi=phi, - pol_type=poltype_xas, gs_list=[0, 1, 2], temperature=300 -) - -# Run RIXS at L3 edge -rixs_L3 = edrixs.rixs_1v1c_py( - eval_i, eval_n, trans_op, ominc_rixs_L3, eloss, gamma_c=gamma_c, gamma_f=gamma_f, - thin=thin, thout=thout, phi=phi, pol_type=poltype_rixs, gs_list=[0, 1, 2], - temperature=300 -) - -# Run RIXS at L2 edge -rixs_L2 = edrixs.rixs_1v1c_py( - eval_i, eval_n, trans_op, ominc_rixs_L2, eloss, gamma_c=gamma_c, gamma_f=gamma_f, - thin=thin, thout=thout, phi=phi, pol_type=poltype_rixs, gs_list=[0, 1, 2], - temperature=300 -) - -# Plot -fig = plt.figure(figsize=(16, 14)) -mpl.rcParams['font.size'] = 20 - -ax1 = plt.subplot(2, 2, 1) -plt.grid() -plt.plot(range(len(eval_i)), eval_i - min(eval_i), '-o') -plt.xlabel(r'Multiplets') -plt.ylabel(r'Energy (eV)') -plt.title(r'(a) Energy of multiplets') - -ax2 = plt.subplot(2, 2, 2) -plt.grid() -plt.plot(ominc_xas, xas[:, 0], '-') -plt.xlabel(r'Incident Energy (eV)') -plt.ylabel(r'XAS Intensity (a.u.)') -plt.title(r'(b) Isotropic XAS') - -ax3 = plt.subplot(2, 2, 3) -plt.imshow(np.sum(rixs_L3, axis=2), - extent=[min(eloss), max(eloss), min(ominc_rixs_L3), max(ominc_rixs_L3)], - origin='lower', aspect='auto', cmap='rainbow', interpolation='gaussian') -plt.xlabel(r'Energy loss (eV)') -plt.ylabel(r'Incident Energy (eV)') -plt.title(r'(c) RIXS map at $L_3$ edge (LH)') - -ax4 = plt.subplot(2, 2, 4) -plt.imshow(np.sum(rixs_L2, axis=2), - extent=[min(eloss), max(eloss), min(ominc_rixs_L2), max(ominc_rixs_L2)], - origin='lower', aspect='auto', cmap='rainbow', interpolation='gaussian') -plt.xlabel(r'Energy loss (eV)') -plt.ylabel(r'Incident Energy (eV)') -plt.title(r'(d) RIXS map at $L_2$ edge (LH)') - -plt.subplots_adjust(left=0.1, right=0.9, bottom=0.1, top=0.9, wspace=0.2, hspace=0.3) -plt.show() diff --git a/edrixs/_downloads/4bf727945bfb7ec7db12f60a40244241/example_7_transitions.py b/edrixs/_downloads/4bf727945bfb7ec7db12f60a40244241/example_7_transitions.py deleted file mode 100644 index c346e469db..0000000000 --- a/edrixs/_downloads/4bf727945bfb7ec7db12f60a40244241/example_7_transitions.py +++ /dev/null @@ -1,198 +0,0 @@ -#!/usr/bin/env python -""" -X-ray transitions -================================================================================ -This example explains how to calculate x-ray transition amplitudes between -specific orbital and spin states. We take the case of a cuprate which has one -hole in the :math:`d_{x^2-y^2}` orbital and a spin ordering direction along the -in-plane diagaonal direction and compute the angular dependence of spin-flip -and non-spin-flip processes. - -This case was chosen because the eigenvectors in question are simple enough -for us to write them out more-or-less by hand, so this example helps the reader -to understand what happens under the hood in more complex cases. - -Some of the code here is credited to Yao Shen who used this approach for the -analysis of a low valence nickelate material [1]_. The task performed repeats -analysis done by many researchers e.g. Luuk Ament et al [2]_ as well as -several other groups. -""" -import edrixs -import numpy as np -import matplotlib.pyplot as plt -import scipy - -################################################################################ -# Eigenvectors -# ------------------------------------------------------------------------------ -# Let us start by determining the eigenvectors involved in the transitions. -# The spin direction can be set using a vector -# :math:`\vec{B}` to represent a magnetic field in terms of generalized spin -# operator :math:`\tilde{\sigma}=\vec{B}\cdot\sigma` based on the Pauli matrices -# :math:`\sigma`. Let's put the spin along the :math:`[1, 1, 0]` direction -# and formuate the problem in the hole basis. -# For one particle, we know that the Hamiltonian will be diagonal in the real -# harmonic basis. -# We can generate the required eigenvectors by making a diagonal -# matrix, transforming it to the required -# complex harmonic basis (as is standard for EDRIXS) and diagonalizing it. -# As long as the crystal field splitting is much larger than the magnetic -# field, the eigenvectors will be independent of the exact values of both -# these parameters. - -B = 1e-3*np.array([1, 1, 0]) -cf_splitting = 1e3 -zeeman = sum(s*b for s, b in zip(edrixs.get_spin_momentum(2), B)) -dd_levels = np.array([energy for dd_level in cf_splitting*np.arange(5) - for energy in [dd_level]*2], dtype=complex) -emat_rhb = np.diag(dd_levels) -emat = edrixs.cb_op(emat_rhb, edrixs.tmat_r2c('d', ispin=True)) + zeeman -_, eigenvectors = np.linalg.eigh(emat) - -def get_eigenvector(orbital_index, spin_index): - return eigenvectors[:, 2*orbital_index + spin_index] - - -################################################################################ -# Let's examine the :math:`d_{x^2-y^2}` orbital first. Recall from the -# :ref:`sphx_glr_auto_examples_example_1_crystal_field.py` -# example that edrixs uses the standard orbital order of -# :math:`d_{3z^2-r^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}`. So we want -# :code:`orbital_index = 3` element. Using this, we can build spin-up and -down -# eigenvectors. -orbital_index = 3 - -groundstate_vector = get_eigenvector(orbital_index, 0) -excitedstate_vector = get_eigenvector(orbital_index, 1) - -################################################################################ -# Transition operators and scattering matrix -# ------------------------------------------------------------------------------ -# Here we are considering the :math:`L_3`-edge. This means -# a :math:`2p_{3/2} \rightarrow 3d` -# absoprtion transition and a :math:`2p_{3/2} \rightarrow 3d` -# emission transition. We can read the relevant matrix from the edrixs database, -# keeping in mind that there are in fact three operations for -# :math:`x, y,` & :math:`z` directions. Note that edrixs provides operators -# in electron notation. If we define :math:`D` as the transition operator in -# electron language, :math:`D^\dagger` is the operator in the hole language -# we are using for this example. -# The angular dependence of a RIXS transition can be conveniently described -# using the scattering matrix, which is a :math:`3\times3` element object that -# specifies the transition amplitude for each incoming and outgoing x-ray -# polarization. Correspondingly, we have -# -# .. math:: -# \begin{equation} -# \mathcal{F}=\sum_n\langle f|D|n\rangle\langle n|D^{\dagger}|g\rangle -# \end{equation}. -# -# In matrix form this is -# -# .. math:: -# \begin{equation} -# \mathcal{F}(m,n)=\{f^{\dagger} \cdot D(m)\} \cdot \{D^{\dagger}(n) \cdot g\} -# \end{equation}. - -D_Tmat = edrixs.get_trans_oper('dp32') - -def get_F(vector_i, vector_f): - F = np.zeros((3, 3), dtype=complex) - for i in range(3): - for j in range(3): - F[i, j] = np.dot(np.dot(np.conj(vector_f.T), D_Tmat[i]), - np.dot(np.conj(D_Tmat[j].T), vector_i)) - return F - -################################################################################ -# Using this function, we can obtain non-spin-flip (NSF) and spin-flip (SF) -# scattering matrices by choosing whether we return to the ground state or -# whether we access the excited state with the spin flipped. -F_NSF = get_F(groundstate_vector, groundstate_vector) -F_SF = get_F(groundstate_vector, excitedstate_vector) - -################################################################################ -# Angular dependence -# ------------------------------------------------------------------------------ -# Let's consider the common case of fixing the total scattering angle at -# :code:`two_theta = 90` and choosing a series of incident angles :code:`thins`. -# Since the detector does not resolve polarization, we need to add both outgoing -# polarizations. It is then convenient to use function :func:`.dipole_polvec_rixs` -# to obtain the incoming and outgoing polarization vectors. -thins = np.linspace(0, 90) -two_theta = 90 -phi = 0 - - -def get_I(thin, alpha, F): - intensity = 0 - for beta in [0, np.pi/2]: - thout = two_theta - thin - ei, ef = edrixs.dipole_polvec_rixs(thin*np.pi/180, thout*np.pi/180, - phi*np.pi/180, alpha, beta) - intensity += np.abs(np.dot(ef, np.dot(F, ei)))**2 - return intensity - - -################################################################################ -# Plot -# ------------------------------------------------------------------------------ -# We now run through a few configurations specified in terms of incoming -# polarization angle :math:`\alpha` (defined in radians w.r.t. the scattering -# plane), :math:`F`, plotting label, and plotting color. -fig, ax = plt.subplots() - -config = [[0, F_NSF, r'$\pi$ NSF', 'C0'], - [np.pi/2, F_NSF, r'$\sigma$ NSF', 'C1'], - [0, F_SF, r'$\pi$ SF', 'C2'], - [np.pi/2, F_SF, r'$\sigma$ SF', 'C3']] - -for alpha, F, label, color in config: - Is = np.array([get_I(thin, alpha, F) for thin in thins]) - ax.plot(thins, Is, label=label, color=color) - -ax.legend() -ax.set_xlabel(r'Theta ($^\circ$)') -ax.set_ylabel('Relative intensity') -plt.show() - -################################################################################ -# Run through orbitals -# ------------------------------------------------------------------------------ -# For completeness, let's look at transitions from :math:`x^2-y^2` to all other -# orbitals. -fig, axs = plt.subplots(5, 1, figsize=(7, 7), - sharex=True, sharey=True) - -orbitals = ['$d_{3z^2-r^2}$', '$d_{xz}$', '$d_{yz}$', - '$d_{x^2-y^2}$', '$d_{xy}$'] -orbital_order = [4, 1, 2, 0, 3] - -plot_index = 0 -for ax, orbital_index in zip(axs, orbital_order): - for spin_index, spin_label in zip([0, 1], ['NSF', 'SF']): - excitedstate_vector = get_eigenvector(orbital_index, spin_index) - F = get_F(groundstate_vector, excitedstate_vector) - for alpha, pol_label in zip([0, np.pi/2], [r'$\pi$', r'$\sigma$']): - Is = np.array([get_I(thin, alpha, F) for thin in thins]) - ax.plot(thins, Is*10, label=f'{pol_label} {spin_label}', - color=f'C{plot_index%4}') - plot_index += 1 - ax.legend(title=orbitals[orbital_index], bbox_to_anchor=(1.1, 1), - loc="upper left", fontsize=8) - - -axs[-1].set_xlabel(r'$\theta$ ($^\circ$)') -axs[2].set_ylabel('Scattering intensity') - -fig.subplots_adjust(hspace=0, left=.3, right=.6) -plt.show() - -############################################################################## -# -# .. rubric:: Footnotes -# -# .. [1] Yao Shen et al., -# `arXiv:2110.08937 (2022) `_. -# .. [2] Luuk J. P. Ament et al., -# `Phys. Rev. Lett. 103, 117003 (2009) `_ diff --git a/edrixs/_downloads/4c17545c9c531bbea8f391a8442d3b7a/example_5_transitions.ipynb b/edrixs/_downloads/4c17545c9c531bbea8f391a8442d3b7a/example_5_transitions.ipynb deleted file mode 100644 index 51f5f3e423..0000000000 --- a/edrixs/_downloads/4c17545c9c531bbea8f391a8442d3b7a/example_5_transitions.ipynb +++ /dev/null @@ -1,176 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# X-ray transitions\nThis example explains how to calculate x-ray transition amplitudes between\nspecific orbital and spin states. We take the case of a cuprate which has one\nhole in the $d_{x^2-y^2}$ orbital and a spin ordering direction along the\nin-plane diagaonal direction and compute the angular dependence of spin-flip\nand non-spin-flip processes.\n\nThis case was chosen because the eigenvectors in question are simple enough\nfor us to write them out more-or-less by hand, so this example helps the reader\nto understand what happens under the hood in more complex cases.\n\nSome of the code here is credited to Yao Shen who used this approach for the\nanalysis of a low valence nickelate material [1]_. The task performed repeats\nanalysis done by many researchers e.g. Luuk Ament et al [2]_ as well as\nseveral other groups.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Eigenvectors\nLet us start by determining the eigenvectors involved in the transitions.\nThe spin direction can be set using a vector\n$\\vec{B}$ to represent a magnetic field in terms of generalized spin\noperator $\\tilde{\\sigma}=\\vec{B}\\cdot\\sigma$ based on the Pauli matrices\n$\\sigma$. Let's put the spin along the $[1, 1, 0]$ direction\nand formuate the problem in the hole basis.\nFor one particle, we know that the Hamiltonian will be diagonal in the real\nharmonic basis.\nWe can generate the required eigenvectors by making a diagonal\nmatrix, transforming it to the required\ncomplex harmonic basis (as is standard for EDRIXS) and diagonalizing it.\nAs long as the crystal field splitting is much larger than the magnetic\nfield, the eigenvectors will be independent of the exact values of both\nthese parameters.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "B = 1e-3*np.array([1, 1, 0])\ncf_splitting = 1e3\nzeeman = sum(s*b for s, b in zip(edrixs.get_spin_momentum(2), B))\ndd_levels = np.array([energy for dd_level in cf_splitting*np.arange(5)\n for energy in [dd_level]*2], dtype=complex)\nemat_rhb = np.diag(dd_levels)\nemat = edrixs.cb_op(emat_rhb, edrixs.tmat_r2c('d', ispin=True)) + zeeman\n_, eigenvectors = np.linalg.eigh(emat)\n\ndef get_eigenvector(orbital_index, spin_index):\n return eigenvectors[:, 2*orbital_index + spin_index]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let's examine the $d_{x^2-y^2}$ orbital first. Recall from the\n`sphx_glr_auto_examples_example_1_crystal_field.py`\nexample that edrixs uses the standard orbital order of\n$d_{3z^2-r^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}$. So we want\n:code:`orbital_index = 3` element. Using this, we can build spin-up and -down\neigenvectors.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "orbital_index = 3\n\ngroundstate_vector = get_eigenvector(orbital_index, 0)\nexcitedstate_vector = get_eigenvector(orbital_index, 1)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Transition operators and scattering matrix\nHere we are considering the $L_3$-edge. This means\na $2p_{3/2} \\rightarrow 3d$\nabsoprtion transition and a $2p_{3/2} \\rightarrow 3d$\nemission transition. We can read the relevant matrix from the edrixs database,\nkeeping in mind that there are in fact three operations for\n$x, y,$ & $z$ directions. Note that edrixs provides operators\nin electron notation. If we define $D$ as the transition operator in\nelectron language, $D^\\dagger$ is the operator in the hole language\nwe are using for this example.\nThe angular dependence of a RIXS transition can be conveniently described\nusing the scattering matrix, which is a $3\\times3$ element object that\nspecifies the transition amplitude for each incoming and outgoing x-ray\npolarization. Correspondingly, we have\n\n .. math::\n \\begin{equation}\n \\mathcal{F}=\\sum_n\\langle f|D|n\\rangle\\langle n|D^{\\dagger}|g\\rangle\n \\end{equation}.\n\nIn matrix form this is\n\n .. math::\n \\begin{equation}\n \\mathcal{F}(m,n)=\\{f^{\\dagger} \\cdot D(m)\\} \\cdot \\{D^{\\dagger}(n) \\cdot g\\}\n \\end{equation}.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "D_Tmat = edrixs.get_trans_oper('dp32')\n\ndef get_F(vector_i, vector_f):\n F = np.zeros((3, 3), dtype=complex)\n for i in range(3):\n for j in range(3):\n F[i, j] = np.dot(np.dot(np.conj(vector_f.T), D_Tmat[i]),\n np.dot(np.conj(D_Tmat[j].T), vector_i))\n return F" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Using this function, we can obtain non-spin-flip (NSF) and spin-flip (SF)\nscattering matrices by choosing whether we return to the ground state or\nwhether we access the excited state with the spin flipped.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "F_NSF = get_F(groundstate_vector, groundstate_vector)\nF_SF = get_F(groundstate_vector, excitedstate_vector)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Angular dependence\nLet's consider the common case of fixing the total scattering angle at\n:code:`two_theta = 90` and choosing a series of incident angles :code:`thins`.\nSince the detector does not resolve polarization, we need to add both outgoing\npolarizations. It is then convenient to use function :func:`.dipole_polvec_rixs`\nto obtain the incoming and outgoing polarization vectors.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "thins = np.linspace(0, 90)\ntwo_theta = 90\nphi = 0\n\n\ndef get_I(thin, alpha, F):\n intensity = 0\n for beta in [0, np.pi/2]:\n thout = two_theta - thin\n ei, ef = edrixs.dipole_polvec_rixs(thin*np.pi/180, thout*np.pi/180,\n phi*np.pi/180, alpha, beta)\n intensity += np.abs(np.dot(ef, np.dot(F, ei)))**2\n return intensity" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Plot\nWe now run through a few configurations specified in terms of incoming\npolarization angle $\\alpha$ (defined in radians w.r.t. the scattering\nplane), $F$, plotting label, and plotting color.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fig, ax = plt.subplots()\n\nconfig = [[0, F_NSF, r'$\\pi$ NSF', 'C0'],\n [np.pi/2, F_NSF, r'$\\sigma$ NSF', 'C1'],\n [0, F_SF, r'$\\pi$ SF', 'C2'],\n [np.pi/2, F_SF, r'$\\sigma$ SF', 'C3']]\n\nfor alpha, F, label, color in config:\n Is = np.array([get_I(thin, alpha, F) for thin in thins])\n ax.plot(thins, Is, label=label, color=color)\n\nax.legend()\nax.set_xlabel(r'Theta ($^\\circ$)')\nax.set_ylabel('Relative intensity')\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Run through orbitals\nFor completeness, let's look at transitions from $x^2-y^2$ to all other\norbitals.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fig, axs = plt.subplots(5, 1, figsize=(7, 7),\n sharex=True, sharey=True)\n\norbitals = ['$d_{3z^2-r^2}$', '$d_{xz}$', '$d_{yz}$',\n '$d_{x^2-y^2}$', '$d_{xy}$']\norbital_order = [4, 1, 2, 0, 3]\n\nplot_index = 0\nfor ax, orbital_index in zip(axs, orbital_order):\n for spin_index, spin_label in zip([0, 1], ['NSF', 'SF']):\n excitedstate_vector = get_eigenvector(orbital_index, spin_index)\n F = get_F(groundstate_vector, excitedstate_vector)\n for alpha, pol_label in zip([0, np.pi/2], [r'$\\pi$', r'$\\sigma$']):\n Is = np.array([get_I(thin, alpha, F) for thin in thins])\n ax.plot(thins, Is*10, label=f'{pol_label} {spin_label}',\n color=f'C{plot_index%4}')\n plot_index += 1\n ax.legend(title=orbitals[orbital_index], bbox_to_anchor=(1.1, 1),\n loc=\"upper left\", fontsize=8)\n\n\naxs[-1].set_xlabel(r'$\\theta$ ($^\\circ$)')\naxs[2].set_ylabel('Scattering intensity')\n\nfig.subplots_adjust(hspace=0, left=.3, right=.6)\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ".. rubric:: Footnotes\n\n.. [1] Yao Shen et al.,\n [arXiv:2110.08937 (2022)](https://arxiv.org/abs/2110.08937).\n.. [2] Luuk J. P. Ament et al.,\n [Phys. Rev. Lett. 103, 117003 (2009)](https://doi.org/10.1103/PhysRevLett.103.117003)\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.14" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/549f42a520207f2312c42f9bc1883308/example_2_single_atom_RIXS.zip b/edrixs/_downloads/549f42a520207f2312c42f9bc1883308/example_2_single_atom_RIXS.zip deleted file mode 100644 index 4cf0e06804..0000000000 Binary files a/edrixs/_downloads/549f42a520207f2312c42f9bc1883308/example_2_single_atom_RIXS.zip and /dev/null differ diff --git a/edrixs/_downloads/5959090930ec84d57a0634c911a64c23/example_9_Coulomb.py b/edrixs/_downloads/5959090930ec84d57a0634c911a64c23/example_9_Coulomb.py deleted file mode 100644 index 2b8065f156..0000000000 --- a/edrixs/_downloads/5959090930ec84d57a0634c911a64c23/example_9_Coulomb.py +++ /dev/null @@ -1,381 +0,0 @@ -#!/usr/bin/env python -""" -Coulomb interactions -===================================== -In this example we provide more details on how Coulomb interactions are -implemented in multiplet calculations and EDRIXS in particular. We aim -to clarify the form of the matrices, how they are parametrized, -and how the breaking of spherical symmetry can switch on additional elements -that one might not anticipate. Our example is based on a :math:`d` atomic shell. -""" - -################################################################################ -# Create matrix -# ------------------------------------------------------------------------------ -# The Coulomb interaction between two particles can be written as -# -# .. math:: -# \begin{equation} -# \hat{H} = \frac{1}{2} -# \int d\mathbf{r} \int d\mathbf{r}^\prime -# \Sigma_{\sigma, \sigma^\prime} -# |\hat{\psi}^\sigma(\mathbf{r})|^2 \frac{e^2}{R} -# |\hat{\psi}^{\sigma^\prime}(\mathbf{r^\prime})|^2, -# \end{equation} -# -# where :math:`\hat{\psi}^\sigma(\mathbf{r})` is the electron wavefunction, with -# spin :math:`\sigma`, and :math:`R=|r-r^\prime|` is the electron separation. -# Solving our problem in this form is difficult due to the need to symmeterize -# the wavefunction to follow fermionic statistics. -# Using second quantization, we can use operators to impose the required -# particle exchange statistics and write the equation in terms of -# a tensor :math:`U` -# -# .. math:: -# \begin{equation} -# \hat{H} = \sum_{\alpha,\beta,\gamma,\delta,\sigma,\sigma^\prime} -# U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} -# \hat{f}^{\dagger}_{\alpha\sigma} -# \hat{f}^{\dagger}_{\beta\sigma^\prime} -# \hat{f}_{\gamma\sigma^\prime}\hat{f}_{\delta\sigma}, -# \end{equation} -# -# where :math:`\alpha`, :math:`\beta`, :math:`\gamma`, :math:`\delta` are -# orbital indices and :math:`\hat{f}^{\dagger}` -# (:math:`\hat{f}`) are the creation (anihilation) operators. -# For a :math:`d`-electron system, we have :math:`10` distinct spin-orbitals -# (:math:`5` orbitals each with :math:`2` spins), which makes matrix the -# :math:`10\times10\times10\times10` in total size. -# In EDRIXS the matrix can be created as follows: -import edrixs -import numpy as np -import scipy -import matplotlib.pyplot as plt -import itertools - -F0, F2, F4 = 6.94, 14.7, 4.41 -umat_chb = edrixs.get_umat_slater('d', F0, F2, F4) -################################################################################ -# We stored this under variable :code:`umat_chb` where "cbh" stands for -# complex harmonic basis, which is the default basis in EDRIXS. - -################################################################################ -# Parameterizing interactions -# ------------------------------------------------------------------------------ -# EDRIXS parameterizes the interactions in :math:`U` via Slater integral -# parameters :math:`F^{k}`. These relate to integrals of various spherical -# Harmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients, -# and Wigner 3J symbols. Textbooks such as [1]_ can be used for further -# reference. If you are interested in the details of how -# EDRIXS does this (and you probably aren't) function :func:`.umat_slater`, -# constructs the required matrix via Gaunt coeficents from -# :func:`.get_gaunt`. Two alternative parameterizations are common. -# The first are the Racah parameters, which are -# -# .. math:: -# \begin{eqnarray} -# A &=& F^0 - \frac{49}{441} F^4 \\ -# B &=& \frac{1}{49}F^2 - \frac{5}{441}F^4 \\ -# C &=& \frac{35}{441}F^4. -# \end{eqnarray} -# -# or an alternative form for the Slater integrals -# -# .. math:: -# \begin{eqnarray} -# F_0 &=& F^0 \\ -# F_2 &=& \frac{1}{49}F^2 \\ -# F_4 &=& \frac{1}{441}F^4, -# \end{eqnarray} -# -# which involves different normalization parameters. - -################################################################################ -# Basis transform -# ------------------------------------------------------------------------------ -# If we want to use the real harmonic basis, we can use a tensor -# transformation, which imposes the following orbital order -# :math:`3z^2-r^2, xz, yz, x^2-y^2, xy`, each of which involves -# :math:`\uparrow, \downarrow` spin pairs. Let's perform this transformation and -# store a list of these orbitals. -umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True)) -orbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy'] - -################################################################################ -# Interactions -# ------------------------------------------------------------------------------ -# Tensor :math:`U` is a series of matrix -# elements -# -# .. math:: -# \begin{equation} -# \langle\psi_{\gamma,\delta}^{\bar{\sigma},\bar{\sigma}^\prime} -# |\hat{H}| -# \psi_{\alpha,\beta}^{\sigma,\sigma^\prime}\rangle -# \end{equation} -# -# the combination of which defines the energetic cost of pairwise -# electron-electron interactions between states :math:`\alpha,\sigma` -# and :math:`\beta,\sigma^\prime`. In EDRIXS we follow the convention of -# summing over all orbital pairs. Some other texts count each pair of -# indices only once. The matrix elements here will consequently -# be half the magnitude of those in other references. -# We can express the interactions in terms of -# the orbitals involved. It is common to distinguish "direct Coulomb" and -# "exchange" interactions. The former come from electrons in the same orbital -# and the later involve swapping orbital labels for electrons. We will use -# :math:`U_0` and :math:`J` as a shorthand for distinguishing these. -# -# Before we describe the different types of interactions, we note that since -# the Coulomb interaction is real, and due to the spin symmmetry properties -# of the process :math:`U` always obeys -# -# .. math:: -# \begin{equation} -# U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} = -# U_{\beta\sigma,\alpha\sigma^\prime,\delta\sigma^\prime,\gamma\sigma} = -# U_{\delta\sigma,\gamma\sigma^\prime,\beta\sigma^\prime,\alpha\sigma} = -# U_{\gamma\sigma,\delta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}. -# \end{equation} -# -# -# 1. Intra orbital -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# The direct Coulomb energy cost to double-occupy an orbital comes from terms -# like :math:`U_{\alpha\sigma,\alpha\bar\sigma,\alpha\bar\sigma,\alpha\sigma}`. -# In this notation, we use :math:`\sigma^\prime` to denote that the matrix -# element is summed over all pairs and :math:`\bar{\sigma}` to denote sums -# over all opposite spin pairs. Due to rotational symmetry, all these -# elements are the same and equal to -# -# .. math:: -# \begin{eqnarray} -# U_0 &=& \frac{A}{2} + 2B + \frac{3C}{2}\\ -# &=& \frac{F_0}{2} + 2F_2 + 18F_4 -# \end{eqnarray} -# -# Let's print these to demonstrate where these live in the array -for i in range(0, 5): - val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {val:.3f}") - -################################################################################ -# 2. Inter orbital Coulomb interactions -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Direct Coulomb repulsion between different orbitals depends on terms like -# :math:`U_{\alpha\sigma,\beta\sigma^\prime,\beta\sigma^\prime,\alpha\sigma}`. -# Expresions for these parameters are provided in column :math:`U` in -# :ref:`table_2_orbital`. We can print the values from :code:`umat` -# like this: -for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - -################################################################################ -# 3. Inter-orbital exchange interactions -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Exchange terms exist with the form -# :math:`U_{\alpha\sigma,\beta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}`. -# Expresions for these parameters are provided in column :math:`J` of -# :ref:`table_2_orbital`. These come from terms like this in the matrix: -for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - -################################################################################ -# 4. Pair hopping term -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Terms that swap pairs of electrons exist as -# :math:`(1-\delta_{\sigma\sigma'})U_{\alpha\sigma,\alpha\bar\sigma,\beta\bar\sigma,\beta\sigma}` -# and depend on exchange interactions column :math:`J` from -# :ref:`table_2_orbital` -# and here in the matrix. -for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - -################################################################################ -# 5. Three orbital -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Another set of terms that one might not immediately anticipate involve three -# orbitals like -# -# .. math:: -# \begin{equation} -# U_{\alpha\sigma, \gamma\sigma', \beta\sigma', \gamma\sigma} \\ -# U_{\alpha\sigma, \gamma\sigma', \gamma\sigma', \beta\sigma} \\ -# (1-\delta_{\sigma\sigma'}) -# U_{\alpha\sigma, \beta\sigma', \gamma\sigma', \gamma\sigma} -# \end{equation} -# -# for :math:`\alpha=3z^2-r^2, \beta=x^2-y^2, \gamma=xz/yz`. -# These are needed to maintain the rotational symmetry of the interations. -# See :ref:`table_3_orbital` for the expressions. We can print some of -# these via: -ijkl = [[0, 1, 3, 1], - [0, 2, 3, 2], - [1, 0, 3, 1], - [1, 1, 3, 0], - [2, 0, 3, 2], - [2, 2, 3, 0]] - -for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t" - f"{orbitals[k]:<8} \t {orbitals[l]:<8} \t {val:.3f}") - -################################################################################ -# 6. Four orbital -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Futher multi-orbital terms include -# :math:`U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma}`. -# We can find these here in the matrix: -ijkl = [[0, 1, 2, 4], - [0, 1, 4, 2], - [0, 2, 1, 4], - [0, 2, 4, 1], - [0, 4, 1, 2], - [0, 4, 2, 1], - [3, 1, 4, 2], - [3, 2, 4, 1], - [3, 4, 1, 2], - [3, 4, 2, 1]] - -for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {orbitals[k]:<8}" - f"\t {orbitals[l]:<8} \t {val:.3f}") - -################################################################################ -# Effects of multi-orbital terms -# ------------------------------------------------------------------------------ -# To test the effects of the multi-orbital terms, let's plot the eigenenergy -# spectra with and without multi-orbital terms switched on for system with and -# without a cubic crystal field. We will use a :math:`d`-shell with two -# electrons. -ten_dqs = [0, 2, 4, 12] - -def diagonalize(ten_dq, umat): - emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq), - edrixs.tmat_c2r('d', ispin=True)) - H = (edrixs.build_opers(4, umat, basis) - + edrixs.build_opers(2, emat, basis)) - e, v = scipy.linalg.eigh(H) - return e - e.min() - -basis = edrixs.get_fock_bin_by_N(10, 2) -umat_no_multiorbital = np.copy(umat) -B = F2/49 - 5*F4/441 -for val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]: - umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0 - -fig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3)) - -for cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)): - ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1, - label='on', color=f'C{cind}') - ax.hlines(diagonalize(ten_dq, umat_no_multiorbital), - xmin=1.5, xmax=2.5, - label='off', - linestyle=':', color=f'C{cind}') - ax.set_title(f"$10D_q={ten_dq}$") - ax.set_ylim([-.5, 20]) - ax.set_xticks([]) - ax.legend() - -fig.suptitle("Eigenvalues with 3&4-orbital effects on/off") -fig.subplots_adjust(wspace=.3) -axs[0].set_ylabel('Eigenvalues (eV)') -fig.subplots_adjust(top=.8) -plt.show() - -################################################################################ -# On the left of the plot Coulomb interactions in spherical symmetry cause -# substantial mxing between :math:`t_{2g}` and :math:`e_{g}` orbitals in the -# eigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the -# the right eigenenergies. As :math:`10D_q` get large, this mixing is switched -# off and the spectra start to become independent of whether the 3 & 4 orbital -# orbital terms are included or not. -# -# -# -# .. _table_2_orbital: -# .. table:: Table of 2 orbital interactions -# -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |Orbitals :math:`\alpha,\beta`|:math:`U_0` Racah | :math:`U_0` Slater |:math:`J` Racah |:math:`J` Slater | -# +=============================+==================+=======================+================+====================+ -# |:math:`3z^2-r^2, xz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`3z^2-r^2, yz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`3z^2-r^2, x^2-y^2` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`3z^2-r^2, xy` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`xz, yz` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`xz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`xz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`yz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`yz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`x^2-y^2, xy` |:math:`A/2+2B+C/2`|:math:`F_0+4F_2-34F_4` | :math:`C/2` |:math:`35F_4/2` | -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# -# -# .. _table_3_orbital: -# .. table:: Table of 3 orbital interactions -# -# +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ -# |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| -# +=============================+=============+====================================================+=====================================================+ -# |:math:`3z^2-r^2, xz, x^2-y^2, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, yz, x^2-y^2, yz` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`xz, 3z^2-r^2, x^2-y^2, xz` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`xz, xz, x^2-y^2, 3z^2-r^2` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`yz, 3z^2-r^2, x^2-y^2, yz` | :math:`\sqrt{3}B` | :math:`\sqrt{3}F_2-5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`yz, yz, x^2-y^2, 3z^2-r^2` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# -# -# .. _table_4_orbital: -# .. table:: Table of 4 orbital interactions -# -# +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ -# |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| -# +=============================+=============+====================================================+=====================================================+ -# |:math:`3z^2-r^2, xz, yz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, xz, xy, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, yz, xz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, yz, xy, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, xy, xz, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, xy, yz, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , xz, xy, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , yz, xy, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , xy, xz, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , xy, yz, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# -# -# .. rubric:: Footnotes -# -# .. [1] MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of -# Transition-Metal Ions in Crystals. Academic Press, New York and London. diff --git a/edrixs/_downloads/66f2a6da335f3f194c2adc5e82be4b27/example_8_Hunds_interactions.ipynb b/edrixs/_downloads/66f2a6da335f3f194c2adc5e82be4b27/example_8_Hunds_interactions.ipynb deleted file mode 100644 index 59ddcab40b..0000000000 --- a/edrixs/_downloads/66f2a6da335f3f194c2adc5e82be4b27/example_8_Hunds_interactions.ipynb +++ /dev/null @@ -1,193 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Hund's Interactions in charge transfer insulators\nIn this exercise we will solve a toy model relevant to cubic $d^8$ charge transfer insulators\nsuch as NiO or NiPS\\ :sub:`3`. We are interested in better understanding the interplay between the\nHund's interactions and the charge transfer energy in terms of the energy of the triplet-singlet\nexcitations of this model. These seem to act against each other in that the Hund's interactions\nimpose a energy cost for the triplet-singlet excitations whenever there are two holes on\nthe Ni $d$ orbitals. The charge transfer physics, on the other hand, will promote a\n$d^9\\underline{L}$ ground state in which the Hund's interactions are not active.\n\nThe simplest model that captures this physics requires four Ni spin-orbitals, representing the Ni\n$e_g$ manifold. We will represent the ligand states in the same way as the Anderson impurity\nmodel in terms of one effective ligand spin-orbital per Ni spin-orbital. We assume these effective\norbitals have been constructed so that each Ni orbital only bonds to one sister orbital. For\nsimplicity, we will treat all Ni and all ligand orbitals as equivalent, even though a more\nrealistic model would account for the different Coulomb and hopping of the $d_{3z^2-r^2}$\nand $d_{x^2-y^2}$ orbitals. We therefore simply connect Ni and ligand orbitals via a constant\nhopping $t$. We also include the ligand energy parameter $e_L$.\n\nThe easiest way to implement the requried Coulomb interactions is to use the so-called Kanamori\nHamiltonian, which is a simplfied form for the interactions, which treats all orbitals as\nequivalent. Daniel Khomskii's book provides a great explanation of this physics [1]_. We\nparameterize the interactions via Coulomb repulsion parameter $U$ and Hund's exchange\n$J_H$. EDRIXS provides this functionality via the more general\n:func:`.get_umat_kanamori` function.\n\nIt's also easiest to consider this problem in hole langauge, which means our eight spin-orbitals\nare populated by two fermions.\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup\nWe start by loading the necessary modules, and defining the total number of\norbitals and electrons.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport scipy\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nnorb = 8\nnoccu = 2" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Diagonalization\nLet's write a function to diagonalize our model in a similar way to\nthe `sphx_glr_auto_examples_example_6_Hubbard_dimer.py` example.\nWithin this function, we also create operators to count the number of\n$d$ holes and operators to calculate expectation values for\n$S^2$ and $S_z$. For the latter to make sense, we also include a\nsmall effective spin interaction along $z$.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "def diagonalize(U, JH, t, eL, n=1):\n # Setup Coulomb matrix\n umat = np.zeros((norb, norb, norb, norb), dtype=complex)\n uNi = edrixs.get_umat_kanamori(norb//2, U, JH)\n umat[:norb//2, :norb//2, :norb//2, :norb//2] = uNi\n\n # Setup hopping matrix\n emat = np.zeros((norb, norb), dtype=complex)\n ind = np.arange(norb//2)\n emat[ind, ind + norb//2] = t\n emat[ind+norb//2, ind] = np.conj(t) # conj is not needed, but is good practise.\n ind = np.arange(norb//2, norb)\n emat[ind, ind] += eL\n\n # Spin operator\n spin_mom = np.zeros((3, norb, norb), dtype=complex)\n spin_mom[:, :2, :2] = edrixs.get_spin_momentum(0)\n spin_mom[:, 2:4, 2:4] = edrixs.get_spin_momentum(0)\n spin_mom[:, 4:6, 4:6] = edrixs.get_spin_momentum(0)\n spin_mom[:, 6:8, 6:8] = edrixs.get_spin_momentum(0)\n\n # add small effective field along z\n emat += 1e-6*spin_mom[2]\n\n # Diagonalize\n basis = edrixs.get_fock_bin_by_N(norb, noccu)\n H = edrixs.build_opers(2, emat, basis) + edrixs.build_opers(4, umat, basis)\n e, v = scipy.linalg.eigh(H)\n e -= e[0] # Define ground state as zero energy\n\n # Operator for holes on Ni\n basis = np.array(basis)\n num_d_electrons = basis[:, :4].sum(1)\n d0 = np.sum(np.abs(v[num_d_electrons == 0, :])**2, axis=0)\n d1 = np.sum(np.abs(v[num_d_electrons == 1, :])**2, axis=0)\n d2 = np.sum(np.abs(v[num_d_electrons == 2, :])**2, axis=0)\n\n # S^2 and Sz operators\n opS = edrixs.build_opers(2, spin_mom, basis)\n S_squared_op = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2])\n S_squared_exp = edrixs.cb_op(S_squared_op, v).diagonal().real\n S_z_exp = edrixs.cb_op(opS[2], v).diagonal().real\n\n return e[:n], d0[:n], d1[:n], d2[:n], S_squared_exp[:n], S_z_exp[:n]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## The atomic limit\nFor simplicity, let's start in the atomic limit with $e_L \\gg t \\gg U$\nwhere all holes are on nickel. In this case, there are six ways to distribute\ntwo holes on the four Ni spin-orbitals. Let's examine the expectation values\nof the $S^2$ and $S_z$ operators.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "U = 10\nJH = 2\nt = 100\neL = 1e10\n\ne, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6)\n\nprint(\"Ground state\\nE\\t\")\nfor i in range(3):\n print(f\"{e[i]:.2f}\\t{S_squared_exp[i]:.2f}\\t{S_z_exp[i]:.2f}\")\n\nprint(\"\\nExcited state\\nE\\t\")\nfor i in range(3, 6):\n print(f\"{e[i]:.2f}\\t{S_squared_exp[i]:.2f}\\t{S_z_exp[i]:.2f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The ground state is a high-spin triplet. The fourth and fifth\nstates (the first excited state) are low-spin singlet excitons at\n$2 J_H$. These have one hole on each orbital in the antisymmetric\ncombination of $|\\uparrow\\downarrow>-|\\downarrow\\uparrow>$.\nThe state at $3 J_H$ also has one hole on each orbital in the symmetric\n$|\\uparrow\\downarrow>+|\\downarrow\\uparrow>$ configuration.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Where are the holes for large hopping\nAs discussed at the start, we are interested to see interplay between Hund's\nand charge-transfer physics, which will obviously depend strongly on whether\nthe holes are on Ni or the ligand. Let's see what happens as $e_L$ is\nreduced while observing the location of the ground state and exciton holes.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "U = 10\nJH = 2\nt = 100\n\neLs = np.linspace(0, 1000, 30)\n\nfig, axs = plt.subplots(1, 2, figsize=(8, 4))\n\nfor ax, ind in zip(axs.ravel(), [0, 3]):\n ds = np.array([diagonalize(U, JH, t, eL, n=6)\n for eL in eLs])\n\n ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$')\n ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$')\n ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$')\n ax.set_xlabel(\"Energy of ligands $e_L$\")\n ax.set_ylabel(\"Number of electrons\")\n ax.legend()\n\naxs[0].set_title(\"Location of ground state holes\")\naxs[1].set_title(\"Location of exciton holes\")\n\nplt.tight_layout()\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "For large $e_L$, we see that both holes are on nickel as expected. In\nthe opposite limit of $|e_L| \\ll t$ and $U \\ll t$ the holes are\nshared in the ratio 0.25:0.5:0.25 as there are two ways to have one hole on\nNi. In the limit of large $e_L$, all holes move onto Ni. Since\n$t$ is large, this applies equally to both the ground state and the\nexciton.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Connecton between atomic and charge transfer limits\nWe now examine the quantum numbers during cross over between the two limits\nwith $e_L$. Let's first look at the how $$ changes for the\nground state and exciton and then examine how the exciton energy changes.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "U = 10\nJH = 2\nt = 100\n\neLs = np.linspace(0, 1000, 30)\n\ninfo = np.array([diagonalize(U, JH, t, eL, n=6)\n for eL in eLs])\n\nfig, axs = plt.subplots(1, 2, figsize=(8, 4))\n\n\naxs[0].plot(eLs, info[:, 4, 0], label='Ground state')\naxs[0].plot(eLs, info[:, 4, 3], label='Exciton')\naxs[0].set_xlabel(\"Energy of ligands $e_L$\")\naxs[0].set_ylabel('$$')\naxs[0].set_title('Quantum numbers')\naxs[0].legend()\n\naxs[1].plot(eLs, info[:, 0, 3], '+', color='C0')\naxs[1].set_xlabel(\"Energy of ligands $e_L$\")\naxs[1].set_ylabel('Exciton energy', color='C0')\naxr = axs[1].twinx()\naxr.plot(eLs, info[:, 3, 5], 'x', color='C1')\naxr.set_ylabel('$d^2$ fraction', color='C1')\n\nfor ax, color in zip([axs[1], axr], ['C0', 'C1']):\n for tick in ax.get_yticklabels():\n tick.set_color(color)\n\naxs[1].set_ylim(0, 2*JH)\naxr.set_ylim(0, 1)\n\naxs[1].set_title('Exciton energy vs. $d^2$ character')\nplt.tight_layout()\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the left panel, we see that the two limits are adiabatically connected\nas they preseve the same quantum numbers. This is because there is always\nan appreciable double occupancy under conditions where the\n$d^9\\underline{L}$ character is maximized and this continues to favor\nthe high spin ground state. Other interactions such as strong tetragonal\ncrystal field would be needed to overcome the Hund's interactions and break\nthis paradigm. In the right panel, we see that the exciton energy simply\nscales with the double occupancy. Overall, even though\nHund's interactions are irrelevant for the $d^9\\underline{L}$\nelectronic configuration, whenever $t$ is appreciable there is a\nstrong mixing with the $d^8$ component is always present, which\ndominates the energy of the exciton.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Charge transfer excitons\nAnother limiting case of the model is where $t$ is smaller than the\nCoulomb interactions. This, however, tends to produce\nground state and exciton configurations that correspond to those of distinct\natomic models. Let's look at the $e_L$ dependence in this case.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "U = 10\nJH = 2\nt = .5\neL = 7\n\neLs = np.linspace(0, 20, 30)\n\nfig, axs = plt.subplots(1, 2, figsize=(8, 4))\n\nfor ax, ind in zip(axs.ravel(), [0, 3]):\n ds = np.array([diagonalize(U, JH, t, eL, n=6)\n for eL in eLs])\n\n ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$')\n ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$')\n ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$')\n ax.set_xlabel(\"Energy of ligands $e_L$\")\n ax.set_ylabel(\"Number of electrons\")\n ax.legend()\n\naxs[0].axvline(x=eL, linestyle=':', color='k')\naxs[1].axvline(x=eL, linestyle=':', color='k')\n\naxs[0].set_title(\"Location of ground state holes\")\naxs[1].set_title(\"Location of exciton holes\")\n\nplt.tight_layout()\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Around $e_L = 7$ the plot shows that the excition is primairly a\n$d^2 \\rightarrow d^1$ transition or a\n$d^8 \\rightarrow d^{9}\\underline{L}$ transition in electron language.\nLet's examine the energy and quantum numbers.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6)\n\nprint(\"Ground state\\nE\\t\")\nfor i in range(3):\n print(f\"{e[i]:.2f}\\t{S_squared_exp[i]:.2f}\\t{S_z_exp[i]:.2f}\")\n\nprint(\"\\nExcited state\\nE\\t\")\nfor i in range(3, 6):\n print(f\"{e[i]:.2f}\\t{S_squared_exp[i]:.2f}\\t{S_z_exp[i]:.2f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We once again see the same quantum numbers, despite the differences in mixing\nin the ground state and exciton.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ".. rubric:: Footnotes\n\n.. [1] D. Khomskii, Transition Metal Compounds, Cambridge University Press (2014)\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.16" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/687fb58743d637976afd57fbd8a78ef9/example_9_Coulomb.ipynb b/edrixs/_downloads/687fb58743d637976afd57fbd8a78ef9/example_9_Coulomb.ipynb deleted file mode 100644 index d05c2ff880..0000000000 --- a/edrixs/_downloads/687fb58743d637976afd57fbd8a78ef9/example_9_Coulomb.ipynb +++ /dev/null @@ -1,215 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Coulomb interactions\nIn this example we provide more details on how Coulomb interactions are\nimplemented in multiplet calculations and EDRIXS in particular. We aim\nto clarify the form of the matrices, how they are parametrized,\nand how the breaking of spherical symmetry can switch on additional elements\nthat one might not anticipate. Our example is based on a $d$ atomic shell.\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Create matrix\nThe Coulomb interaction between two particles can be written as\n\n .. math::\n \\begin{equation}\n \\hat{H} = \\frac{1}{2}\n \\int d\\mathbf{r} \\int d\\mathbf{r}^\\prime\n \\Sigma_{\\sigma, \\sigma^\\prime}\n |\\hat{\\psi}^\\sigma(\\mathbf{r})|^2 \\frac{e^2}{R}\n |\\hat{\\psi}^{\\sigma^\\prime}(\\mathbf{r^\\prime})|^2,\n \\end{equation}\n\nwhere $\\hat{\\psi}^\\sigma(\\mathbf{r})$ is the electron wavefunction, with\nspin $\\sigma$, and $R=|r-r^\\prime|$ is the electron separation.\nSolving our problem in this form is difficult due to the need to symmeterize\nthe wavefunction to follow fermionic statistics.\nUsing second quantization, we can use operators to impose the required\nparticle exchange statistics and write the equation in terms of\na tensor $U$\n\n .. math::\n \\begin{equation}\n \\hat{H} = \\sum_{\\alpha,\\beta,\\gamma,\\delta,\\sigma,\\sigma^\\prime}\n U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\gamma\\sigma^\\prime,\\delta\\sigma}\n \\hat{f}^{\\dagger}_{\\alpha\\sigma}\n \\hat{f}^{\\dagger}_{\\beta\\sigma^\\prime}\n \\hat{f}_{\\gamma\\sigma^\\prime}\\hat{f}_{\\delta\\sigma},\n \\end{equation}\n\nwhere $\\alpha$, $\\beta$, $\\gamma$, $\\delta$ are\norbital indices and $\\hat{f}^{\\dagger}$\n($\\hat{f}$) are the creation (anihilation) operators.\nFor a $d$-electron system, we have $10$ distinct spin-orbitals\n($5$ orbitals each with $2$ spins), which makes matrix the\n$10\\times10\\times10\\times10$ in total size.\nIn EDRIXS the matrix can be created as follows:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport numpy as np\nimport scipy\nimport matplotlib.pyplot as plt\nimport itertools\n\nF0, F2, F4 = 6.94, 14.7, 4.41\numat_chb = edrixs.get_umat_slater('d', F0, F2, F4)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We stored this under variable :code:`umat_chb` where \"cbh\" stands for\ncomplex harmonic basis, which is the default basis in EDRIXS.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Parameterizing interactions\nEDRIXS parameterizes the interactions in $U$ via Slater integral\nparameters $F^{k}$. These relate to integrals of various spherical\nHarmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients,\nand Wigner 3J symbols. Textbooks such as [1]_ can be used for further\nreference. If you are interested in the details of how\nEDRIXS does this (and you probably aren't) function :func:`.umat_slater`,\nconstructs the required matrix via Gaunt coeficents from\n:func:`.get_gaunt`. Two alternative parameterizations are common.\nThe first are the Racah parameters, which are\n\n .. math::\n \\begin{eqnarray}\n A &=& F^0 - \\frac{49}{441} F^4 \\\\\n B &=& \\frac{1}{49}F^2 - \\frac{5}{441}F^4 \\\\\n C &=& \\frac{35}{441}F^4.\n \\end{eqnarray}\n\nor an alternative form for the Slater integrals\n\n .. math::\n \\begin{eqnarray}\n F_0 &=& F^0 \\\\\n F_2 &=& \\frac{1}{49}F^2 \\\\\n F_4 &=& \\frac{1}{441}F^4,\n \\end{eqnarray}\n\nwhich involves different normalization parameters.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Basis transform\nIf we want to use the real harmonic basis, we can use a tensor\ntransformation, which imposes the following orbital order\n$3z^2-r^2, xz, yz, x^2-y^2, xy$, each of which involves\n$\\uparrow, \\downarrow$ spin pairs. Let's perform this transformation and\nstore a list of these orbitals.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True))\norbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy']" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Interactions\nTensor $U$ is a series of matrix\nelements\n\n .. math::\n \\begin{equation}\n \\langle\\psi_{\\gamma,\\delta}^{\\bar{\\sigma},\\bar{\\sigma}^\\prime}\n |\\hat{H}|\n \\psi_{\\alpha,\\beta}^{\\sigma,\\sigma^\\prime}\\rangle\n \\end{equation}\n\nthe combination of which defines the energetic cost of pairwise\nelectron-electron interactions between states $\\alpha,\\sigma$\nand $\\beta,\\sigma^\\prime$. In EDRIXS we follow the convention of\nsumming over all orbital pairs. Some other texts count each pair of\nindices only once. The matrix elements here will consequently\nbe half the magnitude of those in other references.\nWe can express the interactions in terms of\nthe orbitals involved. It is common to distinguish \"direct Coulomb\" and\n\"exchange\" interactions. The former come from electrons in the same orbital\nand the later involve swapping orbital labels for electrons. We will use\n$U_0$ and $J$ as a shorthand for distinguishing these.\n\nBefore we describe the different types of interactions, we note that since\nthe Coulomb interaction is real, and due to the spin symmmetry properties\nof the process $U$ always obeys\n\n .. math::\n \\begin{equation}\n U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\gamma\\sigma^\\prime,\\delta\\sigma} =\n U_{\\beta\\sigma,\\alpha\\sigma^\\prime,\\delta\\sigma^\\prime,\\gamma\\sigma} =\n U_{\\delta\\sigma,\\gamma\\sigma^\\prime,\\beta\\sigma^\\prime,\\alpha\\sigma} =\n U_{\\gamma\\sigma,\\delta\\sigma^\\prime,\\alpha\\sigma^\\prime,\\beta\\sigma}.\n \\end{equation}\n\n\n### 1. Intra orbital\nThe direct Coulomb energy cost to double-occupy an orbital comes from terms\nlike $U_{\\alpha\\sigma,\\alpha\\bar\\sigma,\\alpha\\bar\\sigma,\\alpha\\sigma}$.\nIn this notation, we use $\\sigma^\\prime$ to denote that the matrix\nelement is summed over all pairs and $\\bar{\\sigma}$ to denote sums\nover all opposite spin pairs. Due to rotational symmetry, all these\nelements are the same and equal to\n\n .. math::\n \\begin{eqnarray}\n U_0 &=& \\frac{A}{2} + 2B + \\frac{3C}{2}\\\\\n &=& \\frac{F_0}{2} + 2F_2 + 18F_4\n \\end{eqnarray}\n\nLet's print these to demonstrate where these live in the array\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i in range(0, 5):\n val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real\n print(f\"{orbitals[i]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 2. Inter orbital Coulomb interactions\nDirect Coulomb repulsion between different orbitals depends on terms like\n$U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\beta\\sigma^\\prime,\\alpha\\sigma}$.\nExpresions for these parameters are provided in column $U$ in\n`table_2_orbital`. We can print the values from :code:`umat`\nlike this:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i, j in itertools.combinations(range(5), 2):\n val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 3. Inter-orbital exchange interactions\nExchange terms exist with the form\n$U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\alpha\\sigma^\\prime,\\beta\\sigma}$.\nExpresions for these parameters are provided in column $J$ of\n`table_2_orbital`. These come from terms like this in the matrix:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i, j in itertools.combinations(range(5), 2):\n val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 4. Pair hopping term\nTerms that swap pairs of electrons exist as\n$(1-\\delta_{\\sigma\\sigma'})U_{\\alpha\\sigma,\\alpha\\bar\\sigma,\\beta\\bar\\sigma,\\beta\\sigma}$\nand depend on exchange interactions column $J$ from\n`table_2_orbital`\nand here in the matrix.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i, j in itertools.combinations(range(5), 2):\n val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 5. Three orbital\nAnother set of terms that one might not immediately anticipate involve three\norbitals like\n\n .. math::\n \\begin{equation}\n U_{\\alpha\\sigma, \\gamma\\sigma', \\beta\\sigma', \\gamma\\sigma} \\\\\n U_{\\alpha\\sigma, \\gamma\\sigma', \\gamma\\sigma', \\beta\\sigma} \\\\\n (1-\\delta_{\\sigma\\sigma'})\n U_{\\alpha\\sigma, \\beta\\sigma', \\gamma\\sigma', \\gamma\\sigma}\n \\end{equation}\n\nfor $\\alpha=3z^2-r^2, \\beta=x^2-y^2, \\gamma=xz/yz$.\nThese are needed to maintain the rotational symmetry of the interations.\nSee `table_3_orbital` for the expressions. We can print some of\nthese via:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ijkl = [[0, 1, 3, 1],\n [0, 2, 3, 2],\n [1, 0, 3, 1],\n [1, 1, 3, 0],\n [2, 0, 3, 2],\n [2, 2, 3, 0]]\n\nfor i, j, k, l in ijkl:\n val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t\"\n f\"{orbitals[k]:<8} \\t {orbitals[l]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 6. Four orbital\nFuther multi-orbital terms include\n$U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\gamma\\sigma^\\prime,\\delta\\sigma}$.\nWe can find these here in the matrix:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ijkl = [[0, 1, 2, 4],\n [0, 1, 4, 2],\n [0, 2, 1, 4],\n [0, 2, 4, 1],\n [0, 4, 1, 2],\n [0, 4, 2, 1],\n [3, 1, 4, 2],\n [3, 2, 4, 1],\n [3, 4, 1, 2],\n [3, 4, 2, 1]]\n\nfor i, j, k, l in ijkl:\n val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {orbitals[k]:<8}\"\n f\"\\t {orbitals[l]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Effects of multi-orbital terms\nTo test the effects of the multi-orbital terms, let's plot the eigenenergy\nspectra with and without multi-orbital terms switched on for system with and\nwithout a cubic crystal field. We will use a $d$-shell with two\nelectrons.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ten_dqs = [0, 2, 4, 12]\n\ndef diagonalize(ten_dq, umat):\n emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq),\n edrixs.tmat_c2r('d', ispin=True))\n H = (edrixs.build_opers(4, umat, basis)\n + edrixs.build_opers(2, emat, basis))\n e, v = scipy.linalg.eigh(H)\n return e - e.min()\n\nbasis = edrixs.get_fock_bin_by_N(10, 2)\numat_no_multiorbital = np.copy(umat)\nB = F2/49 - 5*F4/441\nfor val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]:\n umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0\n\nfig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3))\n\nfor cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)):\n ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1,\n label='on', color=f'C{cind}')\n ax.hlines(diagonalize(ten_dq, umat_no_multiorbital),\n xmin=1.5, xmax=2.5,\n label='off',\n linestyle=':', color=f'C{cind}')\n ax.set_title(f\"$10D_q={ten_dq}$\")\n ax.set_ylim([-.5, 20])\n ax.set_xticks([])\n ax.legend()\n\nfig.suptitle(\"Eigenvalues with 3&4-orbital effects on/off\")\nfig.subplots_adjust(wspace=.3)\naxs[0].set_ylabel('Eigenvalues (eV)')\nfig.subplots_adjust(top=.8)\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "On the left of the plot Coulomb interactions in spherical symmetry cause\nsubstantial mxing between $t_{2g}$ and $e_{g}$ orbitals in the\neigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the\nthe right eigenenergies. As $10D_q$ get large, this mixing is switched\noff and the spectra start to become independent of whether the 3 & 4 orbital\norbital terms are included or not.\n\n\n\n.. table:: Table of 2 orbital interactions\n\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |Orbitals $\\alpha,\\beta$|$U_0$ Racah | $U_0$ Slater |$J$ Racah |$J$ Slater |\n +=============================+==================+=======================+================+====================+\n |$3z^2-r^2, xz$ |$A/2+B+C/2$ |$F_0/2+F_2-12F_4$| $B/2+C/2$|$F_2/2+15F_4$ |\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$3z^2-r^2, yz$ |$A/2+B+C/2$ |$F_0/2+F_2-12F_4$| $B/2+C/2$|$F_2/2+15F_4$ |\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$3z^2-r^2, x^2-y^2$ |$A/2-2B+C/2$|$F_0/2-2F_2+3F_4$|$2B+C/2$ |$2F_2+15F_4/2$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$3z^2-r^2, xy$ |$A/2-2B+C/2$|$F_0/2-2F_2+3F_4$|$2B+C/2$ |$2F_2+15F_4/2$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$xz, yz$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$xz, x^2-y^2$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$xz, xy$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$yz, x^2-y^2$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$yz, xy$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$x^2-y^2, xy$ |$A/2+2B+C/2$|$F_0+4F_2-34F_4$ | $C/2$ |$35F_4/2$ |\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n\n\n.. table:: Table of 3 orbital interactions\n\n +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+\n |Orbitals $\\alpha,\\beta,\\gamma,\\delta$|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Racah|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Slater|\n +=============================+=============+====================================================+=====================================================+\n |$3z^2-r^2, xz, x^2-y^2, xz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, yz, x^2-y^2, yz$ | $-\\sqrt{3}B/2$ | $-\\sqrt{3}F_2/2+5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$xz, 3z^2-r^2, x^2-y^2, xz$ | $-\\sqrt{3}B$ | $-\\sqrt{3}F_2+5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$xz, xz, x^2-y^2, 3z^2-r^2$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$yz, 3z^2-r^2, x^2-y^2, yz$ | $\\sqrt{3}B$ | $\\sqrt{3}F_2-5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$yz, yz, x^2-y^2, 3z^2-r^2$ | $-\\sqrt{3}B/2$ | $-\\sqrt{3}F_2/2+5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n\n\n.. table:: Table of 4 orbital interactions\n\n +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+\n |Orbitals $\\alpha,\\beta,\\gamma,\\delta$|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Racah|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Slater|\n +=============================+=============+====================================================+=====================================================+\n |$3z^2-r^2, xz, yz, xy$ | $-\\sqrt{3}B$ | $-\\sqrt{3}F_2+5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, xz, xy, yz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, yz, xz, xy$ | $-\\sqrt{3}B$ | $-\\sqrt{3}F_2+5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, yz, xy, xz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, xy, xz, yz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, xy, yz, xz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , xz, xy, yz$ | $-3B/2$ | $-3F_2/2+15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , yz, xy, xz$ | $3B/2$ | $3F_2/2-15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , xy, xz, yz$ | $-3B/2$ | $-3F_2/2+15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , xy, yz, xz$ | $3B/2$ | $3F_2/2-15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n\n\n.. rubric:: Footnotes\n\n.. [1] MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of\n Transition-Metal Ions in Crystals. Academic Press, New York and London.\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.16" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/6892534c439210f8e60d50aca5e6bbee/example_8_Coulomb.py b/edrixs/_downloads/6892534c439210f8e60d50aca5e6bbee/example_8_Coulomb.py deleted file mode 100644 index 2b8065f156..0000000000 --- a/edrixs/_downloads/6892534c439210f8e60d50aca5e6bbee/example_8_Coulomb.py +++ /dev/null @@ -1,381 +0,0 @@ -#!/usr/bin/env python -""" -Coulomb interactions -===================================== -In this example we provide more details on how Coulomb interactions are -implemented in multiplet calculations and EDRIXS in particular. We aim -to clarify the form of the matrices, how they are parametrized, -and how the breaking of spherical symmetry can switch on additional elements -that one might not anticipate. Our example is based on a :math:`d` atomic shell. -""" - -################################################################################ -# Create matrix -# ------------------------------------------------------------------------------ -# The Coulomb interaction between two particles can be written as -# -# .. math:: -# \begin{equation} -# \hat{H} = \frac{1}{2} -# \int d\mathbf{r} \int d\mathbf{r}^\prime -# \Sigma_{\sigma, \sigma^\prime} -# |\hat{\psi}^\sigma(\mathbf{r})|^2 \frac{e^2}{R} -# |\hat{\psi}^{\sigma^\prime}(\mathbf{r^\prime})|^2, -# \end{equation} -# -# where :math:`\hat{\psi}^\sigma(\mathbf{r})` is the electron wavefunction, with -# spin :math:`\sigma`, and :math:`R=|r-r^\prime|` is the electron separation. -# Solving our problem in this form is difficult due to the need to symmeterize -# the wavefunction to follow fermionic statistics. -# Using second quantization, we can use operators to impose the required -# particle exchange statistics and write the equation in terms of -# a tensor :math:`U` -# -# .. math:: -# \begin{equation} -# \hat{H} = \sum_{\alpha,\beta,\gamma,\delta,\sigma,\sigma^\prime} -# U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} -# \hat{f}^{\dagger}_{\alpha\sigma} -# \hat{f}^{\dagger}_{\beta\sigma^\prime} -# \hat{f}_{\gamma\sigma^\prime}\hat{f}_{\delta\sigma}, -# \end{equation} -# -# where :math:`\alpha`, :math:`\beta`, :math:`\gamma`, :math:`\delta` are -# orbital indices and :math:`\hat{f}^{\dagger}` -# (:math:`\hat{f}`) are the creation (anihilation) operators. -# For a :math:`d`-electron system, we have :math:`10` distinct spin-orbitals -# (:math:`5` orbitals each with :math:`2` spins), which makes matrix the -# :math:`10\times10\times10\times10` in total size. -# In EDRIXS the matrix can be created as follows: -import edrixs -import numpy as np -import scipy -import matplotlib.pyplot as plt -import itertools - -F0, F2, F4 = 6.94, 14.7, 4.41 -umat_chb = edrixs.get_umat_slater('d', F0, F2, F4) -################################################################################ -# We stored this under variable :code:`umat_chb` where "cbh" stands for -# complex harmonic basis, which is the default basis in EDRIXS. - -################################################################################ -# Parameterizing interactions -# ------------------------------------------------------------------------------ -# EDRIXS parameterizes the interactions in :math:`U` via Slater integral -# parameters :math:`F^{k}`. These relate to integrals of various spherical -# Harmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients, -# and Wigner 3J symbols. Textbooks such as [1]_ can be used for further -# reference. If you are interested in the details of how -# EDRIXS does this (and you probably aren't) function :func:`.umat_slater`, -# constructs the required matrix via Gaunt coeficents from -# :func:`.get_gaunt`. Two alternative parameterizations are common. -# The first are the Racah parameters, which are -# -# .. math:: -# \begin{eqnarray} -# A &=& F^0 - \frac{49}{441} F^4 \\ -# B &=& \frac{1}{49}F^2 - \frac{5}{441}F^4 \\ -# C &=& \frac{35}{441}F^4. -# \end{eqnarray} -# -# or an alternative form for the Slater integrals -# -# .. math:: -# \begin{eqnarray} -# F_0 &=& F^0 \\ -# F_2 &=& \frac{1}{49}F^2 \\ -# F_4 &=& \frac{1}{441}F^4, -# \end{eqnarray} -# -# which involves different normalization parameters. - -################################################################################ -# Basis transform -# ------------------------------------------------------------------------------ -# If we want to use the real harmonic basis, we can use a tensor -# transformation, which imposes the following orbital order -# :math:`3z^2-r^2, xz, yz, x^2-y^2, xy`, each of which involves -# :math:`\uparrow, \downarrow` spin pairs. Let's perform this transformation and -# store a list of these orbitals. -umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True)) -orbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy'] - -################################################################################ -# Interactions -# ------------------------------------------------------------------------------ -# Tensor :math:`U` is a series of matrix -# elements -# -# .. math:: -# \begin{equation} -# \langle\psi_{\gamma,\delta}^{\bar{\sigma},\bar{\sigma}^\prime} -# |\hat{H}| -# \psi_{\alpha,\beta}^{\sigma,\sigma^\prime}\rangle -# \end{equation} -# -# the combination of which defines the energetic cost of pairwise -# electron-electron interactions between states :math:`\alpha,\sigma` -# and :math:`\beta,\sigma^\prime`. In EDRIXS we follow the convention of -# summing over all orbital pairs. Some other texts count each pair of -# indices only once. The matrix elements here will consequently -# be half the magnitude of those in other references. -# We can express the interactions in terms of -# the orbitals involved. It is common to distinguish "direct Coulomb" and -# "exchange" interactions. The former come from electrons in the same orbital -# and the later involve swapping orbital labels for electrons. We will use -# :math:`U_0` and :math:`J` as a shorthand for distinguishing these. -# -# Before we describe the different types of interactions, we note that since -# the Coulomb interaction is real, and due to the spin symmmetry properties -# of the process :math:`U` always obeys -# -# .. math:: -# \begin{equation} -# U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} = -# U_{\beta\sigma,\alpha\sigma^\prime,\delta\sigma^\prime,\gamma\sigma} = -# U_{\delta\sigma,\gamma\sigma^\prime,\beta\sigma^\prime,\alpha\sigma} = -# U_{\gamma\sigma,\delta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}. -# \end{equation} -# -# -# 1. Intra orbital -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# The direct Coulomb energy cost to double-occupy an orbital comes from terms -# like :math:`U_{\alpha\sigma,\alpha\bar\sigma,\alpha\bar\sigma,\alpha\sigma}`. -# In this notation, we use :math:`\sigma^\prime` to denote that the matrix -# element is summed over all pairs and :math:`\bar{\sigma}` to denote sums -# over all opposite spin pairs. Due to rotational symmetry, all these -# elements are the same and equal to -# -# .. math:: -# \begin{eqnarray} -# U_0 &=& \frac{A}{2} + 2B + \frac{3C}{2}\\ -# &=& \frac{F_0}{2} + 2F_2 + 18F_4 -# \end{eqnarray} -# -# Let's print these to demonstrate where these live in the array -for i in range(0, 5): - val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {val:.3f}") - -################################################################################ -# 2. Inter orbital Coulomb interactions -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Direct Coulomb repulsion between different orbitals depends on terms like -# :math:`U_{\alpha\sigma,\beta\sigma^\prime,\beta\sigma^\prime,\alpha\sigma}`. -# Expresions for these parameters are provided in column :math:`U` in -# :ref:`table_2_orbital`. We can print the values from :code:`umat` -# like this: -for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - -################################################################################ -# 3. Inter-orbital exchange interactions -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Exchange terms exist with the form -# :math:`U_{\alpha\sigma,\beta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}`. -# Expresions for these parameters are provided in column :math:`J` of -# :ref:`table_2_orbital`. These come from terms like this in the matrix: -for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - -################################################################################ -# 4. Pair hopping term -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Terms that swap pairs of electrons exist as -# :math:`(1-\delta_{\sigma\sigma'})U_{\alpha\sigma,\alpha\bar\sigma,\beta\bar\sigma,\beta\sigma}` -# and depend on exchange interactions column :math:`J` from -# :ref:`table_2_orbital` -# and here in the matrix. -for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - -################################################################################ -# 5. Three orbital -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Another set of terms that one might not immediately anticipate involve three -# orbitals like -# -# .. math:: -# \begin{equation} -# U_{\alpha\sigma, \gamma\sigma', \beta\sigma', \gamma\sigma} \\ -# U_{\alpha\sigma, \gamma\sigma', \gamma\sigma', \beta\sigma} \\ -# (1-\delta_{\sigma\sigma'}) -# U_{\alpha\sigma, \beta\sigma', \gamma\sigma', \gamma\sigma} -# \end{equation} -# -# for :math:`\alpha=3z^2-r^2, \beta=x^2-y^2, \gamma=xz/yz`. -# These are needed to maintain the rotational symmetry of the interations. -# See :ref:`table_3_orbital` for the expressions. We can print some of -# these via: -ijkl = [[0, 1, 3, 1], - [0, 2, 3, 2], - [1, 0, 3, 1], - [1, 1, 3, 0], - [2, 0, 3, 2], - [2, 2, 3, 0]] - -for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t" - f"{orbitals[k]:<8} \t {orbitals[l]:<8} \t {val:.3f}") - -################################################################################ -# 6. Four orbital -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Futher multi-orbital terms include -# :math:`U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma}`. -# We can find these here in the matrix: -ijkl = [[0, 1, 2, 4], - [0, 1, 4, 2], - [0, 2, 1, 4], - [0, 2, 4, 1], - [0, 4, 1, 2], - [0, 4, 2, 1], - [3, 1, 4, 2], - [3, 2, 4, 1], - [3, 4, 1, 2], - [3, 4, 2, 1]] - -for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {orbitals[k]:<8}" - f"\t {orbitals[l]:<8} \t {val:.3f}") - -################################################################################ -# Effects of multi-orbital terms -# ------------------------------------------------------------------------------ -# To test the effects of the multi-orbital terms, let's plot the eigenenergy -# spectra with and without multi-orbital terms switched on for system with and -# without a cubic crystal field. We will use a :math:`d`-shell with two -# electrons. -ten_dqs = [0, 2, 4, 12] - -def diagonalize(ten_dq, umat): - emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq), - edrixs.tmat_c2r('d', ispin=True)) - H = (edrixs.build_opers(4, umat, basis) - + edrixs.build_opers(2, emat, basis)) - e, v = scipy.linalg.eigh(H) - return e - e.min() - -basis = edrixs.get_fock_bin_by_N(10, 2) -umat_no_multiorbital = np.copy(umat) -B = F2/49 - 5*F4/441 -for val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]: - umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0 - -fig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3)) - -for cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)): - ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1, - label='on', color=f'C{cind}') - ax.hlines(diagonalize(ten_dq, umat_no_multiorbital), - xmin=1.5, xmax=2.5, - label='off', - linestyle=':', color=f'C{cind}') - ax.set_title(f"$10D_q={ten_dq}$") - ax.set_ylim([-.5, 20]) - ax.set_xticks([]) - ax.legend() - -fig.suptitle("Eigenvalues with 3&4-orbital effects on/off") -fig.subplots_adjust(wspace=.3) -axs[0].set_ylabel('Eigenvalues (eV)') -fig.subplots_adjust(top=.8) -plt.show() - -################################################################################ -# On the left of the plot Coulomb interactions in spherical symmetry cause -# substantial mxing between :math:`t_{2g}` and :math:`e_{g}` orbitals in the -# eigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the -# the right eigenenergies. As :math:`10D_q` get large, this mixing is switched -# off and the spectra start to become independent of whether the 3 & 4 orbital -# orbital terms are included or not. -# -# -# -# .. _table_2_orbital: -# .. table:: Table of 2 orbital interactions -# -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |Orbitals :math:`\alpha,\beta`|:math:`U_0` Racah | :math:`U_0` Slater |:math:`J` Racah |:math:`J` Slater | -# +=============================+==================+=======================+================+====================+ -# |:math:`3z^2-r^2, xz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`3z^2-r^2, yz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`3z^2-r^2, x^2-y^2` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`3z^2-r^2, xy` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`xz, yz` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`xz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`xz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`yz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`yz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`x^2-y^2, xy` |:math:`A/2+2B+C/2`|:math:`F_0+4F_2-34F_4` | :math:`C/2` |:math:`35F_4/2` | -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# -# -# .. _table_3_orbital: -# .. table:: Table of 3 orbital interactions -# -# +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ -# |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| -# +=============================+=============+====================================================+=====================================================+ -# |:math:`3z^2-r^2, xz, x^2-y^2, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, yz, x^2-y^2, yz` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`xz, 3z^2-r^2, x^2-y^2, xz` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`xz, xz, x^2-y^2, 3z^2-r^2` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`yz, 3z^2-r^2, x^2-y^2, yz` | :math:`\sqrt{3}B` | :math:`\sqrt{3}F_2-5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`yz, yz, x^2-y^2, 3z^2-r^2` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# -# -# .. _table_4_orbital: -# .. table:: Table of 4 orbital interactions -# -# +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ -# |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| -# +=============================+=============+====================================================+=====================================================+ -# |:math:`3z^2-r^2, xz, yz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, xz, xy, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, yz, xz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, yz, xy, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, xy, xz, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, xy, yz, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , xz, xy, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , yz, xy, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , xy, xz, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , xy, yz, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# -# -# .. rubric:: Footnotes -# -# .. [1] MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of -# Transition-Metal Ions in Crystals. Academic Press, New York and London. diff --git a/edrixs/_downloads/6a1b3a453f5ca6a1cd55874996f58fad/example_2_single_atom_RIXS.py b/edrixs/_downloads/6a1b3a453f5ca6a1cd55874996f58fad/example_2_single_atom_RIXS.py deleted file mode 100644 index dc6bd57b00..0000000000 --- a/edrixs/_downloads/6a1b3a453f5ca6a1cd55874996f58fad/example_2_single_atom_RIXS.py +++ /dev/null @@ -1,248 +0,0 @@ -#!/usr/bin/env python -""" -RIXS calculations for an atomic model -===================================== -Here we show how to compute RIXS for a single site atomic model with crystal -field and electron-electron interactions. We take the case of -Sr\ :sub:`2`\ YIrO\ :sub:`6` -from Ref. [1]_ as the material in question. The aim of this example is to -illustrate the proceedure and to provide what we hope is useful advice. What is -written is not meant to be a replacement for reading the docstrings of the -functions, which can always be accessed on the -`edrixs website `_ or -by executing functions with ?? in IPython. -""" -import edrixs -import numpy as np -import matplotlib.pyplot as plt - -################################################################################ -# Specify active core and valence orbitals -# ------------------------------------------------------------------------------ -# Sr\ :sub:`2`\ YIrO\ :sub:`6`\ has a :math:`5d^4` electronic configuration and -# we want to calculate the :math:`L_3` edge spectrum i.e. resonating with a -# :math:`2p_{3/2}` core hole. We will start by including only the -# :math:`t_{2g}` valance orbitals. -shell_name = ('t2g', 'p32') -v_noccu = 4 - -################################################################################ -# Slater parameters -# ------------------------------------------------------------------------------ -# Here we want to use Hund's interaction -# :math:`J_H` and spin orbit coupling :math:`\lambda` as adjustable parameters -# to match experiment. We will take -# the core hole interaction parameter from the Hartree Fock numbers EDRIXS has -# in its database. These need to be converted and arranged into the order -# required by EDRIXS. -Ud = 2 -JH = 0.25 -lam = 0.42 -F0_d, F2_d, F4_d = edrixs.UdJH_to_F0F2F4(Ud, JH) -info = edrixs.utils.get_atom_data('Ir', '5d', v_noccu, edge='L3') -G1_dp = info['slater_n'][5][1] -G3_dp = info['slater_n'][6][1] -F0_dp = edrixs.get_F0('dp', G1_dp, G3_dp) -F2_dp = info['slater_n'][4][1] - -slater_i = [F0_d, F2_d, F4_d] # Fk for d -slater_n = [ - F0_d, F2_d, F4_d, # Fk for d - F0_dp, F2_dp, # Fk for dp - G1_dp, G3_dp, # Gk for dp - 0.0, 0.0 # Fk for p -] -slater = [slater_i, slater_n] -v_soc = (lam, lam) - -################################################################################ -# Diagonalization -# ------------------------------------------------------------------------------ -# We obtain the ground and intermediate state eigenenergies and the transition -# operators via matrix diagonalization. Note that the calculation does not know -# the core hole energy, so we need to adjust the energy that the resonance will -# appear at by hand. We know empirically that the resonance is at 11215 eV -# and that putting four electrons into the valance band costs about -# :math:`4 F^0_d\approx6` eV. In this case -# we are assuming a perfectly cubic crystal field, which we have already -# implemented when we specified the use of the :math:`t_{2g}` subshell only -# so we do not need to pass an additional :code:`v_cfmat` matrix. - -off = 11215 - 6 -out = edrixs.ed_1v1c_py(shell_name, shell_level=(0, -off), v_soc=v_soc, - c_soc=info['c_soc'], v_noccu=v_noccu, slater=slater) -eval_i, eval_n, trans_op = out - -################################################################################ -# Compute XAS -# ------------------------------------------------------------------------------ -# To calculate XAS we need to correctly specify the orientation of the x-rays -# with respect to the sample. By default, the :math:`x, y, z` coordinates -# of the sample's crystal field, will be aligned with our lab frame, passing -# :code:`loc_axis` to :code:`ed_1v1c_py` can be used to specify a different -# convention. The experimental geometry is specified following the angles -# shown in Figure 1 of Y. Wang et al., -# `Computer Physics Communications 243, 151-165 (2019) -# `_. The default -# setting has x-rays along :math:`z` for :math:`\theta=\pi/2` rad -# and the x-ray beam along :math:`-x` for -# :math:`\theta=\phi=0`. Parameter :code:`scatter_axis` can be passed to -# :code:`xas_1v1c_py` to specify a different geometry if desired. -# -# Variable :code:`pol_type` specifies a list of different x-ray -# polarizations to calculate. Here we will use so-called :math:`\pi`-polarization -# where the x-rays are parallel to the plane spanned by the incident -# beam and the sample :math:`z`-axis. -# -# EDRIXS represents the system's ground state using a set of -# low energy eigenstates weighted by Boltzmann thermal factors. -# These eigenstates are specified by :code:`gs_list`, -# which is of the form :math:`[0, 1, 2, 3, \dots]`. In this example, we -# calculate these states as those that have non-negligible thermal -# population. The function :code:`xas_1v1c_py` assumes that the spectral -# broadening is dominated by the inverse core hole lifetime :code:`gamma_c`, -# which is the Lorentzian half width at half maximum. - -ominc = np.linspace(11200, 11230, 50) -temperature = 300 # in K -prob = edrixs.boltz_dist(eval_i, temperature) -gs_list = [n for n, prob in enumerate(prob) if prob > 1e-6] - -thin = 30*np.pi/180 -phi = 0 -pol_type = [('linear', 0)] - -xas = edrixs.xas_1v1c_py( - eval_i, eval_n, trans_op, ominc, gamma_c=info['gamma_c'], - thin=thin, phi=phi, pol_type=pol_type, - gs_list=gs_list) - - -################################################################################ -# Compute RIXS -# ------------------------------------------------------------------------------ -# Calculating RIXS is overall similar to XAS, but with a few additional -# considerations. The spectral width in the energy loss axis of RIXS it -# not set by the core hole lifetime, but by either the final state lifetime -# or the experimental resolution and is parameterized by :code:`gamma_f` -# -- the Lorentzian half width at half maximum. -# -# The angle and polarization of the emitted beam must also be specified, so -# we pass :code:`pol_type_rixs` to the function, which specifies the -# includes the incoming and outgoing x-ray states. If, as is common in -# experiments, the emitted polarization is not resolved -# one needs to add both emitted polarization channels, which is what we will -# do later on in this example. - -eloss = np.linspace(-.5, 6, 400) -pol_type_rixs = [('linear', 0, 'linear', 0), ('linear', 0, 'linear', np.pi/2)] - -thout = 60*np.pi/180 -gamma_f = 0.02 - -rixs = edrixs.rixs_1v1c_py( - eval_i, eval_n, trans_op, ominc, eloss, - gamma_c=info['gamma_c'], gamma_f=gamma_f, - thin=thin, thout=thout, phi=phi, - pol_type=pol_type_rixs, gs_list=gs_list, - temperature=temperature -) - -################################################################################ -# The array :code:`xas` will have shape -# :code:`(len(ominc_xas), len(pol_type))` - -################################################################################ -# Plot XAS and RIXS -# ------------------------------------------------------------------------------ -# Let's plot everything. We will use a function so we can reuse the code later. -# Note that the rixs array :code:`rixs` has shape -# :code:`(len(ominc_xas), len(ominc_xas), len(pol_type))`. We will use some numpy -# tricks to sum over the two different emitted polarizations. - -fig, axs = plt.subplots(2, 2, figsize=(10, 10)) - - -def plot_it(axs, ominc, xas, eloss, rixscut, rixsmap=None, label=None): - axs[0].plot(ominc, xas[:, 0], label=label) - axs[0].set_xlabel('Energy (eV)') - axs[0].set_ylabel('Intensity') - axs[0].set_title('XAS') - - axs[1].plot(eloss, rixscut, label=f"{label}") - axs[1].set_xlabel('Energy loss (eV)') - axs[1].set_ylabel('Intensity') - axs[1].set_title(f'RIXS at resonance') - - if rixsmap is not None: - art = axs[2].pcolormesh(ominc, eloss, rixsmap.T, shading='auto') - plt.colorbar(art, ax=axs[2], label='Intensity') - axs[2].set_xlabel('Incident energy (eV)') - axs[2].set_ylabel('Energy loss') - axs[2].set_title('RIXS map') - - -rixs_pol_sum = rixs.sum(-1) -cut_index = np.argmax(rixs_pol_sum[:, eloss < 2].sum(1)) -rixscut = rixs_pol_sum[cut_index] - -plot_it(axs.ravel(), ominc, xas, eloss, rixscut, rixsmap=rixs_pol_sum) -axs[0, 1].set_xlim(right=3) -axs[1, 0].set_ylim(top=3) -axs[1, 1].remove() - -plt.show() - -################################################################################ -# Full d shell calculation -# ------------------------------------------------------------------------------ -# Some researchers have questioned the appropriateness of only including the -# :math:`t_{2g}` subshell for iridates [2]_. Let's test this. We specify that -# the full :math:`d` shell should be used and apply cubic crystal field matrix -# :code:`v_cfmat`. We shift the energy offset by :math:`\frac{2}{5}10D_q`, which -# is the amount the crystal field moves the :math:`t_{2g}` subshell. - -ten_dq = 3.5 -v_cfmat = edrixs.cf_cubic_d(ten_dq) -off = 11215 - 6 + ten_dq*2/5 -out = edrixs.ed_1v1c_py(('d', 'p32'), shell_level=(0, -off), v_soc=v_soc, - v_cfmat=v_cfmat, - c_soc=info['c_soc'], v_noccu=v_noccu, slater=slater) -eval_i, eval_n, trans_op = out - -xas_full_d_shell = edrixs.xas_1v1c_py( - eval_i, eval_n, trans_op, ominc, gamma_c=info['gamma_c'], - thin=thin, phi=phi, pol_type=pol_type, - gs_list=gs_list) - -rixs_full_d_shell = edrixs.rixs_1v1c_py( - eval_i, eval_n, trans_op, np.array([11215]), eloss, - gamma_c=info['gamma_c'], gamma_f=gamma_f, - thin=thin, thout=thout, phi=phi, - pol_type=pol_type_rixs, gs_list=gs_list, - temperature=temperature) - -fig, axs = plt.subplots(1, 2, figsize=(10, 4)) -plot_it(axs, ominc, xas, eloss, rixscut, label='$t_{2g}$ subshell') -rixscut = rixs_full_d_shell.sum((0, -1)) -plot_it(axs, ominc, xas_full_d_shell, eloss, rixscut, label='$d$ shell') - -axs[0].legend() -axs[1].legend() -plt.show() - -################################################################################ -# As expected, we see the appearance of excitations on the energy scale of -# :math:`10D_q` in the XAS and RIXS. The low energy manifold is qualitatively, -# but not quantiatively similar. This makes it clear that the parameterization -# of Sr\ :sub:`2`\ YIrO\ :sub:`6`\ is dependent on the model. - -############################################################################## -# -# .. rubric:: Footnotes -# -# .. [1] Bo Yuan et al., -# `Phys. Rev. B 95, 235114 (2017) `_. -# -# .. [2] Georgios L. Stamokostas and Gregory A. Fiete -# `Phys. Rev. B 97, 085150 (2018) `_. diff --git a/edrixs/_downloads/6c36c3d3d14c1014b0bd91c1f7e1e81f/example_8_Coulomb.ipynb b/edrixs/_downloads/6c36c3d3d14c1014b0bd91c1f7e1e81f/example_8_Coulomb.ipynb deleted file mode 100644 index b192071ea6..0000000000 --- a/edrixs/_downloads/6c36c3d3d14c1014b0bd91c1f7e1e81f/example_8_Coulomb.ipynb +++ /dev/null @@ -1,215 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Coulomb interactions\nIn this example we provide more details on how Coulomb interactions are\nimplemented in multiplet calculations and EDRIXS in particular. We aim\nto clarify the form of the matrices, how they are parametrized,\nand how the breaking of spherical symmetry can switch on additional elements\nthat one might not anticipate. Our example is based on a $d$ atomic shell.\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Create matrix\nThe Coulomb interaction between two particles can be written as\n\n .. math::\n \\begin{equation}\n \\hat{H} = \\frac{1}{2}\n \\int d\\mathbf{r} \\int d\\mathbf{r}^\\prime\n \\Sigma_{\\sigma, \\sigma^\\prime}\n |\\hat{\\psi}^\\sigma(\\mathbf{r})|^2 \\frac{e^2}{R}\n |\\hat{\\psi}^{\\sigma^\\prime}(\\mathbf{r^\\prime})|^2,\n \\end{equation}\n\nwhere $\\hat{\\psi}^\\sigma(\\mathbf{r})$ is the electron wavefunction, with\nspin $\\sigma$, and $R=|r-r^\\prime|$ is the electron separation.\nSolving our problem in this form is difficult due to the need to symmeterize\nthe wavefunction to follow fermionic statistics.\nUsing second quantization, we can use operators to impose the required\nparticle exchange statistics and write the equation in terms of\na tensor $U$\n\n .. math::\n \\begin{equation}\n \\hat{H} = \\sum_{\\alpha,\\beta,\\gamma,\\delta,\\sigma,\\sigma^\\prime}\n U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\gamma\\sigma^\\prime,\\delta\\sigma}\n \\hat{f}^{\\dagger}_{\\alpha\\sigma}\n \\hat{f}^{\\dagger}_{\\beta\\sigma^\\prime}\n \\hat{f}_{\\gamma\\sigma^\\prime}\\hat{f}_{\\delta\\sigma},\n \\end{equation}\n\nwhere $\\alpha$, $\\beta$, $\\gamma$, $\\delta$ are\norbital indices and $\\hat{f}^{\\dagger}$\n($\\hat{f}$) are the creation (anihilation) operators.\nFor a $d$-electron system, we have $10$ distinct spin-orbitals\n($5$ orbitals each with $2$ spins), which makes matrix the\n$10\\times10\\times10\\times10$ in total size.\nIn EDRIXS the matrix can be created as follows:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport numpy as np\nimport scipy\nimport matplotlib.pyplot as plt\nimport itertools\n\nF0, F2, F4 = 6.94, 14.7, 4.41\numat_chb = edrixs.get_umat_slater('d', F0, F2, F4)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We stored this under variable :code:`umat_chb` where \"cbh\" stands for\ncomplex harmonic basis, which is the default basis in EDRIXS.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Parameterizing interactions\nEDRIXS parameterizes the interactions in $U$ via Slater integral\nparameters $F^{k}$. These relate to integrals of various spherical\nHarmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients,\nand Wigner 3J symbols. Textbooks such as [1]_ can be used for further\nreference. If you are interested in the details of how\nEDRIXS does this (and you probably aren't) function :func:`.umat_slater`,\nconstructs the required matrix via Gaunt coeficents from\n:func:`.get_gaunt`. Two alternative parameterizations are common.\nThe first are the Racah parameters, which are\n\n .. math::\n \\begin{eqnarray}\n A &=& F^0 - \\frac{49}{441} F^4 \\\\\n B &=& \\frac{1}{49}F^2 - \\frac{5}{441}F^4 \\\\\n C &=& \\frac{35}{441}F^4.\n \\end{eqnarray}\n\nor an alternative form for the Slater integrals\n\n .. math::\n \\begin{eqnarray}\n F_0 &=& F^0 \\\\\n F_2 &=& \\frac{1}{49}F^2 \\\\\n F_4 &=& \\frac{1}{441}F^4,\n \\end{eqnarray}\n\nwhich involves different normalization parameters.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Basis transform\nIf we want to use the real harmonic basis, we can use a tensor\ntransformation, which imposes the following orbital order\n$3z^2-r^2, xz, yz, x^2-y^2, xy$, each of which involves\n$\\uparrow, \\downarrow$ spin pairs. Let's perform this transformation and\nstore a list of these orbitals.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True))\norbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy']" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Interactions\nTensor $U$ is a series of matrix\nelements\n\n .. math::\n \\begin{equation}\n \\langle\\psi_{\\gamma,\\delta}^{\\bar{\\sigma},\\bar{\\sigma}^\\prime}\n |\\hat{H}|\n \\psi_{\\alpha,\\beta}^{\\sigma,\\sigma^\\prime}\\rangle\n \\end{equation}\n\nthe combination of which defines the energetic cost of pairwise\nelectron-electron interactions between states $\\alpha,\\sigma$\nand $\\beta,\\sigma^\\prime$. In EDRIXS we follow the convention of\nsumming over all orbital pairs. Some other texts count each pair of\nindices only once. The matrix elements here will consequently\nbe half the magnitude of those in other references.\nWe can express the interactions in terms of\nthe orbitals involved. It is common to distinguish \"direct Coulomb\" and\n\"exchange\" interactions. The former come from electrons in the same orbital\nand the later involve swapping orbital labels for electrons. We will use\n$U_0$ and $J$ as a shorthand for distinguishing these.\n\nBefore we describe the different types of interactions, we note that since\nthe Coulomb interaction is real, and due to the spin symmmetry properties\nof the process $U$ always obeys\n\n .. math::\n \\begin{equation}\n U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\gamma\\sigma^\\prime,\\delta\\sigma} =\n U_{\\beta\\sigma,\\alpha\\sigma^\\prime,\\delta\\sigma^\\prime,\\gamma\\sigma} =\n U_{\\delta\\sigma,\\gamma\\sigma^\\prime,\\beta\\sigma^\\prime,\\alpha\\sigma} =\n U_{\\gamma\\sigma,\\delta\\sigma^\\prime,\\alpha\\sigma^\\prime,\\beta\\sigma}.\n \\end{equation}\n\n\n### 1. Intra orbital\nThe direct Coulomb energy cost to double-occupy an orbital comes from terms\nlike $U_{\\alpha\\sigma,\\alpha\\bar\\sigma,\\alpha\\bar\\sigma,\\alpha\\sigma}$.\nIn this notation, we use $\\sigma^\\prime$ to denote that the matrix\nelement is summed over all pairs and $\\bar{\\sigma}$ to denote sums\nover all opposite spin pairs. Due to rotational symmetry, all these\nelements are the same and equal to\n\n .. math::\n \\begin{eqnarray}\n U_0 &=& \\frac{A}{2} + 2B + \\frac{3C}{2}\\\\\n &=& \\frac{F_0}{2} + 2F_2 + 18F_4\n \\end{eqnarray}\n\nLet's print these to demonstrate where these live in the array\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i in range(0, 5):\n val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real\n print(f\"{orbitals[i]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 2. Inter orbital Coulomb interactions\nDirect Coulomb repulsion between different orbitals depends on terms like\n$U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\beta\\sigma^\\prime,\\alpha\\sigma}$.\nExpresions for these parameters are provided in column $U$ in\n`table_2_orbital`. We can print the values from :code:`umat`\nlike this:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i, j in itertools.combinations(range(5), 2):\n val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 3. Inter-orbital exchange interactions\nExchange terms exist with the form\n$U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\alpha\\sigma^\\prime,\\beta\\sigma}$.\nExpresions for these parameters are provided in column $J$ of\n`table_2_orbital`. These come from terms like this in the matrix:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i, j in itertools.combinations(range(5), 2):\n val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 4. Pair hopping term\nTerms that swap pairs of electrons exist as\n$(1-\\delta_{\\sigma\\sigma'})U_{\\alpha\\sigma,\\alpha\\bar\\sigma,\\beta\\bar\\sigma,\\beta\\sigma}$\nand depend on exchange interactions column $J$ from\n`table_2_orbital`\nand here in the matrix.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i, j in itertools.combinations(range(5), 2):\n val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 5. Three orbital\nAnother set of terms that one might not immediately anticipate involve three\norbitals like\n\n .. math::\n \\begin{equation}\n U_{\\alpha\\sigma, \\gamma\\sigma', \\beta\\sigma', \\gamma\\sigma} \\\\\n U_{\\alpha\\sigma, \\gamma\\sigma', \\gamma\\sigma', \\beta\\sigma} \\\\\n (1-\\delta_{\\sigma\\sigma'})\n U_{\\alpha\\sigma, \\beta\\sigma', \\gamma\\sigma', \\gamma\\sigma}\n \\end{equation}\n\nfor $\\alpha=3z^2-r^2, \\beta=x^2-y^2, \\gamma=xz/yz$.\nThese are needed to maintain the rotational symmetry of the interations.\nSee `table_3_orbital` for the expressions. We can print some of\nthese via:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ijkl = [[0, 1, 3, 1],\n [0, 2, 3, 2],\n [1, 0, 3, 1],\n [1, 1, 3, 0],\n [2, 0, 3, 2],\n [2, 2, 3, 0]]\n\nfor i, j, k, l in ijkl:\n val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t\"\n f\"{orbitals[k]:<8} \\t {orbitals[l]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 6. Four orbital\nFuther multi-orbital terms include\n$U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\gamma\\sigma^\\prime,\\delta\\sigma}$.\nWe can find these here in the matrix:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ijkl = [[0, 1, 2, 4],\n [0, 1, 4, 2],\n [0, 2, 1, 4],\n [0, 2, 4, 1],\n [0, 4, 1, 2],\n [0, 4, 2, 1],\n [3, 1, 4, 2],\n [3, 2, 4, 1],\n [3, 4, 1, 2],\n [3, 4, 2, 1]]\n\nfor i, j, k, l in ijkl:\n val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {orbitals[k]:<8}\"\n f\"\\t {orbitals[l]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Effects of multi-orbital terms\nTo test the effects of the multi-orbital terms, let's plot the eigenenergy\nspectra with and without multi-orbital terms switched on for system with and\nwithout a cubic crystal field. We will use a $d$-shell with two\nelectrons.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ten_dqs = [0, 2, 4, 12]\n\ndef diagonalize(ten_dq, umat):\n emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq),\n edrixs.tmat_c2r('d', ispin=True))\n H = (edrixs.build_opers(4, umat, basis)\n + edrixs.build_opers(2, emat, basis))\n e, v = scipy.linalg.eigh(H)\n return e - e.min()\n\nbasis = edrixs.get_fock_bin_by_N(10, 2)\numat_no_multiorbital = np.copy(umat)\nB = F2/49 - 5*F4/441\nfor val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]:\n umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0\n\nfig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3))\n\nfor cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)):\n ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1,\n label='on', color=f'C{cind}')\n ax.hlines(diagonalize(ten_dq, umat_no_multiorbital),\n xmin=1.5, xmax=2.5,\n label='off',\n linestyle=':', color=f'C{cind}')\n ax.set_title(f\"$10D_q={ten_dq}$\")\n ax.set_ylim([-.5, 20])\n ax.set_xticks([])\n ax.legend()\n\nfig.suptitle(\"Eigenvalues with 3&4-orbital effects on/off\")\nfig.subplots_adjust(wspace=.3)\naxs[0].set_ylabel('Eigenvalues (eV)')\nfig.subplots_adjust(top=.8)\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "On the left of the plot Coulomb interactions in spherical symmetry cause\nsubstantial mxing between $t_{2g}$ and $e_{g}$ orbitals in the\neigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the\nthe right eigenenergies. As $10D_q$ get large, this mixing is switched\noff and the spectra start to become independent of whether the 3 & 4 orbital\norbital terms are included or not.\n\n\n\n.. table:: Table of 2 orbital interactions\n\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |Orbitals $\\alpha,\\beta$|$U_0$ Racah | $U_0$ Slater |$J$ Racah |$J$ Slater |\n +=============================+==================+=======================+================+====================+\n |$3z^2-r^2, xz$ |$A/2+B+C/2$ |$F_0/2+F_2-12F_4$| $B/2+C/2$|$F_2/2+15F_4$ |\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$3z^2-r^2, yz$ |$A/2+B+C/2$ |$F_0/2+F_2-12F_4$| $B/2+C/2$|$F_2/2+15F_4$ |\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$3z^2-r^2, x^2-y^2$ |$A/2-2B+C/2$|$F_0/2-2F_2+3F_4$|$2B+C/2$ |$2F_2+15F_4/2$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$3z^2-r^2, xy$ |$A/2-2B+C/2$|$F_0/2-2F_2+3F_4$|$2B+C/2$ |$2F_2+15F_4/2$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$xz, yz$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$xz, x^2-y^2$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$xz, xy$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$yz, x^2-y^2$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$yz, xy$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$x^2-y^2, xy$ |$A/2+2B+C/2$|$F_0+4F_2-34F_4$ | $C/2$ |$35F_4/2$ |\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n\n\n.. table:: Table of 3 orbital interactions\n\n +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+\n |Orbitals $\\alpha,\\beta,\\gamma,\\delta$|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Racah|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Slater|\n +=============================+=============+====================================================+=====================================================+\n |$3z^2-r^2, xz, x^2-y^2, xz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, yz, x^2-y^2, yz$ | $-\\sqrt{3}B/2$ | $-\\sqrt{3}F_2/2+5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$xz, 3z^2-r^2, x^2-y^2, xz$ | $-\\sqrt{3}B$ | $-\\sqrt{3}F_2+5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$xz, xz, x^2-y^2, 3z^2-r^2$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$yz, 3z^2-r^2, x^2-y^2, yz$ | $\\sqrt{3}B$ | $\\sqrt{3}F_2-5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$yz, yz, x^2-y^2, 3z^2-r^2$ | $-\\sqrt{3}B/2$ | $-\\sqrt{3}F_2/2+5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n\n\n.. table:: Table of 4 orbital interactions\n\n +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+\n |Orbitals $\\alpha,\\beta,\\gamma,\\delta$|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Racah|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Slater|\n +=============================+=============+====================================================+=====================================================+\n |$3z^2-r^2, xz, yz, xy$ | $-\\sqrt{3}B$ | $-\\sqrt{3}F_2+5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, xz, xy, yz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, yz, xz, xy$ | $-\\sqrt{3}B$ | $-\\sqrt{3}F_2+5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, yz, xy, xz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, xy, xz, yz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, xy, yz, xz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , xz, xy, yz$ | $-3B/2$ | $-3F_2/2+15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , yz, xy, xz$ | $3B/2$ | $3F_2/2-15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , xy, xz, yz$ | $-3B/2$ | $-3F_2/2+15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , xy, yz, xz$ | $3B/2$ | $3F_2/2-15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n\n\n.. rubric:: Footnotes\n\n.. [1] MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of\n Transition-Metal Ions in Crystals. Academic Press, New York and London.\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.14" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/6cd93e346e243a1950ba57feae08db0a/example_0_ed_calculator.ipynb b/edrixs/_downloads/6cd93e346e243a1950ba57feae08db0a/example_0_ed_calculator.ipynb deleted file mode 100644 index fb3489b263..0000000000 --- a/edrixs/_downloads/6cd93e346e243a1950ba57feae08db0a/example_0_ed_calculator.ipynb +++ /dev/null @@ -1,355 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Exact diagonalization\nHere we show how to find the eigenvalues and eigenvectors of a many-body\nHamiltonian of fermions with Coulomb interactions. We then determine their spin\nand orbital angular momentum and how this changes when we switch on spin-orbit\ncoupling.\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Import the necessary modules.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import numpy as np\nimport matplotlib.pyplot as plt\nimport scipy\nimport edrixs" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Parameters\nDefine the orbital angular momentum number $l=1$ (i.e. a `p` shell),\nthe number of spin-orbitals, the occupancy and the Slater integrals.\n$F^{k}$ with $k=0,2$:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "l = 1\nnorb = 6\nnoccu = 2\nF0, F2 = 4.0, 1.0" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Coulomb interactions\nThe Coulomb interactions in EDRIXS are described by a tensor. Understanding this\nin full is complicated and requires careful consideration of the symmetry of the\ninteractions. See example 6 for more discussion if desired.\nEDRIXS can construct the matrix via\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "umat = edrixs.get_umat_slater('p', F0, F2)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Create basis\nNow we build the binary form of the Fock basis $|F>$ (we consider it\npreferable to use the standard $F$ and trust the reader to avoid\nconfusing it with the interaction parameters.)\nThe Fock basis is the simplest legitimate form for the basis and it consists\nof a series of 1s and 0s where 1 means occupied and\n0 means empty. These are in order up, down, up, down, up, down.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "basis = edrixs.get_fock_bin_by_N(norb, noccu)\nprint(np.array(basis))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We expect the number of these states to be given by the mathematical\ncombination of two electrons distributed among six states (three spin-orbitals\nwith two spins per orbital).\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "message = (\"We predict C(norb={}, noccu={})={:.0f} states and we got {:d}, \"\n \"which is reassuring!\")\nprint(message.format(norb, noccu, edrixs.combination(norb, noccu), len(basis)))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Note that in more complicated problems with both valence and core\nelectrons, the edrixs convention is to list the valence electrons first.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Transform interactions into Fock basis\nedrixs works by initiailly creating a Hamiltonian matrix\n$\\hat{H}$ in the single particle basis and then transforming into\nour chosen Fock basis. In the single particle basis, we have four fermion\ninteractions with this form\n\n .. math::\n \\hat{H} = \n\ngenerated as\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "n_fermion = 4\nH = edrixs.build_opers(n_fermion, umat, basis)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We needed to specify :code:`n_fermion = 4` because the\n:code:`edrixs.build_opers` function can also make two fermion terms.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Diagonalize the matrix\nFor a small problem such as this it is convenient to use the native\n[scipy](https://scipy.org) diagonalization routine. This returns eigenvalues\n:code:`e` and eignvectors :code:`v` where eigenvalue :code:`e[i]` corresponds\nto eigenvector :code:`v[:,i]`.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "e, v = scipy.linalg.eigh(H)\nprint(\"{} eignvalues and {} eigvenvectors {} elements long.\".format(len(e),\n v.shape[1],\n v.shape[0]))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Computing expectation values\nTo interpret the results, it is informative to compute the expectations values\nrelated to the spin $\\mathbf{S}$, orbital $\\mathbf{L}$,\nand total $\\mathbf{J}$, angular momentum. We first load the relevant\nmatrices for these quantities for a `p` atomic shell. We need to specify\nthat we would like to include spin when loading the orbital operator.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "orb_mom = edrixs.get_orb_momentum(l, ispin=True)\nspin_mom = edrixs.get_spin_momentum(l)\ntot_mom = orb_mom + spin_mom" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We again transform these matrices to our Fock basis to build the operators\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "n_fermion = 2\nopL, opS, opJ = edrixs.build_opers(n_fermion, [orb_mom, spin_mom, tot_mom],\n basis)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Recall that quantum mechanics forbids us from knowing all three Cartesian\ncomponents of angular momentum at once, so we want to compute the squares of\nthese operators i.e.\n\n .. math::\n \\mathbf{S}^2 = S^2_x + S^2_y + S^2_z\\\\\n \\mathbf{L}^2 = L^2_x + L^2_y + L^2_z\\\\\n \\mathbf{J}^2 = J^2_x + J^2_y + J^2_z\n\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "L2 = np.dot(opL[0], opL[0]) + np.dot(opL[1], opL[1]) + np.dot(opL[2], opL[2])\nS2 = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2])\nJ2 = np.dot(opJ[0], opJ[0]) + np.dot(opJ[1], opJ[1]) + np.dot(opJ[2], opJ[2])" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Remember that the eigenvalues of $\\mathbf{S}^2$ are in the form\n$S(S+1)$ etc. and that they can be obtained by calculating the\nprojection of the operators onto our eigenvectors.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "L2_val = edrixs.cb_op(L2, v).diagonal().real\nS2_val = edrixs.cb_op(S2, v).diagonal().real\nJ2_val = edrixs.cb_op(J2, v).diagonal().real" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We can determine the degeneracy of the eigenvalues numerically and print out\nthe values as follows\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "e = np.round(e, decimals=6)\ndegeneracy = [sum(eval == e) for eval in e]\nheader = \"{:<3s}\\t{:>8s}\\t{:>8s}\\t{:>8s}\\t{:>8s}\"\nprint(header.format(\"# \", \"E \", \"S(S+1)\", \"L(L+1)\", \"Degen.\"))\nfor i, eigenvalue in enumerate(e):\n values_list = [i, eigenvalue, S2_val[i], L2_val[i], degeneracy[i]]\n print(\"{:<3d}\\t{:8.3f}\\t{:8.3f}\\t{:8.3f}\\t{:>3d}\".format(*values_list))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We see $S=0$ and $S=1$ states coming from the\ntwo combinations of the spin 1/2 particles. $L$ can take values of\n0, 1, 2. Remember that spin states have degeneracy of $2S+1$ and the\nsame is true for orbital states.\nWe must multiply these $S$ and\n$L$ degeneracies to get the total degeneracy.\nSince these particles are fermions, the\noverall state must be antisymmetric, which dictates the allowed combinations\nof $S$ and $L$.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Energy level diagram\nLet us show our findings graphically\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fig, ax = plt.subplots()\nfor i, eigenvalue in enumerate(np.unique(e)):\n art = ax.plot([0, 1], [eigenvalue, eigenvalue], '-', color='C{}'.format(i))\n ind = np.where(eigenvalue == e)[0][0]\n L = (-1 + np.sqrt(1 + 4*L2_val[ind]))/2\n S = (-1 + np.sqrt(1 + 4*S2_val[ind]))/2\n message = \"L={:.0f}, S={:.0f} ({:.0f})\"\n ax.text(1, eigenvalue, message.format(L, S, degeneracy[ind]),\n horizontalalignment='right',\n verticalalignment='bottom',\n color='C{}'.format(i))\n\nax.set_ylabel('Energy')\nfor loc in ['right', 'top', 'bottom']:\n ax.spines[loc].set_visible(False)\n\nax.yaxis.set_ticks_position('left')\nax.set_xticks([])\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We see Hund's rules in action! Rule 1 says that the highest spin $S=1$\nstate has the lowest energy. Of the two $S=0$ states, the state with\nlarger $L=1$ is lower energy following rule 2.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Spin orbit coupling\nFor fun, we can see how this changes when we add spin orbit coupling (SOC).\nThis is a two-fermion operator that we create, transform into the Fock basis\nand add to the prior Hamiltonian. To make things easy, let us make the SOC\nsmall so that the LS coupling approximation is valid and we can\nstill track the states.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "soc = edrixs.atom_hsoc('p', 0.1)\nn_fermion = 2\nH2 = H + edrixs.build_opers(n_fermion, soc, basis)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Then, we redo the diagonalization and print the results.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "e2, v2 = scipy.linalg.eigh(H2)\ne2 = np.round(e2, decimals=6)\ndegeneracy2 = [sum(eval == e2) for eval in e2]\nprint()\nmessage = \"With SOC\\n {:<3s}\\t{:>8s}\\t{:>8s}\\t{:>8s}\\t{:>8s}\\t{:>8s}\"\nprint(message.format(\"#\", \"E\", \"S(S+1)\", \"L(L+1)\", \"J(J+1)\", \"degen.\"))\nJ2_val_soc = edrixs.cb_op(J2, v2).diagonal().real\nL2_val_soc = edrixs.cb_op(L2, v2).diagonal().real\nS2_val_soc = edrixs.cb_op(S2, v2).diagonal().real\nfor i, eigenvalue in enumerate(e2):\n values_list = [i, eigenvalue, S2_val_soc[i], L2_val_soc[i], J2_val_soc[i],\n degeneracy2[i]]\n print(\"{:<3d}\\t{:8.3f}\\t{:8.3f}\\t{:8.3f}\\t{:8.3f}\\t{:8.3f}\".format(*values_list))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "and we make an equivalent energy level diagram.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fig, ax = plt.subplots()\nfor i, eigenvalue in enumerate(np.unique(e2)):\n art = ax.plot([0, 1], [eigenvalue, eigenvalue], '-', color='C{}'.format(i))\n ind = np.where(eigenvalue == e2)[0][0]\n J = (-1 + np.sqrt(1+4*J2_val_soc[ind]))/2\n message = \"J={:.0f} ({:.0f})\"\n ax.text(1, eigenvalue, message.format(J, degeneracy2[ind]),\n horizontalalignment='right',\n verticalalignment='bottom',\n color='C{}'.format(i))\n\nax.set_ylabel('Energy')\nfor loc in ['right', 'top', 'bottom']:\n ax.spines[loc].set_visible(False)\n\nax.yaxis.set_ticks_position('left')\nax.set_xticks([])\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "It is clear that we have split the $S=1$ state, which branches into\nthree states from $J=|L-S|, |L-S|+1, ..., |L+S|$. Since the shell is\nless than half full, Hund's third rule dictates that the smaller $J$\nstates have the lower energies.\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.16" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/6dffa254d364294a4b733a81a90a1732/example_9_Coulomb.zip b/edrixs/_downloads/6dffa254d364294a4b733a81a90a1732/example_9_Coulomb.zip deleted file mode 100644 index 420846e43d..0000000000 Binary files a/edrixs/_downloads/6dffa254d364294a4b733a81a90a1732/example_9_Coulomb.zip and /dev/null differ diff --git a/edrixs/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip b/edrixs/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip deleted file mode 100644 index 41b8cc1b9d..0000000000 Binary files a/edrixs/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip and /dev/null differ diff --git a/edrixs/_downloads/70de13b284f960b925a33e4b2ba9a8c5/example_1_crystal_field.py b/edrixs/_downloads/70de13b284f960b925a33e4b2ba9a8c5/example_1_crystal_field.py deleted file mode 100644 index 9f7f924c6e..0000000000 --- a/edrixs/_downloads/70de13b284f960b925a33e4b2ba9a8c5/example_1_crystal_field.py +++ /dev/null @@ -1,202 +0,0 @@ -#!/usr/bin/env python -""" -Crystal fields -===================================== -This example explains how to implement crystal fields in edrixs. -""" -################################################################################ -# We need to import these modules. -import edrixs -import numpy as np -import scipy - -np.set_printoptions(precision=2, suppress=True, linewidth=90) - -################################################################################ -# Crystal field matrices -# ------------------------------------------------------------------------------ -# Let us start by considering the common case of a :math:`d` atomic shell in a -# cubic crystal field. This is controlled by parameter :math:`10D_q` and is -# described in terms of a matrix which we will assign to :code:`cfmat`. edrixs -# can make this matrix via. -ten_dq = 10 -cfmat = edrixs.angular_momentum.cf_cubic_d(ten_dq) - -################################################################################ -# Note this matrix is in a complex harmonic basis :math:`Y^m_l` where :math:`m` -# goes from :math:`-l,-l+1,...,l-1, l`. There is an up spin and a down -# spin for each :math:`Y^m_l`. This matrix is not diagonal in the complex -# harmonic basis, but it would be diagonal in the real harmonic basis -# :math:`d_{3z^2-r^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}`. -# Let us diagonalize this matrix as a check and print out the energies -# and their degeneracies. - -e, v = scipy.linalg.eigh(cfmat) -e = e.round(decimals=6) -unique_e = np.unique(e) -degeneracies = [sum(evalue == e) for evalue in unique_e] - -print("E \tDegeneracy") -for evalue, degenvalue in zip(unique_e, degeneracies): - print("{:.1f}\t{:.0f}".format(evalue, degenvalue)) -print("{} distinct energies".format(len(unique_e))) - -################################################################################ -# This makes sense! We see two different energies split by :math:`10D_q=10`. Let -# us look at the six columns corresponding to the lower energy eigenvalues. - -print(v[:, :6].real) - -################################################################################ -# These are the set of so-called :math:`t_{2g}` orbitals, composed of -# :math:`Y^2_2, Y^{-2}_2, Y^{1}_2, Y^{-1}_2`. The rest of the eigenvectors -# (the last four) are -print(v[:, 6:].real) - -################################################################################ -# These are the set of so-called :math:`e_{g}` orbitals, composed of -# :math:`Y^2_2, Y^{-2}_2, Y^{0}_2`. We can use edrixs to prove that -# :code:`cfmat` would be diagonal in the real -# harmonic basis. An operator :math:`\hat{O}` can be transformed into an -# operator in another basis :math:`\hat{O}^{\prime}` using a unitary -# transformation matrix :math:`T` as -# -# .. math:: -# -# \hat{O}^{\prime} = (T)^{\dagger} \hat{O} (T). -# -# This is computed as follows -cfmat_rhb = edrixs.cb_op(cfmat, edrixs.tmat_c2r('d', ispin=True)) -print(cfmat_rhb.real) - -################################################################################ -# where :code:`edrixs.tmat_c2r('d', ispin=True)` is the transformation matrix. -# We needed to tell edrixs that we are working with a :math:`d`-shell and that it -# should include spin. We could also have transformed :code:`v` to see how these -# eignevectors are composed of the real harmonic basis. We will see an example -# of this later. - -################################################################################ -# Crystal field on an atom -# ------------------------------------------------------------------------------ -# To simulate the solid state, we need to combine the crystal field with Coulomb -# interactions. Let us choose an atomic model for Ni. -l = 2 -norb = 10 -noccu = 8 -basis = edrixs.get_fock_bin_by_N(norb, noccu) -slater = edrixs.get_atom_data('Ni', '3d', noccu, edge='L3')['slater_i'] - -################################################################################ -# Let us implement a tetragonal crystal field, for which we need to pass -# :code:`d1` the splitting of :math:`d_{yz}/d_{zx}` and :math:`d_{xy}` and -# :code:`d3` the splitting of :math:`d_{3z^2-r^2}` and :math:`d_{x^2-y^2}`. -ten_dq, d1, d3 = 2.5, 0.9, .2 - -################################################################################ -# To determine the eigenvalues and eigenvectors we need to transform both our -# Coulomb matrix and our crystal field matrix into the same basis. See the -# example on exact diagonalization if needed. In this case, we put this -# procedure into a function, with the option to scale the Coulomb interactions. - - -def diagonlize(scaleU=1): - umat = edrixs.get_umat_slater('d', - slater[0][1]*scaleU, - slater[1][1]*scaleU, - slater[2][1]*scaleU) - cfmat = edrixs.angular_momentum.cf_tetragonal_d(ten_dq=ten_dq, d1=d1, d3=d3) - H = edrixs.build_opers(2, cfmat, basis) + edrixs.build_opers(4, umat, basis) - e, v = scipy.linalg.eigh(H) - e = e - np.min(e) # define ground state as zero energy - return e, v - - -################################################################################ -# Let us look what happens when we run the function with the Coulomb -# interactions switched off and check the degeneracy of the output. Look at this -# python -# `string formatting tutorial `_ -# if the code is confusing. -e, v = diagonlize(scaleU=0) -e = e.round(decimals=6) -unique_e = np.unique(e) -degeneracies = [sum(evalue == e) for evalue in unique_e] - -print("E \tDegeneracy") -for evalue, degenvalue in zip(unique_e, degeneracies): - print("{:.1f}\t{:.0f}".format(evalue, degenvalue)) -print("{} distinct energies".format(len(unique_e))) - -################################################################################ -# We see 10 distinct energies, which is the number of ways one can arrange -# two holes among 4 energy levels -- which makes sense as the tetragonal field -# involves four levels :math:`zx/zy, xy, 3z^2-r^2, x^2-y^2`. To see what is going -# on in more detail, we can also calculate the expectation -# values of the occupancy number of the orbitals -# :math:`3z^2-r^2, zx, zy, x^2-y^2, xy`. -# To create the operator, first write the matrix in the real harmonics basis -# :math:`|3z^2-r^2,\uparrow>`, :math:`|3z^2-r^2,\downarrow>`, -# :math:`|zx,\uparrow>`, :math:`|zx,\downarrow>`, etc. -# In this basis, they take a simple form: only the diagonal terms have element -# 1. We therefore make a 3D empty array and assign the diagonal as 1. Check -# out the -# `numpy indexing notes `_ -# if needed. -nd_real_harmoic_basis = np.zeros((norb, norb, norb), dtype=complex) -indx = np.arange(norb) -nd_real_harmoic_basis[indx, indx, indx] = 1 - -################################################################################ -# Recalling the necessity to put everything in the same basis, we transform -# into the complex harmonic basis and then transform into our Fock basis -nd_complex_harmoic_basis = edrixs.cb_op(nd_real_harmoic_basis, - edrixs.tmat_r2c('d', True)) -nd_op = edrixs.build_opers(2, nd_complex_harmoic_basis, basis) - - -################################################################################ -# We apply the operator and print out as follows. Check the -# `numpy docs `_ -# if the details of how the spin pairs have been added up is not immediately -# transparent. -nd_expt = np.array([edrixs.cb_op(nd_vec, v).diagonal().real for nd_vec in nd_op]) - -message = "{:>3s}" + "\t{:>6s}"*5 -print(message.format(*"E 3z2-r2 zx zy x2-y2 xy".split(" "))) - -message = "{:>3.1f}" + "\t{:>6.1f}"*5 -for evalue, row in zip(e, nd_expt.T): - spin_pairs = row.reshape(-1, 2).sum(1) - print(message.format(evalue, *spin_pairs)) - -################################################################################ -# The lowest energy state involves putting both holes in the :math:`x^2-y^2` -# orbital, which makes sense. Now, let us redo the proceedure including Coulomb -# repulsion, which imposes an energy cost to putting multiple electrons in the -# same orbital. - -e, v = diagonlize(scaleU=1) - -nd_expt = np.array([edrixs.cb_op(nd_vec, v).diagonal().real for nd_vec in nd_op]) - -message = "{:>3s}" + "\t{:>6s}"*5 -print(message.format(*"E 3z2-r2 zx zy x2-y2 xy".split(" "))) - -message = "{:>3.1f}" + "\t{:>6.1f}"*5 -for evalue, row in zip(e, nd_expt.T): - spin_pairs = row.reshape(-1, 2).sum(1) - print(message.format(evalue, *spin_pairs)) - -################################################################################ -# Now the lowest energy state involves splitting the holes between the two -# highest energy :math:`x^2-y^2` and :math:`3z^2-r^2` orbitals. i.e. we have -# gone from low-spin to high spin. Working out the balance between these two -# states is often one of the first things one wants to determine upon the -# discovery of an interesting new material [1]_. - -############################################################################## -# -# .. rubric:: Footnotes -# -# .. [1] M. Rossi et al., `arXiv:2011.00595 (2021) `_. diff --git a/edrixs/_downloads/7d2302527f77719856548abe89da7a72/example_8_Hunds_interactions.py b/edrixs/_downloads/7d2302527f77719856548abe89da7a72/example_8_Hunds_interactions.py deleted file mode 100644 index f33384ac8c..0000000000 --- a/edrixs/_downloads/7d2302527f77719856548abe89da7a72/example_8_Hunds_interactions.py +++ /dev/null @@ -1,290 +0,0 @@ -#!/usr/bin/env python -""" -Hund's Interactions in charge transfer insulators -================================================= -In this exercise we will solve a toy model relevant to cubic :math:`d^8` charge transfer insulators -such as NiO or NiPS\\ :sub:`3`. We are interested in better understanding the interplay between the -Hund's interactions and the charge transfer energy in terms of the energy of the triplet-singlet -excitations of this model. These seem to act against each other in that the Hund's interactions -impose a energy cost for the triplet-singlet excitations whenever there are two holes on -the Ni :math:`d` orbitals. The charge transfer physics, on the other hand, will promote a -:math:`d^9\\underline{L}` ground state in which the Hund's interactions are not active. - -The simplest model that captures this physics requires four Ni spin-orbitals, representing the Ni -:math:`e_g` manifold. We will represent the ligand states in the same way as the Anderson impurity -model in terms of one effective ligand spin-orbital per Ni spin-orbital. We assume these effective -orbitals have been constructed so that each Ni orbital only bonds to one sister orbital. For -simplicity, we will treat all Ni and all ligand orbitals as equivalent, even though a more -realistic model would account for the different Coulomb and hopping of the :math:`d_{3z^2-r^2}` -and :math:`d_{x^2-y^2}` orbitals. We therefore simply connect Ni and ligand orbitals via a constant -hopping :math:`t`. We also include the ligand energy parameter :math:`e_L`. - -The easiest way to implement the requried Coulomb interactions is to use the so-called Kanamori -Hamiltonian, which is a simplfied form for the interactions, which treats all orbitals as -equivalent. Daniel Khomskii's book provides a great explanation of this physics [1]_. We -parameterize the interactions via Coulomb repulsion parameter :math:`U` and Hund's exchange -:math:`J_H`. EDRIXS provides this functionality via the more general -:func:`.get_umat_kanamori` function. - -It's also easiest to consider this problem in hole langauge, which means our eight spin-orbitals -are populated by two fermions. -""" - -################################################################################ -# Setup -# ------------------------------------------------------------------------------ -# We start by loading the necessary modules, and defining the total number of -# orbitals and electrons. -import edrixs -import scipy -import numpy as np -import matplotlib.pyplot as plt - -norb = 8 -noccu = 2 - -################################################################################ -# Diagonalization -# ------------------------------------------------------------------------------ -# Let's write a function to diagonalize our model in a similar way to -# the :ref:`sphx_glr_auto_examples_example_6_Hubbard_dimer.py` example. -# Within this function, we also create operators to count the number of -# :math:`d` holes and operators to calculate expectation values for -# :math:`S^2` and :math:`S_z`. For the latter to make sense, we also include a -# small effective spin interaction along :math:`z`. - - -def diagonalize(U, JH, t, eL, n=1): - # Setup Coulomb matrix - umat = np.zeros((norb, norb, norb, norb), dtype=complex) - uNi = edrixs.get_umat_kanamori(norb//2, U, JH) - umat[:norb//2, :norb//2, :norb//2, :norb//2] = uNi - - # Setup hopping matrix - emat = np.zeros((norb, norb), dtype=complex) - ind = np.arange(norb//2) - emat[ind, ind + norb//2] = t - emat[ind+norb//2, ind] = np.conj(t) # conj is not needed, but is good practise. - ind = np.arange(norb//2, norb) - emat[ind, ind] += eL - - # Spin operator - spin_mom = np.zeros((3, norb, norb), dtype=complex) - spin_mom[:, :2, :2] = edrixs.get_spin_momentum(0) - spin_mom[:, 2:4, 2:4] = edrixs.get_spin_momentum(0) - spin_mom[:, 4:6, 4:6] = edrixs.get_spin_momentum(0) - spin_mom[:, 6:8, 6:8] = edrixs.get_spin_momentum(0) - - # add small effective field along z - emat += 1e-6*spin_mom[2] - - # Diagonalize - basis = edrixs.get_fock_bin_by_N(norb, noccu) - H = edrixs.build_opers(2, emat, basis) + edrixs.build_opers(4, umat, basis) - e, v = scipy.linalg.eigh(H) - e -= e[0] # Define ground state as zero energy - - # Operator for holes on Ni - basis = np.array(basis) - num_d_electrons = basis[:, :4].sum(1) - d0 = np.sum(np.abs(v[num_d_electrons == 0, :])**2, axis=0) - d1 = np.sum(np.abs(v[num_d_electrons == 1, :])**2, axis=0) - d2 = np.sum(np.abs(v[num_d_electrons == 2, :])**2, axis=0) - - # S^2 and Sz operators - opS = edrixs.build_opers(2, spin_mom, basis) - S_squared_op = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2]) - S_squared_exp = edrixs.cb_op(S_squared_op, v).diagonal().real - S_z_exp = edrixs.cb_op(opS[2], v).diagonal().real - - return e[:n], d0[:n], d1[:n], d2[:n], S_squared_exp[:n], S_z_exp[:n] - - -################################################################################ -# The atomic limit -# ------------------------------------------------------------------------------ -# For simplicity, let's start in the atomic limit with :math:`e_L \gg t \gg U` -# where all holes are on nickel. In this case, there are six ways to distribute -# two holes on the four Ni spin-orbitals. Let's examine the expectation values -# of the :math:`S^2` and :math:`S_z` operators. -U = 10 -JH = 2 -t = 100 -eL = 1e10 - -e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6) - -print("Ground state\nE\t") -for i in range(3): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - -print("\nExcited state\nE\t") -for i in range(3, 6): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - -################################################################################ -# The ground state is a high-spin triplet. The fourth and fifth -# states (the first excited state) are low-spin singlet excitons at -# :math:`2 J_H`. These have one hole on each orbital in the antisymmetric -# combination of :math:`|\uparrow\downarrow>-|\downarrow\uparrow>`. -# The state at :math:`3 J_H` also has one hole on each orbital in the symmetric -# :math:`|\uparrow\downarrow>+|\downarrow\uparrow>` configuration. - -################################################################################ -# Where are the holes for large hopping -# ------------------------------------------------------------------------------ -# As discussed at the start, we are interested to see interplay between Hund's -# and charge-transfer physics, which will obviously depend strongly on whether -# the holes are on Ni or the ligand. Let's see what happens as :math:`e_L` is -# reduced while observing the location of the ground state and exciton holes. -U = 10 -JH = 2 -t = 100 - -eLs = np.linspace(0, 1000, 30) - -fig, axs = plt.subplots(1, 2, figsize=(8, 4)) - -for ax, ind in zip(axs.ravel(), [0, 3]): - ds = np.array([diagonalize(U, JH, t, eL, n=6) - for eL in eLs]) - - ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$') - ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$') - ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$') - ax.set_xlabel("Energy of ligands $e_L$") - ax.set_ylabel("Number of electrons") - ax.legend() - -axs[0].set_title("Location of ground state holes") -axs[1].set_title("Location of exciton holes") - -plt.tight_layout() -plt.show() -################################################################################ -# For large :math:`e_L`, we see that both holes are on nickel as expected. In -# the opposite limit of :math:`|e_L| \ll t` and :math:`U \ll t` the holes are -# shared in the ratio 0.25:0.5:0.25 as there are two ways to have one hole on -# Ni. In the limit of large :math:`e_L`, all holes move onto Ni. Since -# :math:`t` is large, this applies equally to both the ground state and the -# exciton. - - -################################################################################ -# Connecton between atomic and charge transfer limits -# ------------------------------------------------------------------------------ -# We now examine the quantum numbers during cross over between the two limits -# with :math:`e_L`. Let's first look at the how :math:`` changes for the -# ground state and exciton and then examine how the exciton energy changes. - -U = 10 -JH = 2 -t = 100 - -eLs = np.linspace(0, 1000, 30) - -info = np.array([diagonalize(U, JH, t, eL, n=6) - for eL in eLs]) - -fig, axs = plt.subplots(1, 2, figsize=(8, 4)) - - -axs[0].plot(eLs, info[:, 4, 0], label='Ground state') -axs[0].plot(eLs, info[:, 4, 3], label='Exciton') -axs[0].set_xlabel("Energy of ligands $e_L$") -axs[0].set_ylabel('$$') -axs[0].set_title('Quantum numbers') -axs[0].legend() - -axs[1].plot(eLs, info[:, 0, 3], '+', color='C0') -axs[1].set_xlabel("Energy of ligands $e_L$") -axs[1].set_ylabel('Exciton energy', color='C0') -axr = axs[1].twinx() -axr.plot(eLs, info[:, 3, 5], 'x', color='C1') -axr.set_ylabel('$d^2$ fraction', color='C1') - -for ax, color in zip([axs[1], axr], ['C0', 'C1']): - for tick in ax.get_yticklabels(): - tick.set_color(color) - -axs[1].set_ylim(0, 2*JH) -axr.set_ylim(0, 1) - -axs[1].set_title('Exciton energy vs. $d^2$ character') -plt.tight_layout() -plt.show() -############################################################################## -# In the left panel, we see that the two limits are adiabatically connected -# as they preseve the same quantum numbers. This is because there is always -# an appreciable double occupancy under conditions where the -# :math:`d^9\underline{L}` character is maximized and this continues to favor -# the high spin ground state. Other interactions such as strong tetragonal -# crystal field would be needed to overcome the Hund's interactions and break -# this paradigm. In the right panel, we see that the exciton energy simply -# scales with the double occupancy. Overall, even though -# Hund's interactions are irrelevant for the :math:`d^9\underline{L}` -# electronic configuration, whenever :math:`t` is appreciable there is a -# strong mixing with the :math:`d^8` component is always present, which -# dominates the energy of the exciton. - -################################################################################ -# Charge transfer excitons -# ------------------------------------------------------------------------------ -# Another limiting case of the model is where :math:`t` is smaller than the -# Coulomb interactions. This, however, tends to produce -# ground state and exciton configurations that correspond to those of distinct -# atomic models. Let's look at the :math:`e_L` dependence in this case. -U = 10 -JH = 2 -t = .5 -eL = 7 - -eLs = np.linspace(0, 20, 30) - -fig, axs = plt.subplots(1, 2, figsize=(8, 4)) - -for ax, ind in zip(axs.ravel(), [0, 3]): - ds = np.array([diagonalize(U, JH, t, eL, n=6) - for eL in eLs]) - - ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$') - ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$') - ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$') - ax.set_xlabel("Energy of ligands $e_L$") - ax.set_ylabel("Number of electrons") - ax.legend() - -axs[0].axvline(x=eL, linestyle=':', color='k') -axs[1].axvline(x=eL, linestyle=':', color='k') - -axs[0].set_title("Location of ground state holes") -axs[1].set_title("Location of exciton holes") - -plt.tight_layout() -plt.show() -################################################################################ -# Around :math:`e_L = 7` the plot shows that the excition is primairly a -# :math:`d^2 \rightarrow d^1` transition or a -# :math:`d^8 \rightarrow d^{9}\underline{L}` transition in electron language. -# Let's examine the energy and quantum numbers. - -e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6) - -print("Ground state\nE\t") -for i in range(3): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - -print("\nExcited state\nE\t") -for i in range(3, 6): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - -################################################################################ -# We once again see the same quantum numbers, despite the differences in mixing -# in the ground state and exciton. - - -############################################################################## -# -# .. rubric:: Footnotes -# -# .. [1] D. Khomskii, Transition Metal Compounds, Cambridge University Press (2014) diff --git a/edrixs/_downloads/86f83fa0327e3b951a4dcf9df5773fd6/example_3_AIM_XAS.py b/edrixs/_downloads/86f83fa0327e3b951a4dcf9df5773fd6/example_3_AIM_XAS.py deleted file mode 100644 index 37033b93e1..0000000000 --- a/edrixs/_downloads/86f83fa0327e3b951a4dcf9df5773fd6/example_3_AIM_XAS.py +++ /dev/null @@ -1,344 +0,0 @@ -#!/usr/bin/env python -""" -Anderson impurity model for NiO XAS -================================================================================ -Here we calculate the :math:`L`-edge XAS spectrum of an Anderson impurity model, -which is sometimes also called a charge-transfer multiplet model. This model -considers a set of correlated orbitals, often called the impurity or metal -states, that hybridize with a set of uncorrelated orbitals, often called the -ligands or bath states. Everyone's favorite test case for x-ray spectroscopic -calculations of the Anderson impurity model is NiO and we won't risk being -original! This means that our correlated states will -be the Ni :math:`3d` orbitals and the uncorrelated states come from O -:math:`2p` orbitals. The fact that we include these interactions means that our -spectrum can include processes where electrons transition from the bath to the -impurity, as such the Anderson Impurity Model is often more accurate than atomic -models, especially if the material has strong covalency. - -When defining the bath states, it is useful to use the so-called -symmetry adapted linear combinations of orbitals as the basis. These states -take into account the symmetry relationships between the different bath atom -orbitals and the fact that there are bath orbital combinations that do not -interact with the impurity by symmetry. By doing this the problem can be -represented with fewer orbitals, which makes the calculation far more efficient. -The standard EDRIXS solver that we will use assumes that the bath states are -represented by an integer number of bath sites set by :code:`nbath`, each of -which hosts the same number of spin-orbits as the impurity e.g. 10 for a -:math:`d`-electron material. - -NiO has a rocksalt structure in which all Ni atoms are surrounded by six O -atoms. This NiO cluster used to simulate the -crystal would then contain 10 Ni :math:`3d` spin-orbitals and :math:`6` -spin-orbitals per O :math:`\\times 6` O atoms :math:`=36` oxygen -spin-orbitals. As explained by, for example, Maurits Haverkort -et al. in [1]_ symmetry allows us to represent the bath with 10 symmetry -adapted linear combinations of the different O :math:`p_x, p_y, p_z` states. -The crystal field and hopping parameters for -such a calculation can be obtained by post-processing DFT calculations. We will -use values for NiO from [1]_. If you use values from a paper the relevant -references should, of course, be cited. - -""" -import edrixs -import numpy as np -import matplotlib.pyplot as plt - -################################################################################ -# Number of electrons -# ------------------------------------------------------------------------------ -# When formulating problems of this type, one usually thinks of a nominal -# valence for the impurity atom in this case :code:`nd = 8` and assume that the -# bath is full. The solver that we will -# use can simulate multiple bath sites. In our case we specify -# :code:`nbath = 1` sites. Electrons will be able to transition from O to Ni -# during our calculation, but the total number of valance electrons -# :code:`v_noccu` will be conserved. -nd = 8 -norb_d = 10 -norb_bath = 10 -nbath = 1 -v_noccu = nd + nbath*norb_d -shell_name = ('d', 'p') # valence and core shells for XAS calculation - -################################################################################ -# Coulomb interactions -# ------------------------------------------------------------------------------ -# The atomic Coulomb interactions are usually initialized based on Hartree-Fock -# calculations from, for example, -# `Cowan's code `_. -# edrixs has a database of these. -info = edrixs.utils.get_atom_data('Ni', '3d', nd, edge='L3') - -################################################################################ -# The atomic values are typically scaled to account for screening in the solid. -# Here we use 80% scaling. Let's write these out in full, so that nothing is -# hidden. Values for :math:`U_{dd}` and :math:`U_{dp}` are those of Ref. [1]_ -# obtained by comparing theory and experiment [2]_ [3]_. -scale_dd = 0.8 -F2_dd = info['slater_i'][1][1] * scale_dd -F4_dd = info['slater_i'][2][1] * scale_dd -U_dd = 7.3 -F0_dd = U_dd + edrixs.get_F0('d', F2_dd, F4_dd) - -scale_dp = 0.8 -F2_dp = info['slater_n'][4][1] * scale_dp -G1_dp = info['slater_n'][5][1] * scale_dp -G3_dp = info['slater_n'][6][1] * scale_dp -U_dp = 8.5 -F0_dp = U_dp + edrixs.get_F0('dp', G1_dp, G3_dp) - -slater = ([F0_dd, F2_dd, F4_dd], # initial - [F0_dd, F2_dd, F4_dd, F0_dp, F2_dp, G1_dp, G3_dp]) # with core hole - -################################################################################ -# Energy of the bath states -# ------------------------------------------------------------------------------ -# In the notation used in EDRIXS, :math:`\Delta` sets the energy difference -# between the bath and impurity states. :math:`\Delta` is defined in the atomic -# limit without crystal field (i.e. in terms of the centers of the impurity and -# bath states before hybridization is considered) as the energy for a -# :math:`d^{n_d} \rightarrow d^{n_d + 1} \underline{L}` transition. -# Note that as electrons are moved one has to pay energy -# costs associated with the Coulomb interactions. The -# energy splitting between the bath and impurity is consequently not simply -# :math:`\Delta`. One must therefore determine the energies by solving -# a set of linear equations. See the :ref:`edrixs.utils functions ` -# for details. We can call these functions to get the impurity energy -# :math:`E_d`, bath energy :math:`E_L`, impurity energy with a core hole -# :math:`E_{dc}`, bath energy with a core hole :math:`E_{Lc}` and the -# core hole energy :math:`E_p`. The -# :code:`if __name__ == '__main__'` code specifies that this command -# should only be executed if the file is explicitly run. -Delta = 4.7 -E_d, E_L = edrixs.CT_imp_bath(U_dd, Delta, nd) -E_dc, E_Lc, E_p = edrixs.CT_imp_bath_core_hole(U_dd, U_dp, Delta, nd) -message = ("E_d = {:.3f} eV\n" - "E_L = {:.3f} eV\n" - "E_dc = {:.3f} eV\n" - "E_Lc = {:.3f} eV\n" - "E_p = {:.3f} eV\n") -if __name__ == '__main__': - print(message.format(E_d, E_L, E_dc, E_Lc, E_p)) - - -################################################################################ -# The spin-orbit coupling for the valence electrons in the ground state, the -# valence electrons with the core hole present, and for the core hole itself -# are initialized using the atomic values. -zeta_d_i = info['v_soc_i'][0] -zeta_d_n = info['v_soc_n'][0] -c_soc = info['c_soc'] - -################################################################################ -# Build matrices describing interactions -# ------------------------------------------------------------------------------ -# edrixs uses complex spherical harmonics as its default basis set. If we want to -# use another basis set, we need to pass a matrix to the solver, which transforms -# from complex spherical harmonics into the basis we use. -# The solver will use this matrix when implementing the Coulomb interactions -# using the :code:`slater` list of Coulomb parameters. -# Here it is easiest to -# use real harmonics. We make the complex harmonics to real harmonics transformation -# matrix via -trans_c2n = edrixs.tmat_c2r('d',True) - -################################################################################ -# The crystal field and SOC needs to be passed to the solver by constructing -# the impurity matrix in the real harmonic basis. For cubic symmetry, we need -# to set the energies of the orbitals along the -# diagonal of the matrix. These need to be in pairs as there are two -# spin-orbitals for each orbital energy. Python -# `list comprehension `_ -# and -# `numpy indexing `_ -# are used here. See :ref:`sphx_glr_auto_examples_example_1_crystal_field.py` -# for more details if needed. -ten_dq = 0.56 -CF = np.zeros((norb_d, norb_d), dtype=complex) -diagonal_indices = np.arange(norb_d) - -orbital_energies = np.array([e for orbital_energy in - [+0.6 * ten_dq, # dz2 - -0.4 * ten_dq, # dzx - -0.4 * ten_dq, # dzy - +0.6 * ten_dq, # dx2-y2 - -0.4 * ten_dq] # dxy) - for e in [orbital_energy]*2]) - - -CF[diagonal_indices, diagonal_indices] = orbital_energies - -################################################################################ -# The valence band SOC is constructed in the normal way and transformed into the -# real harmonic basis. -soc = edrixs.cb_op(edrixs.atom_hsoc('d', zeta_d_i), edrixs.tmat_c2r('d', True)) - -################################################################################ -# The total impurity matrices for the ground and core-hole states are then -# the sum of crystal field and spin-orbit coupling. We further needed to apply -# an energy shift along the matrix diagonal, which we do using the -# :code:`np.eye` function which creates a diagonal matrix of ones. -E_d_mat = E_d*np.eye(norb_d) -E_dc_mat = E_dc*np.eye(norb_d) -imp_mat = CF + soc + E_d_mat -imp_mat_n = CF + soc + E_dc_mat - -################################################################################ -# The energy level of the bath(s) is described by a matrix where the row index -# denotes which bath and the column index denotes which orbital. Here we have -# only one bath, with 10 spin-orbitals. We initialize the matrix to -# :code:`norb_d` and then split the energies according to :code:`ten_dq_bath`. -ten_dq_bath = 1.44 -bath_level = np.full((nbath, norb_d), E_L, dtype=complex) -bath_level[0, :2] += ten_dq_bath*.6 # 3z2-r2 -bath_level[0, 2:6] -= ten_dq_bath*.4 # zx/yz -bath_level[0, 6:8] += ten_dq_bath*.6 # x2-y2 -bath_level[0, 8:] -= ten_dq_bath*.4 # xy -bath_level_n = np.full((nbath, norb_d), E_Lc, dtype=complex) -bath_level_n[0, :2] += ten_dq_bath*.6 # 3z2-r2 -bath_level_n[0, 2:6] -= ten_dq_bath*.4 # zx/yz -bath_level_n[0, 6:8] += ten_dq_bath*.6 # x2-y2 -bath_level_n[0, 8:] -= ten_dq_bath*.4 # xy - -################################################################################ -# The hybridization matrix describes the hopping between the bath -# and the impurity. This is called either :math:`V` or :math:`T` in the -# literature and matrix sign can either be positive or negative based. -# This is the same shape as the bath matrix. We take our -# values from Maurits Haverkort et al.'s DFT calculations [1]_. -Veg = 2.06 -Vt2g = 1.21 - -hyb = np.zeros((nbath, norb_d), dtype=complex) -hyb[0, :2] = Veg # 3z2-r2 -hyb[0, 2:6] = Vt2g # zx/yz -hyb[0, 6:8] = Veg # x2-y2 -hyb[0, 8:] = Vt2g # xy - -################################################################################ -# We now need to define the parameters describing the XAS. X-ray polarization -# can be linear, circular or isotropic (appropriate for a powder). -poltype_xas = [('isotropic', 0)] -################################################################################ -# edrixs uses the temperature in Kelvin to work out the population of the low-lying -# states via a Boltzmann distribution. -temperature = 300 -################################################################################ -# The x-ray beam is specified by the incident angle and azimuthal angle in radians -thin = 0 / 180.0 * np.pi -phi = 0.0 -################################################################################ -# these are with respect to the crystal field :math:`z` and :math:`x` axes -# written above. (That is, unless you specify the :code:`loc_axis` parameter -# described in the :code:`edrixs.xas_siam_fort` function documentation.) - -################################################################################ -# The spectrum in the raw calculation is offset by the energy involved with the -# core hole state, which is roughly :math:`5 E_p`, so we offset the spectrum by -# this and use :code:`om_shift` as an adjustable parameters for comparing -# theory to experiment. We also use this to specify :code:`ominc_xas` -# the range we want to compute the spectrum over. The core hole lifetime -# broadening also needs to be set via :code:`gamma_c_stat`. -om_shift = 857.6 -c_level = -om_shift - 5*E_p -ominc_xas = om_shift + np.linspace(-15, 25, 1000) - -################################################################################ -# The final state broadening is specified in terms of half-width at half-maximum -# You can either pass a constant value or an array the same size as -# :code:`om_shift` with varying values to simulate, for example, different state -# lifetimes for higher energy states. -gamma_c = np.full(ominc_xas.shape, 0.48/2) - -################################################################################ -# Magnetic field is a three-component vector in eV specified with respect to the -# same local axis as the x-ray beam. Since we are considering a powder here -# we create an isotropic normalized vector. :code:`on_which = 'both'` specifies to -# apply the operator to the total spin plus orbital angular momentum as is -# appropriate for a physical external magnetic field. You can use -# :code:`on_which = 'spin'` to apply the operator to spin in order to simulate -# magnetic order in the sample. The value of the Bohr Magneton can -# be useful for converting here :math:`\mu_B = 5.7883818012\times 10^{−5}`. -# For this example, we will account for magnetic order in the sample by -ext_B = np.array([0.00, 0.00, 0.12]) -on_which = 'spin' - -################################################################################ -# The number crunching uses -# `mpi4py `_. You can safely ignore -# this for most purposes, but see -# `Y. L. Wang et al., Computer Physics Communications 243, 151-165 (2019) `_ -# if you would like more details. -# The main thing to remember is that you should call this script via:: -# -# mpirun -n python example_AIM_XAS.py -# -# where :code:`` is the number of processors -# you'd like to us. Running it as normal will work, it will just be slower. -if __name__ == '__main__': - from mpi4py import MPI - comm = MPI.COMM_WORLD - rank = comm.Get_rank() - size = comm.Get_size() - -################################################################################ -# Calling the :code:`edrixs.ed_siam_fort` solver will find the ground state and -# write input files, *hopping_i.in*, *hopping_n.in*, *coulomb_i.in*, *coulomb_n.in* -# for following XAS (or RIXS) calculation. We need to specify :code:`siam_type=0` -# which says that we will pass *imp_mat*, *bath_level* and *hyb*. -# We need to specify :code:`do_ed = 1`. For this example, we cannot use -# :code:`do_ed = 0` for a ground state search as we have set the impurity and -# bath energy levels artificially, which means edrixs will have trouble to know -# which subspace to search to find the ground state. -if __name__ == '__main__': - do_ed = 1 - eval_i, denmat, noccu_gs = edrixs.ed_siam_fort( - comm, shell_name, nbath, siam_type=0, imp_mat=imp_mat, imp_mat_n=imp_mat_n, - bath_level=bath_level, bath_level_n=bath_level_n, hyb=hyb, c_level=c_level, - c_soc=c_soc, slater=slater, ext_B=ext_B, - on_which=on_which, trans_c2n=trans_c2n, v_noccu=v_noccu, do_ed=do_ed, - ed_solver=2, neval=50, nvector=3, ncv=100, idump=True) -################################################################################ -# Let's check that we have all the electrons we think we have and print how -# the electron are distributed between the Ni (impurity) and O (bath). -if __name__ == '__main__': - assert np.abs(noccu_gs - v_noccu) < 1e-6 - impurity_occupation = np.sum(denmat[0].diagonal()[0:norb_d]).real - bath_occupation = np.sum(denmat[0].diagonal()[norb_d:]).real - print('Impurity occupation = {:.6f}\n'.format(impurity_occupation)) - print('Bath occupation = {:.6f}\n'.format(bath_occupation)) -################################################################################ -# We see that 0.18 electrons move from the O to the Ni in the ground state. -# -# We can now construct the XAS spectrum edrixs by applying a transition -# operator to create the excited state. We need to be careful to specify how -# many of the low energy states are thermally populated. In this case -# :code:`num_gs=3`. This can be determined by inspecting the function output. -if __name__ == '__main__': - xas, xas_poles = edrixs.xas_siam_fort( - comm, shell_name, nbath, ominc_xas, gamma_c=gamma_c, v_noccu=v_noccu, thin=thin, - phi=phi, num_gs=3, nkryl=200, pol_type=poltype_xas, temperature=temperature - ) -################################################################################ -# Let's plot the data and save it just in case -if __name__ == '__main__': - fig, ax = plt.subplots() - - ax.plot(ominc_xas, xas) - ax.set_xlabel('Energy (eV)') - ax.set_ylabel('XAS intensity') - ax.set_title('Anderson impurity model for NiO') - plt.show() - - np.savetxt('xas.dat', np.concatenate((np.array([ominc_xas]).T, xas), axis=1)) - -############################################################################## -# -# .. rubric:: Footnotes -# -# .. [1] Maurits Haverkort et al -# `Phys. Rev. B 85, 165113 (2012) `_. -# .. [2] A. E. Bocquet et al., -# `Phys. Rev. B 53, 1161 (1996) `_. -# .. [3] Arata Tanaka, and Takeo Jo, -# `J. Phys. Soc. Jpn. 63, 2788-2807(1994) `_. diff --git a/edrixs/_downloads/9014043ee6a1e0681078cd8cc8ad3780/example_5_Hubbard_dimer.ipynb b/edrixs/_downloads/9014043ee6a1e0681078cd8cc8ad3780/example_5_Hubbard_dimer.ipynb deleted file mode 100644 index 331bf277f4..0000000000 --- a/edrixs/_downloads/9014043ee6a1e0681078cd8cc8ad3780/example_5_Hubbard_dimer.ipynb +++ /dev/null @@ -1,190 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "%matplotlib inline" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Hubbard Dimer\nThis exercise will demonstrate how to handle hopping and multi-site problems within\nedrixs using the example of a Hubbard dimer. We want to solve the equation\n\n .. math::\n \\begin{equation}\n \\hat{H} = \\sum_{i,j} \\sum_{\\sigma} t_{i,j} \\hat{f}^{\\dagger}_{i,\\sigma} \\hat{f}_{j, \\sigma}\n + U \\sum_{i} \\hat{n}_{i,\\uparrow}\\hat{n}_{i,\\downarrow},\n \\end{equation}\n\nwhich involves two sites labeled with indices $i$ or $j$ with two\nelectrons of spin $\\sigma\\in{\\uparrow,\\downarrow}$. $t_{i,j}$\nis the hopping between sites, $\\hat{f}^{\\dagger}_{i,\\sigma}$ is the\ncreation operators, and\n$\\hat{n}^{\\dagger}_{i,\\sigma}=\\hat{f}^{\\dagger}_{i,\\sigma}\\hat{f}_{i,\\sigma}$\nis the number operator. The main task is to represent this Hamiltonian and\nthe related spin operator using the EDRIXS two-fermion and four-fermion form\nwhere $\\alpha,\\beta,\\delta,\\gamma$ are the indices of the single\nparticle basis.\n\n .. math::\n \\begin{equation}\n \\hat{H} = \\sum_{\\alpha,\\beta} t_{\\alpha,\\beta} \\hat{f}^{\\dagger}_{\\alpha} \\hat{f}_{\\beta}\n + \\sum_{\\alpha,\\beta,\\gamma,\\delta} U_{\\alpha,\\beta,\\gamma,\\delta}\n \\hat{f}^{\\dagger}_{\\alpha}\\hat{f}^{\\dagger}_{\\beta}\\hat{f}_{\\gamma}\\hat{f}_{\\delta}.\n \\end{equation}\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Initialize matrices\nWe start by noting that each of the two sites is like an $l=0$\n$s$-orbital with two spin-orbitals each. We will include\ntwo electron occupation and build the Fock basis.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import numpy as np\nimport matplotlib.pyplot as plt\nimport scipy\nimport edrixs\nnp.set_printoptions(precision=4)\n\n\nll = 0\ncase = 's'\nnorb = 4\nnoccu = 2\nbasis = edrixs.get_fock_bin_by_N(norb, noccu)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Create function to populate and diagonalize matrices\nThe Coulomb and hopping matrices :code:`umat` and :code:`emat` will be\nrepresented by $4\\times4\\times4\\times4$ and $4\\times4$ matrices,\nrespectively. Note that we needed to specify\nthat these are, in general, complex, although\nthey happen to contain only real numbers in this case. We follow the convention\nthat these are ordered first by site and then by spin:\n$|0\\uparrow>, |0\\downarrow>, |1\\uparrow>, |1\\downarrow>$.\nConsequently the $2\\times2$ and $2\\times2\\times2\\times2$ block\ndiagonal structures of the matrices will contain the on-site interactions.\nThe converse is true for the hopping between the sites.\nFrom here let us generate a function to build and diagonalize the Hamiltonian.\nWe need to generate the Coulomb matrix for the on-site interactions and\napply it to the block diagonal. The hopping connects off-site indices with\nthe same spin.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "def diagonalize(U, t, extra_emat=None):\n \"\"\"Diagonalize 2 site Hubbard Hamiltonian\"\"\"\n umat = np.zeros((norb, norb, norb, norb), dtype=np.complex128)\n emat = np.zeros((norb, norb), dtype=np.complex128)\n U_mat_1site = edrixs.get_umat_slater('s', U)\n umat[:2, :2, :2, :2,] = umat[2:, 2:, 2:, 2:] = U_mat_1site\n emat[2, 0] = emat[3, 1] = emat[0, 2] = emat[1, 3] = t\n\n if extra_emat is not None:\n emat = emat + extra_emat\n\n H = (edrixs.build_opers(2, emat, basis)\n + edrixs.build_opers(4, umat, basis))\n\n e, v = scipy.linalg.eigh(H)\n return e, v" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## The large $U$ limit\nLet us see what happens with $U \\gg t$.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "e, v = diagonalize(1000, 1)\nprint(\"Energies are\")\nprint(e)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To analyze what is going on we can determine the spin expectation values\nof the cluster. Building the operators follows the same form as the\nHamiltonian and the previous example.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "spin_mom_one_site = edrixs.get_spin_momentum(ll)\nspin_mom = np.zeros((3, norb, norb), dtype=np.complex128)\nspin_mom[:, :2, :2] = spin_mom[:, 2:, 2:] = spin_mom_one_site\n\nopS = edrixs.build_opers(2, spin_mom, basis)\nopS_squared = (np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1])\n + np.dot(opS[2], opS[2]))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This time let us include a tiny magnetic field along the $z$-axis, so\nthat we have a well-defined measurement axis and print out the expectation\nvalues.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "zeeman = np.zeros((norb, norb), dtype=np.complex128)\nzeeman[:2, :2] = zeeman[2:, 2:] = 1e-8*spin_mom_one_site[2]\ne, v = diagonalize(1000, 1, extra_emat=zeeman)\n\nSsq_exp = edrixs.cb_op(opS_squared, v).diagonal().real\nSz_exp = edrixs.cb_op(opS[2], v).diagonal().real\n\nheader = \"{:<10s}\\t{:<6s}\\t{:<6s}\"\nprint(header.format(\"E\", \"S(S+1)\", \"\"))\nfor i in range(len(e)):\n print(\"{:<2f}\\t{:.1f}\\t{:.1f}\".format(e[i], Ssq_exp[i], Sz_exp[i]))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "For $U \\gg t$ the two states with double occupancy acquire an energy of\napproximately $U$. The low energy states are a $S=0$ singlet and\nand $S=1$ triplet, which are split by $4t^2/U$, which is the\nmagnetic exchange term.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## $U$ dependence\nLet us plot the changes in energy with $U$.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "plt.figure()\n\nt = 1\nUs = np.linspace(0.01, 10, 50)\nEs = np.array([diagonalize(U, t, extra_emat=zeeman)[0] for U in Us])\n\nplt.plot(Us/t, Es/t)\nplt.xlabel('U/t')\nplt.ylabel('Eigenstate energies/t')\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To help interpret this, we can represent the eigenvectors in terms of a sum\nof the single particle states.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "def get_single_particle_repesentations(v):\n reps = []\n for i in range(6):\n rep = sum([vec*weight for weight, vec\n in zip(v[:, i], np.array(basis))])\n reps.append(rep)\n\n return np.array(reps)\n\nt = 1\nfor U in [10000, 0.0001]:\n e, v = diagonalize(U, t, extra_emat=zeeman)\n repesentations = get_single_particle_repesentations(v)\n print(\"For U={} t={} states are\".format(U, t))\n print(repesentations.round(3).real)\n print(\"\\n\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "For $U \\gg t$ the ground state maximizes its magnetic exchange\nenergy saving. In the $U \\ll t$ condition the ground state maximizes\nits kinetic energy saving. Since both states share the same parity, the\ncross-over between them is smooth. This type of physics is at play in current\nresearch on quantum materials [1]_ [2]_.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ".. rubric:: Footnotes\n\n.. [1] Y. Wang et al., `Phys. Rev. Lett. 122, 106401 (2019) `_.\n.. [2] A. Revelli et al., `Science Advances 5, eaav4020 (2019) `_.\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.12" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/9d9d4281e4fa8bdc87c5f8d67a01fd4a/example_4_GS_analysis.zip b/edrixs/_downloads/9d9d4281e4fa8bdc87c5f8d67a01fd4a/example_4_GS_analysis.zip deleted file mode 100644 index a9a73f9aa2..0000000000 Binary files a/edrixs/_downloads/9d9d4281e4fa8bdc87c5f8d67a01fd4a/example_4_GS_analysis.zip and /dev/null differ diff --git a/edrixs/_downloads/a366641f5cade924791a73ee6d78cee6/example_0_ed_calculator.py b/edrixs/_downloads/a366641f5cade924791a73ee6d78cee6/example_0_ed_calculator.py deleted file mode 100644 index 30371fb96b..0000000000 --- a/edrixs/_downloads/a366641f5cade924791a73ee6d78cee6/example_0_ed_calculator.py +++ /dev/null @@ -1,237 +0,0 @@ -#!/usr/bin/env python -""" -Exact diagonalization -===================================== -Here we show how to find the eigenvalues and eigenvectors of a many-body -Hamiltonian of fermions with Coulomb interactions. We then determine their spin -and orbital angular momentum and how this changes when we switch on spin-orbit -coupling. -""" - -################################################################################ -# Import the necessary modules. -import numpy as np -import matplotlib.pyplot as plt -import scipy -import edrixs - -################################################################################ -# Parameters -# ------------------------------------------------------------------------------ -# Define the orbital angular momentum number :math:`l=1` (i.e. a `p` shell), -# the number of spin-orbitals, the occupancy and the Slater integrals. -# :math:`F^{k}` with :math:`k=0,2`: -l = 1 -norb = 6 -noccu = 2 -F0, F2 = 4.0, 1.0 - -################################################################################ -# Coulomb interactions -# ------------------------------------------------------------------------------ -# The Coulomb interactions in EDRIXS are described by a tensor. Understanding this -# in full is complicated and requires careful consideration of the symmetry of the -# interactions. See example 6 for more discussion if desired. -# EDRIXS can construct the matrix via -umat = edrixs.get_umat_slater('p', F0, F2) - -################################################################################ -# Create basis -# ------------------------------------------------------------------------------ -# Now we build the binary form of the Fock basis :math:`|F>` (we consider it -# preferable to use the standard :math:`F` and trust the reader to avoid -# confusing it with the interaction parameters.) -# The Fock basis is the simplest legitimate form for the basis and it consists -# of a series of 1s and 0s where 1 means occupied and -# 0 means empty. These are in order up, down, up, down, up, down. -basis = edrixs.get_fock_bin_by_N(norb, noccu) -print(np.array(basis)) -################################################################################ -# We expect the number of these states to be given by the mathematical -# combination of two electrons distributed among six states (three spin-orbitals -# with two spins per orbital). -message = ("We predict C(norb={}, noccu={})={:.0f} states and we got {:d}, " - "which is reassuring!") -print(message.format(norb, noccu, edrixs.combination(norb, noccu), len(basis))) -################################################################################ -# Note that in more complicated problems with both valence and core -# electrons, the edrixs convention is to list the valence electrons first. - -################################################################################ -# Transform interactions into Fock basis -# ------------------------------------------------------------------------------ -# edrixs works by initiailly creating a Hamiltonian matrix -# :math:`\hat{H}` in the single particle basis and then transforming into -# our chosen Fock basis. In the single particle basis, we have four fermion -# interactions with this form -# -# .. math:: -# \hat{H} = -# -# generated as -n_fermion = 4 -H = edrixs.build_opers(n_fermion, umat, basis) - -################################################################################ -# We needed to specify :code:`n_fermion = 4` because the -# :code:`edrixs.build_opers` function can also make two fermion terms. - -################################################################################ -# Diagonalize the matrix -# ------------------------------------------------------------------------------ -# For a small problem such as this it is convenient to use the native -# `scipy `_ diagonalization routine. This returns eigenvalues -# :code:`e` and eignvectors :code:`v` where eigenvalue :code:`e[i]` corresponds -# to eigenvector :code:`v[:,i]`. -e, v = scipy.linalg.eigh(H) -print("{} eignvalues and {} eigvenvectors {} elements long.".format(len(e), - v.shape[1], - v.shape[0])) - -################################################################################ -# Computing expectation values -# ------------------------------------------------------------------------------ -# To interpret the results, it is informative to compute the expectations values -# related to the spin :math:`\mathbf{S}`, orbital :math:`\mathbf{L}`, -# and total :math:`\mathbf{J}`, angular momentum. We first load the relevant -# matrices for these quantities for a `p` atomic shell. We need to specify -# that we would like to include spin when loading the orbital operator. -orb_mom = edrixs.get_orb_momentum(l, ispin=True) -spin_mom = edrixs.get_spin_momentum(l) -tot_mom = orb_mom + spin_mom - -################################################################################ -# We again transform these matrices to our Fock basis to build the operators -n_fermion = 2 -opL, opS, opJ = edrixs.build_opers(n_fermion, [orb_mom, spin_mom, tot_mom], - basis) - -################################################################################ -# Recall that quantum mechanics forbids us from knowing all three Cartesian -# components of angular momentum at once, so we want to compute the squares of -# these operators i.e. -# -# .. math:: -# \mathbf{S}^2 = S^2_x + S^2_y + S^2_z\\ -# \mathbf{L}^2 = L^2_x + L^2_y + L^2_z\\ -# \mathbf{J}^2 = J^2_x + J^2_y + J^2_z -# -L2 = np.dot(opL[0], opL[0]) + np.dot(opL[1], opL[1]) + np.dot(opL[2], opL[2]) -S2 = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2]) -J2 = np.dot(opJ[0], opJ[0]) + np.dot(opJ[1], opJ[1]) + np.dot(opJ[2], opJ[2]) - -################################################################################ -# Remember that the eigenvalues of :math:`\mathbf{S}^2` are in the form -# :math:`S(S+1)` etc. and that they can be obtained by calculating the -# projection of the operators onto our eigenvectors. -L2_val = edrixs.cb_op(L2, v).diagonal().real -S2_val = edrixs.cb_op(S2, v).diagonal().real -J2_val = edrixs.cb_op(J2, v).diagonal().real -################################################################################ -# We can determine the degeneracy of the eigenvalues numerically and print out -# the values as follows -e = np.round(e, decimals=6) -degeneracy = [sum(eval == e) for eval in e] -header = "{:<3s}\t{:>8s}\t{:>8s}\t{:>8s}\t{:>8s}" -print(header.format("# ", "E ", "S(S+1)", "L(L+1)", "Degen.")) -for i, eigenvalue in enumerate(e): - values_list = [i, eigenvalue, S2_val[i], L2_val[i], degeneracy[i]] - print("{:<3d}\t{:8.3f}\t{:8.3f}\t{:8.3f}\t{:>3d}".format(*values_list)) - -################################################################################ -# We see :math:`S=0` and :math:`S=1` states coming from the -# two combinations of the spin 1/2 particles. :math:`L` can take values of -# 0, 1, 2. Remember that spin states have degeneracy of :math:`2S+1` and the -# same is true for orbital states. -# We must multiply these :math:`S` and -# :math:`L` degeneracies to get the total degeneracy. -# Since these particles are fermions, the -# overall state must be antisymmetric, which dictates the allowed combinations -# of :math:`S` and :math:`L`. - -################################################################################ -# Energy level diagram -# ------------------------------------------------------------------------------ -# Let us show our findings graphically -fig, ax = plt.subplots() -for i, eigenvalue in enumerate(np.unique(e)): - art = ax.plot([0, 1], [eigenvalue, eigenvalue], '-', color='C{}'.format(i)) - ind = np.where(eigenvalue == e)[0][0] - L = (-1 + np.sqrt(1 + 4*L2_val[ind]))/2 - S = (-1 + np.sqrt(1 + 4*S2_val[ind]))/2 - message = "L={:.0f}, S={:.0f} ({:.0f})" - ax.text(1, eigenvalue, message.format(L, S, degeneracy[ind]), - horizontalalignment='right', - verticalalignment='bottom', - color='C{}'.format(i)) - -ax.set_ylabel('Energy') -for loc in ['right', 'top', 'bottom']: - ax.spines[loc].set_visible(False) - -ax.yaxis.set_ticks_position('left') -ax.set_xticks([]) -plt.show() - -################################################################################ -# We see Hund's rules in action! Rule 1 says that the highest spin :math:`S=1` -# state has the lowest energy. Of the two :math:`S=0` states, the state with -# larger :math:`L=1` is lower energy following rule 2. - -################################################################################ -# Spin orbit coupling -# ------------------------------------------------------------------------------ -# For fun, we can see how this changes when we add spin orbit coupling (SOC). -# This is a two-fermion operator that we create, transform into the Fock basis -# and add to the prior Hamiltonian. To make things easy, let us make the SOC -# small so that the LS coupling approximation is valid and we can -# still track the states. -soc = edrixs.atom_hsoc('p', 0.1) -n_fermion = 2 -H2 = H + edrixs.build_opers(n_fermion, soc, basis) - -################################################################################ -# Then, we redo the diagonalization and print the results. -e2, v2 = scipy.linalg.eigh(H2) -e2 = np.round(e2, decimals=6) -degeneracy2 = [sum(eval == e2) for eval in e2] -print() -message = "With SOC\n {:<3s}\t{:>8s}\t{:>8s}\t{:>8s}\t{:>8s}\t{:>8s}" -print(message.format("#", "E", "S(S+1)", "L(L+1)", "J(J+1)", "degen.")) -J2_val_soc = edrixs.cb_op(J2, v2).diagonal().real -L2_val_soc = edrixs.cb_op(L2, v2).diagonal().real -S2_val_soc = edrixs.cb_op(S2, v2).diagonal().real -for i, eigenvalue in enumerate(e2): - values_list = [i, eigenvalue, S2_val_soc[i], L2_val_soc[i], J2_val_soc[i], - degeneracy2[i]] - print("{:<3d}\t{:8.3f}\t{:8.3f}\t{:8.3f}\t{:8.3f}\t{:8.3f}".format(*values_list)) - -################################################################################ -# and we make an equivalent energy level diagram. - -fig, ax = plt.subplots() -for i, eigenvalue in enumerate(np.unique(e2)): - art = ax.plot([0, 1], [eigenvalue, eigenvalue], '-', color='C{}'.format(i)) - ind = np.where(eigenvalue == e2)[0][0] - J = (-1 + np.sqrt(1+4*J2_val_soc[ind]))/2 - message = "J={:.0f} ({:.0f})" - ax.text(1, eigenvalue, message.format(J, degeneracy2[ind]), - horizontalalignment='right', - verticalalignment='bottom', - color='C{}'.format(i)) - -ax.set_ylabel('Energy') -for loc in ['right', 'top', 'bottom']: - ax.spines[loc].set_visible(False) - -ax.yaxis.set_ticks_position('left') -ax.set_xticks([]) -plt.show() - -################################################################################ -# It is clear that we have split the :math:`S=1` state, which branches into -# three states from :math:`J=|L-S|, |L-S|+1, ..., |L+S|`. Since the shell is -# less than half full, Hund's third rule dictates that the smaller :math:`J` -# states have the lower energies. diff --git a/edrixs/_downloads/a3ecf627cca43801e771a480c3e554b3/example_7_Hunds_interactions.py b/edrixs/_downloads/a3ecf627cca43801e771a480c3e554b3/example_7_Hunds_interactions.py deleted file mode 100644 index f33384ac8c..0000000000 --- a/edrixs/_downloads/a3ecf627cca43801e771a480c3e554b3/example_7_Hunds_interactions.py +++ /dev/null @@ -1,290 +0,0 @@ -#!/usr/bin/env python -""" -Hund's Interactions in charge transfer insulators -================================================= -In this exercise we will solve a toy model relevant to cubic :math:`d^8` charge transfer insulators -such as NiO or NiPS\\ :sub:`3`. We are interested in better understanding the interplay between the -Hund's interactions and the charge transfer energy in terms of the energy of the triplet-singlet -excitations of this model. These seem to act against each other in that the Hund's interactions -impose a energy cost for the triplet-singlet excitations whenever there are two holes on -the Ni :math:`d` orbitals. The charge transfer physics, on the other hand, will promote a -:math:`d^9\\underline{L}` ground state in which the Hund's interactions are not active. - -The simplest model that captures this physics requires four Ni spin-orbitals, representing the Ni -:math:`e_g` manifold. We will represent the ligand states in the same way as the Anderson impurity -model in terms of one effective ligand spin-orbital per Ni spin-orbital. We assume these effective -orbitals have been constructed so that each Ni orbital only bonds to one sister orbital. For -simplicity, we will treat all Ni and all ligand orbitals as equivalent, even though a more -realistic model would account for the different Coulomb and hopping of the :math:`d_{3z^2-r^2}` -and :math:`d_{x^2-y^2}` orbitals. We therefore simply connect Ni and ligand orbitals via a constant -hopping :math:`t`. We also include the ligand energy parameter :math:`e_L`. - -The easiest way to implement the requried Coulomb interactions is to use the so-called Kanamori -Hamiltonian, which is a simplfied form for the interactions, which treats all orbitals as -equivalent. Daniel Khomskii's book provides a great explanation of this physics [1]_. We -parameterize the interactions via Coulomb repulsion parameter :math:`U` and Hund's exchange -:math:`J_H`. EDRIXS provides this functionality via the more general -:func:`.get_umat_kanamori` function. - -It's also easiest to consider this problem in hole langauge, which means our eight spin-orbitals -are populated by two fermions. -""" - -################################################################################ -# Setup -# ------------------------------------------------------------------------------ -# We start by loading the necessary modules, and defining the total number of -# orbitals and electrons. -import edrixs -import scipy -import numpy as np -import matplotlib.pyplot as plt - -norb = 8 -noccu = 2 - -################################################################################ -# Diagonalization -# ------------------------------------------------------------------------------ -# Let's write a function to diagonalize our model in a similar way to -# the :ref:`sphx_glr_auto_examples_example_6_Hubbard_dimer.py` example. -# Within this function, we also create operators to count the number of -# :math:`d` holes and operators to calculate expectation values for -# :math:`S^2` and :math:`S_z`. For the latter to make sense, we also include a -# small effective spin interaction along :math:`z`. - - -def diagonalize(U, JH, t, eL, n=1): - # Setup Coulomb matrix - umat = np.zeros((norb, norb, norb, norb), dtype=complex) - uNi = edrixs.get_umat_kanamori(norb//2, U, JH) - umat[:norb//2, :norb//2, :norb//2, :norb//2] = uNi - - # Setup hopping matrix - emat = np.zeros((norb, norb), dtype=complex) - ind = np.arange(norb//2) - emat[ind, ind + norb//2] = t - emat[ind+norb//2, ind] = np.conj(t) # conj is not needed, but is good practise. - ind = np.arange(norb//2, norb) - emat[ind, ind] += eL - - # Spin operator - spin_mom = np.zeros((3, norb, norb), dtype=complex) - spin_mom[:, :2, :2] = edrixs.get_spin_momentum(0) - spin_mom[:, 2:4, 2:4] = edrixs.get_spin_momentum(0) - spin_mom[:, 4:6, 4:6] = edrixs.get_spin_momentum(0) - spin_mom[:, 6:8, 6:8] = edrixs.get_spin_momentum(0) - - # add small effective field along z - emat += 1e-6*spin_mom[2] - - # Diagonalize - basis = edrixs.get_fock_bin_by_N(norb, noccu) - H = edrixs.build_opers(2, emat, basis) + edrixs.build_opers(4, umat, basis) - e, v = scipy.linalg.eigh(H) - e -= e[0] # Define ground state as zero energy - - # Operator for holes on Ni - basis = np.array(basis) - num_d_electrons = basis[:, :4].sum(1) - d0 = np.sum(np.abs(v[num_d_electrons == 0, :])**2, axis=0) - d1 = np.sum(np.abs(v[num_d_electrons == 1, :])**2, axis=0) - d2 = np.sum(np.abs(v[num_d_electrons == 2, :])**2, axis=0) - - # S^2 and Sz operators - opS = edrixs.build_opers(2, spin_mom, basis) - S_squared_op = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2]) - S_squared_exp = edrixs.cb_op(S_squared_op, v).diagonal().real - S_z_exp = edrixs.cb_op(opS[2], v).diagonal().real - - return e[:n], d0[:n], d1[:n], d2[:n], S_squared_exp[:n], S_z_exp[:n] - - -################################################################################ -# The atomic limit -# ------------------------------------------------------------------------------ -# For simplicity, let's start in the atomic limit with :math:`e_L \gg t \gg U` -# where all holes are on nickel. In this case, there are six ways to distribute -# two holes on the four Ni spin-orbitals. Let's examine the expectation values -# of the :math:`S^2` and :math:`S_z` operators. -U = 10 -JH = 2 -t = 100 -eL = 1e10 - -e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6) - -print("Ground state\nE\t") -for i in range(3): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - -print("\nExcited state\nE\t") -for i in range(3, 6): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - -################################################################################ -# The ground state is a high-spin triplet. The fourth and fifth -# states (the first excited state) are low-spin singlet excitons at -# :math:`2 J_H`. These have one hole on each orbital in the antisymmetric -# combination of :math:`|\uparrow\downarrow>-|\downarrow\uparrow>`. -# The state at :math:`3 J_H` also has one hole on each orbital in the symmetric -# :math:`|\uparrow\downarrow>+|\downarrow\uparrow>` configuration. - -################################################################################ -# Where are the holes for large hopping -# ------------------------------------------------------------------------------ -# As discussed at the start, we are interested to see interplay between Hund's -# and charge-transfer physics, which will obviously depend strongly on whether -# the holes are on Ni or the ligand. Let's see what happens as :math:`e_L` is -# reduced while observing the location of the ground state and exciton holes. -U = 10 -JH = 2 -t = 100 - -eLs = np.linspace(0, 1000, 30) - -fig, axs = plt.subplots(1, 2, figsize=(8, 4)) - -for ax, ind in zip(axs.ravel(), [0, 3]): - ds = np.array([diagonalize(U, JH, t, eL, n=6) - for eL in eLs]) - - ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$') - ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$') - ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$') - ax.set_xlabel("Energy of ligands $e_L$") - ax.set_ylabel("Number of electrons") - ax.legend() - -axs[0].set_title("Location of ground state holes") -axs[1].set_title("Location of exciton holes") - -plt.tight_layout() -plt.show() -################################################################################ -# For large :math:`e_L`, we see that both holes are on nickel as expected. In -# the opposite limit of :math:`|e_L| \ll t` and :math:`U \ll t` the holes are -# shared in the ratio 0.25:0.5:0.25 as there are two ways to have one hole on -# Ni. In the limit of large :math:`e_L`, all holes move onto Ni. Since -# :math:`t` is large, this applies equally to both the ground state and the -# exciton. - - -################################################################################ -# Connecton between atomic and charge transfer limits -# ------------------------------------------------------------------------------ -# We now examine the quantum numbers during cross over between the two limits -# with :math:`e_L`. Let's first look at the how :math:`` changes for the -# ground state and exciton and then examine how the exciton energy changes. - -U = 10 -JH = 2 -t = 100 - -eLs = np.linspace(0, 1000, 30) - -info = np.array([diagonalize(U, JH, t, eL, n=6) - for eL in eLs]) - -fig, axs = plt.subplots(1, 2, figsize=(8, 4)) - - -axs[0].plot(eLs, info[:, 4, 0], label='Ground state') -axs[0].plot(eLs, info[:, 4, 3], label='Exciton') -axs[0].set_xlabel("Energy of ligands $e_L$") -axs[0].set_ylabel('$$') -axs[0].set_title('Quantum numbers') -axs[0].legend() - -axs[1].plot(eLs, info[:, 0, 3], '+', color='C0') -axs[1].set_xlabel("Energy of ligands $e_L$") -axs[1].set_ylabel('Exciton energy', color='C0') -axr = axs[1].twinx() -axr.plot(eLs, info[:, 3, 5], 'x', color='C1') -axr.set_ylabel('$d^2$ fraction', color='C1') - -for ax, color in zip([axs[1], axr], ['C0', 'C1']): - for tick in ax.get_yticklabels(): - tick.set_color(color) - -axs[1].set_ylim(0, 2*JH) -axr.set_ylim(0, 1) - -axs[1].set_title('Exciton energy vs. $d^2$ character') -plt.tight_layout() -plt.show() -############################################################################## -# In the left panel, we see that the two limits are adiabatically connected -# as they preseve the same quantum numbers. This is because there is always -# an appreciable double occupancy under conditions where the -# :math:`d^9\underline{L}` character is maximized and this continues to favor -# the high spin ground state. Other interactions such as strong tetragonal -# crystal field would be needed to overcome the Hund's interactions and break -# this paradigm. In the right panel, we see that the exciton energy simply -# scales with the double occupancy. Overall, even though -# Hund's interactions are irrelevant for the :math:`d^9\underline{L}` -# electronic configuration, whenever :math:`t` is appreciable there is a -# strong mixing with the :math:`d^8` component is always present, which -# dominates the energy of the exciton. - -################################################################################ -# Charge transfer excitons -# ------------------------------------------------------------------------------ -# Another limiting case of the model is where :math:`t` is smaller than the -# Coulomb interactions. This, however, tends to produce -# ground state and exciton configurations that correspond to those of distinct -# atomic models. Let's look at the :math:`e_L` dependence in this case. -U = 10 -JH = 2 -t = .5 -eL = 7 - -eLs = np.linspace(0, 20, 30) - -fig, axs = plt.subplots(1, 2, figsize=(8, 4)) - -for ax, ind in zip(axs.ravel(), [0, 3]): - ds = np.array([diagonalize(U, JH, t, eL, n=6) - for eL in eLs]) - - ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$') - ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$') - ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$') - ax.set_xlabel("Energy of ligands $e_L$") - ax.set_ylabel("Number of electrons") - ax.legend() - -axs[0].axvline(x=eL, linestyle=':', color='k') -axs[1].axvline(x=eL, linestyle=':', color='k') - -axs[0].set_title("Location of ground state holes") -axs[1].set_title("Location of exciton holes") - -plt.tight_layout() -plt.show() -################################################################################ -# Around :math:`e_L = 7` the plot shows that the excition is primairly a -# :math:`d^2 \rightarrow d^1` transition or a -# :math:`d^8 \rightarrow d^{9}\underline{L}` transition in electron language. -# Let's examine the energy and quantum numbers. - -e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6) - -print("Ground state\nE\t") -for i in range(3): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - -print("\nExcited state\nE\t") -for i in range(3, 6): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - -################################################################################ -# We once again see the same quantum numbers, despite the differences in mixing -# in the ground state and exciton. - - -############################################################################## -# -# .. rubric:: Footnotes -# -# .. [1] D. Khomskii, Transition Metal Compounds, Cambridge University Press (2014) diff --git a/edrixs/_downloads/a55bc2c31f15bafae0fd721b61500b04/example_3_AIM_XAS.zip b/edrixs/_downloads/a55bc2c31f15bafae0fd721b61500b04/example_3_AIM_XAS.zip deleted file mode 100644 index c543906094..0000000000 Binary files a/edrixs/_downloads/a55bc2c31f15bafae0fd721b61500b04/example_3_AIM_XAS.zip and /dev/null differ diff --git a/edrixs/_downloads/a59d1211c3e01cc94d65ba02ae9647da/example_7_Hunds_interactions.zip b/edrixs/_downloads/a59d1211c3e01cc94d65ba02ae9647da/example_7_Hunds_interactions.zip deleted file mode 100644 index 8b86cbaaa8..0000000000 Binary files a/edrixs/_downloads/a59d1211c3e01cc94d65ba02ae9647da/example_7_Hunds_interactions.zip and /dev/null differ diff --git a/edrixs/_downloads/a78af2b1cbb139d2a3505d4ef66507e7/example_6_Hubbard_dimer.zip b/edrixs/_downloads/a78af2b1cbb139d2a3505d4ef66507e7/example_6_Hubbard_dimer.zip deleted file mode 100644 index 800a59b5dc..0000000000 Binary files a/edrixs/_downloads/a78af2b1cbb139d2a3505d4ef66507e7/example_6_Hubbard_dimer.zip and /dev/null differ diff --git a/edrixs/_downloads/abf6cbdf639390b5897a511a4eb14530/example_6_Coulomb.py b/edrixs/_downloads/abf6cbdf639390b5897a511a4eb14530/example_6_Coulomb.py deleted file mode 100644 index 65b3c07794..0000000000 --- a/edrixs/_downloads/abf6cbdf639390b5897a511a4eb14530/example_6_Coulomb.py +++ /dev/null @@ -1,381 +0,0 @@ -#!/usr/bin/env python -""" -Coulomb interactions -===================================== -In this example we provide more details on how Coulomb interactions are -implemented in multiplet calculations and EDRIXS in particular. We aim -to clarify the form of the matrices, how they are parametrized, -and how the breaking of spherical symmetry can switch on additional elements -that one might not anticipate. Our example is based on a :math:`d` atomic shell. -""" - -################################################################################ -# Create matrix -# ------------------------------------------------------------------------------ -# The Coulomb interaction between two particles can be written as -# -# .. math:: -# \begin{equation} -# \hat{H} = \frac{1}{2} -# \int d\mathbf{r} \int d\mathbf{r}^\prime -# \Sigma_{\sigma, \sigma^\prime} -# |\hat{\psi}^\sigma(\mathbf{r})|^2 \frac{e^2}{R} -# |\hat{\psi}^{\sigma^\prime}(\mathbf{r})|^2, -# \end{equation} -# -# where :math:`\hat{\psi}^\sigma(\mathbf{r})` is the electron wavefunction, with -# spin :math:`\sigma`, and :math:`R=|r-r^\prime|` is the electron separation. -# Solving our problem in this form is difficult due to the need to symmeterize -# the wavefunction to follow fermionic statistics. -# Using second quantization, we can use operators to impose the required -# particle exchange statistics and write the equation in terms of -# a tensor :math:`U` -# -# .. math:: -# \begin{equation} -# \hat{H} = \sum_{\alpha,\beta,\gamma,\delta,\sigma,\sigma^\prime} -# U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} -# \hat{f}^{\dagger}_{\alpha\sigma} -# \hat{f}^{\dagger}_{\beta\sigma^\prime} -# \hat{f}_{t\sigma^\prime}\hat{f}_{\delta\sigma}, -# \end{equation} -# -# where :math:`\alpha`, :math:`\beta`, :math:`\gamma`, :math:`\delta` are -# orbital indices and :math:`\hat{f}^{\dagger}` -# (:math:`\hat{f}`) are the creation (anihilation) operators. -# For a :math:`d`-electron system, we have :math:`10` distinct spin-orbitals -# (:math:`5` orbitals each with :math:`2` spins), which makes matrix the -# :math:`10\times10\times10\times10` in total size. -# In EDRIXS the matrix can be created as follows: -import edrixs -import numpy as np -import scipy -import matplotlib.pyplot as plt -import itertools - -F0, F2, F4 = 6.94, 14.7, 4.41 -umat_chb = edrixs.get_umat_slater('d', F0, F2, F4) -################################################################################ -# We stored this under variable :code:`umat_chb` where "cbh" stands for -# complex harmonic basis, which is the default basis in EDRIXS. - -################################################################################ -# Parameterizing interactions -# ------------------------------------------------------------------------------ -# EDRIXS parameterizes the interactions in :math:`U` via Slater integral -# parameters :math:`F^{k}`. These relate to integrals of various spherical -# Harmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients, -# and Wigner 3J symbols. Textbooks such as [1]_ can be used for further -# reference. If you are interested in the details of how -# EDRIXS does this (and you probably aren't) function :func:`.umat_slater`, -# constructs the required matrix via Gaunt coeficents from -# :func:`.get_gaunt`. Two alternative parameterizations are common. -# The first are the Racah parameters, which are -# -# .. math:: -# \begin{eqnarray} -# A &=& F^0 - \frac{49}{441} F^4 \\ -# B &=& \frac{1}{49}F^2 - \frac{5}{441}F^4 \\ -# C &=& \frac{35}{441}F^4. -# \end{eqnarray} -# -# or an alternative form for the Slater integrals -# -# .. math:: -# \begin{eqnarray} -# F_0 &=& F^0 \\ -# F_2 &=& \frac{1}{49}F^2 \\ -# F_4 &=& \frac{1}{441}F^4, -# \end{eqnarray} -# -# which involves different normalization parameters. - -################################################################################ -# Basis transform -# ------------------------------------------------------------------------------ -# If we want to use the real harmonic basis, we can use a tensor -# transformation, which imposes the following orbital order -# :math:`3z^2-r^2, xz, yz, x^2-y^2, xy`, each of which involves -# :math:`\uparrow, \downarrow` spin pairs. Let's perform this transformation and -# store a list of these orbitals. -umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True)) -orbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy'] - -################################################################################ -# Interactions -# ------------------------------------------------------------------------------ -# Tensor :math:`U` is a series of matrix -# elements -# -# .. math:: -# \begin{equation} -# \langle\psi_{\gamma,\delta}^{\bar{\sigma},\bar{\sigma}^\prime} -# |\hat{H}| -# \psi_{\alpha,\beta}^{\sigma,\sigma^\prime}\rangle -# \end{equation} -# -# the combination of which defines the energetic cost of pairwise -# electron-electron interactions between states :math:`\alpha,\sigma` -# and :math:`\beta,\sigma^\prime`. In EDRIXS we follow the convention of -# summing over all orbital pairs. Some other texts count each pair of -# indices only once. The matrix elements here will consequently -# be half the magnitude of those in other references. -# We can express the interactions in terms of -# the orbitals involved. It is common to distinguish "direct Coulomb" and -# "exchange" interactions. The former come from electrons in the same orbital -# and the later involve swapping orbital labels for electrons. We will use -# :math:`U_0` and :math:`J` as a shorthand for distinguishing these. -# -# Before we describe the different types of interactions, we note that since -# the Coulomb interaction is real, and due to the spin symmmetry properties -# of the process :math:`U` always obeys -# -# .. math:: -# \begin{equation} -# U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} = -# U_{\beta\sigma,\alpha\sigma^\prime,\delta\sigma^\prime,\gamma\sigma} = -# U_{\delta\sigma,\gamma\sigma^\prime,\beta\sigma^\prime,\alpha\sigma} = -# U_{\gamma\sigma,\delta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}. -# \end{equation} -# -# -# 1. Intra orbital -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# The direct Coulomb energy cost to double-occupy an orbital comes from terms -# like :math:`U_{\alpha\sigma,\alpha\bar\sigma,\alpha\bar\sigma,\alpha\sigma}`. -# In this notation, we use :math:`\sigma^\prime` to denote that the matrix -# element is summed over all pairs and :math:`\bar{\sigma}` to denote sums -# over all opposite spin pairs. Due to rotational symmetry, all these -# elements are the same and equal to -# -# .. math:: -# \begin{eqnarray} -# U_0 &=& \frac{A}{2} + 2B + \frac{3C}{2}\\ -# &=& \frac{F_0}{2} + 2F_2 + 18F_4 -# \end{eqnarray} -# -# Let's print these to demonstrate where these live in the array -for i in range(0, 5): - val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {val:.3f}") - -################################################################################ -# 2. Inter orbital Coulomb interactions -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Direct Coulomb repulsion between different orbitals depends on terms like -# :math:`U_{\alpha\sigma,\beta\sigma^\prime,\beta\sigma^\prime,\alpha\sigma}`. -# Expresions for these parameters are provided in column :math:`U` in -# :ref:`table_2_orbital`. We can print the values from :code:`umat` -# like this: -for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - -################################################################################ -# 3. Inter-orbital exchange interactions -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Exchange terms exist with the form -# :math:`U_{\alpha\sigma,\beta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}`. -# Expresions for these parameters are provided in column :math:`J` of -# :ref:`table_2_orbital`. These come from terms like this in the matrix: -for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - -################################################################################ -# 4. Pair hopping term -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Terms that swap pairs of electrons exist as -# :math:`(1-\delta_{\sigma\sigma'})U_{\alpha\sigma,\alpha\bar\sigma,\beta\bar\sigma,\beta\sigma}` -# and depend on exchange interactions column :math:`J` from -# :ref:`table_2_orbital` -# and here in the matrix. -for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - -################################################################################ -# 5. Three orbital -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Another set of terms that one might not immediately anticipate involve three -# orbitals like -# -# .. math:: -# \begin{equation} -# U_{\alpha\sigma, \gamma\sigma', \beta\sigma', \gamma\sigma} \\ -# U_{\alpha\sigma, \gamma\sigma', \gamma\sigma', \beta\sigma} \\ -# (1-\delta_{\sigma\sigma'}) -# U_{\alpha\sigma, \beta\sigma', \gamma\sigma', \gamma\sigma} -# \end{equation} -# -# for :math:`\alpha=3z^2-r^2, \beta=x^2-y^2, \gamma=xz/yz`. -# These are needed to maintain the rotational symmetry of the interations. -# See :ref:`table_3_orbital` for the expressions. We can print some of -# these via: -ijkl = [[0, 1, 3, 1], - [0, 2, 3, 2], - [1, 0, 3, 1], - [1, 1, 3, 0], - [2, 0, 3, 2], - [2, 2, 3, 0]] - -for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t" - f"{orbitals[k]:<8} \t {orbitals[l]:<8} \t {val:.3f}") - -################################################################################ -# 6. Four orbital -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Futher multi-orbital terms include -# :math:`U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma}`. -# We can find these here in the matrix: -ijkl = [[0, 1, 2, 4], - [0, 1, 4, 2], - [0, 2, 1, 4], - [0, 2, 4, 1], - [0, 4, 1, 2], - [0, 4, 2, 1], - [3, 1, 4, 2], - [3, 2, 4, 1], - [3, 4, 1, 2], - [3, 4, 2, 1]] - -for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {orbitals[k]:<8}" - f"\t {orbitals[l]:<8} \t {val:.3f}") - -################################################################################ -# Effects of multi-orbital terms -# ------------------------------------------------------------------------------ -# To test the effects of the multi-orbital terms, let's plot the eigenenergy -# spectra with and without multi-orbital terms switched on for system with and -# without a cubic crystal field. We will use a :math:`d`-shell with two -# electrons. -ten_dqs = [0, 2, 4, 12] - -def diagonalize(ten_dq, umat): - emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq), - edrixs.tmat_c2r('d', ispin=True)) - H = (edrixs.build_opers(4, umat, basis) - + edrixs.build_opers(2, emat, basis)) - e, v = scipy.linalg.eigh(H) - return e - e.min() - -basis = edrixs.get_fock_bin_by_N(10, 2) -umat_no_multiorbital = np.copy(umat) -B = F2/49 - 5*F4/441 -for val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]: - umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0 - -fig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3)) - -for cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)): - ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1, - label='on', color=f'C{cind}') - ax.hlines(diagonalize(ten_dq, umat_no_multiorbital), - xmin=1.5, xmax=2.5, - label='off', - linestyle=':', color=f'C{cind}') - ax.set_title(f"$10D_q={ten_dq}$") - ax.set_ylim([-.5, 20]) - ax.set_xticks([]) - ax.legend() - -fig.suptitle("Eigenvalues with 3&4-orbital effects on/off") -fig.subplots_adjust(wspace=.3) -axs[0].set_ylabel('Eigenvalues (eV)') -fig.subplots_adjust(top=.8) -plt.show() - -################################################################################ -# On the left of the plot Coulomb interactions in spherical symmetry cause -# substantial mxing between :math:`t_{2g}` and :math:`e_{g}` orbitals in the -# eigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the -# the right eigenenergies. As :math:`10D_q` get large, this mixing is switched -# off and the spectra start to become independent of whether the 3 & 4 orbital -# orbital terms are included or not. -# -# -# -# .. _table_2_orbital: -# .. table:: Table of 2 orbital interactions -# -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |Orbitals :math:`\alpha,\beta`|:math:`U_0` Racah | :math:`U_0` Slater |:math:`J` Racah |:math:`J` Slater | -# +=============================+==================+=======================+================+====================+ -# |:math:`3z^2-r^2, xz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`3z^2-r^2, yz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`3z^2-r^2, x^2-y^2` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`3z^2-r^2, xy` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`xz, yz` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`xz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`xz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`yz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`yz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`x^2-y^2, xy` |:math:`A/2+2B+C/2`|:math:`F_0+4F_2-34F_4` | :math:`C/2` |:math:`35F_4/2` | -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# -# -# .. _table_3_orbital: -# .. table:: Table of 3 orbital interactions -# -# +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ -# |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| -# +=============================+=============+====================================================+=====================================================+ -# |:math:`3z^2-r^2, xz, x^2-y^2, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, yz, x^2-y^2, yz` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`xz, 3z^2-r^2, x^2-y^2, xz` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`xz, xz, x^2-y^2, 3z^2-r^2` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`yz, 3z^2-r^2, x^2-y^2, yz` | :math:`\sqrt{3}B` | :math:`\sqrt{3}F_2-5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`yz, yz, x^2-y^2, 3z^2-r^2` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# -# -# .. _table_4_orbital: -# .. table:: Table of 4 orbital interactions -# -# +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ -# |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| -# +=============================+=============+====================================================+=====================================================+ -# |:math:`3z^2-r^2, xz, yz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, xz, xy, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, yz, xz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, yz, xy, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, xy, xz, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, xy, yz, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , xz, xy, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , yz, xy, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , xy, xz, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , xy, yz, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# -# -# .. rubric:: Footnotes -# -# .. [1] MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of -# Transition-Metal Ions in Crystals. Academic Press, New York and London. diff --git a/edrixs/_downloads/acd53eaa7242222013141c0dd7643cc0/example_7_Hunds_interactions.ipynb b/edrixs/_downloads/acd53eaa7242222013141c0dd7643cc0/example_7_Hunds_interactions.ipynb deleted file mode 100644 index cd199cb720..0000000000 --- a/edrixs/_downloads/acd53eaa7242222013141c0dd7643cc0/example_7_Hunds_interactions.ipynb +++ /dev/null @@ -1,193 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Hund's Interactions in charge transfer insulators\nIn this exercise we will solve a toy model relevant to cubic $d^8$ charge transfer insulators\nsuch as NiO or NiPS\\ :sub:`3`. We are interested in better understanding the interplay between the\nHund's interactions and the charge transfer energy in terms of the energy of the triplet-singlet\nexcitations of this model. These seem to act against each other in that the Hund's interactions\nimpose a energy cost for the triplet-singlet excitations whenever there are two holes on\nthe Ni $d$ orbitals. The charge transfer physics, on the other hand, will promote a\n$d^9\\underline{L}$ ground state in which the Hund's interactions are not active.\n\nThe simplest model that captures this physics requires four Ni spin-orbitals, representing the Ni\n$e_g$ manifold. We will represent the ligand states in the same way as the Anderson impurity\nmodel in terms of one effective ligand spin-orbital per Ni spin-orbital. We assume these effective\norbitals have been constructed so that each Ni orbital only bonds to one sister orbital. For\nsimplicity, we will treat all Ni and all ligand orbitals as equivalent, even though a more\nrealistic model would account for the different Coulomb and hopping of the $d_{3z^2-r^2}$\nand $d_{x^2-y^2}$ orbitals. We therefore simply connect Ni and ligand orbitals via a constant\nhopping $t$. We also include the ligand energy parameter $e_L$.\n\nThe easiest way to implement the requried Coulomb interactions is to use the so-called Kanamori\nHamiltonian, which is a simplfied form for the interactions, which treats all orbitals as\nequivalent. Daniel Khomskii's book provides a great explanation of this physics [1]_. We\nparameterize the interactions via Coulomb repulsion parameter $U$ and Hund's exchange\n$J_H$. EDRIXS provides this functionality via the more general\n:func:`.get_umat_kanamori` function.\n\nIt's also easiest to consider this problem in hole langauge, which means our eight spin-orbitals\nare populated by two fermions.\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup\nWe start by loading the necessary modules, and defining the total number of\norbitals and electrons.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport scipy\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nnorb = 8\nnoccu = 2" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Diagonalization\nLet's write a function to diagonalize our model in a similar way to\nthe `sphx_glr_auto_examples_example_6_Hubbard_dimer.py` example.\nWithin this function, we also create operators to count the number of\n$d$ holes and operators to calculate expectation values for\n$S^2$ and $S_z$. For the latter to make sense, we also include a\nsmall effective spin interaction along $z$.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "def diagonalize(U, JH, t, eL, n=1):\n # Setup Coulomb matrix\n umat = np.zeros((norb, norb, norb, norb), dtype=complex)\n uNi = edrixs.get_umat_kanamori(norb//2, U, JH)\n umat[:norb//2, :norb//2, :norb//2, :norb//2] = uNi\n\n # Setup hopping matrix\n emat = np.zeros((norb, norb), dtype=complex)\n ind = np.arange(norb//2)\n emat[ind, ind + norb//2] = t\n emat[ind+norb//2, ind] = np.conj(t) # conj is not needed, but is good practise.\n ind = np.arange(norb//2, norb)\n emat[ind, ind] += eL\n\n # Spin operator\n spin_mom = np.zeros((3, norb, norb), dtype=complex)\n spin_mom[:, :2, :2] = edrixs.get_spin_momentum(0)\n spin_mom[:, 2:4, 2:4] = edrixs.get_spin_momentum(0)\n spin_mom[:, 4:6, 4:6] = edrixs.get_spin_momentum(0)\n spin_mom[:, 6:8, 6:8] = edrixs.get_spin_momentum(0)\n\n # add small effective field along z\n emat += 1e-6*spin_mom[2]\n\n # Diagonalize\n basis = edrixs.get_fock_bin_by_N(norb, noccu)\n H = edrixs.build_opers(2, emat, basis) + edrixs.build_opers(4, umat, basis)\n e, v = scipy.linalg.eigh(H)\n e -= e[0] # Define ground state as zero energy\n\n # Operator for holes on Ni\n basis = np.array(basis)\n num_d_electrons = basis[:, :4].sum(1)\n d0 = np.sum(np.abs(v[num_d_electrons == 0, :])**2, axis=0)\n d1 = np.sum(np.abs(v[num_d_electrons == 1, :])**2, axis=0)\n d2 = np.sum(np.abs(v[num_d_electrons == 2, :])**2, axis=0)\n\n # S^2 and Sz operators\n opS = edrixs.build_opers(2, spin_mom, basis)\n S_squared_op = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2])\n S_squared_exp = edrixs.cb_op(S_squared_op, v).diagonal().real\n S_z_exp = edrixs.cb_op(opS[2], v).diagonal().real\n\n return e[:n], d0[:n], d1[:n], d2[:n], S_squared_exp[:n], S_z_exp[:n]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## The atomic limit\nFor simplicity, let's start in the atomic limit with $e_L \\gg t \\gg U$\nwhere all holes are on nickel. In this case, there are six ways to distribute\ntwo holes on the four Ni spin-orbitals. Let's examine the expectation values\nof the $S^2$ and $S_z$ operators.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "U = 10\nJH = 2\nt = 100\neL = 1e10\n\ne, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6)\n\nprint(\"Ground state\\nE\\t\")\nfor i in range(3):\n print(f\"{e[i]:.2f}\\t{S_squared_exp[i]:.2f}\\t{S_z_exp[i]:.2f}\")\n\nprint(\"\\nExcited state\\nE\\t\")\nfor i in range(3, 6):\n print(f\"{e[i]:.2f}\\t{S_squared_exp[i]:.2f}\\t{S_z_exp[i]:.2f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The ground state is a high-spin triplet. The fourth and fifth\nstates (the first excited state) are low-spin singlet excitons at\n$2 J_H$. These have one hole on each orbital in the antisymmetric\ncombination of $|\\uparrow\\downarrow>-|\\downarrow\\uparrow>$.\nThe state at $3 J_H$ also has one hole on each orbital in the symmetric\n$|\\uparrow\\downarrow>+|\\downarrow\\uparrow>$ configuration.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Where are the holes for large hopping\nAs discussed at the start, we are interested to see interplay between Hund's\nand charge-transfer physics, which will obviously depend strongly on whether\nthe holes are on Ni or the ligand. Let's see what happens as $e_L$ is\nreduced while observing the location of the ground state and exciton holes.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "U = 10\nJH = 2\nt = 100\n\neLs = np.linspace(0, 1000, 30)\n\nfig, axs = plt.subplots(1, 2, figsize=(8, 4))\n\nfor ax, ind in zip(axs.ravel(), [0, 3]):\n ds = np.array([diagonalize(U, JH, t, eL, n=6)\n for eL in eLs])\n\n ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$')\n ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$')\n ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$')\n ax.set_xlabel(\"Energy of ligands $e_L$\")\n ax.set_ylabel(\"Number of electrons\")\n ax.legend()\n\naxs[0].set_title(\"Location of ground state holes\")\naxs[1].set_title(\"Location of exciton holes\")\n\nplt.tight_layout()\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "For large $e_L$, we see that both holes are on nickel as expected. In\nthe opposite limit of $|e_L| \\ll t$ and $U \\ll t$ the holes are\nshared in the ratio 0.25:0.5:0.25 as there are two ways to have one hole on\nNi. In the limit of large $e_L$, all holes move onto Ni. Since\n$t$ is large, this applies equally to both the ground state and the\nexciton.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Connecton between atomic and charge transfer limits\nWe now examine the quantum numbers during cross over between the two limits\nwith $e_L$. Let's first look at the how $$ changes for the\nground state and exciton and then examine how the exciton energy changes.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "U = 10\nJH = 2\nt = 100\n\neLs = np.linspace(0, 1000, 30)\n\ninfo = np.array([diagonalize(U, JH, t, eL, n=6)\n for eL in eLs])\n\nfig, axs = plt.subplots(1, 2, figsize=(8, 4))\n\n\naxs[0].plot(eLs, info[:, 4, 0], label='Ground state')\naxs[0].plot(eLs, info[:, 4, 3], label='Exciton')\naxs[0].set_xlabel(\"Energy of ligands $e_L$\")\naxs[0].set_ylabel('$$')\naxs[0].set_title('Quantum numbers')\naxs[0].legend()\n\naxs[1].plot(eLs, info[:, 0, 3], '+', color='C0')\naxs[1].set_xlabel(\"Energy of ligands $e_L$\")\naxs[1].set_ylabel('Exciton energy', color='C0')\naxr = axs[1].twinx()\naxr.plot(eLs, info[:, 3, 5], 'x', color='C1')\naxr.set_ylabel('$d^2$ fraction', color='C1')\n\nfor ax, color in zip([axs[1], axr], ['C0', 'C1']):\n for tick in ax.get_yticklabels():\n tick.set_color(color)\n\naxs[1].set_ylim(0, 2*JH)\naxr.set_ylim(0, 1)\n\naxs[1].set_title('Exciton energy vs. $d^2$ character')\nplt.tight_layout()\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the left panel, we see that the two limits are adiabatically connected\nas they preseve the same quantum numbers. This is because there is always\nan appreciable double occupancy under conditions where the\n$d^9\\underline{L}$ character is maximized and this continues to favor\nthe high spin ground state. Other interactions such as strong tetragonal\ncrystal field would be needed to overcome the Hund's interactions and break\nthis paradigm. In the right panel, we see that the exciton energy simply\nscales with the double occupancy. Overall, even though\nHund's interactions are irrelevant for the $d^9\\underline{L}$\nelectronic configuration, whenever $t$ is appreciable there is a\nstrong mixing with the $d^8$ component is always present, which\ndominates the energy of the exciton.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Charge transfer excitons\nAnother limiting case of the model is where $t$ is smaller than the\nCoulomb interactions. This, however, tends to produce\nground state and exciton configurations that correspond to those of distinct\natomic models. Let's look at the $e_L$ dependence in this case.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "U = 10\nJH = 2\nt = .5\neL = 7\n\neLs = np.linspace(0, 20, 30)\n\nfig, axs = plt.subplots(1, 2, figsize=(8, 4))\n\nfor ax, ind in zip(axs.ravel(), [0, 3]):\n ds = np.array([diagonalize(U, JH, t, eL, n=6)\n for eL in eLs])\n\n ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$')\n ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$')\n ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$')\n ax.set_xlabel(\"Energy of ligands $e_L$\")\n ax.set_ylabel(\"Number of electrons\")\n ax.legend()\n\naxs[0].axvline(x=eL, linestyle=':', color='k')\naxs[1].axvline(x=eL, linestyle=':', color='k')\n\naxs[0].set_title(\"Location of ground state holes\")\naxs[1].set_title(\"Location of exciton holes\")\n\nplt.tight_layout()\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Around $e_L = 7$ the plot shows that the excition is primairly a\n$d^2 \\rightarrow d^1$ transition or a\n$d^8 \\rightarrow d^{9}\\underline{L}$ transition in electron language.\nLet's examine the energy and quantum numbers.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6)\n\nprint(\"Ground state\\nE\\t\")\nfor i in range(3):\n print(f\"{e[i]:.2f}\\t{S_squared_exp[i]:.2f}\\t{S_z_exp[i]:.2f}\")\n\nprint(\"\\nExcited state\\nE\\t\")\nfor i in range(3, 6):\n print(f\"{e[i]:.2f}\\t{S_squared_exp[i]:.2f}\\t{S_z_exp[i]:.2f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We once again see the same quantum numbers, despite the differences in mixing\nin the ground state and exciton.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ".. rubric:: Footnotes\n\n.. [1] D. Khomskii, Transition Metal Compounds, Cambridge University Press (2014)\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.14" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/b4dc84131d87174f7c09b58fc61829a8/example_7_transitions.ipynb b/edrixs/_downloads/b4dc84131d87174f7c09b58fc61829a8/example_7_transitions.ipynb deleted file mode 100644 index 7b0469a93a..0000000000 --- a/edrixs/_downloads/b4dc84131d87174f7c09b58fc61829a8/example_7_transitions.ipynb +++ /dev/null @@ -1,176 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# X-ray transitions\nThis example explains how to calculate x-ray transition amplitudes between\nspecific orbital and spin states. We take the case of a cuprate which has one\nhole in the $d_{x^2-y^2}$ orbital and a spin ordering direction along the\nin-plane diagaonal direction and compute the angular dependence of spin-flip\nand non-spin-flip processes.\n\nThis case was chosen because the eigenvectors in question are simple enough\nfor us to write them out more-or-less by hand, so this example helps the reader\nto understand what happens under the hood in more complex cases.\n\nSome of the code here is credited to Yao Shen who used this approach for the\nanalysis of a low valence nickelate material [1]_. The task performed repeats\nanalysis done by many researchers e.g. Luuk Ament et al [2]_ as well as\nseveral other groups.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Eigenvectors\nLet us start by determining the eigenvectors involved in the transitions.\nThe spin direction can be set using a vector\n$\\vec{B}$ to represent a magnetic field in terms of generalized spin\noperator $\\tilde{\\sigma}=\\vec{B}\\cdot\\sigma$ based on the Pauli matrices\n$\\sigma$. Let's put the spin along the $[1, 1, 0]$ direction\nand formuate the problem in the hole basis.\nFor one particle, we know that the Hamiltonian will be diagonal in the real\nharmonic basis.\nWe can generate the required eigenvectors by making a diagonal\nmatrix, transforming it to the required\ncomplex harmonic basis (as is standard for EDRIXS) and diagonalizing it.\nAs long as the crystal field splitting is much larger than the magnetic\nfield, the eigenvectors will be independent of the exact values of both\nthese parameters.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "B = 1e-3*np.array([1, 1, 0])\ncf_splitting = 1e3\nzeeman = sum(s*b for s, b in zip(edrixs.get_spin_momentum(2), B))\ndd_levels = np.array([energy for dd_level in cf_splitting*np.arange(5)\n for energy in [dd_level]*2], dtype=complex)\nemat_rhb = np.diag(dd_levels)\nemat = edrixs.cb_op(emat_rhb, edrixs.tmat_r2c('d', ispin=True)) + zeeman\n_, eigenvectors = np.linalg.eigh(emat)\n\ndef get_eigenvector(orbital_index, spin_index):\n return eigenvectors[:, 2*orbital_index + spin_index]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let's examine the $d_{x^2-y^2}$ orbital first. Recall from the\n`sphx_glr_auto_examples_example_1_crystal_field.py`\nexample that edrixs uses the standard orbital order of\n$d_{3z^2-r^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}$. So we want\n:code:`orbital_index = 3` element. Using this, we can build spin-up and -down\neigenvectors.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "orbital_index = 3\n\ngroundstate_vector = get_eigenvector(orbital_index, 0)\nexcitedstate_vector = get_eigenvector(orbital_index, 1)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Transition operators and scattering matrix\nHere we are considering the $L_3$-edge. This means\na $2p_{3/2} \\rightarrow 3d$\nabsoprtion transition and a $2p_{3/2} \\rightarrow 3d$\nemission transition. We can read the relevant matrix from the edrixs database,\nkeeping in mind that there are in fact three operations for\n$x, y,$ & $z$ directions. Note that edrixs provides operators\nin electron notation. If we define $D$ as the transition operator in\nelectron language, $D^\\dagger$ is the operator in the hole language\nwe are using for this example.\nThe angular dependence of a RIXS transition can be conveniently described\nusing the scattering matrix, which is a $3\\times3$ element object that\nspecifies the transition amplitude for each incoming and outgoing x-ray\npolarization. Correspondingly, we have\n\n .. math::\n \\begin{equation}\n \\mathcal{F}=\\sum_n\\langle f|D|n\\rangle\\langle n|D^{\\dagger}|g\\rangle\n \\end{equation}.\n\nIn matrix form this is\n\n .. math::\n \\begin{equation}\n \\mathcal{F}(m,n)=\\{f^{\\dagger} \\cdot D(m)\\} \\cdot \\{D^{\\dagger}(n) \\cdot g\\}\n \\end{equation}.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "D_Tmat = edrixs.get_trans_oper('dp32')\n\ndef get_F(vector_i, vector_f):\n F = np.zeros((3, 3), dtype=complex)\n for i in range(3):\n for j in range(3):\n F[i, j] = np.dot(np.dot(np.conj(vector_f.T), D_Tmat[i]),\n np.dot(np.conj(D_Tmat[j].T), vector_i))\n return F" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Using this function, we can obtain non-spin-flip (NSF) and spin-flip (SF)\nscattering matrices by choosing whether we return to the ground state or\nwhether we access the excited state with the spin flipped.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "F_NSF = get_F(groundstate_vector, groundstate_vector)\nF_SF = get_F(groundstate_vector, excitedstate_vector)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Angular dependence\nLet's consider the common case of fixing the total scattering angle at\n:code:`two_theta = 90` and choosing a series of incident angles :code:`thins`.\nSince the detector does not resolve polarization, we need to add both outgoing\npolarizations. It is then convenient to use function :func:`.dipole_polvec_rixs`\nto obtain the incoming and outgoing polarization vectors.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "thins = np.linspace(0, 90)\ntwo_theta = 90\nphi = 0\n\n\ndef get_I(thin, alpha, F):\n intensity = 0\n for beta in [0, np.pi/2]:\n thout = two_theta - thin\n ei, ef = edrixs.dipole_polvec_rixs(thin*np.pi/180, thout*np.pi/180,\n phi*np.pi/180, alpha, beta)\n intensity += np.abs(np.dot(ef, np.dot(F, ei)))**2\n return intensity" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Plot\nWe now run through a few configurations specified in terms of incoming\npolarization angle $\\alpha$ (defined in radians w.r.t. the scattering\nplane), $F$, plotting label, and plotting color.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fig, ax = plt.subplots()\n\nconfig = [[0, F_NSF, r'$\\pi$ NSF', 'C0'],\n [np.pi/2, F_NSF, r'$\\sigma$ NSF', 'C1'],\n [0, F_SF, r'$\\pi$ SF', 'C2'],\n [np.pi/2, F_SF, r'$\\sigma$ SF', 'C3']]\n\nfor alpha, F, label, color in config:\n Is = np.array([get_I(thin, alpha, F) for thin in thins])\n ax.plot(thins, Is, label=label, color=color)\n\nax.legend()\nax.set_xlabel(r'Theta ($^\\circ$)')\nax.set_ylabel('Relative intensity')\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Run through orbitals\nFor completeness, let's look at transitions from $x^2-y^2$ to all other\norbitals.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fig, axs = plt.subplots(5, 1, figsize=(7, 7),\n sharex=True, sharey=True)\n\norbitals = ['$d_{3z^2-r^2}$', '$d_{xz}$', '$d_{yz}$',\n '$d_{x^2-y^2}$', '$d_{xy}$']\norbital_order = [4, 1, 2, 0, 3]\n\nplot_index = 0\nfor ax, orbital_index in zip(axs, orbital_order):\n for spin_index, spin_label in zip([0, 1], ['NSF', 'SF']):\n excitedstate_vector = get_eigenvector(orbital_index, spin_index)\n F = get_F(groundstate_vector, excitedstate_vector)\n for alpha, pol_label in zip([0, np.pi/2], [r'$\\pi$', r'$\\sigma$']):\n Is = np.array([get_I(thin, alpha, F) for thin in thins])\n ax.plot(thins, Is*10, label=f'{pol_label} {spin_label}',\n color=f'C{plot_index%4}')\n plot_index += 1\n ax.legend(title=orbitals[orbital_index], bbox_to_anchor=(1.1, 1),\n loc=\"upper left\", fontsize=8)\n\n\naxs[-1].set_xlabel(r'$\\theta$ ($^\\circ$)')\naxs[2].set_ylabel('Scattering intensity')\n\nfig.subplots_adjust(hspace=0, left=.3, right=.6)\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ".. rubric:: Footnotes\n\n.. [1] Yao Shen et al.,\n [arXiv:2110.08937 (2022)](https://arxiv.org/abs/2110.08937).\n.. [2] Luuk J. P. Ament et al.,\n [Phys. Rev. Lett. 103, 117003 (2009)](https://doi.org/10.1103/PhysRevLett.103.117003)\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.16" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/b91e28daa42d542643c2e6a87c5adde5/example_5_charge_transfer.py b/edrixs/_downloads/b91e28daa42d542643c2e6a87c5adde5/example_5_charge_transfer.py deleted file mode 100644 index ca25920658..0000000000 --- a/edrixs/_downloads/b91e28daa42d542643c2e6a87c5adde5/example_5_charge_transfer.py +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env python -""" -Charge-transfer energy for NiO -================================================================================ -This example follows the :ref:`sphx_glr_auto_examples_example_3_AIM_XAS.py` -example and considers the same model. This time we outline how to determine -the charge transfer energy in the sense defined by Zaanen, Sawatzky, and Allen -[1]_. That is, a :math:`d^{n_d} \\rightarrow d^{n_d + 1} \\underline{L}` transition -in the atomic limit, after considering Coulomb interactions and crystal field. Although -this can be determined analytically in some cases, the easiest way is often just to -calculate it, as we will do here. -""" -import edrixs -import numpy as np -import matplotlib.pyplot as plt -import scipy -import example_3_AIM_XAS -import importlib -_ = importlib.reload(example_3_AIM_XAS) - -################################################################################ -# Determine eigenvectors and occupations -# ------------------------------------------------------------------------------ -# The first step repeats what was done in -# :ref:`sphx_glr_auto_examples_example_4_GS_analysis.py` but it does not apply -# the hybridization between the impurity and both states. - -from example_3_AIM_XAS import (F0_dd, F2_dd, F4_dd, - nd, norb_d, norb_bath, v_noccu, - imp_mat, bath_level, - hyb, ext_B, trans_c2n) -ntot = 20 -umat_delectrons = edrixs.get_umat_slater('d', F0_dd, F2_dd, F4_dd) -umat = np.zeros((ntot, ntot, ntot, ntot), dtype=complex) -umat[:norb_d, :norb_d, :norb_d, :norb_d] += umat_delectrons -emat_rhb = np.zeros((ntot, ntot), dtype='complex') -emat_rhb[0:norb_d, 0:norb_d] += imp_mat -indx = np.arange(norb_d, norb_d*2) -emat_rhb[indx, indx] += bath_level[0] -tmat = np.eye(ntot, dtype=complex) -for i in range(2): - off = i * norb_d - tmat[off:off+norb_d, off:off+norb_d] = np.conj(np.transpose(trans_c2n)) - -emat_chb = edrixs.cb_op(emat_rhb, tmat) -v_orbl = 2 -sx = edrixs.get_sx(v_orbl) -sy = edrixs.get_sy(v_orbl) -sz = edrixs.get_sz(v_orbl) -zeeman = ext_B[0] * (2 * sx) + ext_B[1] * (2 * sy) + ext_B[2] * (2 * sz) -emat_chb[0:norb_d, 0:norb_d] += zeeman -basis = np.array(edrixs.get_fock_bin_by_N(ntot, v_noccu)) -H = (edrixs.build_opers(2, emat_chb, basis) - + edrixs.build_opers(4, umat, basis)) - -e, v = scipy.linalg.eigh(H) -e -= e[0] - -num_d_electrons = basis[:, :norb_d].sum(1) -alphas = np.sum(np.abs(v[num_d_electrons == 8, :])**2, axis=0) -betas = np.sum(np.abs(v[num_d_electrons == 9, :])**2, axis=0) - -################################################################################ -# Energy to lowest energy ligand orbital -# ------------------------------------------------------------------------------ -# Let's vizualize :math:`\alpha` and :math:`\beta`. - -fig, ax = plt.subplots() - -ax.plot(e, alphas, '.-', label=r'$\alpha$ $d^8L^{10}$') -ax.plot(e, betas, '.-', label=r'$\beta$ $d^9L^{9}$') - -ax.set_xlabel('Energy (eV)') -ax.set_ylabel('Population') -ax.set_title('NiO') -ax.legend() -plt.show() - -################################################################################ -# One can see that the mixing between impurity and bath states has disappered -# because we have turned off the hybridization. The energy required to - -GS_energy = min(e[np.isclose(alphas, 1)]) -lowest_energy_to_transfer_electron = min(e[np.isclose(betas, 1)]) -E_to_ligand = lowest_energy_to_transfer_electron - GS_energy -print(f"Energy to lowest energy ligand state is {E_to_ligand:.3f} eV") - -################################################################################ -# where we have used :code:`np.isclose` to avoid errors from finite numerical -# precision. - -################################################################################ -# Diagonalizing by blocks -# ------------------------------------------------------------------------------ -# When working on a problem with a large basis, one can take advantage of the -# lack of hybridization and separately diagonalize the impurity and bath -# states - -energies = [] - -for n_ligand_holes in [0, 1]: - basis_d = edrixs.get_fock_bin_by_N(10, nd + n_ligand_holes) - Hd = (edrixs.build_opers(2, emat_chb[:10, :10], basis_d) - + edrixs.build_opers(4, umat[:10, :10, :10, :10], basis_d)) - ed = scipy.linalg.eigh(Hd, eigvals_only=True, subset_by_index=[0, 0])[0] - - basis_L = edrixs.get_fock_bin_by_N(10, 10 - n_ligand_holes) - HL = (edrixs.build_opers(2, emat_chb[10:, 10:], basis_L) - + edrixs.build_opers(4, umat[10:, 10:, 10:, 10:], basis_L)) - eL = scipy.linalg.eigh(HL, eigvals_only=True, subset_by_index=[0, 0])[0] - - energies.append(ed + eL) - -print(f"Energy to lowest energy ligand state is {energies[1] - energies[0]:.3f} eV") - -################################################################################ -# which yields the same result. - -################################################################################ -# Energy splitting in ligand states -# ------------------------------------------------------------------------------ -# The last thing to consider is that our definition of the charge transfer -# energy refers to the atomic limit with all hopping terms switched off, whereas -# the ligand states in the model are already split by the oxygen-oxygen hopping -# term :math:`T_{pp}` as illustrated below. So the final charge transer energy -# needs to account for this. -# -# .. image:: /_static/energy_level.png -# - -T_pp = 1 -print(f"Charge transfer is {energies[1] - energies[0] + T_pp:.3f} eV") - - -############################################################################## -# -# .. rubric:: Footnotes -# -# .. [1] J. Zaanen, G. A. Sawatzky, and J. W. Allen, -# `Phys. Rev. Lett. 55, 418 (1985) `_. diff --git a/edrixs/_downloads/c80f6188449857a8752ca41e52553006/example_4_GS_analysis.ipynb b/edrixs/_downloads/c80f6188449857a8752ca41e52553006/example_4_GS_analysis.ipynb deleted file mode 100644 index 572f8e7e79..0000000000 --- a/edrixs/_downloads/c80f6188449857a8752ca41e52553006/example_4_GS_analysis.ipynb +++ /dev/null @@ -1,255 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Ground state analysis for NiO\nThis example follows the `sphx_glr_auto_examples_example_3_AIM_XAS.py`\nexample and considers the same model. This time we show how to analyze\nthe wavevectors in terms of a\n$\\alpha |d^8L^{10}> + \\beta |d^9L^9> \\gamma |d^{10}L^8>$\nrepresentation.\n\nIn doing this we will go through the exercise of building and diagonalizing\nthe Hamiltonian in a way that hopefully clarifies how to analyze other\nproperties of the model.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy\nimport example_3_AIM_XAS\nimport importlib\n_ = importlib.reload(example_3_AIM_XAS)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Hamiltonian\nedrixs builds model Hamiltonians based on two fermion and four fermion terms.\nThe four fermion terms come from Coulomb interactions and will be\nassigned to :code:`umat`. All other interactions contribute to two fermion\nterms in :code:`emat`.\n\n .. math::\n \\begin{equation}\n \\hat{H}_{i} = \\sum_{\\alpha,\\beta} t_{\\alpha,\\beta}\n \\hat{f}^{\\dagger}_{\\alpha} \\hat{f}_{\\beta}\n + \\sum_{\\alpha,\\beta,\\gamma,\\delta} U_{\\alpha,\\beta,\\gamma,\\delta}\n \\hat{f}^{\\dagger}_{\\alpha}\\hat{f}^{\\dagger}_{\\beta}\n \\hat{f}_{\\gamma}\\hat{f}_{\\delta},\n \\end{equation}\n\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Import parameters\nLet's get the parammeters we need from the\n`sphx_glr_auto_examples_example_3_AIM_XAS.py` example. We need to\nconsider :code:`ntot=20` spin-orbitals\nfor this problem.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "from example_3_AIM_XAS import (F0_dd, F2_dd, F4_dd,\n nd, norb_d, norb_bath, v_noccu,\n imp_mat, bath_level,\n hyb, ext_B, trans_c2n)\nntot = 20" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Four fermion matrix\nThe Coulomb interactions in the $d$ shell of this problem are described\nby a $10\\times10\\times10\\times10$ matrix. We\nneed to specify a $20\\times20\\times20\\times 20$ matrix since we need to\ninclude the full problem with :code:`ntot=20` spin-orbitals. The edrixs\nconvention is to put the $d$ orbitals first, so we assign them to the\nfirst $10\\times10\\times10\\times 10$ indices of the matrix. edrixs\ncreates this matrix in the complex harmmonic basis by default.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "umat_delectrons = edrixs.get_umat_slater('d', F0_dd, F2_dd, F4_dd)\numat = np.zeros((ntot, ntot, ntot, ntot), dtype=complex)\numat[:norb_d, :norb_d, :norb_d, :norb_d] += umat_delectrons" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Two fermion matrix\nPreviously we made a $10\\times10$ two-fermion matrix describing the\n$d$-shell interactions. Keep in mind we did this in the real harmonic\nbasis. We need to specify the two-fermion matrix for\nthe full problem $20\\times20$ spin-orbitals in size.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "emat_rhb = np.zeros((ntot, ntot), dtype='complex')\nemat_rhb[0:norb_d, 0:norb_d] += imp_mat" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The :code:`bath_level` energies need to be applied to the diagonal of the\nlast $10\\times10$ region of the matrix.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "indx = np.arange(norb_d, norb_d*2)\nemat_rhb[indx, indx] += bath_level[0]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The :code:`hyb` terms mix the impurity and bath states and are therefore\napplied to the off-diagonal terms of :code:`emat`.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "indx1 = np.arange(norb_d)\nindx2 = np.arange(norb_d, norb_d*2)\nemat_rhb[indx1, indx2] += hyb[0]\nemat_rhb[indx2, indx1] += np.conj(hyb[0])" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We now need to transform into the complex harmonic basis. We assign\nthe two diagonal blocks of a $20\\times20$ matrix to the\nconjugate transpose of the transition matrix.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "tmat = np.eye(ntot, dtype=complex)\nfor i in range(2):\n off = i * norb_d\n tmat[off:off+norb_d, off:off+norb_d] = np.conj(np.transpose(trans_c2n))\n\nemat_chb = edrixs.cb_op(emat_rhb, tmat)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The spin exchange is built from the spin operators and the effective field\nis applied to the $d$-shell region of the matrix.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "v_orbl = 2\nsx = edrixs.get_sx(v_orbl)\nsy = edrixs.get_sy(v_orbl)\nsz = edrixs.get_sz(v_orbl)\nzeeman = ext_B[0] * (2 * sx) + ext_B[1] * (2 * sy) + ext_B[2] * (2 * sz)\nemat_chb[0:norb_d, 0:norb_d] += zeeman" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Build the Fock basis and Hamiltonain and Diagonalize\nWe create the fock basis and build the Hamiltonian using the full set of\n$20$ spin orbitals, specifying that they are occuplied by $18$\nelectrons. See the `sphx_glr_auto_examples_example_0_ed_calculator.py`\nexample for more details if needed. We also set the ground state to zero\nenergy.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "basis = np.array(edrixs.get_fock_bin_by_N(ntot, v_noccu))\nH = (edrixs.build_opers(2, emat_chb, basis)\n + edrixs.build_opers(4, umat, basis))\n\ne, v = scipy.linalg.eigh(H)\ne -= e[0]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## State analysis\nNow we have all the eigenvectors in the Fock basis, we need to pick out the\nstates that have 8, 9 and 10 $d$-electrons, respectively.\nThe modulus squared of these coeffcients need to be added up to get\n$\\alpha$, $\\beta$, and $\\gamma$.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "num_d_electrons = basis[:, :norb_d].sum(1)\n\nalphas = np.sum(np.abs(v[num_d_electrons==8, :])**2, axis=0)\nbetas = np.sum(np.abs(v[num_d_electrons==9, :])**2, axis=0)\ngammas = np.sum(np.abs(v[num_d_electrons==10, :])**2, axis=0)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The ground state is the first entry.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "message = \"Ground state\\nalpha={:.3f}\\tbeta={:.3f}\\tgamma={:.3f}\"\nprint(message.format(alphas[0], betas[0], gammas[0]))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Plot\nLet's look how $\\alpha$, $\\beta$, and $\\gamma$ vary with\nenergy.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fig, ax = plt.subplots()\n\nax.plot(e, alphas, label=r'$\\alpha$ $d^8L^{10}$')\nax.plot(e, betas, label=r'$\\beta$ $d^9L^{9}$')\nax.plot(e, gammas, label=r'$\\gamma$ $d^{10}L^{8}$')\n\nax.set_xlabel('Energy (eV)')\nax.set_ylabel('Population')\nax.set_title('NiO')\nax.legend()\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We see that the ligand states are mixed into the ground state, but the\nmajority of the weight for the $L^9$ and $L^8$ states\nlive at $\\Delta$ and $2\\Delta$. With a lot of additional\nstructure from the other interactions.\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.16" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/ceccd240871166cf69609184775c524d/example_6_Hubbard_dimer.ipynb b/edrixs/_downloads/ceccd240871166cf69609184775c524d/example_6_Hubbard_dimer.ipynb deleted file mode 100644 index 01185a72cb..0000000000 --- a/edrixs/_downloads/ceccd240871166cf69609184775c524d/example_6_Hubbard_dimer.ipynb +++ /dev/null @@ -1,179 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Hubbard Dimer\nThis exercise will demonstrate how to handle hopping and multi-site problems within\nedrixs using the example of a Hubbard dimer. We want to solve the equation\n\n .. math::\n \\begin{equation}\n \\hat{H} = \\sum_{i,j} \\sum_{\\sigma} t_{i,j} \\hat{f}^{\\dagger}_{i,\\sigma} \\hat{f}_{j, \\sigma}\n + U \\sum_{i} \\hat{n}_{i,\\uparrow}\\hat{n}_{i,\\downarrow},\n \\end{equation}\n\nwhich involves two sites labeled with indices $i$ or $j$ with two\nelectrons of spin $\\sigma\\in{\\uparrow,\\downarrow}$. $t_{i,j}$\nis the hopping between sites, $\\hat{f}^{\\dagger}_{i,\\sigma}$ is the\ncreation operators, and\n$\\hat{n}^{\\dagger}_{i,\\sigma}=\\hat{f}^{\\dagger}_{i,\\sigma}\\hat{f}_{i,\\sigma}$\nis the number operator. The main task is to represent this Hamiltonian and\nthe related spin operator using the EDRIXS two-fermion and four-fermion form\nwhere $\\alpha,\\beta,\\delta,\\gamma$ are the indices of the single\nparticle basis.\n\n .. math::\n \\begin{equation}\n \\hat{H} = \\sum_{\\alpha,\\beta} t_{\\alpha,\\beta} \\hat{f}^{\\dagger}_{\\alpha} \\hat{f}_{\\beta}\n + \\sum_{\\alpha,\\beta,\\gamma,\\delta} U_{\\alpha,\\beta,\\gamma,\\delta}\n \\hat{f}^{\\dagger}_{\\alpha}\\hat{f}^{\\dagger}_{\\beta}\\hat{f}_{\\gamma}\\hat{f}_{\\delta}.\n \\end{equation}\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Initialize matrices\nWe start by noting that each of the two sites is like an $l=0$\n$s$-orbital with two spin-orbitals each. We will include\ntwo electron occupation and build the Fock basis.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import numpy as np\nimport matplotlib.pyplot as plt\nimport scipy\nimport edrixs\nnp.set_printoptions(precision=4)\n\n\nll = 0\ncase = 's'\nnorb = 4\nnoccu = 2\nbasis = edrixs.get_fock_bin_by_N(norb, noccu)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Create function to populate and diagonalize matrices\nThe Coulomb and hopping matrices :code:`umat` and :code:`emat` will be\nrepresented by $4\\times4\\times4\\times4$ and $4\\times4$ matrices,\nrespectively. Note that we needed to specify\nthat these are, in general, complex, although\nthey happen to contain only real numbers in this case. We follow the convention\nthat these are ordered first by site and then by spin:\n$|0\\uparrow>, |0\\downarrow>, |1\\uparrow>, |1\\downarrow>$.\nConsequently the $2\\times2$ and $2\\times2\\times2\\times2$ block\ndiagonal structures of the matrices will contain the on-site interactions.\nThe converse is true for the hopping between the sites.\nFrom here let us generate a function to build and diagonalize the Hamiltonian.\nWe need to generate the Coulomb matrix for the on-site interactions and\napply it to the block diagonal. The hopping connects off-site indices with\nthe same spin.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "def diagonalize(U, t, extra_emat=None):\n \"\"\"Diagonalize 2 site Hubbard Hamiltonian\"\"\"\n umat = np.zeros((norb, norb, norb, norb), dtype=np.complex128)\n emat = np.zeros((norb, norb), dtype=np.complex128)\n U_mat_1site = edrixs.get_umat_slater('s', U)\n umat[:2, :2, :2, :2,] = umat[2:, 2:, 2:, 2:] = U_mat_1site\n emat[2, 0] = emat[3, 1] = emat[0, 2] = emat[1, 3] = t\n\n if extra_emat is not None:\n emat = emat + extra_emat\n\n H = (edrixs.build_opers(2, emat, basis)\n + edrixs.build_opers(4, umat, basis))\n\n e, v = scipy.linalg.eigh(H)\n return e, v" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## The large $U$ limit\nLet us see what happens with $U \\gg t$.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "e, v = diagonalize(1000, 1)\nprint(\"Energies are\")\nprint(e)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To analyze what is going on we can determine the spin expectation values\nof the cluster. Building the operators follows the same form as the\nHamiltonian and the previous example.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "spin_mom_one_site = edrixs.get_spin_momentum(ll)\nspin_mom = np.zeros((3, norb, norb), dtype=np.complex128)\nspin_mom[:, :2, :2] = spin_mom[:, 2:, 2:] = spin_mom_one_site\n\nopS = edrixs.build_opers(2, spin_mom, basis)\nopS_squared = (np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1])\n + np.dot(opS[2], opS[2]))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This time let us include a tiny magnetic field along the $z$-axis, so\nthat we have a well-defined measurement axis and print out the expectation\nvalues.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "zeeman = np.zeros((norb, norb), dtype=np.complex128)\nzeeman[:2, :2] = zeeman[2:, 2:] = 1e-8*spin_mom_one_site[2]\ne, v = diagonalize(1000, 1, extra_emat=zeeman)\n\nSsq_exp = edrixs.cb_op(opS_squared, v).diagonal().real\nSz_exp = edrixs.cb_op(opS[2], v).diagonal().real\n\nheader = \"{:<10s}\\t{:<6s}\\t{:<6s}\"\nprint(header.format(\"E\", \"S(S+1)\", \"\"))\nfor i in range(len(e)):\n print(\"{:<2f}\\t{:.1f}\\t{:.1f}\".format(e[i], Ssq_exp[i], Sz_exp[i]))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "For $U \\gg t$ the two states with double occupancy acquire an energy of\napproximately $U$. The low energy states are a $S=0$ singlet and\nand $S=1$ triplet, which are split by $4t^2/U$, which is the\nmagnetic exchange term.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## $U$ dependence\nLet us plot the changes in energy with $U$.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "plt.figure()\n\nt = 1\nUs = np.linspace(0.01, 10, 50)\nEs = np.array([diagonalize(U, t, extra_emat=zeeman)[0] for U in Us])\n\nplt.plot(Us/t, Es/t)\nplt.xlabel('U/t')\nplt.ylabel('Eigenstate energies/t')\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To help interpret this, we can represent the eigenvectors in terms of a sum\nof the single particle states.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "def get_single_particle_repesentations(v):\n reps = []\n for i in range(6):\n rep = sum([vec*weight for weight, vec\n in zip(v[:, i], np.array(basis))])\n reps.append(rep)\n\n return np.array(reps)\n\nt = 1\nfor U in [10000, 0.0001]:\n e, v = diagonalize(U, t, extra_emat=zeeman)\n repesentations = get_single_particle_repesentations(v)\n print(\"For U={} t={} states are\".format(U, t))\n print(repesentations.round(3).real)\n print(\"\\n\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "For $U \\gg t$ the ground state maximizes its magnetic exchange\nenergy saving. In the $U \\ll t$ condition the ground state maximizes\nits kinetic energy saving. Since both states share the same parity, the\ncross-over between them is smooth. This type of physics is at play in current\nresearch on quantum materials [1]_ [2]_.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ".. rubric:: Footnotes\n\n.. [1] Y. Wang et al., [Phys. Rev. Lett. 122, 106401 (2019)](https://www.doi.org/10.1103/PhysRevLett.122.106401).\n.. [2] A. Revelli et al., [Science Advances 5, eaav4020 (2019)](https://doi.org/10.1126/sciadv.aav4020).\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.16" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/d7c6df44b25b2a3a0133d7014a6a992c/example_8_Hunds_interactions.zip b/edrixs/_downloads/d7c6df44b25b2a3a0133d7014a6a992c/example_8_Hunds_interactions.zip deleted file mode 100644 index 8d037446b3..0000000000 Binary files a/edrixs/_downloads/d7c6df44b25b2a3a0133d7014a6a992c/example_8_Hunds_interactions.zip and /dev/null differ diff --git a/edrixs/_downloads/d9595727e69eae422552d4c9e271d049/example_5_transitions.py b/edrixs/_downloads/d9595727e69eae422552d4c9e271d049/example_5_transitions.py deleted file mode 100644 index c346e469db..0000000000 --- a/edrixs/_downloads/d9595727e69eae422552d4c9e271d049/example_5_transitions.py +++ /dev/null @@ -1,198 +0,0 @@ -#!/usr/bin/env python -""" -X-ray transitions -================================================================================ -This example explains how to calculate x-ray transition amplitudes between -specific orbital and spin states. We take the case of a cuprate which has one -hole in the :math:`d_{x^2-y^2}` orbital and a spin ordering direction along the -in-plane diagaonal direction and compute the angular dependence of spin-flip -and non-spin-flip processes. - -This case was chosen because the eigenvectors in question are simple enough -for us to write them out more-or-less by hand, so this example helps the reader -to understand what happens under the hood in more complex cases. - -Some of the code here is credited to Yao Shen who used this approach for the -analysis of a low valence nickelate material [1]_. The task performed repeats -analysis done by many researchers e.g. Luuk Ament et al [2]_ as well as -several other groups. -""" -import edrixs -import numpy as np -import matplotlib.pyplot as plt -import scipy - -################################################################################ -# Eigenvectors -# ------------------------------------------------------------------------------ -# Let us start by determining the eigenvectors involved in the transitions. -# The spin direction can be set using a vector -# :math:`\vec{B}` to represent a magnetic field in terms of generalized spin -# operator :math:`\tilde{\sigma}=\vec{B}\cdot\sigma` based on the Pauli matrices -# :math:`\sigma`. Let's put the spin along the :math:`[1, 1, 0]` direction -# and formuate the problem in the hole basis. -# For one particle, we know that the Hamiltonian will be diagonal in the real -# harmonic basis. -# We can generate the required eigenvectors by making a diagonal -# matrix, transforming it to the required -# complex harmonic basis (as is standard for EDRIXS) and diagonalizing it. -# As long as the crystal field splitting is much larger than the magnetic -# field, the eigenvectors will be independent of the exact values of both -# these parameters. - -B = 1e-3*np.array([1, 1, 0]) -cf_splitting = 1e3 -zeeman = sum(s*b for s, b in zip(edrixs.get_spin_momentum(2), B)) -dd_levels = np.array([energy for dd_level in cf_splitting*np.arange(5) - for energy in [dd_level]*2], dtype=complex) -emat_rhb = np.diag(dd_levels) -emat = edrixs.cb_op(emat_rhb, edrixs.tmat_r2c('d', ispin=True)) + zeeman -_, eigenvectors = np.linalg.eigh(emat) - -def get_eigenvector(orbital_index, spin_index): - return eigenvectors[:, 2*orbital_index + spin_index] - - -################################################################################ -# Let's examine the :math:`d_{x^2-y^2}` orbital first. Recall from the -# :ref:`sphx_glr_auto_examples_example_1_crystal_field.py` -# example that edrixs uses the standard orbital order of -# :math:`d_{3z^2-r^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}`. So we want -# :code:`orbital_index = 3` element. Using this, we can build spin-up and -down -# eigenvectors. -orbital_index = 3 - -groundstate_vector = get_eigenvector(orbital_index, 0) -excitedstate_vector = get_eigenvector(orbital_index, 1) - -################################################################################ -# Transition operators and scattering matrix -# ------------------------------------------------------------------------------ -# Here we are considering the :math:`L_3`-edge. This means -# a :math:`2p_{3/2} \rightarrow 3d` -# absoprtion transition and a :math:`2p_{3/2} \rightarrow 3d` -# emission transition. We can read the relevant matrix from the edrixs database, -# keeping in mind that there are in fact three operations for -# :math:`x, y,` & :math:`z` directions. Note that edrixs provides operators -# in electron notation. If we define :math:`D` as the transition operator in -# electron language, :math:`D^\dagger` is the operator in the hole language -# we are using for this example. -# The angular dependence of a RIXS transition can be conveniently described -# using the scattering matrix, which is a :math:`3\times3` element object that -# specifies the transition amplitude for each incoming and outgoing x-ray -# polarization. Correspondingly, we have -# -# .. math:: -# \begin{equation} -# \mathcal{F}=\sum_n\langle f|D|n\rangle\langle n|D^{\dagger}|g\rangle -# \end{equation}. -# -# In matrix form this is -# -# .. math:: -# \begin{equation} -# \mathcal{F}(m,n)=\{f^{\dagger} \cdot D(m)\} \cdot \{D^{\dagger}(n) \cdot g\} -# \end{equation}. - -D_Tmat = edrixs.get_trans_oper('dp32') - -def get_F(vector_i, vector_f): - F = np.zeros((3, 3), dtype=complex) - for i in range(3): - for j in range(3): - F[i, j] = np.dot(np.dot(np.conj(vector_f.T), D_Tmat[i]), - np.dot(np.conj(D_Tmat[j].T), vector_i)) - return F - -################################################################################ -# Using this function, we can obtain non-spin-flip (NSF) and spin-flip (SF) -# scattering matrices by choosing whether we return to the ground state or -# whether we access the excited state with the spin flipped. -F_NSF = get_F(groundstate_vector, groundstate_vector) -F_SF = get_F(groundstate_vector, excitedstate_vector) - -################################################################################ -# Angular dependence -# ------------------------------------------------------------------------------ -# Let's consider the common case of fixing the total scattering angle at -# :code:`two_theta = 90` and choosing a series of incident angles :code:`thins`. -# Since the detector does not resolve polarization, we need to add both outgoing -# polarizations. It is then convenient to use function :func:`.dipole_polvec_rixs` -# to obtain the incoming and outgoing polarization vectors. -thins = np.linspace(0, 90) -two_theta = 90 -phi = 0 - - -def get_I(thin, alpha, F): - intensity = 0 - for beta in [0, np.pi/2]: - thout = two_theta - thin - ei, ef = edrixs.dipole_polvec_rixs(thin*np.pi/180, thout*np.pi/180, - phi*np.pi/180, alpha, beta) - intensity += np.abs(np.dot(ef, np.dot(F, ei)))**2 - return intensity - - -################################################################################ -# Plot -# ------------------------------------------------------------------------------ -# We now run through a few configurations specified in terms of incoming -# polarization angle :math:`\alpha` (defined in radians w.r.t. the scattering -# plane), :math:`F`, plotting label, and plotting color. -fig, ax = plt.subplots() - -config = [[0, F_NSF, r'$\pi$ NSF', 'C0'], - [np.pi/2, F_NSF, r'$\sigma$ NSF', 'C1'], - [0, F_SF, r'$\pi$ SF', 'C2'], - [np.pi/2, F_SF, r'$\sigma$ SF', 'C3']] - -for alpha, F, label, color in config: - Is = np.array([get_I(thin, alpha, F) for thin in thins]) - ax.plot(thins, Is, label=label, color=color) - -ax.legend() -ax.set_xlabel(r'Theta ($^\circ$)') -ax.set_ylabel('Relative intensity') -plt.show() - -################################################################################ -# Run through orbitals -# ------------------------------------------------------------------------------ -# For completeness, let's look at transitions from :math:`x^2-y^2` to all other -# orbitals. -fig, axs = plt.subplots(5, 1, figsize=(7, 7), - sharex=True, sharey=True) - -orbitals = ['$d_{3z^2-r^2}$', '$d_{xz}$', '$d_{yz}$', - '$d_{x^2-y^2}$', '$d_{xy}$'] -orbital_order = [4, 1, 2, 0, 3] - -plot_index = 0 -for ax, orbital_index in zip(axs, orbital_order): - for spin_index, spin_label in zip([0, 1], ['NSF', 'SF']): - excitedstate_vector = get_eigenvector(orbital_index, spin_index) - F = get_F(groundstate_vector, excitedstate_vector) - for alpha, pol_label in zip([0, np.pi/2], [r'$\pi$', r'$\sigma$']): - Is = np.array([get_I(thin, alpha, F) for thin in thins]) - ax.plot(thins, Is*10, label=f'{pol_label} {spin_label}', - color=f'C{plot_index%4}') - plot_index += 1 - ax.legend(title=orbitals[orbital_index], bbox_to_anchor=(1.1, 1), - loc="upper left", fontsize=8) - - -axs[-1].set_xlabel(r'$\theta$ ($^\circ$)') -axs[2].set_ylabel('Scattering intensity') - -fig.subplots_adjust(hspace=0, left=.3, right=.6) -plt.show() - -############################################################################## -# -# .. rubric:: Footnotes -# -# .. [1] Yao Shen et al., -# `arXiv:2110.08937 (2022) `_. -# .. [2] Luuk J. P. Ament et al., -# `Phys. Rev. Lett. 103, 117003 (2009) `_ diff --git a/edrixs/_downloads/db7d7888e6c3547d28a97a5460ad1cae/example_7_Coulomb.py b/edrixs/_downloads/db7d7888e6c3547d28a97a5460ad1cae/example_7_Coulomb.py deleted file mode 100644 index 65b3c07794..0000000000 --- a/edrixs/_downloads/db7d7888e6c3547d28a97a5460ad1cae/example_7_Coulomb.py +++ /dev/null @@ -1,381 +0,0 @@ -#!/usr/bin/env python -""" -Coulomb interactions -===================================== -In this example we provide more details on how Coulomb interactions are -implemented in multiplet calculations and EDRIXS in particular. We aim -to clarify the form of the matrices, how they are parametrized, -and how the breaking of spherical symmetry can switch on additional elements -that one might not anticipate. Our example is based on a :math:`d` atomic shell. -""" - -################################################################################ -# Create matrix -# ------------------------------------------------------------------------------ -# The Coulomb interaction between two particles can be written as -# -# .. math:: -# \begin{equation} -# \hat{H} = \frac{1}{2} -# \int d\mathbf{r} \int d\mathbf{r}^\prime -# \Sigma_{\sigma, \sigma^\prime} -# |\hat{\psi}^\sigma(\mathbf{r})|^2 \frac{e^2}{R} -# |\hat{\psi}^{\sigma^\prime}(\mathbf{r})|^2, -# \end{equation} -# -# where :math:`\hat{\psi}^\sigma(\mathbf{r})` is the electron wavefunction, with -# spin :math:`\sigma`, and :math:`R=|r-r^\prime|` is the electron separation. -# Solving our problem in this form is difficult due to the need to symmeterize -# the wavefunction to follow fermionic statistics. -# Using second quantization, we can use operators to impose the required -# particle exchange statistics and write the equation in terms of -# a tensor :math:`U` -# -# .. math:: -# \begin{equation} -# \hat{H} = \sum_{\alpha,\beta,\gamma,\delta,\sigma,\sigma^\prime} -# U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} -# \hat{f}^{\dagger}_{\alpha\sigma} -# \hat{f}^{\dagger}_{\beta\sigma^\prime} -# \hat{f}_{t\sigma^\prime}\hat{f}_{\delta\sigma}, -# \end{equation} -# -# where :math:`\alpha`, :math:`\beta`, :math:`\gamma`, :math:`\delta` are -# orbital indices and :math:`\hat{f}^{\dagger}` -# (:math:`\hat{f}`) are the creation (anihilation) operators. -# For a :math:`d`-electron system, we have :math:`10` distinct spin-orbitals -# (:math:`5` orbitals each with :math:`2` spins), which makes matrix the -# :math:`10\times10\times10\times10` in total size. -# In EDRIXS the matrix can be created as follows: -import edrixs -import numpy as np -import scipy -import matplotlib.pyplot as plt -import itertools - -F0, F2, F4 = 6.94, 14.7, 4.41 -umat_chb = edrixs.get_umat_slater('d', F0, F2, F4) -################################################################################ -# We stored this under variable :code:`umat_chb` where "cbh" stands for -# complex harmonic basis, which is the default basis in EDRIXS. - -################################################################################ -# Parameterizing interactions -# ------------------------------------------------------------------------------ -# EDRIXS parameterizes the interactions in :math:`U` via Slater integral -# parameters :math:`F^{k}`. These relate to integrals of various spherical -# Harmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients, -# and Wigner 3J symbols. Textbooks such as [1]_ can be used for further -# reference. If you are interested in the details of how -# EDRIXS does this (and you probably aren't) function :func:`.umat_slater`, -# constructs the required matrix via Gaunt coeficents from -# :func:`.get_gaunt`. Two alternative parameterizations are common. -# The first are the Racah parameters, which are -# -# .. math:: -# \begin{eqnarray} -# A &=& F^0 - \frac{49}{441} F^4 \\ -# B &=& \frac{1}{49}F^2 - \frac{5}{441}F^4 \\ -# C &=& \frac{35}{441}F^4. -# \end{eqnarray} -# -# or an alternative form for the Slater integrals -# -# .. math:: -# \begin{eqnarray} -# F_0 &=& F^0 \\ -# F_2 &=& \frac{1}{49}F^2 \\ -# F_4 &=& \frac{1}{441}F^4, -# \end{eqnarray} -# -# which involves different normalization parameters. - -################################################################################ -# Basis transform -# ------------------------------------------------------------------------------ -# If we want to use the real harmonic basis, we can use a tensor -# transformation, which imposes the following orbital order -# :math:`3z^2-r^2, xz, yz, x^2-y^2, xy`, each of which involves -# :math:`\uparrow, \downarrow` spin pairs. Let's perform this transformation and -# store a list of these orbitals. -umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True)) -orbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy'] - -################################################################################ -# Interactions -# ------------------------------------------------------------------------------ -# Tensor :math:`U` is a series of matrix -# elements -# -# .. math:: -# \begin{equation} -# \langle\psi_{\gamma,\delta}^{\bar{\sigma},\bar{\sigma}^\prime} -# |\hat{H}| -# \psi_{\alpha,\beta}^{\sigma,\sigma^\prime}\rangle -# \end{equation} -# -# the combination of which defines the energetic cost of pairwise -# electron-electron interactions between states :math:`\alpha,\sigma` -# and :math:`\beta,\sigma^\prime`. In EDRIXS we follow the convention of -# summing over all orbital pairs. Some other texts count each pair of -# indices only once. The matrix elements here will consequently -# be half the magnitude of those in other references. -# We can express the interactions in terms of -# the orbitals involved. It is common to distinguish "direct Coulomb" and -# "exchange" interactions. The former come from electrons in the same orbital -# and the later involve swapping orbital labels for electrons. We will use -# :math:`U_0` and :math:`J` as a shorthand for distinguishing these. -# -# Before we describe the different types of interactions, we note that since -# the Coulomb interaction is real, and due to the spin symmmetry properties -# of the process :math:`U` always obeys -# -# .. math:: -# \begin{equation} -# U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} = -# U_{\beta\sigma,\alpha\sigma^\prime,\delta\sigma^\prime,\gamma\sigma} = -# U_{\delta\sigma,\gamma\sigma^\prime,\beta\sigma^\prime,\alpha\sigma} = -# U_{\gamma\sigma,\delta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}. -# \end{equation} -# -# -# 1. Intra orbital -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# The direct Coulomb energy cost to double-occupy an orbital comes from terms -# like :math:`U_{\alpha\sigma,\alpha\bar\sigma,\alpha\bar\sigma,\alpha\sigma}`. -# In this notation, we use :math:`\sigma^\prime` to denote that the matrix -# element is summed over all pairs and :math:`\bar{\sigma}` to denote sums -# over all opposite spin pairs. Due to rotational symmetry, all these -# elements are the same and equal to -# -# .. math:: -# \begin{eqnarray} -# U_0 &=& \frac{A}{2} + 2B + \frac{3C}{2}\\ -# &=& \frac{F_0}{2} + 2F_2 + 18F_4 -# \end{eqnarray} -# -# Let's print these to demonstrate where these live in the array -for i in range(0, 5): - val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {val:.3f}") - -################################################################################ -# 2. Inter orbital Coulomb interactions -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Direct Coulomb repulsion between different orbitals depends on terms like -# :math:`U_{\alpha\sigma,\beta\sigma^\prime,\beta\sigma^\prime,\alpha\sigma}`. -# Expresions for these parameters are provided in column :math:`U` in -# :ref:`table_2_orbital`. We can print the values from :code:`umat` -# like this: -for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - -################################################################################ -# 3. Inter-orbital exchange interactions -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Exchange terms exist with the form -# :math:`U_{\alpha\sigma,\beta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}`. -# Expresions for these parameters are provided in column :math:`J` of -# :ref:`table_2_orbital`. These come from terms like this in the matrix: -for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - -################################################################################ -# 4. Pair hopping term -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Terms that swap pairs of electrons exist as -# :math:`(1-\delta_{\sigma\sigma'})U_{\alpha\sigma,\alpha\bar\sigma,\beta\bar\sigma,\beta\sigma}` -# and depend on exchange interactions column :math:`J` from -# :ref:`table_2_orbital` -# and here in the matrix. -for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - -################################################################################ -# 5. Three orbital -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Another set of terms that one might not immediately anticipate involve three -# orbitals like -# -# .. math:: -# \begin{equation} -# U_{\alpha\sigma, \gamma\sigma', \beta\sigma', \gamma\sigma} \\ -# U_{\alpha\sigma, \gamma\sigma', \gamma\sigma', \beta\sigma} \\ -# (1-\delta_{\sigma\sigma'}) -# U_{\alpha\sigma, \beta\sigma', \gamma\sigma', \gamma\sigma} -# \end{equation} -# -# for :math:`\alpha=3z^2-r^2, \beta=x^2-y^2, \gamma=xz/yz`. -# These are needed to maintain the rotational symmetry of the interations. -# See :ref:`table_3_orbital` for the expressions. We can print some of -# these via: -ijkl = [[0, 1, 3, 1], - [0, 2, 3, 2], - [1, 0, 3, 1], - [1, 1, 3, 0], - [2, 0, 3, 2], - [2, 2, 3, 0]] - -for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t" - f"{orbitals[k]:<8} \t {orbitals[l]:<8} \t {val:.3f}") - -################################################################################ -# 6. Four orbital -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Futher multi-orbital terms include -# :math:`U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma}`. -# We can find these here in the matrix: -ijkl = [[0, 1, 2, 4], - [0, 1, 4, 2], - [0, 2, 1, 4], - [0, 2, 4, 1], - [0, 4, 1, 2], - [0, 4, 2, 1], - [3, 1, 4, 2], - [3, 2, 4, 1], - [3, 4, 1, 2], - [3, 4, 2, 1]] - -for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {orbitals[k]:<8}" - f"\t {orbitals[l]:<8} \t {val:.3f}") - -################################################################################ -# Effects of multi-orbital terms -# ------------------------------------------------------------------------------ -# To test the effects of the multi-orbital terms, let's plot the eigenenergy -# spectra with and without multi-orbital terms switched on for system with and -# without a cubic crystal field. We will use a :math:`d`-shell with two -# electrons. -ten_dqs = [0, 2, 4, 12] - -def diagonalize(ten_dq, umat): - emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq), - edrixs.tmat_c2r('d', ispin=True)) - H = (edrixs.build_opers(4, umat, basis) - + edrixs.build_opers(2, emat, basis)) - e, v = scipy.linalg.eigh(H) - return e - e.min() - -basis = edrixs.get_fock_bin_by_N(10, 2) -umat_no_multiorbital = np.copy(umat) -B = F2/49 - 5*F4/441 -for val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]: - umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0 - -fig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3)) - -for cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)): - ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1, - label='on', color=f'C{cind}') - ax.hlines(diagonalize(ten_dq, umat_no_multiorbital), - xmin=1.5, xmax=2.5, - label='off', - linestyle=':', color=f'C{cind}') - ax.set_title(f"$10D_q={ten_dq}$") - ax.set_ylim([-.5, 20]) - ax.set_xticks([]) - ax.legend() - -fig.suptitle("Eigenvalues with 3&4-orbital effects on/off") -fig.subplots_adjust(wspace=.3) -axs[0].set_ylabel('Eigenvalues (eV)') -fig.subplots_adjust(top=.8) -plt.show() - -################################################################################ -# On the left of the plot Coulomb interactions in spherical symmetry cause -# substantial mxing between :math:`t_{2g}` and :math:`e_{g}` orbitals in the -# eigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the -# the right eigenenergies. As :math:`10D_q` get large, this mixing is switched -# off and the spectra start to become independent of whether the 3 & 4 orbital -# orbital terms are included or not. -# -# -# -# .. _table_2_orbital: -# .. table:: Table of 2 orbital interactions -# -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |Orbitals :math:`\alpha,\beta`|:math:`U_0` Racah | :math:`U_0` Slater |:math:`J` Racah |:math:`J` Slater | -# +=============================+==================+=======================+================+====================+ -# |:math:`3z^2-r^2, xz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`3z^2-r^2, yz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`3z^2-r^2, x^2-y^2` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`3z^2-r^2, xy` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`xz, yz` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`xz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`xz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`yz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`yz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# |:math:`x^2-y^2, xy` |:math:`A/2+2B+C/2`|:math:`F_0+4F_2-34F_4` | :math:`C/2` |:math:`35F_4/2` | -# +-----------------------------+------------------+-----------------------+----------------+--------------------+ -# -# -# .. _table_3_orbital: -# .. table:: Table of 3 orbital interactions -# -# +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ -# |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| -# +=============================+=============+====================================================+=====================================================+ -# |:math:`3z^2-r^2, xz, x^2-y^2, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, yz, x^2-y^2, yz` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`xz, 3z^2-r^2, x^2-y^2, xz` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`xz, xz, x^2-y^2, 3z^2-r^2` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`yz, 3z^2-r^2, x^2-y^2, yz` | :math:`\sqrt{3}B` | :math:`\sqrt{3}F_2-5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`yz, yz, x^2-y^2, 3z^2-r^2` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# -# -# .. _table_4_orbital: -# .. table:: Table of 4 orbital interactions -# -# +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ -# |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| -# +=============================+=============+====================================================+=====================================================+ -# |:math:`3z^2-r^2, xz, yz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, xz, xy, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, yz, xz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, yz, xy, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, xy, xz, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`3z^2-r^2, xy, yz, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , xz, xy, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , yz, xy, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , xy, xz, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# |:math:`x^2-y^2 , xy, yz, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | -# +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ -# -# -# .. rubric:: Footnotes -# -# .. [1] MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of -# Transition-Metal Ions in Crystals. Academic Press, New York and London. diff --git a/edrixs/_downloads/ea938601a5ea0e41baae4e0ea4cfc9b2/example_5_charge_transfer.ipynb b/edrixs/_downloads/ea938601a5ea0e41baae4e0ea4cfc9b2/example_5_charge_transfer.ipynb deleted file mode 100644 index 8027b44d95..0000000000 --- a/edrixs/_downloads/ea938601a5ea0e41baae4e0ea4cfc9b2/example_5_charge_transfer.ipynb +++ /dev/null @@ -1,154 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Charge-transfer energy for NiO\nThis example follows the `sphx_glr_auto_examples_example_3_AIM_XAS.py`\nexample and considers the same model. This time we outline how to determine\nthe charge transfer energy in the sense defined by Zaanen, Sawatzky, and Allen\n[1]_. That is, a $d^{n_d} \\rightarrow d^{n_d + 1} \\underline{L}$ transition\nin the atomic limit, after considering Coulomb interactions and crystal field. Although\nthis can be determined analytically in some cases, the easiest way is often just to\ncalculate it, as we will do here.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy\nimport example_3_AIM_XAS\nimport importlib\n_ = importlib.reload(example_3_AIM_XAS)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Determine eigenvectors and occupations\nThe first step repeats what was done in\n`sphx_glr_auto_examples_example_4_GS_analysis.py` but it does not apply\nthe hybridization between the impurity and both states.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "from example_3_AIM_XAS import (F0_dd, F2_dd, F4_dd,\n nd, norb_d, norb_bath, v_noccu,\n imp_mat, bath_level,\n hyb, ext_B, trans_c2n)\nntot = 20\numat_delectrons = edrixs.get_umat_slater('d', F0_dd, F2_dd, F4_dd)\numat = np.zeros((ntot, ntot, ntot, ntot), dtype=complex)\numat[:norb_d, :norb_d, :norb_d, :norb_d] += umat_delectrons\nemat_rhb = np.zeros((ntot, ntot), dtype='complex')\nemat_rhb[0:norb_d, 0:norb_d] += imp_mat\nindx = np.arange(norb_d, norb_d*2)\nemat_rhb[indx, indx] += bath_level[0]\ntmat = np.eye(ntot, dtype=complex)\nfor i in range(2):\n off = i * norb_d\n tmat[off:off+norb_d, off:off+norb_d] = np.conj(np.transpose(trans_c2n))\n\nemat_chb = edrixs.cb_op(emat_rhb, tmat)\nv_orbl = 2\nsx = edrixs.get_sx(v_orbl)\nsy = edrixs.get_sy(v_orbl)\nsz = edrixs.get_sz(v_orbl)\nzeeman = ext_B[0] * (2 * sx) + ext_B[1] * (2 * sy) + ext_B[2] * (2 * sz)\nemat_chb[0:norb_d, 0:norb_d] += zeeman\nbasis = np.array(edrixs.get_fock_bin_by_N(ntot, v_noccu))\nH = (edrixs.build_opers(2, emat_chb, basis)\n + edrixs.build_opers(4, umat, basis))\n\ne, v = scipy.linalg.eigh(H)\ne -= e[0]\n\nnum_d_electrons = basis[:, :norb_d].sum(1)\nalphas = np.sum(np.abs(v[num_d_electrons == 8, :])**2, axis=0)\nbetas = np.sum(np.abs(v[num_d_electrons == 9, :])**2, axis=0)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Energy to lowest energy ligand orbital\nLet's vizualize $\\alpha$ and $\\beta$.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fig, ax = plt.subplots()\n\nax.plot(e, alphas, '.-', label=r'$\\alpha$ $d^8L^{10}$')\nax.plot(e, betas, '.-', label=r'$\\beta$ $d^9L^{9}$')\n\nax.set_xlabel('Energy (eV)')\nax.set_ylabel('Population')\nax.set_title('NiO')\nax.legend()\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "One can see that the mixing between impurity and bath states has disappered\nbecause we have turned off the hybridization. The energy required to\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "GS_energy = min(e[np.isclose(alphas, 1)])\nlowest_energy_to_transfer_electron = min(e[np.isclose(betas, 1)])\nE_to_ligand = lowest_energy_to_transfer_electron - GS_energy\nprint(f\"Energy to lowest energy ligand state is {E_to_ligand:.3f} eV\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "where we have used :code:`np.isclose` to avoid errors from finite numerical\nprecision.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Diagonalizing by blocks\nWhen working on a problem with a large basis, one can take advantage of the\nlack of hybridization and separately diagonalize the impurity and bath\nstates\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "energies = []\n\nfor n_ligand_holes in [0, 1]:\n basis_d = edrixs.get_fock_bin_by_N(10, nd + n_ligand_holes)\n Hd = (edrixs.build_opers(2, emat_chb[:10, :10], basis_d)\n + edrixs.build_opers(4, umat[:10, :10, :10, :10], basis_d))\n ed = scipy.linalg.eigh(Hd, eigvals_only=True, subset_by_index=[0, 0])[0]\n\n basis_L = edrixs.get_fock_bin_by_N(10, 10 - n_ligand_holes)\n HL = (edrixs.build_opers(2, emat_chb[10:, 10:], basis_L)\n + edrixs.build_opers(4, umat[10:, 10:, 10:, 10:], basis_L))\n eL = scipy.linalg.eigh(HL, eigvals_only=True, subset_by_index=[0, 0])[0]\n\n energies.append(ed + eL)\n\nprint(f\"Energy to lowest energy ligand state is {energies[1] - energies[0]:.3f} eV\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "which yields the same result.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Energy splitting in ligand states\nThe last thing to consider is that our definition of the charge transfer\nenergy refers to the atomic limit with all hopping terms switched off, whereas\nthe ligand states in the model are already split by the oxygen-oxygen hopping\nterm $T_{pp}$ as illustrated below. So the final charge transer energy\nneeds to account for this.\n\n .. image:: /_static/energy_level.png\n\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "T_pp = 1\nprint(f\"Charge transfer is {energies[1] - energies[0] + T_pp:.3f} eV\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ".. rubric:: Footnotes\n\n.. [1] J. Zaanen, G. A. Sawatzky, and J. W. Allen,\n [Phys. Rev. Lett. 55, 418 (1985)](https://doi.org/10.1103/PhysRevLett.55.418).\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.16" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/ec5be3ffa2b20d2aa5db9e4571690517/example_2_single_atom_RIXS.ipynb b/edrixs/_downloads/ec5be3ffa2b20d2aa5db9e4571690517/example_2_single_atom_RIXS.ipynb deleted file mode 100644 index 9c4374907c..0000000000 --- a/edrixs/_downloads/ec5be3ffa2b20d2aa5db9e4571690517/example_2_single_atom_RIXS.ipynb +++ /dev/null @@ -1,190 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# RIXS calculations for an atomic model\nHere we show how to compute RIXS for a single site atomic model with crystal\nfield and electron-electron interactions. We take the case of\nSr\\ :sub:`2`\\ YIrO\\ :sub:`6`\nfrom Ref. [1]_ as the material in question. The aim of this example is to\nillustrate the proceedure and to provide what we hope is useful advice. What is\nwritten is not meant to be a replacement for reading the docstrings of the\nfunctions, which can always be accessed on the\n[edrixs website](https://nsls-ii.github.io/edrixs/reference/index.html) or\nby executing functions with ?? in IPython.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport numpy as np\nimport matplotlib.pyplot as plt" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Specify active core and valence orbitals\nSr\\ :sub:`2`\\ YIrO\\ :sub:`6`\\ has a $5d^4$ electronic configuration and\nwe want to calculate the $L_3$ edge spectrum i.e. resonating with a\n$2p_{3/2}$ core hole. We will start by including only the\n$t_{2g}$ valance orbitals.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "shell_name = ('t2g', 'p32')\nv_noccu = 4" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Slater parameters\nHere we want to use Hund's interaction\n$J_H$ and spin orbit coupling $\\lambda$ as adjustable parameters\nto match experiment. We will take\nthe core hole interaction parameter from the Hartree Fock numbers EDRIXS has\nin its database. These need to be converted and arranged into the order\nrequired by EDRIXS.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "Ud = 2\nJH = 0.25\nlam = 0.42\nF0_d, F2_d, F4_d = edrixs.UdJH_to_F0F2F4(Ud, JH)\ninfo = edrixs.utils.get_atom_data('Ir', '5d', v_noccu, edge='L3')\nG1_dp = info['slater_n'][5][1]\nG3_dp = info['slater_n'][6][1]\nF0_dp = edrixs.get_F0('dp', G1_dp, G3_dp)\nF2_dp = info['slater_n'][4][1]\n\nslater_i = [F0_d, F2_d, F4_d] # Fk for d\nslater_n = [\n F0_d, F2_d, F4_d, # Fk for d\n F0_dp, F2_dp, # Fk for dp\n G1_dp, G3_dp, # Gk for dp\n 0.0, 0.0 # Fk for p\n]\nslater = [slater_i, slater_n]\nv_soc = (lam, lam)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Diagonalization\nWe obtain the ground and intermediate state eigenenergies and the transition\noperators via matrix diagonalization. Note that the calculation does not know\nthe core hole energy, so we need to adjust the energy that the resonance will\nappear at by hand. We know empirically that the resonance is at 11215 eV\nand that putting four electrons into the valance band costs about\n$4 F^0_d\\approx6$ eV. In this case\nwe are assuming a perfectly cubic crystal field, which we have already\nimplemented when we specified the use of the $t_{2g}$ subshell only\nso we do not need to pass an additional :code:`v_cfmat` matrix.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "off = 11215 - 6\nout = edrixs.ed_1v1c_py(shell_name, shell_level=(0, -off), v_soc=v_soc,\n c_soc=info['c_soc'], v_noccu=v_noccu, slater=slater)\neval_i, eval_n, trans_op = out" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Compute XAS\nTo calculate XAS we need to correctly specify the orientation of the x-rays\nwith respect to the sample. By default, the $x, y, z$ coordinates\nof the sample's crystal field, will be aligned with our lab frame, passing\n:code:`loc_axis` to :code:`ed_1v1c_py` can be used to specify a different\nconvention. The experimental geometry is specified following the angles\nshown in Figure 1 of Y. Wang et al.,\n[Computer Physics Communications 243, 151-165 (2019)](https://doi.org/10.1016/j.cpc.2019.04.018). The default\nsetting has x-rays along $z$ for $\\theta=\\pi/2$ rad\nand the x-ray beam along $-x$ for\n$\\theta=\\phi=0$. Parameter :code:`scatter_axis` can be passed to\n:code:`xas_1v1c_py` to specify a different geometry if desired.\n\nVariable :code:`pol_type` specifies a list of different x-ray\npolarizations to calculate. Here we will use so-called $\\pi$-polarization\nwhere the x-rays are parallel to the plane spanned by the incident\nbeam and the sample $z$-axis.\n\nEDRIXS represents the system's ground state using a set of\nlow energy eigenstates weighted by Boltzmann thermal factors.\nThese eigenstates are specified by :code:`gs_list`,\nwhich is of the form $[0, 1, 2, 3, \\dots]$. In this example, we\ncalculate these states as those that have non-negligible thermal\npopulation. The function :code:`xas_1v1c_py` assumes that the spectral\nbroadening is dominated by the inverse core hole lifetime :code:`gamma_c`,\nwhich is the Lorentzian half width at half maximum.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ominc = np.linspace(11200, 11230, 50)\ntemperature = 300 # in K\nprob = edrixs.boltz_dist(eval_i, temperature)\ngs_list = [n for n, prob in enumerate(prob) if prob > 1e-6]\n\nthin = 30*np.pi/180\nphi = 0\npol_type = [('linear', 0)]\n\nxas = edrixs.xas_1v1c_py(\n eval_i, eval_n, trans_op, ominc, gamma_c=info['gamma_c'],\n thin=thin, phi=phi, pol_type=pol_type,\n gs_list=gs_list)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Compute RIXS\nCalculating RIXS is overall similar to XAS, but with a few additional\nconsiderations. The spectral width in the energy loss axis of RIXS it\nnot set by the core hole lifetime, but by either the final state lifetime\nor the experimental resolution and is parameterized by :code:`gamma_f`\n-- the Lorentzian half width at half maximum.\n\nThe angle and polarization of the emitted beam must also be specified, so\nwe pass :code:`pol_type_rixs` to the function, which specifies the\nincludes the incoming and outgoing x-ray states. If, as is common in\nexperiments, the emitted polarization is not resolved\none needs to add both emitted polarization channels, which is what we will\ndo later on in this example.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "eloss = np.linspace(-.5, 6, 400)\npol_type_rixs = [('linear', 0, 'linear', 0), ('linear', 0, 'linear', np.pi/2)]\n\nthout = 60*np.pi/180\ngamma_f = 0.02\n\nrixs = edrixs.rixs_1v1c_py(\n eval_i, eval_n, trans_op, ominc, eloss,\n gamma_c=info['gamma_c'], gamma_f=gamma_f,\n thin=thin, thout=thout, phi=phi,\n pol_type=pol_type_rixs, gs_list=gs_list,\n temperature=temperature\n)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The array :code:`xas` will have shape\n:code:`(len(ominc_xas), len(pol_type))`\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Plot XAS and RIXS\nLet's plot everything. We will use a function so we can reuse the code later.\nNote that the rixs array :code:`rixs` has shape\n:code:`(len(ominc_xas), len(ominc_xas), len(pol_type))`. We will use some numpy\ntricks to sum over the two different emitted polarizations.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fig, axs = plt.subplots(2, 2, figsize=(10, 10))\n\n\ndef plot_it(axs, ominc, xas, eloss, rixscut, rixsmap=None, label=None):\n axs[0].plot(ominc, xas[:, 0], label=label)\n axs[0].set_xlabel('Energy (eV)')\n axs[0].set_ylabel('Intensity')\n axs[0].set_title('XAS')\n\n axs[1].plot(eloss, rixscut, label=f\"{label}\")\n axs[1].set_xlabel('Energy loss (eV)')\n axs[1].set_ylabel('Intensity')\n axs[1].set_title(f'RIXS at resonance')\n\n if rixsmap is not None:\n art = axs[2].pcolormesh(ominc, eloss, rixsmap.T, shading='auto')\n plt.colorbar(art, ax=axs[2], label='Intensity')\n axs[2].set_xlabel('Incident energy (eV)')\n axs[2].set_ylabel('Energy loss')\n axs[2].set_title('RIXS map')\n\n\nrixs_pol_sum = rixs.sum(-1)\ncut_index = np.argmax(rixs_pol_sum[:, eloss < 2].sum(1))\nrixscut = rixs_pol_sum[cut_index]\n\nplot_it(axs.ravel(), ominc, xas, eloss, rixscut, rixsmap=rixs_pol_sum)\naxs[0, 1].set_xlim(right=3)\naxs[1, 0].set_ylim(top=3)\naxs[1, 1].remove()\n\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Full d shell calculation\nSome researchers have questioned the appropriateness of only including the\n$t_{2g}$ subshell for iridates [2]_. Let's test this. We specify that\nthe full $d$ shell should be used and apply cubic crystal field matrix\n:code:`v_cfmat`. We shift the energy offset by $\\frac{2}{5}10D_q$, which\nis the amount the crystal field moves the $t_{2g}$ subshell.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ten_dq = 3.5\nv_cfmat = edrixs.cf_cubic_d(ten_dq)\noff = 11215 - 6 + ten_dq*2/5\nout = edrixs.ed_1v1c_py(('d', 'p32'), shell_level=(0, -off), v_soc=v_soc,\n v_cfmat=v_cfmat,\n c_soc=info['c_soc'], v_noccu=v_noccu, slater=slater)\neval_i, eval_n, trans_op = out\n\nxas_full_d_shell = edrixs.xas_1v1c_py(\n eval_i, eval_n, trans_op, ominc, gamma_c=info['gamma_c'],\n thin=thin, phi=phi, pol_type=pol_type,\n gs_list=gs_list)\n\nrixs_full_d_shell = edrixs.rixs_1v1c_py(\n eval_i, eval_n, trans_op, np.array([11215]), eloss,\n gamma_c=info['gamma_c'], gamma_f=gamma_f,\n thin=thin, thout=thout, phi=phi,\n pol_type=pol_type_rixs, gs_list=gs_list,\n temperature=temperature)\n\nfig, axs = plt.subplots(1, 2, figsize=(10, 4))\nplot_it(axs, ominc, xas, eloss, rixscut, label='$t_{2g}$ subshell')\nrixscut = rixs_full_d_shell.sum((0, -1))\nplot_it(axs, ominc, xas_full_d_shell, eloss, rixscut, label='$d$ shell')\n\naxs[0].legend()\naxs[1].legend()\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As expected, we see the appearance of excitations on the energy scale of\n$10D_q$ in the XAS and RIXS. The low energy manifold is qualitatively,\nbut not quantiatively similar. This makes it clear that the parameterization\nof Sr\\ :sub:`2`\\ YIrO\\ :sub:`6`\\ is dependent on the model.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ".. rubric:: Footnotes\n\n.. [1] Bo Yuan et al.,\n [Phys. Rev. B 95, 235114 (2017)](https://doi.org/10.1103/PhysRevB.95.235114).\n\n.. [2] Georgios L. Stamokostas and Gregory A. Fiete\n [Phys. Rev. B 97, 085150 (2018)](https://doi.org/10.1103/PhysRevB.97.085150).\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.16" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_downloads/fbd478f01d8361d8a36f393bd9b6097c/example_7_transitions.zip b/edrixs/_downloads/fbd478f01d8361d8a36f393bd9b6097c/example_7_transitions.zip deleted file mode 100644 index 0c91e88420..0000000000 Binary files a/edrixs/_downloads/fbd478f01d8361d8a36f393bd9b6097c/example_7_transitions.zip and /dev/null differ diff --git a/edrixs/_downloads/fefe43e950d8d7431b1943e681e41d20/example_7_Coulomb.ipynb b/edrixs/_downloads/fefe43e950d8d7431b1943e681e41d20/example_7_Coulomb.ipynb deleted file mode 100644 index 3799d4e92f..0000000000 --- a/edrixs/_downloads/fefe43e950d8d7431b1943e681e41d20/example_7_Coulomb.ipynb +++ /dev/null @@ -1,226 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "%matplotlib inline" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n# Coulomb interactions\nIn this example we provide more details on how Coulomb interactions are\nimplemented in multiplet calculations and EDRIXS in particular. We aim\nto clarify the form of the matrices, how they are parametrized,\nand how the breaking of spherical symmetry can switch on additional elements\nthat one might not anticipate. Our example is based on a $d$ atomic shell.\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Create matrix\nThe Coulomb interaction between two particles can be written as\n\n .. math::\n \\begin{equation}\n \\hat{H} = \\frac{1}{2}\n \\int d\\mathbf{r} \\int d\\mathbf{r}^\\prime\n \\Sigma_{\\sigma, \\sigma^\\prime}\n |\\hat{\\psi}^\\sigma(\\mathbf{r})|^2 \\frac{e^2}{R}\n |\\hat{\\psi}^{\\sigma^\\prime}(\\mathbf{r})|^2,\n \\end{equation}\n\nwhere $\\hat{\\psi}^\\sigma(\\mathbf{r})$ is the electron wavefunction, with\nspin $\\sigma$, and $R=|r-r^\\prime|$ is the electron separation.\nSolving our problem in this form is difficult due to the need to symmeterize\nthe wavefunction to follow fermionic statistics.\nUsing second quantization, we can use operators to impose the required\nparticle exchange statistics and write the equation in terms of\na tensor $U$\n\n .. math::\n \\begin{equation}\n \\hat{H} = \\sum_{\\alpha,\\beta,\\gamma,\\delta,\\sigma,\\sigma^\\prime}\n U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\gamma\\sigma^\\prime,\\delta\\sigma}\n \\hat{f}^{\\dagger}_{\\alpha\\sigma}\n \\hat{f}^{\\dagger}_{\\beta\\sigma^\\prime}\n \\hat{f}_{t\\sigma^\\prime}\\hat{f}_{\\delta\\sigma},\n \\end{equation}\n\nwhere $\\alpha$, $\\beta$, $\\gamma$, $\\delta$ are\norbital indices and $\\hat{f}^{\\dagger}$\n($\\hat{f}$) are the creation (anihilation) operators.\nFor a $d$-electron system, we have $10$ distinct spin-orbitals\n($5$ orbitals each with $2$ spins), which makes matrix the\n$10\\times10\\times10\\times10$ in total size.\nIn EDRIXS the matrix can be created as follows:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import edrixs\nimport numpy as np\nimport scipy\nimport matplotlib.pyplot as plt\nimport itertools\n\nF0, F2, F4 = 6.94, 14.7, 4.41\numat_chb = edrixs.get_umat_slater('d', F0, F2, F4)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We stored this under variable :code:`umat_chb` where \"cbh\" stands for\ncomplex harmonic basis, which is the default basis in EDRIXS.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Parameterizing interactions\nEDRIXS parameterizes the interactions in $U$ via Slater integral\nparameters $F^{k}$. These relate to integrals of various spherical\nHarmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients,\nand Wigner 3J symbols. Textbooks such as [1]_ can be used for further\nreference. If you are interested in the details of how\nEDRIXS does this (and you probably aren't) function :func:`.umat_slater`,\nconstructs the required matrix via Gaunt coeficents from\n:func:`.get_gaunt`. Two alternative parameterizations are common.\nThe first are the Racah parameters, which are\n\n .. math::\n \\begin{eqnarray}\n A &=& F^0 - \\frac{49}{441} F^4 \\\\\n B &=& \\frac{1}{49}F^2 - \\frac{5}{441}F^4 \\\\\n C &=& \\frac{35}{441}F^4.\n \\end{eqnarray}\n\nor an alternative form for the Slater integrals\n\n .. math::\n \\begin{eqnarray}\n F_0 &=& F^0 \\\\\n F_2 &=& \\frac{1}{49}F^2 \\\\\n F_4 &=& \\frac{1}{441}F^4,\n \\end{eqnarray}\n\nwhich involves different normalization parameters.\n\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Basis transform\nIf we want to use the real harmonic basis, we can use a tensor\ntransformation, which imposes the following orbital order\n$3z^2-r^2, xz, yz, x^2-y^2, xy$, each of which involves\n$\\uparrow, \\downarrow$ spin pairs. Let's perform this transformation and\nstore a list of these orbitals.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True))\norbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy']" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Interactions\nTensor $U$ is a series of matrix\nelements\n\n .. math::\n \\begin{equation}\n \\langle\\psi_{\\gamma,\\delta}^{\\bar{\\sigma},\\bar{\\sigma}^\\prime}\n |\\hat{H}|\n \\psi_{\\alpha,\\beta}^{\\sigma,\\sigma^\\prime}\\rangle\n \\end{equation}\n\nthe combination of which defines the energetic cost of pairwise\nelectron-electron interactions between states $\\alpha,\\sigma$\nand $\\beta,\\sigma^\\prime$. In EDRIXS we follow the convention of\nsumming over all orbital pairs. Some other texts count each pair of\nindices only once. The matrix elements here will consequently\nbe half the magnitude of those in other references.\nWe can express the interactions in terms of\nthe orbitals involved. It is common to distinguish \"direct Coulomb\" and\n\"exchange\" interactions. The former come from electrons in the same orbital\nand the later involve swapping orbital labels for electrons. We will use\n$U_0$ and $J$ as a shorthand for distinguishing these.\n\nBefore we describe the different types of interactions, we note that since\nthe Coulomb interaction is real, and due to the spin symmmetry properties\nof the process $U$ always obeys\n\n .. math::\n \\begin{equation}\n U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\gamma\\sigma^\\prime,\\delta\\sigma} =\n U_{\\beta\\sigma,\\alpha\\sigma^\\prime,\\delta\\sigma^\\prime,\\gamma\\sigma} =\n U_{\\delta\\sigma,\\gamma\\sigma^\\prime,\\beta\\sigma^\\prime,\\alpha\\sigma} =\n U_{\\gamma\\sigma,\\delta\\sigma^\\prime,\\alpha\\sigma^\\prime,\\beta\\sigma}.\n \\end{equation}\n\n\n### 1. Intra orbital\nThe direct Coulomb energy cost to double-occupy an orbital comes from terms\nlike $U_{\\alpha\\sigma,\\alpha\\bar\\sigma,\\alpha\\bar\\sigma,\\alpha\\sigma}$.\nIn this notation, we use $\\sigma^\\prime$ to denote that the matrix\nelement is summed over all pairs and $\\bar{\\sigma}$ to denote sums\nover all opposite spin pairs. Due to rotational symmetry, all these\nelements are the same and equal to\n\n .. math::\n \\begin{eqnarray}\n U_0 &=& \\frac{A}{2} + 2B + \\frac{3C}{2}\\\\\n &=& \\frac{F_0}{2} + 2F_2 + 18F_4\n \\end{eqnarray}\n\nLet's print these to demonstrate where these live in the array\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i in range(0, 5):\n val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real\n print(f\"{orbitals[i]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 2. Inter orbital Coulomb interactions\nDirect Coulomb repulsion between different orbitals depends on terms like\n$U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\beta\\sigma^\\prime,\\alpha\\sigma}$.\nExpresions for these parameters are provided in column $U$ in\n`table_2_orbital`. We can print the values from :code:`umat`\nlike this:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i, j in itertools.combinations(range(5), 2):\n val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 3. Inter-orbital exchange interactions\nExchange terms exist with the form\n$U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\alpha\\sigma^\\prime,\\beta\\sigma}$.\nExpresions for these parameters are provided in column $J$ of\n`table_2_orbital`. These come from terms like this in the matrix:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i, j in itertools.combinations(range(5), 2):\n val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 4. Pair hopping term\nTerms that swap pairs of electrons exist as\n$(1-\\delta_{\\sigma\\sigma'})U_{\\alpha\\sigma,\\alpha\\bar\\sigma,\\beta\\bar\\sigma,\\beta\\sigma}$\nand depend on exchange interactions column $J$ from\n`table_2_orbital`\nand here in the matrix.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "for i, j in itertools.combinations(range(5), 2):\n val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 5. Three orbital\nAnother set of terms that one might not immediately anticipate involve three\norbitals like\n\n .. math::\n \\begin{equation}\n U_{\\alpha\\sigma, \\gamma\\sigma', \\beta\\sigma', \\gamma\\sigma} \\\\\n U_{\\alpha\\sigma, \\gamma\\sigma', \\gamma\\sigma', \\beta\\sigma} \\\\\n (1-\\delta_{\\sigma\\sigma'})\n U_{\\alpha\\sigma, \\beta\\sigma', \\gamma\\sigma', \\gamma\\sigma}\n \\end{equation}\n\nfor $\\alpha=3z^2-r^2, \\beta=x^2-y^2, \\gamma=xz/yz$.\nThese are needed to maintain the rotational symmetry of the interations.\nSee `table_3_orbital` for the expressions. We can print some of\nthese via:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ijkl = [[0, 1, 3, 1],\n [0, 2, 3, 2],\n [1, 0, 3, 1],\n [1, 1, 3, 0],\n [2, 0, 3, 2],\n [2, 2, 3, 0]]\n\nfor i, j, k, l in ijkl:\n val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t\"\n f\"{orbitals[k]:<8} \\t {orbitals[l]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 6. Four orbital\nFuther multi-orbital terms include\n$U_{\\alpha\\sigma,\\beta\\sigma^\\prime,\\gamma\\sigma^\\prime,\\delta\\sigma}$.\nWe can find these here in the matrix:\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ijkl = [[0, 1, 2, 4],\n [0, 1, 4, 2],\n [0, 2, 1, 4],\n [0, 2, 4, 1],\n [0, 4, 1, 2],\n [0, 4, 2, 1],\n [3, 1, 4, 2],\n [3, 2, 4, 1],\n [3, 4, 1, 2],\n [3, 4, 2, 1]]\n\nfor i, j, k, l in ijkl:\n val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real\n print(f\"{orbitals[i]:<8} \\t {orbitals[j]:<8} \\t {orbitals[k]:<8}\"\n f\"\\t {orbitals[l]:<8} \\t {val:.3f}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Effects of multi-orbital terms\nTo test the effects of the multi-orbital terms, let's plot the eigenenergy\nspectra with and without multi-orbital terms switched on for system with and\nwithout a cubic crystal field. We will use a $d$-shell with two\nelectrons.\n\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "ten_dqs = [0, 2, 4, 12]\n\ndef diagonalize(ten_dq, umat):\n emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq),\n edrixs.tmat_c2r('d', ispin=True))\n H = (edrixs.build_opers(4, umat, basis)\n + edrixs.build_opers(2, emat, basis))\n e, v = scipy.linalg.eigh(H)\n return e - e.min()\n\nbasis = edrixs.get_fock_bin_by_N(10, 2)\numat_no_multiorbital = np.copy(umat)\nB = F2/49 - 5*F4/441\nfor val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]:\n umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0\n\nfig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3))\n\nfor cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)):\n ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1,\n label='on', color=f'C{cind}')\n ax.hlines(diagonalize(ten_dq, umat_no_multiorbital),\n xmin=1.5, xmax=2.5,\n label='off',\n linestyle=':', color=f'C{cind}')\n ax.set_title(f\"$10D_q={ten_dq}$\")\n ax.set_ylim([-.5, 20])\n ax.set_xticks([])\n ax.legend()\n\nfig.suptitle(\"Eigenvalues with 3&4-orbital effects on/off\")\nfig.subplots_adjust(wspace=.3)\naxs[0].set_ylabel('Eigenvalues (eV)')\nfig.subplots_adjust(top=.8)\nplt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "On the left of the plot Coulomb interactions in spherical symmetry cause\nsubstantial mxing between $t_{2g}$ and $e_{g}$ orbitals in the\neigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the\nthe right eigenenergies. As $10D_q$ get large, this mixing is switched\noff and the spectra start to become independent of whether the 3 & 4 orbital\norbital terms are included or not.\n\n\n\n.. table:: Table of 2 orbital interactions\n\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |Orbitals $\\alpha,\\beta$|$U_0$ Racah | $U_0$ Slater |$J$ Racah |$J$ Slater |\n +=============================+==================+=======================+================+====================+\n |$3z^2-r^2, xz$ |$A/2+B+C/2$ |$F_0/2+F_2-12F_4$| $B/2+C/2$|$F_2/2+15F_4$ |\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$3z^2-r^2, yz$ |$A/2+B+C/2$ |$F_0/2+F_2-12F_4$| $B/2+C/2$|$F_2/2+15F_4$ |\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$3z^2-r^2, x^2-y^2$ |$A/2-2B+C/2$|$F_0/2-2F_2+3F_4$|$2B+C/2$ |$2F_2+15F_4/2$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$3z^2-r^2, xy$ |$A/2-2B+C/2$|$F_0/2-2F_2+3F_4$|$2B+C/2$ |$2F_2+15F_4/2$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$xz, yz$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$xz, x^2-y^2$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$xz, xy$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$yz, x^2-y^2$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$yz, xy$ |$A/2-B+C/2$ |$F_0/2-F_2-12F_4$|$3B/2+C/2$|$3F_2/2+10F_4$|\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n |$x^2-y^2, xy$ |$A/2+2B+C/2$|$F_0+4F_2-34F_4$ | $C/2$ |$35F_4/2$ |\n +-----------------------------+------------------+-----------------------+----------------+--------------------+\n\n\n.. table:: Table of 3 orbital interactions\n\n +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+\n |Orbitals $\\alpha,\\beta,\\gamma,\\delta$|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Racah|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Slater|\n +=============================+=============+====================================================+=====================================================+\n |$3z^2-r^2, xz, x^2-y^2, xz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, yz, x^2-y^2, yz$ | $-\\sqrt{3}B/2$ | $-\\sqrt{3}F_2/2+5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$xz, 3z^2-r^2, x^2-y^2, xz$ | $-\\sqrt{3}B$ | $-\\sqrt{3}F_2+5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$xz, xz, x^2-y^2, 3z^2-r^2$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$yz, 3z^2-r^2, x^2-y^2, yz$ | $\\sqrt{3}B$ | $\\sqrt{3}F_2-5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$yz, yz, x^2-y^2, 3z^2-r^2$ | $-\\sqrt{3}B/2$ | $-\\sqrt{3}F_2/2+5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n\n\n.. table:: Table of 4 orbital interactions\n\n +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+\n |Orbitals $\\alpha,\\beta,\\gamma,\\delta$|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Racah|$\\langle\\alpha\\beta|\\gamma\\delta\\rangle$ Slater|\n +=============================+=============+====================================================+=====================================================+\n |$3z^2-r^2, xz, yz, xy$ | $-\\sqrt{3}B$ | $-\\sqrt{3}F_2+5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, xz, xy, yz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, yz, xz, xy$ | $-\\sqrt{3}B$ | $-\\sqrt{3}F_2+5\\sqrt{3}F_4$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, yz, xy, xz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, xy, xz, yz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$3z^2-r^2, xy, yz, xz$ | $\\sqrt{3}B/2$ | $\\sqrt{3}F_2/2-5\\sqrt{3}F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , xz, xy, yz$ | $-3B/2$ | $-3F_2/2+15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , yz, xy, xz$ | $3B/2$ | $3F_2/2-15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , xy, xz, yz$ | $-3B/2$ | $-3F_2/2+15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n |$x^2-y^2 , xy, yz, xz$ | $3B/2$ | $3F_2/2-15F_4/2$ |\n +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+\n\n\n.. rubric:: Footnotes\n\n.. [1] MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of\n Transition-Metal Ions in Crystals. Academic Press, New York and London.\n\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.16" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/edrixs/_images/energy_level.png b/edrixs/_images/energy_level.png deleted file mode 100644 index 9878f7d91d..0000000000 Binary files a/edrixs/_images/energy_level.png and /dev/null differ diff --git a/edrixs/_images/helloworld.png b/edrixs/_images/helloworld.png deleted file mode 100644 index cca501f2a5..0000000000 Binary files a/edrixs/_images/helloworld.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_0_ed_calculator_001.png b/edrixs/_images/sphx_glr_example_0_ed_calculator_001.png deleted file mode 100644 index f7ff48c2ca..0000000000 Binary files a/edrixs/_images/sphx_glr_example_0_ed_calculator_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_0_ed_calculator_002.png b/edrixs/_images/sphx_glr_example_0_ed_calculator_002.png deleted file mode 100644 index b4d71d6999..0000000000 Binary files a/edrixs/_images/sphx_glr_example_0_ed_calculator_002.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_0_ed_calculator_thumb.png b/edrixs/_images/sphx_glr_example_0_ed_calculator_thumb.png deleted file mode 100644 index 0e3d9fd6b5..0000000000 Binary files a/edrixs/_images/sphx_glr_example_0_ed_calculator_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_1_crystal_field_thumb.png b/edrixs/_images/sphx_glr_example_1_crystal_field_thumb.png deleted file mode 100644 index 8a5fed589d..0000000000 Binary files a/edrixs/_images/sphx_glr_example_1_crystal_field_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_2_single_atom_RIXS_001.png b/edrixs/_images/sphx_glr_example_2_single_atom_RIXS_001.png deleted file mode 100644 index b9b1ac65d8..0000000000 Binary files a/edrixs/_images/sphx_glr_example_2_single_atom_RIXS_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_2_single_atom_RIXS_002.png b/edrixs/_images/sphx_glr_example_2_single_atom_RIXS_002.png deleted file mode 100644 index 2a3f00e204..0000000000 Binary files a/edrixs/_images/sphx_glr_example_2_single_atom_RIXS_002.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_2_single_atom_RIXS_thumb.png b/edrixs/_images/sphx_glr_example_2_single_atom_RIXS_thumb.png deleted file mode 100644 index 65ca1e771f..0000000000 Binary files a/edrixs/_images/sphx_glr_example_2_single_atom_RIXS_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_3_AIM_XAS_001.png b/edrixs/_images/sphx_glr_example_3_AIM_XAS_001.png deleted file mode 100644 index fb33f4dd4e..0000000000 Binary files a/edrixs/_images/sphx_glr_example_3_AIM_XAS_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_3_AIM_XAS_thumb.png b/edrixs/_images/sphx_glr_example_3_AIM_XAS_thumb.png deleted file mode 100644 index 8d4a0f00e3..0000000000 Binary files a/edrixs/_images/sphx_glr_example_3_AIM_XAS_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_4_GS_analysis_001.png b/edrixs/_images/sphx_glr_example_4_GS_analysis_001.png deleted file mode 100644 index 1516a8fea2..0000000000 Binary files a/edrixs/_images/sphx_glr_example_4_GS_analysis_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_4_GS_analysis_thumb.png b/edrixs/_images/sphx_glr_example_4_GS_analysis_thumb.png deleted file mode 100644 index d5104a0409..0000000000 Binary files a/edrixs/_images/sphx_glr_example_4_GS_analysis_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_5_Hubbard_dimer_001.png b/edrixs/_images/sphx_glr_example_5_Hubbard_dimer_001.png deleted file mode 100644 index e08122d101..0000000000 Binary files a/edrixs/_images/sphx_glr_example_5_Hubbard_dimer_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_5_Hubbard_dimer_thumb.png b/edrixs/_images/sphx_glr_example_5_Hubbard_dimer_thumb.png deleted file mode 100644 index 48e47ddb41..0000000000 Binary files a/edrixs/_images/sphx_glr_example_5_Hubbard_dimer_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_5_charge_transfer_001.png b/edrixs/_images/sphx_glr_example_5_charge_transfer_001.png deleted file mode 100644 index a36a10519e..0000000000 Binary files a/edrixs/_images/sphx_glr_example_5_charge_transfer_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_5_charge_transfer_thumb.png b/edrixs/_images/sphx_glr_example_5_charge_transfer_thumb.png deleted file mode 100644 index 542edfdf27..0000000000 Binary files a/edrixs/_images/sphx_glr_example_5_charge_transfer_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_5_transitions_001.png b/edrixs/_images/sphx_glr_example_5_transitions_001.png deleted file mode 100644 index 3a1f6b554b..0000000000 Binary files a/edrixs/_images/sphx_glr_example_5_transitions_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_5_transitions_002.png b/edrixs/_images/sphx_glr_example_5_transitions_002.png deleted file mode 100644 index e62f353f7d..0000000000 Binary files a/edrixs/_images/sphx_glr_example_5_transitions_002.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_5_transitions_thumb.png b/edrixs/_images/sphx_glr_example_5_transitions_thumb.png deleted file mode 100644 index e093b06ec7..0000000000 Binary files a/edrixs/_images/sphx_glr_example_5_transitions_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_6_Coulomb_001.png b/edrixs/_images/sphx_glr_example_6_Coulomb_001.png deleted file mode 100644 index 6030b42b46..0000000000 Binary files a/edrixs/_images/sphx_glr_example_6_Coulomb_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_6_Coulomb_thumb.png b/edrixs/_images/sphx_glr_example_6_Coulomb_thumb.png deleted file mode 100644 index 97ad8d7fff..0000000000 Binary files a/edrixs/_images/sphx_glr_example_6_Coulomb_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_6_Hubbard_dimer_001.png b/edrixs/_images/sphx_glr_example_6_Hubbard_dimer_001.png deleted file mode 100644 index a1d3ca4ece..0000000000 Binary files a/edrixs/_images/sphx_glr_example_6_Hubbard_dimer_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_6_Hubbard_dimer_thumb.png b/edrixs/_images/sphx_glr_example_6_Hubbard_dimer_thumb.png deleted file mode 100644 index 48e47ddb41..0000000000 Binary files a/edrixs/_images/sphx_glr_example_6_Hubbard_dimer_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_7_Coulomb_001.png b/edrixs/_images/sphx_glr_example_7_Coulomb_001.png deleted file mode 100644 index 3310e6c6cd..0000000000 Binary files a/edrixs/_images/sphx_glr_example_7_Coulomb_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_7_Coulomb_thumb.png b/edrixs/_images/sphx_glr_example_7_Coulomb_thumb.png deleted file mode 100644 index 97ad8d7fff..0000000000 Binary files a/edrixs/_images/sphx_glr_example_7_Coulomb_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_7_Hunds_interactions_001.png b/edrixs/_images/sphx_glr_example_7_Hunds_interactions_001.png deleted file mode 100644 index e4c8c799ad..0000000000 Binary files a/edrixs/_images/sphx_glr_example_7_Hunds_interactions_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_7_Hunds_interactions_002.png b/edrixs/_images/sphx_glr_example_7_Hunds_interactions_002.png deleted file mode 100644 index b15dc57028..0000000000 Binary files a/edrixs/_images/sphx_glr_example_7_Hunds_interactions_002.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_7_Hunds_interactions_003.png b/edrixs/_images/sphx_glr_example_7_Hunds_interactions_003.png deleted file mode 100644 index 24229060a9..0000000000 Binary files a/edrixs/_images/sphx_glr_example_7_Hunds_interactions_003.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_7_Hunds_interactions_thumb.png b/edrixs/_images/sphx_glr_example_7_Hunds_interactions_thumb.png deleted file mode 100644 index 977cf97161..0000000000 Binary files a/edrixs/_images/sphx_glr_example_7_Hunds_interactions_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_7_transitions_001.png b/edrixs/_images/sphx_glr_example_7_transitions_001.png deleted file mode 100644 index c881d71e8c..0000000000 Binary files a/edrixs/_images/sphx_glr_example_7_transitions_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_7_transitions_002.png b/edrixs/_images/sphx_glr_example_7_transitions_002.png deleted file mode 100644 index 1bbce35510..0000000000 Binary files a/edrixs/_images/sphx_glr_example_7_transitions_002.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_7_transitions_thumb.png b/edrixs/_images/sphx_glr_example_7_transitions_thumb.png deleted file mode 100644 index e093b06ec7..0000000000 Binary files a/edrixs/_images/sphx_glr_example_7_transitions_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_8_Coulomb_001.png b/edrixs/_images/sphx_glr_example_8_Coulomb_001.png deleted file mode 100644 index 4bceacf8d4..0000000000 Binary files a/edrixs/_images/sphx_glr_example_8_Coulomb_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_8_Coulomb_thumb.png b/edrixs/_images/sphx_glr_example_8_Coulomb_thumb.png deleted file mode 100644 index 97ad8d7fff..0000000000 Binary files a/edrixs/_images/sphx_glr_example_8_Coulomb_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_8_Hunds_interactions_001.png b/edrixs/_images/sphx_glr_example_8_Hunds_interactions_001.png deleted file mode 100644 index 277196e086..0000000000 Binary files a/edrixs/_images/sphx_glr_example_8_Hunds_interactions_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_8_Hunds_interactions_002.png b/edrixs/_images/sphx_glr_example_8_Hunds_interactions_002.png deleted file mode 100644 index 3b9d3cb6ca..0000000000 Binary files a/edrixs/_images/sphx_glr_example_8_Hunds_interactions_002.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_8_Hunds_interactions_003.png b/edrixs/_images/sphx_glr_example_8_Hunds_interactions_003.png deleted file mode 100644 index a35be706a5..0000000000 Binary files a/edrixs/_images/sphx_glr_example_8_Hunds_interactions_003.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_8_Hunds_interactions_thumb.png b/edrixs/_images/sphx_glr_example_8_Hunds_interactions_thumb.png deleted file mode 100644 index 977cf97161..0000000000 Binary files a/edrixs/_images/sphx_glr_example_8_Hunds_interactions_thumb.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_9_Coulomb_001.png b/edrixs/_images/sphx_glr_example_9_Coulomb_001.png deleted file mode 100644 index 063ed33327..0000000000 Binary files a/edrixs/_images/sphx_glr_example_9_Coulomb_001.png and /dev/null differ diff --git a/edrixs/_images/sphx_glr_example_9_Coulomb_thumb.png b/edrixs/_images/sphx_glr_example_9_Coulomb_thumb.png deleted file mode 100644 index 97ad8d7fff..0000000000 Binary files a/edrixs/_images/sphx_glr_example_9_Coulomb_thumb.png and /dev/null differ diff --git a/edrixs/_modules/edrixs/angular_momentum.html b/edrixs/_modules/edrixs/angular_momentum.html deleted file mode 100644 index 55d29f1dd6..0000000000 --- a/edrixs/_modules/edrixs/angular_momentum.html +++ /dev/null @@ -1,937 +0,0 @@ - - - - - - - - edrixs.angular_momentum — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.angular_momentum

-__all__ = ['get_ladd', 'get_lminus', 'get_lx', 'get_ly', 'get_lz', 'get_orb_momentum',
-           'get_pauli', 'get_sx', 'get_sy', 'get_sz', 'get_spin_momentum', 'euler_to_rmat',
-           'rmat_to_euler', 'where_is_angle', 'dmat_spinor', 'zx_to_rmat', 'get_wigner_dmat',
-           'cf_cubic_d', 'cf_tetragonal_d', 'cf_square_planar_d', 'cf_trigonal_t2g']
-
-import numpy as np
-from .basis_transform import cb_op, tmat_r2c
-
-
-
-[docs] -def get_ladd(ll, ispin=False): - """ - Get the matrix form of the raising operator :math:`l^+` in the - complex spherical harmonics basis - - .. math:: - - l^+|ll,m> = \\sqrt{(ll-m)(ll+m+1)} |ll,m+1> - - Parameters - ---------- - ll: int - Orbital angular momentum number. - ispin: logical - Whether including spin or not (default: False). - - Returns - ------- - ladd: 2d complex array - The matrix form of :math:`l^+`. - - If ispin=True, the dimension will be :math:`2(2ll+1) \\times 2(2ll+1)`, - - otherwise, it will be :math:`(2ll+1) \\times (2ll+1)`. - """ - - norbs = 2 * ll + 1 - ladd = np.zeros((norbs, norbs), dtype=np.complex128) - cone = np.complex128(1.0 + 0.0j) - for m in range(-ll, ll): - ladd[ll + m + 1, ll + m] = np.sqrt((ll - m) * (ll + m + 1.0) * cone) - if ispin: - ladd_spin = np.zeros((2 * norbs, 2 * norbs), dtype=np.complex128) - ladd_spin[0:2 * norbs:2, 0:2 * norbs:2] = ladd - ladd_spin[1:2 * norbs:2, 1:2 * norbs:2] = ladd - return ladd_spin - else: - return ladd
- - - -
-[docs] -def get_lminus(ll, ispin=False): - """ - Get the matrix form of the lowering operator :math:`l^-` in the - complex spherical harmonics basis - - .. math:: - - l^-|ll,m> = \\sqrt{(ll+m)(ll-m+1)} |ll,m-1> - - Parameters - ---------- - ll: int - Orbital angular momentum number. - ispin: logical - Whether including spin or not (default: False). - - Returns - ------- - lminus: 2d complex array - The matrix form of :math:`l^-`. - - If ispin=True, the dimension will be :math:`2(2ll+1) \\times 2(2ll+1)`, - - otherwise, it will be :math:`(2ll+1) \\times (2ll+1)`. - """ - - norbs = 2 * ll + 1 - lminus = np.zeros((norbs, norbs), dtype=np.complex128) - cone = np.complex128(1.0 + 0.0j) - for m in range(-ll + 1, ll + 1): - lminus[ll + m - 1, ll + m] = np.sqrt((ll + m) * (ll - m + 1.0) * cone) - if ispin: - lminus_spin = np.zeros((2 * norbs, 2 * norbs), dtype=np.complex128) - lminus_spin[0:2 * norbs:2, 0:2 * norbs:2] = lminus - lminus_spin[1:2 * norbs:2, 1:2 * norbs:2] = lminus - return lminus_spin - else: - return lminus
- - - -
-[docs] -def get_lx(ll, ispin=False): - """ - Get the matrix form of the orbital angular momentum - operator :math:`l_x` in the complex spherical harmonics basis, - - .. math:: - - l_x = \\frac{1}{2} (l^+ + l^-) - - Parameters - ---------- - ll: int - Orbital angular momentum number. - ispin: logical - Whether including spin or not (default: False). - - Returns - ------- - lx: 2d complex array - The matrix form of :math:`l_x`. - - If ispin=True, the dimension will be :math:`2(2ll+1) \\times 2(2ll+1)`, - - otherwise, it will be :math:`(2ll+1) \\times (2ll+1)`. - """ - - if ispin: - return (get_ladd(ll, True) + get_lminus(ll, True)) / 2.0 - else: - return (get_ladd(ll) + get_lminus(ll)) / 2.0
- - - -
-[docs] -def get_ly(ll, ispin=False): - """ - Get the matrix form of the orbital angular momentum - operator :math:`l_y` in the complex spherical harmonics basis, - - .. math:: - - l_y = \\frac{-i}{2} (l^+ - l^-) - - Parameters - ---------- - ll: int - Orbital angular momentum number. - ispin: logical - Whether including spin or not (default: False). - - Returns - ------- - ly: 2d complex array - The matrix form of :math:`l_y`. - - If ispin=True, the dimension will be :math:`2(2ll+1) \\times 2(2ll+1)`, - - otherwise, it will be :math:`(2ll+1) \\times (2ll+1)`. - """ - - if ispin: - return (get_ladd(ll, True) - get_lminus(ll, True)) / 2.0 * -1j - else: - return (get_ladd(ll) - get_lminus(ll)) / 2.0 * -1j
- - - -
-[docs] -def get_lz(ll, ispin=False): - """ - Get the matrix form of the orbital angular momentum - operator :math:`l_z` in the complex spherical harmonics basis. - - Parameters - ---------- - ll: int - Orbital angular momentum number. - ispin: logical - Whether including spin or not (default: False). - - Returns - ------- - lz: 2d complex array - The matrix form of :math:`l_z`. - - If ispin=True, the dimension will be :math:`2(2ll+1) \\times 2(2ll+1)`, - - otherwise, it will be :math:`(2ll+1) \\times (2ll+1)`. - """ - norbs = 2 * ll + 1 - lz = np.zeros((norbs, norbs), dtype=np.complex128) - for m in range(-ll, ll + 1): - lz[ll + m, ll + m] = m - if ispin: - lz_spin = np.zeros((2 * norbs, 2 * norbs), dtype=np.complex128) - lz_spin[0:2 * norbs:2, 0:2 * norbs:2] = lz - lz_spin[1:2 * norbs:2, 1:2 * norbs:2] = lz - return lz_spin - else: - return lz
- - - -
-[docs] -def get_orb_momentum(ll, ispin=False): - """ - Get the matrix form of the orbital angular momentum - operator :math:`l_x, l_y, l_z` in the complex spherical harmonics basis. - - Parameters - ---------- - ll: int - Orbital angular momentum number. - ispin: logical - Whether including spin or not (default: False). - - Returns - ------- - res: 3d complex array - The matrix form of - - - res[0]: :math:`l_x` - - - res[1]: :math:`l_y` - - - res[2]: :math:`l_z` - - If ispin=True, the dimension will be :math:`3 \\times 2(2ll+1) \\times 2(2ll+1)`, - - otherwise, it will be :math:`3 \\times (2ll+1) \\times (2ll+1)`. - """ - norbs = 2 * ll + 1 - if ispin: - res = np.zeros((3, 2*norbs, 2*norbs), dtype=np.complex128) - else: - res = np.zeros((3, norbs, norbs), dtype=np.complex128) - res[0] = get_lx(ll, ispin) - res[1] = get_ly(ll, ispin) - res[2] = get_lz(ll, ispin) - - return res
- - - -
-[docs] -def get_pauli(): - """ - Get the Pauli matrix - - Returns - ------- - sigma: 3d complex array, shape=(3, 2, 2) - - - sigma[0] is :math:`\\sigma_x`, - - - sigma[1] is :math:`\\sigma_y`, - - - sigma[2] is :math:`\\sigma_z`, - """ - - sigma = np.zeros((3, 2, 2), dtype=np.complex128) - sigma[0, 0, 1] = 1.0 - sigma[0, 1, 0] = 1.0 - sigma[1, 0, 1] = -1.0j - sigma[1, 1, 0] = 1.0j - sigma[2, 0, 0] = 1.0 - sigma[2, 1, 1] = -1.0 - - return sigma
- - - -
-[docs] -def get_sx(ll): - """ - Get the matrix form of spin angular momentum operator :math:`s_x` in the - complex spherical harmonics basis. - - Parameters - ---------- - ll: int - Quantum number of orbital angular momentum. - - Returns - ------- - sx: 2d complex array. - Matrix form of :math:`s_x`, the dimension - is :math:`2(2ll+1) \\times 2(2ll+1)`, - - Orbital order is: \\|-ll,up\\>, \\|-ll,down\\>, ..., - \\|+ll, up\\>, \\|+ll,down\\>. - """ - - norbs = 2 * (2 * ll + 1) - sx = np.zeros((norbs, norbs), dtype=np.complex128) - sigma = get_pauli() - for i in range(2 * ll + 1): - sx[2 * i:2 * i + 2, 2 * i:2 * i + 2] = sigma[0, :, :] / 2.0 - - return sx
- - - -
-[docs] -def get_sy(ll): - """ - Get the matrix form of spin angular momentum operator :math:`s_y` in the - complex spherical harmonics basis. - - Parameters - ---------- - ll: int - Quantum number of orbital angular momentum. - - Returns - ------- - sy: 2d complex array. - Matrix form of :math:`s_y`, the dimension - is :math:`2(2ll+1) \\times 2(2ll+1)`, spin order is: - - Orbital order is: \\|-ll,up\\>, \\|-ll,down\\>, ..., - \\|+ll, up\\>, \\|+ll,down\\> - """ - - norbs = 2 * (2 * ll + 1) - sy = np.zeros((norbs, norbs), dtype=np.complex128) - sigma = get_pauli() - for i in range(2 * ll + 1): - sy[2 * i:2 * i + 2, 2 * i:2 * i + 2] = sigma[1, :, :] / 2.0 - - return sy
- - - -
-[docs] -def get_sz(ll): - """ - Get the matrix form of spin angular momentum operator :math:`s_z` in the - complex spherical harmonics basis. - - Parameters - ---------- - ll: int - Quantum number of orbital angular momentum. - - Returns - ------- - sz: 2d complex array. - Matrix form of :math:`s_z`, the dimension - is :math:`2(2ll+1) \\times 2(2ll+1)`. - - Orbital order is: \\|-ll,up\\>, \\|-ll,down\\>, ..., - \\|+ll, up\\>, \\|+ll,down\\> - """ - - norbs = 2 * (2 * ll + 1) - sz = np.zeros((norbs, norbs), dtype=np.complex128) - sigma = get_pauli() - for i in range(2 * ll + 1): - sz[2 * i:2 * i + 2, 2 * i:2 * i + 2] = sigma[2, :, :] / 2.0 - - return sz
- - - -
-[docs] -def get_spin_momentum(ll): - """ - Get the matrix form of the spin angular momentum - operator :math:`s_x, s_y, s_z` in the complex spherical harmonics basis. - - Parameters - ---------- - ll: int - Orbital angular momentum number. - - Returns - ------- - res: 3d complex array - The matrix form of - - - res[0]: :math:`s_x` - - - res[1]: :math:`s_y` - - - res[2]: :math:`s_z` - - the dimension is :math:`3 \\times 2(2ll+1) \\times 2(2ll+1)`, - - Orbital order is: \\|-ll,up\\>, \\|-ll,down\\>, ..., - \\|+ll, up\\>, \\|+ll,down\\> - """ - norbs = 2 * (2 * ll + 1) - res = np.zeros((3, norbs, norbs), dtype=np.complex128) - res[0] = get_sx(ll) - res[1] = get_sy(ll) - res[2] = get_sz(ll) - - return res
- - - -
-[docs] -def euler_to_rmat(alpha, beta, gamma): - """ - Given Euler angle: :math:`\\alpha, \\beta, \\gamma`, - generate the :math:`3 \\times 3` rotational matrix :math:`R`. - - Parameters - ---------- - alpha: float - Euler angle, in radian, [0, :math:`2\\pi`] - beta: float - Euler angle, in radian, [0, :math:`\\pi`] - gamma: float - Euler angle, in radian, [0, :math:`2\\pi`] - - Returns - ------- - rmat: 2d float array - The :math:`3 \\times 3` rotational matrix. - """ - - rmat = np.zeros((3, 3), dtype=np.float64) - rmat[0, 0] = np.cos(alpha) * np.cos(beta) * np.cos(gamma) - np.sin(alpha) * np.sin(gamma) - rmat[0, 1] = -np.sin(gamma) * np.cos(alpha) * np.cos(beta) - np.sin(alpha) * np.cos(gamma) - rmat[0, 2] = np.cos(alpha) * np.sin(beta) - rmat[1, 0] = np.sin(alpha) * np.cos(beta) * np.cos(gamma) + np.cos(alpha) * np.sin(gamma) - rmat[1, 1] = -np.sin(gamma) * np.sin(alpha) * np.cos(beta) + np.cos(alpha) * np.cos(gamma) - rmat[1, 2] = np.sin(alpha) * np.sin(beta) - rmat[2, 0] = -np.cos(gamma) * np.sin(beta) - rmat[2, 1] = np.sin(beta) * np.sin(gamma) - rmat[2, 2] = np.cos(beta) - return rmat
- - - -
-[docs] -def rmat_to_euler(rmat): - """ - Given the :math:`3 \\times 3` rotational matrix :math:`R`, return the Euler - angles: :math:`\\alpha, \\beta, \\gamma`. - - Parameters - ---------- - rmat: 2d float array - The :math:`3 \\times 3` rotational matrix :math:`R`. - - Returns - ------- - alpha: float - Euler angle :math:`\\alpha` in radian, [0, :math:`2\\pi`]. - beta: float - Euler angle :math:`\\beta` in radian, [0, :math:`\\pi`]. - gamma: float - Euler angle :math:`\\gamma` in radian, [0, :math:`2\\pi`] - - """ - - if np.abs(rmat[2, 2]) < 1.0: - beta = np.arccos(rmat[2, 2]) - - cos_gamma = -rmat[2, 0] / np.sin(beta) - sin_gamma = rmat[2, 1] / np.sin(beta) - gamma = where_is_angle(sin_gamma, cos_gamma) - - cos_alpha = rmat[0, 2] / np.sin(beta) - sin_alpha = rmat[1, 2] / np.sin(beta) - alpha = where_is_angle(sin_alpha, cos_alpha) - else: - if rmat[2, 2] > 0: - beta = 0.0 - else: - beta = np.pi - gamma = 0.0 - alpha = np.arccos(rmat[1, 1]) - return alpha, beta, gamma
- - - -
-[docs] -def where_is_angle(sina, cosa): - """ - Given sine and cosine of an angle :math:`\\alpha`, return the - angle :math:`\\alpha` range from [0, :math:`2\\pi`]. - - Parameters - ---------- - sina: float - :math:`\\sin(\\alpha)`. - cosa: float - :math:`\\cos(\\alpha)`. - - Returns - ------- - alpha: float - The angle :math:`\\alpha` in radian [0, :math:`2\\pi`]. - """ - - if cosa > 1.0: - cosa = 1.0 - elif cosa < -1.0: - cosa = -1.0 - alpha = np.arccos(cosa) - if sina < 0.0: - alpha = 2.0 * np.pi - alpha - return alpha
- - - -
-[docs] -def dmat_spinor(alpha, beta, gamma): - """ - Given three Euler angle: :math:`\\alpha, \\beta, \\gamma`, - return the transformation - matrix for :math:`\\frac{1}{2}`-spinor. - - Parameters - ---------- - alpha: float - Euler angle :math:`\\alpha` in radian [0, :math:`2\\pi`]. - beta: float - Euler angle :math:`\\beta` in radian [0, :math:`\\pi`]. - gamma: float - Euler angle :math:`\\gamma` in radian [0, :math:`2\\pi`]. - - Returns - ------- - dmat: 2d complex array - The :math:`2 \\times 2` transformation matrix. - """ - - dmat = np.zeros((2, 2), dtype=np.complex128) - dmat[0, 0] = np.exp(-(alpha + gamma) / 2.0 * 1j) * np.cos(beta / 2.0) - dmat[0, 1] = -np.exp(-(alpha - gamma) / 2.0 * 1j) * np.sin(beta / 2.0) - dmat[1, 0] = np.exp((alpha - gamma) / 2.0 * 1j) * np.sin(beta / 2.0) - dmat[1, 1] = np.exp((alpha + gamma) / 2.0 * 1j) * np.cos(beta / 2.0) - return dmat
- - - -
-[docs] -def zx_to_rmat(z, x): - """ - Given :math:`z` vector and :math:`x` vector, calculate :math:`y` vector - which satisfies the right-hand Cartesian coordinate and normalize them to - unit if needed, and then return the :math:`3 \\times 3` - rotational matrix :math:`R`. - - Parameters - ---------- - z: 1d float array - The :math:`z` vector. - x: 1d float array - The :math:`x` vector. - - Returns - ------- - rmat: 2d float array - The :math:`3 \\times 3` rotational matrix :math:`R`. - """ - - z = np.array(z, dtype=np.float64) - x = np.array(x, dtype=np.float64) - xx = x / np.sqrt(np.dot(x, x)) - zz = z / np.sqrt(np.dot(z, z)) - yy = np.cross(zz, xx) - - rmat = np.zeros((3, 3), dtype=np.float64) - rmat[:, 0] = xx - rmat[:, 1] = yy - rmat[:, 2] = zz - - return rmat
- - - -
-[docs] -def get_wigner_dmat(quant_2j, alpha, beta, gamma): - """ - Given quantum number and Euler angles, return the Wigner-D matrix. - - Parameters - ---------- - quant_2j: int - Twice of the quantum number j: 2j, for example, quant_2j=1 means j=1/2, - quant_2j=2 means j=1 - alpha: float number - The first Euler angle :math:`\\alpha` in radian [0, :math:`2\\pi`]. - beta: float number - The second Euler angle :math:`\\beta` in radian [0, :math:`\\pi`]. - gamma: float number - The third Euler angle :math:`\\gamma` in radian [0, :math:`2\\pi`]. - - Returns - ------- - result: 2d complex array, shape(quant_2j+1, quant_2j+1) - The Wigner D-matrix. - For :math:`j=1/2`, the orbital order is: +1/2 (spin up), -1/2 (spin down). - For :math:`j>1/2`, the orbital order is: :math:`-j, -j+1, ..., +j` - - Examples - -------- - >>> import edrixs - spin-1/2 D-matrix - >>> edrixs.get_wigner_dmat(1, 1, 2, 3) - array([[-0.224845-0.491295j, -0.454649-0.708073j], - [ 0.454649-0.708073j, -0.224845+0.491295j]]) - j=1 D-matrix - >>> edrixs.get_wigner_dmat(2, 1, 2, 3) - array([[-0.190816-0.220931j, 0.347398+0.541041j, -0.294663-0.643849j], - [ 0.636536-0.090736j, -0.416147+0.j , -0.636536-0.090736j], - [-0.294663+0.643849j, -0.347398+0.541041j, -0.190816+0.220931j]]) - """ - - from sympy.physics.quantum.spin import Rotation - from sympy import N, S - ndim = quant_2j + 1 - result = np.zeros((ndim, ndim), dtype=complex) - # For j=1/2, we use different orbital order: first +1/2, then -1/2 - if quant_2j == 1: - for i, mi in enumerate(range(quant_2j, -quant_2j-1, -2)): - for j, mj in enumerate(range(quant_2j, -quant_2j-1, -2)): - rot = Rotation.D(S(quant_2j)/2, S(mi)/2, S(mj)/2, alpha, beta, gamma) - result[i, j] = N(rot.doit()) - # For j > 1/2, the order is -j, -j+1, ..., +j - else: - for i, mi in enumerate(range(-quant_2j, quant_2j+1, 2)): - for j, mj in enumerate(range(-quant_2j, quant_2j+1, 2)): - rot = Rotation.D(S(quant_2j)/2, S(mi)/2, S(mj)/2, alpha, beta, gamma) - result[i, j] = N(rot.doit()) - - return result
- - - -
-[docs] -def cf_cubic_d(ten_dq): - """ - Given 10Dq, return cubic crystal field matrix for d orbitals - in the complex harmonics basis. - - Parameters - ---------- - ten_dq: float scalar - The splitting between :math:`eg` and :math:`t2g` orbitals. - - Returns - ------- - cf: 2d complex array, shape=(10, 10) - The matrix form of crystal field Hamiltonian in complex harmonics basis. - """ - - tmp = np.zeros((5, 5), dtype=complex) - tmp[0, 0] = 0.6 * ten_dq # dz2 - tmp[1, 1] = -0.4 * ten_dq # dzx - tmp[2, 2] = -0.4 * ten_dq # dzy - tmp[3, 3] = 0.6 * ten_dq # dx2-y2 - tmp[4, 4] = -0.4 * ten_dq # dxy - cf = np.zeros((10, 10), dtype=complex) - cf[0:10:2, 0:10:2] = tmp - cf[1:10:2, 1:10:2] = tmp - - cf[:, :] = cb_op(cf, tmat_r2c('d', True)) - - return cf
- - - -
-[docs] -def cf_tetragonal_d(ten_dq, d1, d3): - """ - Given 10Dq, d1, d3, return tetragonal crystal field matrix for d orbitals - in the complex harmonics basis. - - Parameters - ---------- - ten_dq: float scalar - Parameter used to label cubic crystal splitting. - d1: float scalar - Paramter used to label tetragonal splitting. - d3: float scalar - Paramter used to label tetragonal splitting. - - Returns - ------- - cf: 2d complex array, shape=(10, 10) - The matrix form of crystal field Hamiltonian in complex harmonics basis. - """ - - dt = (3.0 * d3 - 4.0 * d1) / 35 - ds = (d3 + d1) / 7.0 - dq = ten_dq / 10.0 - - tmp = np.zeros((5, 5), dtype=complex) - tmp[0, 0] = 6 * dq - 2 * ds - 6 * dt # d3z2-r2 - tmp[1, 1] = -4 * dq - 1 * ds + 4 * dt # dzx - tmp[2, 2] = -4 * dq - 1 * ds + 4 * dt # dzy - tmp[3, 3] = 6 * dq + 2 * ds - 1 * dt # dx2-y2 - tmp[4, 4] = -4 * dq + 2 * ds - 1 * dt # dxy - - cf = np.zeros((10, 10), dtype=complex) - cf[0:10:2, 0:10:2] = tmp - cf[1:10:2, 1:10:2] = tmp - - cf[:, :] = cb_op(cf, tmat_r2c('d', True)) - - return cf
- - - -
-[docs] -def cf_trigonal_t2g(delta): - """ - Given delta, return trigonal crystal field matrix for t2g orbitals - in the complex harmonics basis. - - Parameters - ---------- - delta: float scalar - Parameter used to label trigonal crystal splitting. - - Returns - ------- - cf: 2d complex array, shape=(6, 6) - The matrix form of crystal field Hamiltonian in complex harmonics basis. - """ - - tmp = np.array([[0, delta, delta], - [delta, 0, delta], - [delta, delta, 0]]) - cf = np.zeros((6, 6), dtype=complex) - cf[0:6:2, 0:6:2] += tmp - cf[1:6:2, 1:6:2] += tmp - cf[:, :] = cb_op(cf, tmat_r2c('t2g', True)) - - return cf
- - - -
-[docs] -def cf_square_planar_d(ten_dq, ds): - """ - Given 10Dq, ds, return square planar crystal field matrix for d orbitals - in the complex harmonics basis. This is the limit of strong tetragonal - distortion with two axial ligands at infinity. Note that in this case the - three parameters, ten_dq, ds, and dt, are no longer independent: - dt = 2/35*ten_dq and the levels depend on only two parameters - ten_dq and ds. - - Parameters - ---------- - ten_dq: float scalar - Parameter associated with eg-t2g splitting. - ds: float scalar - Paramter associated with splitting orbitals with - z-components. - - Returns - ------- - cf: 2d complex array, shape=(10, 10) - The matrix form of crystal field Hamiltonian in complex harmonics basis. - """ - tmp = np.zeros((5, 5), dtype=complex) - tmp[0, 0] = 9/35*ten_dq - 2*ds # d3z2-r2 - tmp[1, 1] = -6/35*ten_dq - ds # dzx - tmp[2, 2] = -6/35*ten_dq - ds # dzy - tmp[3, 3] = 19/35*ten_dq + 2*ds # dx2-y2 - tmp[4, 4] = -16/35*ten_dq + 2*ds # dxy - - cf = np.zeros((10, 10), dtype=complex) - cf[0:10:2, 0:10:2] = tmp - cf[1:10:2, 1:10:2] = tmp - - cf[:, :] = cb_op(cf, tmat_r2c('d', True)) - - return cf
- - - -def cf_tetragonal_t2g(ten_dq, d1, d3): - """ - Given 10Dq, d1, d3, return tetragonal crystal field matrix for t2g orbitals - in the complex harmonics basis. - - Parameters - ---------- - ten_dq: float scalar - Parameter used to label cubic crystal splitting. - d1: float scalar - Paramter used to label tetragonal splitting. - d3: float scalar - Paramter used to label tetragonal splitting. - - Returns - ------- - cf: 2d complex array, shape=(6, 6) - The matrix form of crystal field Hamiltonian in complex harmonics basis. - """ - dt = (3.0 * d3 - 4.0 * d1) / 35 - ds = (d3 + d1) / 7.0 - dq = ten_dq / 10.0 - - tmp = np.zeros((3, 3), dtype=complex) - tmp[0, 0] = -4 * dq - 1 * ds + 4 * dt # dxz - tmp[1, 1] = -4 * dq - 1 * ds + 4 * dt # dyz - tmp[2, 2] = -4 * dq + 2 * ds - 1 * dt # dxy - - cf = np.zeros((6, 6), dtype=complex) - cf[0:6:2, 0:6:2] += tmp - cf[1:6:2, 1:6:2] += tmp - cf[:, :] = cb_op(cf, tmat_r2c('t2g', True)) - return cf -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/basis_transform.html b/edrixs/_modules/edrixs/basis_transform.html deleted file mode 100644 index aeb00c772c..0000000000 --- a/edrixs/_modules/edrixs/basis_transform.html +++ /dev/null @@ -1,646 +0,0 @@ - - - - - - - - edrixs.basis_transform — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.basis_transform

-__all__ = ['cb_op', 'cb_op2', 'tmat_c2r', 'tmat_r2c', 'tmat_r2cub_f',
-           'tmat_cub2r_f', 'tmat_c2j', 'transform_utensor', 'fourier_hr2hk']
-
-import numpy as np
-
-
-
-[docs] -def cb_op(oper_O, TL, TR=None): - """ - Change the basis of an operator :math:`\\hat{O}`. - - .. math:: - - O^{\\prime} = (T_L)^{\\dagger} O (T_R), - - Parameters - ---------- - oper_O: array-like - At least 2-dimension, the last 2-dimension is the dimension of the - matrix form of operator :math:`\\hat{O}` in basis :math:`A`. - For example: - - - oper_O.shape = (3, 10, 10), means 3 operators with dimension :math:`10 \\times 10` - - - oper_O.shape = (2, 3, 10, 10), means :math:`2 \\times 3=6` operators with - dimension :math:`10 \\times 10` - TL: 2d array - The unitary transformation matrix from basis :math:`A` to - basis :math:`B`, namely, - - :math:`TL_{ij} = <\\psi^{A}_{i}|\\phi^{B}_{j}>`. - - TR: 2d array - The unitary transformation matrix from basis :math:`A` to - basis :math:`B`, namely, - - :math:`TR_{ij} = <\\psi^{A}_{i}|\\phi^{B}_{j}>`. - - if TR = None, TR = TL - - Returns - ------- - res: same shape as oper_O - The matrices form of operators :math:`\\hat{O}` in new basis. - """ - oper_O = np.array(oper_O, order='C') - dim = oper_O.shape - if TR is None: - TR = TL - if len(dim) < 2: - raise Exception("Dimension of oper_O should be at least 2") - elif len(dim) == 2: - res = np.dot(np.dot(np.conj(np.transpose(TL)), oper_O), TR) - else: - tot = np.prod(dim[0:-2]) - tmp_oper = oper_O.reshape((tot, dim[-2], dim[-1])) - for i in range(tot): - tmp_oper[i] = np.dot(np.dot(np.conj(np.transpose(TL)), tmp_oper[i]), TR) - res = tmp_oper.reshape(dim) - - return res
- - - -
-[docs] -def cb_op2(oper_O, TL, TR): - """ - Change the basis of an operator :math:`\\hat{O}`. - - .. math:: - - O^{\\prime} = (T_L)^{\\dagger} O (T_R), - - - Parameters - ---------- - oper_O: array-like - At least 2-dimension, the last 2-dimension is the dimension of the - matrix form of operator :math:`\\hat{O}` in basis :math:`A`. - For example: - - - oper_O.shape = (3, 10, 10), means 3 operatos with dimension :math:`10 \\times 10` - - - oper_O.shape = (2, 3, 10, 10), means :math:`2 \\times 3=6` operators with - dimension :math:`10 \\times 10` - TL: 2d array - The unitary transformation matrix applied on the left. - TR: 2d array - The unitary transformation matrix applied on the right. - - Returns - ------- - res: same shape as oper_O - The matrices form of operators :math:`\\hat{O}` in new basis. - """ - oper_O = np.array(oper_O, order='C') - dim = oper_O.shape - if len(dim) < 2: - raise Exception("Dimension of oper_O should be at least 2") - elif len(dim) == 2: - res = np.dot(np.dot(np.conj(np.transpose(TL)), oper_O), TR) - else: - tot = np.prod(dim[0:-2]) - tmp_oper = oper_O.reshape((tot, dim[-2], dim[-1])) - for i in range(tot): - tmp_oper[i] = np.dot(np.dot(np.conj(np.transpose(TL)), tmp_oper[i]), TR) - res = tmp_oper.reshape(dim) - - return res
- - - -
-[docs] -def tmat_c2r(case, ispin=False): - """ - Get the unitary transformation matrix from the basis of complex - spherical harmonics to real spherical harmonics. - - Parameters - ---------- - case: string - Label for different systems. - - - 'p': for :math:`p`-shell - - 't2g': for :math:`t_{2g}`-shell - - 'd': for :math:`d`-shell - - 'f': for :math:`f`-shell - ispin: logical - Whether including spin degree of freedom or not (default: False). - - Returns - ------- - t_c2r: 2d complex array - The transformation matrix. - """ - - sqrt2 = np.sqrt(2.0) - ci = np.complex128(0.0 + 1.0j) - cone = np.complex128(1.0 + 0.0j) - - # p orbitals: px, py, pz - if case.strip() == 'p': - norbs = 3 - t_c2r = np.zeros((norbs, norbs), dtype=np.complex128) - # px=1/sqrt(2)( |1,-1> - |1,1> ) - t_c2r[0, 0] = cone / sqrt2 - t_c2r[2, 0] = -cone / sqrt2 - # py=i/sqrt(2)( |1,-1> + |1,1> ) - t_c2r[0, 1] = ci / sqrt2 - t_c2r[2, 1] = ci / sqrt2 - # pz=|1,0> - t_c2r[1, 2] = cone - - # t2g orbitals in the t2g subspace, here, we use the so-called - # T-P equivalence, t2g orbitals behave like the effective orbital - # angular momentum leff=1 - # dzx ~ py, dzy ~ px, dxy ~ pz - elif case.strip() == 't2g': - norbs = 3 - t_c2r = np.zeros((norbs, norbs), dtype=np.complex128) - # dzx --> py=i/sqrt(2)( |1,-1> + |1,1> ) - t_c2r[0, 0] = ci / sqrt2 - t_c2r[2, 0] = ci / sqrt2 - # dzy --> px=1/sqrt(2)( |1,-1> - |1,1> ) - t_c2r[0, 1] = cone / sqrt2 - t_c2r[2, 1] = -cone / sqrt2 - # dxy --> pz=|1,0> - t_c2r[1, 2] = cone - - # d orbitals: dz2, dzx, dzy, dx2-y2, dxy - elif case.strip() == 'd': - norbs = 5 - t_c2r = np.zeros((norbs, norbs), dtype=np.complex128) - # dz2=|2,0> - t_c2r[2, 0] = cone - # dzx=1/sqrt(2)( |2,-1> - |2,1> ) - t_c2r[1, 1] = cone / sqrt2 - t_c2r[3, 1] = -cone / sqrt2 - # dzy=i/sqrt(2)( |2,-1> + |2,1> ) - t_c2r[1, 2] = ci / sqrt2 - t_c2r[3, 2] = ci / sqrt2 - # dx2-y2=1/sqrt(2)( |2,-2> + |2,2> ) - t_c2r[0, 3] = cone / sqrt2 - t_c2r[4, 3] = cone / sqrt2 - # dxy=i/sqrt(2)( |2,-2> - |2,2> ) - t_c2r[0, 4] = ci / sqrt2 - t_c2r[4, 4] = -ci / sqrt2 - - # f orbitals, please NOTE that this real form of the f orbitals is not the - # basis of the representation of the cubic point group, please call the - # function ``tmat_r2cub" to get the transformation matrix from this basis - # to the cubic basis that is the representation of the cubic point group. - elif case.strip() == 'f': - norbs = 7 - t_c2r = np.zeros((norbs, norbs), dtype=np.complex128) - # fz3 = |3,0> - t_c2r[3, 0] = cone - # fxz2 = 1/sqrt(2)( |3,-1> - |3,1> ) - t_c2r[2, 1] = cone / sqrt2 - t_c2r[4, 1] = -cone / sqrt2 - # fyz2 = i/sqrt(2)( |3,-1> + |3,1> ) - t_c2r[2, 2] = ci / sqrt2 - t_c2r[4, 2] = ci / sqrt2 - # fz(x2-y2) = 1/sqrt(2)( |3,-2> + |3,2> ) - t_c2r[1, 3] = cone / sqrt2 - t_c2r[5, 3] = cone / sqrt2 - # fxyz = i/sqrt(2)( |3,-2> - |3,2> ) - t_c2r[1, 4] = ci / sqrt2 - t_c2r[5, 4] = -ci / sqrt2 - # fx(x2-3y2) = 1/sqrt(2) ( |3,-3> - |3,3> ) - t_c2r[0, 5] = cone / sqrt2 - t_c2r[6, 5] = -cone / sqrt2 - # fy(3x2-y2) = i/sqrt(2) ( |3,-3> + |3,3> ) - t_c2r[0, 6] = ci / sqrt2 - t_c2r[6, 6] = ci / sqrt2 - else: - raise Exception("error in tmat_c2r: Do NOT support tmat_c2r for this case: ", case) - - # the spin order is: up dn up dn ... up dn - if ispin: - ntot_orbs = 2 * norbs - t_c2r_spin = np.zeros((ntot_orbs, ntot_orbs), dtype=np.complex128) - # spin up - t_c2r_spin[0:ntot_orbs:2, 0:ntot_orbs:2] = t_c2r - # spin dn - t_c2r_spin[1:ntot_orbs:2, 1:ntot_orbs:2] = t_c2r - return t_c2r_spin - else: - return t_c2r
- - - -
-[docs] -def tmat_r2c(case, ispin=False): - """ - Get the unitary transformation matrix from the basis of real - spherical harmonics to complex spherical harmonics. - - Parameters - ---------- - case: string - Label for different systems. - - - 'p': for :math:`p`-shell - - 't2g': for :math:`t_{2g}`-shell - - 'd': for :math:`d`-shell - - 'f': for :math:`f`-shell - ispin: logical - Whether including spin degree of freedom or not (default: False). - - Returns - ------- - t_r2c: 2d complex array - The transformation matrix. - """ - - t_r2c = np.conj(np.transpose(tmat_c2r(case, ispin))) - return t_r2c
- - - -
-[docs] -def tmat_r2cub_f(ispin=False): - """ - Get the transformation matrix from real spherical harmonics to the - cubic spherical harmonics that is the representation of the cubic - point group, only for :math:`f` system. - - Parameters - ---------- - ispin: logical - Whether including spin degree of freedom or not (default: False). - - Returns - ------- - t_r2cub: 2d complex array - The transformation matrix. - """ - - a = np.sqrt(10.0) / 4.0 + 0.0j - b = np.sqrt(6.0) / 4.0 + 0.0j - c = 1.0 + 0.0j - - norbs = 7 - t_r2cub = np.zeros((norbs, norbs), dtype=np.complex128) - - # T1u - # fx3 = -sqrt(6)/4 fxz2 + sqrt(10)/4 fx(x2-3y2) - t_r2cub[1, 0] = -b - t_r2cub[5, 0] = a - # fy3 = -sqrt(6)/4 fyz2 - sqrt(10)/4 fy(3x2-y2) - t_r2cub[2, 1] = -b - t_r2cub[6, 1] = -a - # fz3 = fz3 - t_r2cub[0, 2] = c - - # T2u - # fx(y2-z2) = -sqrt(10)/4 fxz2 - sqrt(6)/4 fx(x2-3y2) - t_r2cub[1, 3] = -a - t_r2cub[5, 3] = -b - # fy(z2-x2) = sqrt(10)/4 fyz2 - sqrt(6)/4 fy(3x2-y2) - t_r2cub[2, 4] = a - t_r2cub[6, 4] = -b - # fz(x2-y2) = fz(x2-y2) - t_r2cub[3, 5] = c - - # A2u - # fxyz = fxyz - t_r2cub[4, 6] = c - - if ispin: - ntot_orbs = 2 * norbs - t_r2cub_spin = np.zeros((ntot_orbs, ntot_orbs), dtype=np.complex128) - # spin up - t_r2cub_spin[0:ntot_orbs:2, 0:ntot_orbs:2] = t_r2cub - # spin dn - t_r2cub_spin[1:ntot_orbs:2, 1:ntot_orbs:2] = t_r2cub - return t_r2cub_spin - else: - return t_r2cub
- - - -
-[docs] -def tmat_cub2r_f(ispin=False): - """ - Get the transformation matrix from the cubic spherical harmonics to - real spherical harmonics, only for :math:`f` system. - - Parameters - ---------- - ispin: logical - Whether including spin degree of freedom or not (default: False). - - Returns - ------- - t_cub2r: 2d complex array - The transformation matrix. - """ - - t_cub2r = np.conj(np.transpose(tmat_r2cub_f(ispin))) - return t_cub2r
- - - -
-[docs] -def tmat_c2j(orb_l): - """ - Get the transformation matrix from the complex spherical harmonics to - the :math:`|j^2,j_z>` basis in which the spin-oribt coupling Hamiltonian - is diagonal. The orbital order is: - - :math:`|j=l-1/2, -j>, |j=l-1/2, -j+1>, ... |j=l-1/2, +j>,` - - :math:`|j=l+1/2, -j>, |j=l+1/2, -j+1>, ..., |j=l+1/2, +j>`. - - Parameters - ---------- - orb_l: int - Quantum number of orbital angular momentum. - - Returns - ------- - t_c2j: 2d complex array - The transformation matrix. - """ - - if orb_l == 1: - t_c2j = np.zeros((6, 6), dtype=np.complex128) - t_c2j[0, 0] = -np.sqrt(2.0 / 3.0) - t_c2j[3, 0] = np.sqrt(1.0 / 3.0) - t_c2j[2, 1] = -np.sqrt(1.0 / 3.0) - t_c2j[5, 1] = np.sqrt(2.0 / 3.0) - t_c2j[1, 2] = 1.0 - t_c2j[0, 3] = np.sqrt(1.0 / 3.0) - t_c2j[3, 3] = np.sqrt(2.0 / 3.0) - t_c2j[2, 4] = np.sqrt(2.0 / 3.0) - t_c2j[5, 4] = np.sqrt(1.0 / 3.0) - t_c2j[4, 5] = 1.0 - - return t_c2j - - elif orb_l == 2: - t_c2j = np.zeros((10, 10), dtype=np.complex128) - t_c2j[0, 0] = -np.sqrt(4.0 / 5.0) - t_c2j[3, 0] = np.sqrt(1.0 / 5.0) - t_c2j[2, 1] = -np.sqrt(3.0 / 5.0) - t_c2j[5, 1] = np.sqrt(2.0 / 5.0) - t_c2j[4, 2] = -np.sqrt(2.0 / 5.0) - t_c2j[7, 2] = np.sqrt(3.0 / 5.0) - t_c2j[6, 3] = -np.sqrt(1.0 / 5.0) - t_c2j[9, 3] = np.sqrt(4.0 / 5.0) - t_c2j[1, 4] = 1.0 - t_c2j[0, 5] = np.sqrt(1.0 / 5.0) - t_c2j[3, 5] = np.sqrt(4.0 / 5.0) - t_c2j[2, 6] = np.sqrt(2.0 / 5.0) - t_c2j[5, 6] = np.sqrt(3.0 / 5.0) - t_c2j[4, 7] = np.sqrt(3.0 / 5.0) - t_c2j[7, 7] = np.sqrt(2.0 / 5.0) - t_c2j[6, 8] = np.sqrt(4.0 / 5.0) - t_c2j[9, 8] = np.sqrt(1.0 / 5.0) - t_c2j[8, 9] = 1.0 - - return t_c2j - - elif orb_l == 3: - t_c2j = np.zeros((14, 14), dtype=np.complex128) - t_c2j[0, 0] = -np.sqrt(6.0 / 7.0) - t_c2j[3, 0] = np.sqrt(1.0 / 7.0) - t_c2j[2, 1] = -np.sqrt(5.0 / 7.0) - t_c2j[5, 1] = np.sqrt(2.0 / 7.0) - t_c2j[4, 2] = -np.sqrt(4.0 / 7.0) - t_c2j[7, 2] = np.sqrt(3.0 / 7.0) - t_c2j[6, 3] = -np.sqrt(3.0 / 7.0) - t_c2j[9, 3] = np.sqrt(4.0 / 7.0) - t_c2j[8, 4] = -np.sqrt(2.0 / 7.0) - t_c2j[11, 4] = np.sqrt(5.0 / 7.0) - t_c2j[10, 5] = -np.sqrt(1.0 / 7.0) - t_c2j[13, 5] = np.sqrt(6.0 / 7.0) - t_c2j[1, 6] = 1.0 - t_c2j[0, 7] = np.sqrt(1.0 / 7.0) - t_c2j[3, 7] = np.sqrt(6.0 / 7.0) - t_c2j[2, 8] = np.sqrt(2.0 / 7.0) - t_c2j[5, 8] = np.sqrt(5.0 / 7.0) - t_c2j[4, 9] = np.sqrt(3.0 / 7.0) - t_c2j[7, 9] = np.sqrt(4.0 / 7.0) - t_c2j[6, 10] = np.sqrt(4.0 / 7.0) - t_c2j[9, 10] = np.sqrt(3.0 / 7.0) - t_c2j[8, 11] = np.sqrt(5.0 / 7.0) - t_c2j[11, 11] = np.sqrt(2.0 / 7.0) - t_c2j[10, 12] = np.sqrt(6.0 / 7.0) - t_c2j[13, 12] = np.sqrt(1.0 / 7.0) - t_c2j[12, 13] = 1.0 - - return t_c2j - - else: - raise Exception("error in tmat_c2j: Have NOT implemented for this case: ", orb_l)
- - - -
-[docs] -def transform_utensor(umat, tmat): - """ - Transform the rank-4 Coulomb interaction tensor from one basis to - another basis. - - Parameters - ---------- - umat: 4d array - Coulomb interaction tensor (rank-4). - tmat: 2d array - The transformation matrix. - - Returns - ------- - umat_new: 4d complex array - The Coulomb interaction tensor in the new basis. - """ - - n = umat.shape[0] - umat_new = np.zeros((n, n, n, n), dtype=np.complex128) - - a1, a2, a3, a4 = np.nonzero(abs(umat) > 1E-16) - nonzero = np.stack((a1, a2, a3, a4), axis=-1) - - for ii, jj, kk, mm in nonzero: - for i in range(n): - if abs(tmat[ii, i]) < 1E-16: - continue - else: - for j in range(n): - if abs(tmat[jj, j]) < 1E-16: - continue - else: - for k in range(n): - if abs(tmat[kk, k]) < 1E-16: - continue - else: - for m in range(n): - umat_new[i, j, k, m] += (np.conj(tmat[ii, i]) * - np.conj(tmat[jj, j]) * - umat[ii, jj, kk, mm] * - tmat[kk, k] * - tmat[mm, m]) - - return umat_new
- - - -
-[docs] -def fourier_hr2hk(norbs, nkpt, kvec, nrpt, rvec, deg_rpt, hr): - """ - Fourier transform a tight-binding Hamiltonian :math:`H(r)` from - real space to :math:`k` space :math:`H(k)`, - for Wannier90. - - Parameters - ---------- - norbs: int - Number of orbitals. - nkpt: int - Number of :math:`k`-points. - kvec: 2d float array - Fractional coordinate for k-points. - nrpt: int - Number of r-points. - rvec: 2d float array - Fractional coordinate for r-points. - deg_rpt: int - The degenerancy for each r-point. - hr: 3d complex array - Hamiltonian in r-space. - - Returns - ------- - hk: 3d complex array - Hamiltonian in k-space. - """ - - hk = np.zeros((nkpt, norbs, norbs), dtype=np.complex128) - for i in range(nkpt): - for j in range(nrpt): - coef = -2 * np.pi * np.dot(kvec[i, :], rvec[j, :]) - ratio = (np.cos(coef) + np.sin(coef) * 1j) / float(deg_rpt[j]) - hk[i, :, :] = hk[i, :, :] + ratio * hr[j, :, :] - return hk
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/coulomb_utensor.html b/edrixs/_modules/edrixs/coulomb_utensor.html deleted file mode 100644 index 54d346d5f7..0000000000 --- a/edrixs/_modules/edrixs/coulomb_utensor.html +++ /dev/null @@ -1,871 +0,0 @@ - - - - - - - - edrixs.coulomb_utensor — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.coulomb_utensor

-__all__ = ['get_gaunt', 'umat_slater', 'get_umat_kanamori_ge', 'get_F0',
-           'get_umat_slater', 'get_umat_kanamori', 'get_umat_slater_3shells']
-
-import numpy as np
-from sympy.physics.wigner import gaunt
-from .basis_transform import tmat_c2r, tmat_r2c, tmat_c2j, transform_utensor
-from .utils import info_atomic_shell, case_to_shell_name, slater_integrals_name
-
-
-
-[docs] -def get_gaunt(l1, l2): - """ - Calculate the Gaunt coefficents :math:`C_{l_1,l_2}(k,m_1,m_2)` - - .. math:: - - C_{l_1,l_2}(k,m_1,m_2)=\\sqrt{\\frac{4\\pi}{2k+1}} \\int - \\mathop{d\\phi} \\mathop{d\\theta} sin(\\theta) - Y_{l_1}^{m_1\\star}(\\theta,\\phi) Y_{k}^{m_1-m_2}(\\theta,\\phi) - Y_{l_2}^{m_2}(\\theta,\\phi) - - Parameters - ---------- - l1: int - The first quantum number of angular momentum. - l2: int - The second quantum number of angular momentum. - - Returns - ------- - res: 3d float array - The calculated Gaunt coefficents. - - The 1st index (:math:`= 0, 1, ..., l_1+l_2+1`) is the order :math:`k`. - - The 2nd index (:math:`= 0, 1, ... ,2l_1`) is the magnetic quantum - number :math:`m_1` plus :math:`l_1` - - The 3nd index (:math:`= 0, 1, ... ,2l_2`) is the magnetic quantum - number :math:`m_2` plus :math:`l_2` - - Notes - ----- - It should be noted that :math:`C_{l_1,l_2}(k,m_1,m_2)` is - nonvanishing only when - - :math:`k + l_1 + l_2 = \\text{even}`, - - and - - :math:`|l_1 - l_2| \\leq k \\leq l_1 + l_2`. - - Please see Ref. [1]_ p. 10 for more details. - - References - ---------- - .. [1] Sugano S, Tanabe Y and Kamimura H. 1970. Multiplets of - Transition-Metal Ions in Crystals. Academic Press, New York and London. - - Examples - -------- - >>> import edrixs - - Get gaunt coefficients between :math:`p`-shell and :math:`d`-shell - - >>> g = edrixs.get_gaunt(1, 2) - - """ - - from sympy import N - res = np.zeros((l1 + l2 + 1, 2 * l1 + 1, 2 * l2 + 1), dtype=np.float64) - for k in range(l1 + l2 + 1): - if not (np.mod(l1 + l2 + k, 2) == 0 and np.abs(l1 - l2) <= k <= l1 + l2): - continue - for i1, m1 in enumerate(range(-l1, l1 + 1)): - for i2, m2 in enumerate(range(-l2, l2 + 1)): - res[k, i1, i2] = (N(gaunt(l1, k, l2, -m1, m1 - m2, m2)) * - (-1.0)**m1 * np.sqrt(4 * np.pi / (2 * k + 1))) - return res
- - - -
-[docs] -def umat_slater(l_list, fk): - """ - Calculate the Coulomb interaction tensor which is parameterized by - Slater integrals :math:`F^{k}`: - - .. math:: - - U_{m_{l_i}m_{s_i}, m_{l_j}m_{s_j}, m_{l_t}m_{s_t}, - m_{l_u}m_{s_u}}^{i,j,t,u} - =\\frac{1}{2} \\delta_{m_{s_i},m_{s_t}}\\delta_{m_{s_j},m_{s_u}} - \\delta_{m_{l_i}+m_{l_j}, m_{l_t}+m_{l_u}} - \\sum_{k}C_{l_i,l_t}(k,m_{l_i},m_{l_t})C_{l_u,l_j} - (k,m_{l_u},m_{l_j})F^{k}_{i,j,t,u} - - where :math:`m_s` is the magnetic quantum number for spin - and :math:`m_l` is the magnetic quantum number for orbital. - :math:`F^{k}_{i,j,t,u}` are Slater integrals. - :math:`C_{l_i,l_j}(k,m_{l_i},m_{l_j})` are Gaunt coefficients. - - Parameters - ---------- - l_list: list of int - contains the quantum number of orbital angular momentum - :math:`l` for each shell. - fk: dict of float - contains all the possible Slater integrals between the shells - in l_list, the key is a tuple of 5 ints (:math:`k,i,j,t,u`), - where :math:`k` is the order, - :math:`i,j,t,u` are the shell indices begin with 1. - - Returns - ------- - umat: 4d array of complex - contains the Coulomb interaction tensor. - - Examples - -------- - >>> import edrixs - - For only one :math:`d`-shell - - >>> l_list = [2] - >>> fk={} - >>> F0, F2, F4 = 5.0, 4.0 2.0 - >>> fk[(0,1,1,1,1)] = F0 - >>> fk[(2,1,1,1,1)] = F2 - >>> fk[(4,1,1,1,1)] = F4 - >>> umat_d = edrixs.umat_slater(l_list, fk) - - For one :math:`d`-shell and one :math:`p`-shell - - >>> l_list = [2,1] - >>> fk={} - >>> F0_dd, F2_dd, F4_dd = 5.0, 4.0, 2.0 - >>> F0_dp, F2_dp = 4.0, 2.0 - >>> G1_dp, G3_dp = 2.0, 1.0 - >>> F0_pp, F2_pp = 2.0, 1.0 - - >>> fk[(0,1,1,1,1)] = F0_dd - >>> fk[(2,1,1,1,1)] = F2_dd - >>> fk[(4,1,1,1,1)] = F4_dd - - >>> fk[(0,1,2,1,2)] = F0_dp - >>> fk[(0,2,1,2,1)] = F0_dp - >>> fk[(2,1,2,1,2)] = F2_dp - >>> fk[(2,2,1,2,1)] = F2_dp - - >>> fk[(1,1,2,2,1)] = G1_dp - >>> fk[(1,2,1,1,2)] = G1_dp - >>> fk[(3,1,2,2,1)] = G3_dp - >>> fk[(3,2,1,1,2)] = G3_dp - - >>> fk[(0,2,2,2,2)] = F0_pp - >>> fk[(2,2,2,2,2)] = F2_pp - - >>> umat_dp = edrixs.umat_slater(l_list, fk) - - See also - -------- - coulomb_utensor.get_umat_slater - coulomb_utensor.get_umat_kanamori - coulomb_utensor.get_umat_kanamori_ge - """ - k_list = list(range(0, 2 * max(l_list) + 1)) - ck = {} - orb_label = [] - # for each shell - for i, l in enumerate(l_list): - # magnetic quantum number - for m in range(-l, l + 1): - # spin part, up,dn - for spin in range(2): - orb_label.append((i + 1, l, m, spin)) - - # all the possible gaunt coefficient - for l1 in l_list: - for l2 in l_list: - ck_tmp = get_gaunt(l1, l2) - for m1 in range(-l1, l1 + 1): - for m2 in range(-l2, l2 + 1): - for k in k_list: - if (np.mod(l1 + l2 + k, 2) == 0 and np.abs(l1 - l2) <= k <= l1 + l2): - ck[(k, l1, m1, l2, m2)] = ck_tmp[k, m1 + l1, m2 + l2] - else: - ck[(k, l1, m1, l2, m2)] = 0 - - # build the coulomb interaction tensor - norbs = len(orb_label) - umat = np.zeros((norbs, norbs, norbs, norbs), dtype=np.complex128) - for orb1 in range(norbs): - for orb2 in range(norbs): - for orb3 in range(norbs): - for orb4 in range(norbs): - i1, l1, m1, sigma1 = orb_label[orb1] - i2, l2, m2, sigma2 = orb_label[orb2] - i3, l3, m3, sigma3 = orb_label[orb3] - i4, l4, m4, sigma4 = orb_label[orb4] - if (m1 + m2) != (m3 + m4): - continue - if (sigma1 != sigma3) or (sigma2 != sigma4): - continue - res = 0.0 - for k in k_list: - tmp_key = (k, i1, i2, i3, i4) - if tmp_key in list(fk.keys()): - res += ck[(k, l1, m1, l3, m3)] * ck[(k, l4, m4, l2, m2)] * fk[tmp_key] - umat[orb1, orb2, orb4, orb3] = res - - umat = umat / 2.0 - return umat
- - - -
-[docs] -def get_umat_kanamori_ge(norbs, U1, U2, J, Jx, Jp): - """ - Calculate the Coulomb interaction tensor for a Kanamori-type interaction. - For the general case, it is parameterized by :math:`U_1, U_2, J, J_x, J_p`. - - Parameters - ---------- - norbs: int - number of orbitals (including spin). - U1: float - Hubbard :math:`U` for electrons residing on the same orbital with opposite spin. - U2: float - Hubbard :math:`U` for electrons residing on different orbitals. - J: float - Hund's coupling for density-density interaction. - Jx: float - Hund's coupling for spin flip. - Jp: float - Hund's coupling for pair-hopping. - - Returns - ------- - umat: 4d complex array - The calculated Coulomb interaction tensor - - Notes - ----- - The order of spin index is: up, down, up, down, ..., up, down. - - See Also - -------- - coulomb_utensor.get_umat_kanamori - coulomb_utensor.get_umat_slater - coulomb_utensor.umat_slater - - """ - - umat = np.zeros((norbs, norbs, norbs, norbs), dtype=np.complex128) - for alpha in range(0, norbs - 1): - for beta in range(alpha + 1, norbs): - for gamma in range(0, norbs - 1): - for delta in range(gamma + 1, norbs): - aband = alpha // 2 - aspin = alpha % 2 - bband = beta // 2 - bspin = beta % 2 - gband = gamma // 2 - gspin = gamma % 2 - dband = delta // 2 - dspin = delta % 2 - - dtmp = 0.0 - if ((alpha == gamma) and (beta == delta)): - if ((aband == bband) and (aspin != bspin)): - dtmp = dtmp + U1 - - if ((alpha == gamma) and (beta == delta)): - if (aband != bband): - dtmp = dtmp + U2 - - if ((alpha == gamma) and (beta == delta)): - if ((aband != bband) and (aspin == bspin)): - dtmp = dtmp - J - - if ((aband == gband) and (bband == dband)): - if ((aspin != gspin) and (bspin != dspin) - and (aspin != bspin)): - dtmp = dtmp - Jx - - if ((aband == bband) and (dband == gband) - and (aband != dband)): - if ((aspin != bspin) and (dspin != gspin) - and (aspin == gspin)): - dtmp = dtmp + Jp - - umat[alpha, beta, delta, gamma] = dtmp - - return umat
- - - -def get_F0(case, *args): - case = case.strip() - if case == 's': - return 0.0 - - elif case == 'p': - F2 = args[0] - return 2.0 / 25.0 * F2 - - elif case == 'd': - F2, F4 = args[0:2] - return 2.0 / 63.0 * F2 + 2.0 / 63.0 * F4 - - elif case == 'f': - F2, F4, F6 = args[0:3] - return 4.0 / 195.0 * F2 + 2.0 / 143.0 * F4 + 100.0 / 5577.0 * F6 - - elif case == 'ss': - G0 = args[0] - return 0.5 * G0 - - elif case == 'sp' or case == 'ps': - G1 = args[0] - return 1.0 / 6.0 * G1 - - elif case == 'sd' or case == 'ds': - G2 = args[0] - return 1.0 / 10.0 * G2 - - elif case == 'sf' or case == 'fs': - G3 = args[0] - return 1.0 / 14.0 * G3 - - elif case == 'pp': - G0, G2 = args[0:2] - return 1.0 / 6.0 * G0 + 1.0 / 15.0 * G2 - - elif case == 'pd' or case == 'dp': - G1, G3 = args[0:2] - return 1.0 / 15.0 * G1 + 3.0 / 70.0 * G3 - - elif case == 'pf' or case == 'fp': - G2, G4 = args[0:2] - return 3.0 / 70.0 * G2 + 2.0 / 63.0 * G4 - - elif case == 'dd': - G0, G2, G4 = args[0:3] - return 1.0 / 10.0 * G0 + 1.0 / 35.0 * G2 + 1.0 / 35.0 * G4 - - elif case == 'df' or case == 'fd': - G1, G3, G5 = args[0:3] - return 3.0 / 70.0 * G1 + 2.0 / 105.0 * G3 + 5.0 / 231.0 * G5 - - elif case == 'ff': - G0, G2, G4, G6 = args[0:4] - return 1.0 / 14.0 * G0 + 2.0 / 105.0 * G2 + 1.0 / 77.0 * G4 + 50.0 / 3003.0 * G6 - - else: - raise Exception("error in get_F0(): Unknown case name:", case) - - -
-[docs] -def get_umat_slater(case, *args): - """ - Convenient adapter function to return the Coulomb interaction tensor for common case. - - Parameters - ---------- - case: string - Indicates atomic shells, should be one of - - For single shell: - - - 's': single :math:`s`-shell (:math:`l=0`) - - 'p': single :math:`p`-shell (:math:`l=1`) - - 'p12': single :math:`p_{1/2}`-shell (:math:`l=1`) - - 'p32': single :math:`p_{3/2}`-shell (:math:`l=1`) - - 't2g': single :math:`t_{2g}`-shell (:math:`l_{\\text{eff}}=1`) - - 'd': single :math:`d`-shell (:math:`l=2`) - - 'd32': single :math:`d_{3/2}`-shell (:math:`l=2`) - - 'd52': single :math:`d_{5/2}`-shell (:math:`l=2`) - - 'f': single :math:`f`-shell (:math:`l=3`) - - 'f52': single :math:`f_{5/2}`-shell (:math:`l=3`) - - 'f72': single :math:`f_{7/2}`-shell (:math:`l=3`) - - For two shells: - - case = str1 + str2 - - where, str1 and str2 are strings and they can be any of - - ['s', 'p', 'p12', 'p32', 't2g', 'd', 'd32', 'd52', 'f', 'f52', 'f72'] - - For examples, - - - 'dp': 1st :math:`d`-shell and 2nd :math:`p`-shell - - 'dp12': 1st :math:`d`-shell and 2nd :math:`p_{1/2}`-shell - - 'f52p32': 1st :math:`f_{5/2}`-shell and 2nd :math:`p_{3/2}`-shell - - 't2gp': 1st :math:`t_{2g}`-shell and 2nd :math:`p`-shell - - *args: floats - Variable length argument list. Slater integrals. - The order of these integrals shoule be - - For only one shell case, - - args = [F0, F2, F4, F6, ....] - - For two shells case, - - args = [FX_11, FX_12, GX_12, FX_22] - - where, 1 (2) means 1st (2nd)-shell, and X=0, 2, 4, ... or X=1, 3, 5 ..., - and X should be in ascending order. The following are possible cases: - - - 's': - - args = [F0] - - - 'p', 'p12', 'p32': - - args = [F0, F2] - - - 'd', 'd32', 'd52', 't2g': - - args = [F0, F2, F4] - - - 'f', 'f52', 'f72': - - args = [F0, F2, F4, F6] - - - 'ss': - - args = [F0_11, F0_12, G0_12, F0_22] - - - 'ps', 'p12s', 'p32s': - - args = [F0_11, F2_11, F0_12, G1_12, F0_22] - - - 'ds', 'd32s', 'd52s', 't2gs': - - args = [F0_11, F2_11, F4_11, F0_12, G2_12, F0_22] - - - 'fs', 'f52s', 'f72s': - - args = [F0_11, F2_11, F4_11, F6_11, F0_12, G3_12, F0_22] - - - 'sp', 'sp12', 'sp32': - - args = [F0_11, F0_12, G1_12, F0_22, F2_22] - - - 'pp', 'pp12', 'pp32', 'p12p', 'p12p12', 'p12p32', 'p32p', 'p32p12', 'p32p32': - - args = [F0_11, F2_11, F0_12, F2_12, G0_12, G2_12, F0_22, F2_22] - - - 'dp', 'dp12', 'dp32', 'd32p', 'd32p12', 'd32p32', 'd52p', 'd52p12', 'd52p32', - 't2gp', 't2gp12', t2gp32': - - args = [F0_11, F2_11, F4_11, F0_12, F2_12, G1_12, G3_12, F0_22, F2_22] - - - 'fp', 'fp12', 'fp32', 'f52p', 'f52p12', 'f52p32', 'f72p', 'f72p12', 'f72p32': - - args = [F0_11, F2_11, F4_11, F6_11, F0_12, F2_12, G2_12, G4_12, F0_22, F2_22] - - - 'sd', 'sd32', 'sd52': - - args = [F0_11, F0_12, G2_12, F0_22, F2_22, F4_22] - - - 'pd', 'pd32', 'pd52', 'p12d', 'p12d32', 'p12d52', 'p32d', 'p32d32', 'p32d52': - - args = [F0_11, F2_11, F0_12, F2_12, G1_12, G3_12, F0_22, F2_22, F4_22] - - - 'dd', 'dd32', 'dd52', 'd32d', 'd32d32', 'd32d52', 'd52d', 'd52d32', 'd52d52', - 't2gd', 't2gd32', 't2gd52': - - args = [F0_11, F2_11, F4_11, F0_12, F2_12, F4_12, G0_12, G2_12, G4_12, F0_22, F2_22, F4_22] - - - 'fd', 'fd32', 'fd52', 'f52d', 'f52d32', 'f52d52', 'f72d', 'f72d32', 'f72d52': - - args = [F0_11, F2_11, F4_11, F6_11, F0_12, F2_12, F4_12, G1_12, G3_12, G5_12, - F0_22, F2_22, F4_22] - - - 'sf', 'sf52', 'sf72': - - args = [F0_11, F0_12, G3_12, F0_22, F2_22, F4_22, F6_22] - - - 'pf', 'pf52', 'pf72', 'p12f', 'p12f52', 'p12f72', 'p32f', 'p32f52', 'p32f72': - - args = [F0_11, F2_11, F0_12, F2_12, G2_12, G4_12, F0_22, F2_22, F4_22, F6_22] - - - 'df', 'df52', 'df72', 'd32f', 'd32f52', 'd32f72', 'd52f', 'd52f52', 'd52f72', - 't2gf', 't2gf52', 't2gf72': - - args = [F0_11, F2_11, F4_11, F0_12, F2_12, F4_12, G1_12, G3_12, G5_12, - F0_22, F2_22, F4_22, F6_22] - - - 'ff', 'ff52', 'ff72', 'f52f', 'f52f52', 'f52f72', 'f72f', 'f72f52', 'f72f72': - - args = [F0_11, F2_11, F4_11, F6_11, F0_12, F2_12, F4_12, F6_12, - G0_12, G2_12, G4_12, G6_12, F0_22, F2_22, F4_22, F6_22] - - Returns - ------- - umat: 4d array of complex - the Coulomb interaction tensor - - Examples - -------- - >>> import edrixs - >>> F0_dd, F2_dd, F4_dd = 3.0, 1.0, 0.5 - >>> F0_dp, F2_dp, G1_dp, G3_dp = 2.0, 1.0, 0.2, 0.1 - >>> F0_pp, F2_pp = 0.0, 0.0 - >>> slater = [F0_dd, F2_dd, F4_dd, F0_dp, F2_dp, G1_dp, G3_dp, F0_pp, F2_pp] - >>> umat_d = edrixs.get_umat_slater('d', F0_dd, F2_dd, F4_dd) - >>> umat_dp = edrixs.get_umat_slater('dp', *slater) - >>> umat_t2gp = edrixs.get_umat_slater('t2gp', *slater) - >>> umat_dp32 = edrixs.get_umat_slater('dp32', *slater) - - See Also - -------- - coulomb_utensor.umat_slater - coulomb_utensor.get_umat_kanamori - coulomb_utensor.get_umat_kanamori_ge - - """ - info = info_atomic_shell() - shells = case_to_shell_name(case) - nslat = len(slater_integrals_name(shells)) - if nslat != len(args): - raise Exception("Number of Slater integrals", len(args), " is not equal to ", nslat) - - special_shell = ['t2g', 'p12', 'p32', 'd32', 'd52', 'f52', 'f72'] - orb_indx = { - special_shell[0]: [2, 3, 4, 5, 8, 9], - special_shell[1]: [0, 1], - special_shell[2]: [2, 3, 4, 5], - special_shell[3]: [0, 1, 2, 3], - special_shell[4]: [4, 5, 6, 7, 8, 9], - special_shell[5]: [0, 1, 2, 3, 4, 5], - special_shell[6]: [6, 7, 8, 9, 10, 11, 12, 13] - } - # only one shell - if len(shells) == 1: - orbl = info[shells[0]][0] - l_list = [orbl] - fk = {} - it = 0 - for rank in range(0, 2*orbl+1, 2): - fk[(rank, 1, 1, 1, 1)] = args[it] - it += 1 - umat = umat_slater(l_list, fk) - # truncate to a sub-shell if necessary - if shells[0] in special_shell: - if shells[0] == 't2g': - tmat = tmat_c2r('d', True) - else: - tmat = tmat_c2j(orbl) - umat = transform_utensor(umat, tmat) - indx = orb_indx[shells[0]] - umat_tmp = np.zeros((len(indx), len(indx), len(indx), len(indx)), dtype=complex) - umat_tmp[:, :, :, :] = umat[indx][:, indx][:, :, indx][:, :, :, indx] - if shells[0] == 't2g': - umat_tmp[:, :, :, :] = transform_utensor(umat_tmp, tmat_r2c('t2g', True)) - umat = umat_tmp - # two shells - elif len(shells) == 2: - name1, name2 = shells - l1, l2 = info[name1][0], info[name2][0] - n1, n2 = 2*(2*l1+1), 2*(2*l2+1) - ntot = n1 + n2 - l_list = [l1, l2] - fk = {} - it = 0 - for rank in range(0, 2 * l1 + 1, 2): - fk[(rank, 1, 1, 1, 1)] = args[it] - it += 1 - for rank in range(0, min(2 * l1, 2 * l2) + 1, 2): - fk[(rank, 1, 2, 1, 2)] = args[it] - fk[(rank, 2, 1, 2, 1)] = args[it] - it += 1 - for rank in range(abs(l1 - l2), l1 + l2 + 1, 2): - fk[(rank, 1, 2, 2, 1)] = args[it] - fk[(rank, 2, 1, 1, 2)] = args[it] - it += 1 - for rank in range(0, 2 * l2 + 1, 2): - fk[(rank, 2, 2, 2, 2)] = args[it] - it += 1 - umat = umat_slater(l_list, fk) - # truncate to a sub-shell if necessary - if (name1 in special_shell) or (name2 in special_shell): - tmat = np.eye(ntot, dtype=complex) - indx1 = list(range(0, n1)) - if name1 in special_shell: - if name1 == 't2g': - tmat[0:n1, 0:n1] = tmat_c2r('d', True) - else: - tmat[0:n1, 0:n1] = tmat_c2j(l1) - indx1 = orb_indx[name1] - - indx2 = [n1 + i for i in range(0, n2)] - if name2 in special_shell: - if name2 == 't2g': - tmat[n1:ntot, n1:ntot] = tmat_c2r('d', True) - else: - tmat[n1:ntot, n1:ntot] = tmat_c2j(l2) - indx2 = [n1 + i for i in orb_indx[name2]] - - indx = indx1 + indx2 - umat = transform_utensor(umat, tmat) - umat_tmp = np.zeros((len(indx), len(indx), len(indx), len(indx)), dtype=complex) - umat_tmp[:, :, :, :] = umat[indx][:, indx][:, :, indx][:, :, :, indx] - if name1 == 't2g' or name2 == 't2g': - tmat = np.eye(len(indx), dtype=np.complex128) - if name1 == 't2g': - tmat[0:6, 0:6] = tmat_r2c('t2g', True) - if name2 == 't2g': - tmat[-6:, -6:] = tmat_r2c('t2g', True) - umat_tmp[:, :, :, :] = transform_utensor(umat_tmp, tmat) - umat = umat_tmp - else: - raise Exception("Not implemented for this case: ", shells) - - return umat
- - - -
-[docs] -def get_umat_slater_3shells(shell_name, *args): - """ - Given three shells, build the slater type of Coulomb tensors among - the three shells. - - Parameters - ---------- - shell_name: tuple of three strings - Shells names. - *args: floats - Slater integrals. The order should be - - FX_11, FX_12, GX_12, FX_22, FX_13, GX_13, FX_23, GX_23, FX_33 - - where, 1, 2, 3 means 1st, 2nd, 3rd shell, and X=0, 2, 4, ... or X=1, 3, 5 ..., - and X should be in ascending order. - - Returns - ------- - umat: 4d complex array - Rank-4 Coulomb tensors. - """ - - v1_name = shell_name[0].strip() - v2_name = shell_name[1].strip() - v3_name = shell_name[2].strip() - info_shell = info_atomic_shell() - - v1_orbl = info_shell[v1_name][0] - v2_orbl = info_shell[v2_name][0] - v3_orbl = info_shell[v3_name][0] - - v1_norb = info_shell[v1_name][1] - v2_norb = info_shell[v2_name][1] - v3_norb = info_shell[v3_name][1] - - # total number of orbitals - ntot = v1_norb + v2_norb + v3_norb - v1v2_norb = v1_norb + v2_norb - - indx = [] - it = 0 - it += len(range(0, 2*v1_orbl+1, 2)) - indx.append(it) - it += len(range(0, min(2*v1_orbl, 2*v2_orbl)+1, 2)) - it += len(range(abs(v1_orbl-v2_orbl), v1_orbl+v2_orbl+1, 2)) - indx.append(it) - it += len(range(0, 2*v2_orbl+1, 2)) - indx.append(it) - it += len(range(0, min(2*v1_orbl, 2*v3_orbl)+1, 2)) - it += len(range(abs(v1_orbl-v3_orbl), v1_orbl+v3_orbl+1, 2)) - indx.append(it) - it += len(range(0, min(2*v2_orbl, 2*v3_orbl)+1, 2)) - it += len(range(abs(v2_orbl-v3_orbl), v2_orbl+v3_orbl+1, 2)) - indx.append(it) - it += len(range(0, 2*v3_orbl+1, 2)) - indx.append(it) - - if it != len(args): - raise Exception("Number of Slater integrals", len(args), " is not equal to ", it) - - umat = np.zeros((ntot, ntot, ntot, ntot), dtype=complex) - - # v1-v2 - case = v1_name + v2_name - arg_list = list(args[0:indx[0]]) + list(args[indx[0]:indx[1]]) + list(args[indx[1]:indx[2]]) - umat_tmp = get_umat_slater(case, *arg_list) - umat[0:v1v2_norb, 0:v1v2_norb, 0:v1v2_norb, 0:v1v2_norb] = umat_tmp - - # v1-v3 - case = v1_name + v3_name - arg_list = [0.0] * indx[0] + list(args[indx[2]:indx[3]]) + list(args[indx[4]:indx[5]]) - umat_tmp = get_umat_slater(case, *arg_list) - aa = list(range(0, v1_norb)) + list(range(v1v2_norb, ntot)) - for i in range(v1_norb + v3_norb): - for j in range(v1_norb + v3_norb): - for k in range(v1_norb + v3_norb): - for m in range(v1_norb + v3_norb): - umat[aa[i], aa[j], aa[k], aa[m]] += umat_tmp[i, j, k, m] - - # v2-v3 - case = v2_name + v3_name - arg_list = ([0.0] * (indx[2] - indx[1]) + - list(args[indx[3]:indx[4]]) + - [0.0] * (indx[5] - indx[4])) - umat_tmp = get_umat_slater(case, *arg_list) - aa = list(range(v1_norb, ntot)) - for i in range(v2_norb + v3_norb): - for j in range(v2_norb + v3_norb): - for k in range(v2_norb + v3_norb): - for m in range(v2_norb + v3_norb): - umat[aa[i], aa[j], aa[k], aa[m]] += umat_tmp[i, j, k, m] - - return umat
- - - -
-[docs] -def get_umat_kanamori(norbs, U, J): - """ - Calculate the Coulomb interaction tensor for a Kanamori-type interaction. - For the :math:`t2g`-shell case, it is parameterized by :math:`U, J`. - - Parameters - ---------- - norbs: int - number of orbitals (including spin). - U: float - Hubbard :math:`U` for electrons residing on the same orbital with opposite spin. - J: float - Hund's coupling. - - Returns - ------- - umat: 4d complex array - The calculated Coulomb interaction tensor - - Notes - ----- - The order of spin index is: up, down, up, down, ..., up, down. - - See Also - -------- - coulomb_utensor.get_umat_kanamori_ge - coulomb_utensor.get_umat_slater - coulomb_utensor.umat_slater - - """ - - return get_umat_kanamori_ge(norbs, U, U - 2 * J, J, J, J)
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/fit_hyb.html b/edrixs/_modules/edrixs/fit_hyb.html deleted file mode 100644 index 2f7b4aca6c..0000000000 --- a/edrixs/_modules/edrixs/fit_hyb.html +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - edrixs.fit_hyb — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.fit_hyb

-__all__ = ['fit_func', 'fit_hyb', 'get_hyb']
-
-import numpy as np
-from scipy.optimize import curve_fit
-
-
-
-[docs] -def fit_func(x, *args): - """ - Given frequency :math:`\\omega`, bath energy level :math:`\\epsilon_{l}` and - the hybridization strength :math:`V_{l}`, - return the hybridization function, - - .. math:: - - \\Delta(\\omega)=\\sum_{l=1}^{N}\\frac{|V_{l}|^2}{\\omega-\\epsilon_{l}}. - - Parameters - ---------- - x: 1d float array - Frequency :math:`\\omega`, the first half is the real part and - the second half is the imaginary part. - args: 1d float array - The first half is the bath energy level :math:`\\epsilon_{l}` and the - second half if the hybridization strength :math:`V_{l}`. - - Returns - ------- - y: 1d float array - The calculated hybridization function :math:`\\Delta(\\omega)`, the - first half is the real part and the second half is the imaginary part. - """ - - m = len(x) // 2 - n = len(args) // 2 - y = np.zeros(len(x), dtype=np.float64) - - tmp_x = np.zeros(m, dtype=np.complex128) - tmp_y = np.zeros(m, dtype=np.complex128) - tmp_x[:] = x[0:m] + 1j * x[m:2 * m] - - for i in range(n): - tmp_y[:] += args[n + i]**2 / (tmp_x[:] - args[i]) - - y[0:m] = tmp_y.real - y[m:2 * m] = tmp_y.imag - - return y
- - - -
-[docs] -def fit_hyb(x, y, N, p0): - """ - Given the hybridization function :math:`\\Delta(\\omega)`, - call function curve_fit in scipy to - fit bath energy levels :math:`\\epsilon_{l}` and - hybridization strength :math:`V_{l}`. - - .. math:: - - \\Delta(\\omega)=\\sum_{l=1}^{N}\\frac{|V_{l}|^2}{\\omega-\\epsilon_{l}}. - - - Parameters - ---------- - x: 1d complex array - Frequency :math:`\\omega`. - y: 1d complex array - Hybridization function :math:`\\Delta(\\omega)`. - N: int - Number of bath sites - p0: N-length 1d float array - Initial guess, the first half is :math:`\\epsilon_{l}` and - the second half is :math:`V_{l}`. - - Returns - ------- - e: N-length 1d float array - The fitted bath energy levels :math:`\\epsilon_{l}`. - v: N-length 1d float array - The fitted hybridization strength :math:`V_{l}`. - """ - - m = len(x) - xdata = np.zeros(2 * m, dtype=np.float64) - ydata = np.zeros(2 * m, dtype=np.float64) - xdata[0:m], xdata[m:2 * m] = x.real, x.imag - ydata[0:m], ydata[m:2 * m] = y.real, y.imag - popt, pcov = curve_fit(fit_func, xdata, ydata, p0) - e, v = popt[0:N], popt[N:2 * N] - return e, v
- - - -
-[docs] -def get_hyb(x, e, v): - """ - Given the fitted :math:`\\epsilon_{l}` and :math:`V_{l}`, calcualte the - hybridization function :math:`\\Delta(\\omega)`, - - .. math:: - - \\Delta(\\omega)=\\sum_{l=1}^{N}\\frac{|V_{l}|^2}{\\omega-\\epsilon_{l}}. - - Parameters - ---------- - x: 1d complex array - Frequency :math:`\\omega`. - e: N-length 1d float array - The fitted bath energy levels. - v: N-length 1d float array - The fitted hybridization strength. - - Returns - ------- - y: 1d complex array - The calculated hybridization function :math:`\\Delta(\\omega)`. - """ - - y = np.zeros(len(x), dtype=np.complex128) - for i in range(len(e)): - y[:] += v[i]**2 / (x[:] - e[i]) - return y
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/fock_basis.html b/edrixs/_modules/edrixs/fock_basis.html deleted file mode 100644 index de7e235ae4..0000000000 --- a/edrixs/_modules/edrixs/fock_basis.html +++ /dev/null @@ -1,638 +0,0 @@ - - - - - - - - edrixs.fock_basis — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.fock_basis

-#!/usr/bin/env python
-
-__all__ = ['combination', 'fock_bin', 'get_fock_bin_by_N', 'get_fock_half_N',
-           'get_fock_full_N', 'get_fock_basis_by_NLz', 'get_fock_basis_by_NSz',
-           'get_fock_basis_by_NJz', 'get_fock_basis_by_N_abelian',
-           'get_fock_basis_by_N_LzSz', 'write_fock_dec_by_N']
-
-import numpy as np
-import itertools
-
-
-
-[docs] -def combination(n, m): - """ - Calculate the combination :math:`C_{n}^{m}`, - - .. math:: - - C_{n}^{m} = \\frac{n!}{m!(n-m)!}. - - Parameters - ---------- - n: int - Number n. - m: int - Number m. - - Returns - ------- - res: int - The calculated result. - - Examples - -------- - >>> import edrixs - >>> edrixs.combination(6, 2) - 15 - - """ - - if m > n or n < 0 or m < 0: - print("wrong number in combination") - return - if m == 0 or n == m: - return 1 - - largest = max(m, n - m) - smallest = min(m, n - m) - numer = 1.0 - for i in range(largest + 1, n + 1): - numer *= i - - denom = 1.0 - for i in range(1, smallest + 1): - denom *= i - - res = int(numer / denom) - return res
- - - -
-[docs] -def fock_bin(n, k): - """ - Return all the possible :math:`n`-length binary - where :math:`k` of :math:`n` digitals are set to 1. - - Parameters - ---------- - n: int - Binary length :math:`n`. - k: int - How many digitals are set to be 1. - - Returns - ------- - res: list of int-lists - A list of list containing the binary digitals. - - Examples - -------- - >>> import edrixs - >>> edrixs.fock_bin(4, 2) - [[1, 1, 0, 0], - [1, 0, 1, 0], - [1, 0, 0, 1], - [0, 1, 1, 0], - [0, 1, 0, 1], - [0, 0, 1, 1]] - - """ - - if n == 0: - return [[0]] - - res = [] - for bits in itertools.combinations(list(range(n)), k): - s = [0] * n - for bit in bits: - s[bit] = 1 - res.append(s) - return res
- - - -
-[docs] -def get_fock_bin_by_N(*args): - """ - Get binary form to represent a Fock state. - - Parameters - ---------- - args: ints - args[0]: number of orbitals for 1st-shell, - - args[1]: number of occupancy for 1st-shell, - - args[2]: number of orbitals for 2nd-shell, - - args[3]: number of occupancy for 2nd-shell, - - ... - - args[ :math:`2N-2`]: number of orbitals for :math:`N` th-shell, - - args[ :math:`2N-1`]: number of occupancy for :math:`N` th-shell. - - Returns - ------- - result: list of int list - The binary form of Fock states. - - Examples - -------- - >>> import edrixs - >>> edrixs.get_fock_bin_by_N(4, 2) - [[1, 1, 0, 0], - [1, 0, 1, 0], - [1, 0, 0, 1], - [0, 1, 1, 0], - [0, 1, 0, 1], - [0, 0, 1, 1]] - - >>> edrixs.get_fock_bin_by_N(4, 2, 2, 1) - [[1, 1, 0, 0, 1, 0], - [1, 0, 1, 0, 1, 0], - [1, 0, 0, 1, 1, 0], - [0, 1, 1, 0, 1, 0], - [0, 1, 0, 1, 1, 0], - [0, 0, 1, 1, 1, 0], - [1, 1, 0, 0, 0, 1], - [1, 0, 1, 0, 0, 1], - [1, 0, 0, 1, 0, 1], - [0, 1, 1, 0, 0, 1], - [0, 1, 0, 1, 0, 1], - [0, 0, 1, 1, 0, 1]] - - """ - - n = len(args) - - if n % 2 != 0: - print("Error: number of arguments is not even") - return - - if n == 2: - return fock_bin(args[0], args[1]) - else: - result = [] - res1 = fock_bin(args[0], args[1]) - res2 = get_fock_bin_by_N(*args[2:]) - for ifock in res2: - for jfock in res1: - result.append(jfock + ifock) - return result
- - - -def get_fock_half_N(N): - res = [[] for i in range(N + 1)] - for i in range(2**N): - occu = bin(i).count('1') - res[occu].append(i) - return res - - -
-[docs] -def get_fock_full_N(norb, N): - """ - Get the decimal digitals to represent Fock states. - - Parameters - ---------- - norb: int - Number of orbitals. - N: int - Number of occupancy. - - Returns - ------- - res: list of int - The decimal digitals to represent Fock states. - - Examples - -------- - >>> import edrixs - >>> edrixs.fock_bin(4,2) - [[1, 1, 0, 0], - [1, 0, 1, 0], - [0, 1, 1, 0], - [1, 0, 0, 1], - [0, 1, 0, 1], - [0, 0, 1, 1]] - - >>> import edrixs - >>> edrixs.get_fock_full_N(4,2) - [3, 5, 6, 9, 10, 12] - - """ - - res = [] - half_N = get_fock_half_N(norb // 2) - for m in range(norb // 2 + 1): - n = N - m - if n >= 0 and n <= norb // 2: - res.extend([i * 2**(norb // 2) + j for i in half_N[m] for j in half_N[n]]) - return res
- - - -
-[docs] -def get_fock_basis_by_NLz(norb, N, lz_list): - """ - Get decimal digitals to represent Fock states, use good quantum number: - - - orbital angular momentum :math:`L_{z}` - - Parameters - ---------- - norb: int - Number of orbitals. - N: int - Number of total occupancy. - lz_list: list of int - Quantum number :math:`l_{z}` for each orbital. - - Returns - ------- - res: dict - A dictionary containing the decimal digitals, the key is good - quantum numbers :math:`L_{z}`, the value is a list of int. - - Examples - -------- - >>> import edrixs - >>> edrixs.get_fock_basis_by_NLz(6, 2, [-1, -1, 0, 0, 1, 1]) - { - -2: [3], - -1: [5, 6, 9, 10], - 0: [12, 17, 18, 33, 34], - 1: [20, 36, 24, 40], - 2: [48] - } - """ - - res = get_fock_basis_by_N_abelian(norb, N, lz_list) - return res
- - - -
-[docs] -def get_fock_basis_by_NSz(norb, N, sz_list): - """ - Get decimal digitals to represent Fock states, use good quantum number: - - - spin angular momentum :math:`S_{z}` - - Parameters - ---------- - norb: int - Number of orbitals. - N: int - Number of total occupancy. - sz_list: list of int - Quantum number :math:`s_{z}` for each orbital. - - Returns - ------- - res: dict - A dictionary containing the decimal digitals, the key is good quantum - numbers :math:`S_{z}`, the value is a list of int. - - Examples - -------- - >>> import edrixs - >>> edrixs.get_fock_basis_by_NSz(6, 2, [1, -1, 1, -1, 1, -1]) - { - -2: [10, 34, 40], - -1: [], - 0: [3, 6, 9, 12, 18, 33, 36, 24, 48], - 1: [], - 2: [5, 17, 20] - } - """ - - res = get_fock_basis_by_N_abelian(norb, N, sz_list) - return res
- - - -
-[docs] -def get_fock_basis_by_NJz(norb, N, jz_list): - """ - Get decimal digitals to represent Fock states, use good quantum number: - - - total angular momentum :math:`J_{z}` - - Parameters - ---------- - norb: int - Number of orbitals. - N: int - Number of total occupancy. - jz_list: list of int - Quantum number :math:`j_{z}` for each orbital. - - Returns - ------- - res: dict - A dictionary containing the decimal digitals, the key is good quantum - numbers :math:`j_{z}`, the value is a list of int. - - Examples - -------- - >>> import edrixs - >>> edrixs.get_fock_basis_by_NJz(6, 2, [-1, 1, -3, -1, 1, 3]) - { - -6: [], - -5: [], - -4: [5, 12], - -3: [], - -2: [6, 9, 20], - -1: [], - 0: [3, 10, 17, 36, 24], - 1: [], - 2: [18, 33, 40], - 3: [], - 4: [34, 48], - 5: [], - 6: [] - } - """ - - res = get_fock_basis_by_N_abelian(norb, N, jz_list) - return res
- - - -
-[docs] -def get_fock_basis_by_N_abelian(norb, N, a_list): - """ - Get decimal digitals to represent Fock states, use some Abelian good quantum number. - - Parameters - ---------- - norb: int - Number of orbitals. - N: int - Number of total occupancy. - a_list: list of int - Quantum number of the Abelian symmetry for each orbital. - - Returns - ------- - basis: dict - A dictionary containing the decimal digitals, the key is good quantum numbers, - the value is a list of int. - """ - - result = get_fock_full_N(norb, N) - min_a, max_a = min(a_list) * N, max(a_list) * N - basis = {} - for i in range(min_a, max_a + 1): - basis[i] = [] - for n in result: - a = sum([a_list[i] for i in range(0, n.bit_length()) if (n >> i & 1)]) - basis[a].append(n) - return basis
- - - -
-[docs] -def get_fock_basis_by_N_LzSz(norb, N, lz_list, sz_list): - """ - Get decimal digitals to represent Fock states, use good quantum number: - - - orbital angular momentum :math:`L_{z}` - - spin angular momentum :math:`S_{z}` - - Parameters - ---------- - norb: int - Number of orbitals. - N: int - Number of total occupancy. - lz_list: list of int - Quantum number :math:`l_{z}` for each orbital. - sz_list: list of int - Quantum number :math:`s_{z}` for each orbital. - - Returns - ------- - basis: dict - A dictionary containing the decimal digitals, the key is a tuple containing good quantum - numbers ( :math:`l_{z}`, :math:`s_{z}`), the value is a list of int. - - Examples - -------- - >>> import edrixs - >>> edrixs.get_fock_basis_by_N_LzSz(6, 2, [-1, -1, 0, 0, 1, 1], [1, -1, 1, -1, 1, -1]) - { - (-2, -2): [], - (-2, -1): [], - (-2, 0): [3], - (-2, 1): [], - (-2, 2): [], - (-1, -2): [10], - (-1, -1): [], - (-1, 0): [6, 9], - (-1, 1): [], - (-1, 2): [5], - (0, -2): [34], - (0, -1): [], - (0, 0): [12, 18, 33], - (0, 1): [], - (0, 2): [17], - (1, -2): [40], - (1, -1): [], - (1, 0): [36, 24], - (1, 1): [], - (1, 2): [20], - (2, -2): [], - (2, -1): [], - (2, 0): [48], - (2, 1): [], - (2, 2): [] - } - """ - result = get_fock_full_N(norb, N) - min_Lz, max_Lz = min(lz_list) * N, max(lz_list) * N - min_Sz, max_Sz = min(sz_list) * N, max(sz_list) * N - basis = {} - for i in range(min_Lz, max_Lz + 1): - for j in range(min_Sz, max_Sz + 1): - basis[(i, j)] = [] - for n in result: - Lz, Sz = np.sum([[lz_list[i], sz_list[i]] for i in range(0, n.bit_length()) - if (n >> i & 1)], axis=0) - basis[(Lz, Sz)].append(n) - return basis
- - - -
-[docs] -def write_fock_dec_by_N(N, r, fname='fock_i.in'): - """ - Get decimal digitals to represent Fock states, sort them by - ascending order and then write them to file. - - Parameters - ---------- - N: int - Number of orbitals. - r: int - Number of occuancy. - fname: string - File name. - - Returns - ------- - ndim: int - The dimension of the Hilbert space - - Examples - -------- - >>> import edrixs - >>> edrixs.write_fock_dec_by_N(4, 2, 'fock_i.in') - file fock_i.in looks like - 15 - 3 - 5 - 6 - 9 - 10 - 12 - 17 - 18 - 20 - 24 - 33 - 34 - 36 - 40 - 48 - - where, the first line is the total numer of Fock states, - and the following lines are the Fock states in decimal form. - """ - - res = get_fock_full_N(N, r) - res.sort() - ndim = len(res) - f = open(fname, 'w') - print(ndim, file=f) - for item in res: - print(item, file=f) - f.close() - return ndim
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/iostream.html b/edrixs/_modules/edrixs/iostream.html deleted file mode 100644 index f78e7e15b5..0000000000 --- a/edrixs/_modules/edrixs/iostream.html +++ /dev/null @@ -1,487 +0,0 @@ - - - - - - - - edrixs.iostream — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.iostream

-__all__ = ['write_tensor', 'write_emat', 'write_umat', 'write_config',
-           'read_poles_from_file', 'dump_poles', 'load_poles']
-
-import numpy as np
-import json
-
-
-def write_tensor_1(tensor, fname, only_nonzeros=False, tol=1E-10, fmt_int='{:10d}',
-                   fmt_float='{:.15f}'):
-    (n1, ) = tensor.shape
-    is_cmplx = False
-    if tensor.dtype in (complex, np.complex128):
-        is_cmplx = True
-    space = "    "
-    f = open(fname, 'w')
-    for i in range(n1):
-        if only_nonzeros and abs(tensor[i]) < tol:
-            continue
-        if is_cmplx:
-            fmt_string = fmt_int + space + (fmt_float + space) * 2 + '\n'
-            f.write(fmt_string.format(i + 1, tensor[i].real, tensor[i].imag))
-        else:
-            fmt_string = fmt_int + space + fmt_float + space + '\n'
-            f.write(fmt_string.format(i + 1, tensor[i]))
-    f.close()
-
-
-def write_tensor_2(tensor, fname, only_nonzeros=False, tol=1E-10, fmt_int='{:10d}',
-                   fmt_float='{:.15f}'):
-    (n1, n2) = tensor.shape
-    is_cmplx = False
-    if tensor.dtype in (complex, np.complex128):
-        is_cmplx = True
-    space = "    "
-    f = open(fname, 'w')
-    for i in range(n1):
-        for j in range(n2):
-            if only_nonzeros and abs(tensor[i, j]) < tol:
-                continue
-            if is_cmplx:
-                fmt_string = (fmt_int + space) * 2 + (fmt_float + space) * 2 + '\n'
-                f.write(fmt_string.format(i + 1, j + 1, tensor[i, j].real, tensor[i, j].imag))
-            else:
-                fmt_string = (fmt_int + space) * 2 + fmt_float + space + '\n'
-                f.write(fmt_string.format(i + 1, j + 1, tensor[i, j]))
-    f.close()
-
-
-def write_tensor_3(tensor, fname, only_nonzeros=False, tol=1E-10, fmt_int='{:10d}',
-                   fmt_float='{:.15f}'):
-    (n1, n2, n3) = tensor.shape
-    is_cmplx = False
-    if tensor.dtype in (complex, np.complex128):
-        is_cmplx = True
-    space = "    "
-    f = open(fname, 'w')
-    for i in range(n1):
-        for j in range(n2):
-            for k in range(n3):
-                if only_nonzeros and abs(tensor[i, j, k]) < tol:
-                    continue
-                if is_cmplx:
-                    fmt_string = (fmt_int + space) * 3 + (fmt_float + space) * 2 + '\n'
-                    f.write(fmt_string.format(i + 1, j + 1, k + 1, tensor[i, j, k].real,
-                                              tensor[i, j, k].imag))
-                else:
-                    fmt_string = (fmt_int + space) * 3 + fmt_float + space + '\n'
-                    f.write(fmt_string.format(i + 1, j + 1, k + 1, tensor[i, j, k]))
-    f.close()
-
-
-def write_tensor_4(tensor, fname, only_nonzeros=False, tol=1E-10, fmt_int='{:10d}',
-                   fmt_float='{:.15f}'):
-    (n1, n2, n3, n4) = tensor.shape
-    is_cmplx = False
-    if tensor.dtype in (complex, np.complex128):
-        is_cmplx = True
-    space = "    "
-    f = open(fname, 'w')
-    for i in range(n1):
-        for j in range(n2):
-            for k in range(n3):
-                for m in range(n4):
-                    if only_nonzeros and abs(tensor[i, j, k, m]) < tol:
-                        continue
-                    if is_cmplx:
-                        fmt_string = (fmt_int + space) * 4 + (fmt_float + space) * 2 + '\n'
-                        f.write(fmt_string.format(i + 1, j + 1, k + 1, m + 1,
-                                tensor[i, j, k, m].real, tensor[i, j, k, m].imag))
-                    else:
-                        fmt_string = (fmt_int + space) * 4 + fmt_float + space + '\n'
-                        f.write(fmt_string.format(i + 1, j + 1, k + 1, m + 1, tensor[i, j, k, m]))
-    f.close()
-
-
-def write_tensor_5(tensor, fname, only_nonzeros=False, tol=1E-10, fmt_int='{:10d}',
-                   fmt_float='{:.15f}'):
-    (n1, n2, n3, n4, n5) = tensor.shape
-    is_cmplx = False
-    if tensor.dtype in (complex, np.complex128):
-        is_cmplx = True
-    space = "    "
-    f = open(fname, 'w')
-    for i in range(n1):
-        for j in range(n2):
-            for k in range(n3):
-                for r in range(n4):
-                    for m in range(n5):
-                        if only_nonzeros and abs(tensor[i, j, k, r, m]) < tol:
-                            continue
-                        if is_cmplx:
-                            fmt_string = (fmt_int + space) * 5 + (fmt_float + space) * 2 + '\n'
-                            f.write(fmt_string.format(i + 1, j + 1, k + 1, r + 1, m + 1,
-                                    tensor[i, j, k, r, m].real, tensor[i, j, k, r, m].imag))
-                        else:
-                            fmt_string = (fmt_int + space) * 5 + fmt_float + space + '\n'
-                            f.write(fmt_string.format(i + 1, j + 1, k + 1, r + 1, m + 1,
-                                    tensor[i, j, k, r, m]))
-    f.close()
-
-
-
-[docs] -def write_tensor(tensor, fname, only_nonzeros=False, tol=1E-10, fmt_int='{:10d}', - fmt_float='{:.15f}'): - """ - Write :math:`n` -dimension numpy array to file, currently, :math:`n` can be 1, 2, 3, 4, 5. - - Parameters - ---------- - tensor: :math:`n` d float or complex array - The array needs to be written. - fname: str - File name. - only_nonzeros: logical (default: False) - Only write nonzero elements. - tol: float (default: 1E-10) - Only write the elements when their absolute value are larger than tol - and only_nonzeros=True. - fmt_int: str (default: '{:10d}') - The format for printing integer numbers. - fmt_float: str (default: '{:.15f}') - The format for printing float numbers. - - """ - - ndim = tensor.ndim - if ndim == 1: - write_tensor_1(tensor, fname, only_nonzeros=only_nonzeros, tol=tol, - fmt_int=fmt_int, fmt_float=fmt_float) - elif ndim == 2: - write_tensor_2(tensor, fname, only_nonzeros=only_nonzeros, tol=tol, - fmt_int=fmt_int, fmt_float=fmt_float) - elif ndim == 3: - write_tensor_3(tensor, fname, only_nonzeros=only_nonzeros, tol=tol, - fmt_int=fmt_int, fmt_float=fmt_float) - elif ndim == 4: - write_tensor_4(tensor, fname, only_nonzeros=only_nonzeros, tol=tol, - fmt_int=fmt_int, fmt_float=fmt_float) - elif ndim == 5: - write_tensor_5(tensor, fname, only_nonzeros=only_nonzeros, tol=tol, - fmt_int=fmt_int, fmt_float=fmt_float) - else: - raise Exception("error in write_tensor: ndim >5, not implemented !")
- - - -
-[docs] -def write_emat(emat, fname, tol=1E-12, fmt_int='{:10d}', fmt_float='{:.15f}'): - """ - Write the nonzeros of the rank-2 hopping matrices to file. - The first line is the number of nonzeros, and the following lines are the nonzero elements. - This file will be read by ed.x, xas.x or rixs.x. - - Parameters - ---------- - emat: 2d complex array - The array to be written. - fname: str - File name. - tol: float - Precision. - fmt_int: str (default: '{:10d}') - Format for printing integer numbers. - fmt_float: str (default: '{:.15f}') - Format for printing float numbers. - """ - - a1, a2 = np.nonzero(abs(emat) > tol) - nonzero = np.stack((a1, a2), axis=-1) - - space = " " - fmt_string = (fmt_int + space) * 2 + (fmt_float + space) * 2 + '\n' - f = open(fname, 'w') - if len(nonzero) == 0: - f.write("{:10d}\n".format(1)) - f.write(fmt_string.format(1, 1, 0.0, 0.0)) - else: - f.write("{:20d}\n".format(len(nonzero))) - for i, j in nonzero: - f.write(fmt_string.format(i + 1, j + 1, emat[i, j].real, emat[i, j].imag)) - f.close()
- - - -
-[docs] -def write_umat(umat, fname, tol=1E-12, fmt_int='{:10d}', fmt_float='{:.15f}'): - """ - Write the nonzeros of the rank-4 Coulomb U tensor to file. - The first line is the number of nonzeros, and the following lines are the nonzero elements. - This file will be read by ed.x, xas.x or rixs.x. - - Parameters - ---------- - umat: 4d complex array - The array to be written. - fname: str - File name. - tol: float (default: 1E-12) - Precision. - fmt_int: str (default: '{:10d}') - Format for printing integer numbers. - fmt_float: str (default: '{:.15f}') - Format for printing float numbers. - """ - - a1, a2, a3, a4 = np.nonzero(abs(umat) > tol) - nonzero = np.stack((a1, a2, a3, a4), axis=-1) - - space = " " - fmt_string = (fmt_int + space) * 4 + (fmt_float + space) * 2 + '\n' - f = open(fname, 'w') - if len(nonzero) == 0: - f.write("{:10d}\n".format(1)) - f.write(fmt_string.format(1, 1, 1, 1, 0.0, 0.0)) - else: - f.write("{:20d}\n".format(len(nonzero))) - for i, j, k, l in nonzero: - f.write(fmt_string.format(i + 1, j + 1, k + 1, l + 1, - umat[i, j, k, l].real, umat[i, j, k, l].imag)) - f.close()
- - - -
-[docs] -def write_config( - directory='.', ed_solver=1, num_val_orbs=2, num_core_orbs=2, - neval=1, nvector=1, ncv=1, idump=True, num_gs=1, maxiter=500, - linsys_max=1000, min_ndim=1000, nkryl=500, eigval_tol=1e-8, - linsys_tol=1e-10, omega_in=0.0, gamma_in=0.1 - ): - """ - Write control parameters in config.in file for ed_fsolver. - """ - if idump: - dump_vector = '.true.' - else: - dump_vector = '.false.' - - config = [ - "&control", - "ed_solver=" + str(ed_solver), - "num_val_orbs=" + str(num_val_orbs), - "num_core_orbs=" + str(num_core_orbs), - "neval=" + str(neval), - "nvector=" + str(nvector), - "ncv=" + str(ncv), - "idump=" + str(dump_vector), - "num_gs=" + str(num_gs), - "maxiter=" + str(maxiter), - "linsys_max=" + str(linsys_max), - "min_ndim=" + str(min_ndim), - "nkryl=" + str(nkryl), - "eigval_tol=" + str(eigval_tol), - "linsys_tol=" + str(linsys_tol), - "omega_in=" + str(omega_in), - "gamma_in=" + str(gamma_in), - "&end" - ] - - f = open(directory + '/config.in', 'w') - for item in config: - f.write(item + "\n") - f.close()
- - - -
-[docs] -def read_poles_from_file(file_list): - """ - Read informations in files xas_poles.n or rixs_poles.n to a dict. - - Parameters - ---------- - file_list: list of strings - Names of pole files. - - pole_dict: dict - A dict containing information of poles. - """ - pole_dict = { - 'npoles': [], - 'eigval': [], - 'norm': [], - 'alpha': [], - 'beta': [] - } - for fname in file_list: - f = open(fname, 'r') - line = f.readline() - neff = int(line.strip().split()[1]) - pole_dict['npoles'].append(neff) - - line = f.readline() - eigval = float(line.strip().split()[1]) - pole_dict['eigval'].append(eigval) - - line = f.readline() - norm = float(line.strip().split()[1]) - pole_dict['norm'].append(norm) - - alpha = [] - beta = [] - for i in range(neff): - line = f.readline() - line = line.strip().split() - alpha.append(float(line[1])) - beta.append(float(line[2])) - pole_dict['alpha'].append(alpha) - pole_dict['beta'].append(beta) - f.close() - - return pole_dict
- - - -
-[docs] -def dump_poles(obj, file_name="poles"): - """ - Dump the objects of poles returned from XAS or RIXS calculations to file for later plotting. - - Parameters - ---------- - obj: Python object - Object of poles, a dict or a list of dicts. - file_name: string - File name. - """ - with open(file_name+'.json', 'w') as f: - json.dump(obj, f, indent=2)
- - - -
-[docs] -def load_poles(file_name='poles'): - """ - Load the objects of poles from file. - - Parameters - ---------- - file_name: string - - Returns - ------- - obj: Python objects - Poles object. - """ - with open(file_name+'.json', 'r') as f: - obj = json.load(f) - - return obj
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/manybody_operator.html b/edrixs/_modules/edrixs/manybody_operator.html deleted file mode 100644 index 465dcc10a3..0000000000 --- a/edrixs/_modules/edrixs/manybody_operator.html +++ /dev/null @@ -1,447 +0,0 @@ - - - - - - - - edrixs.manybody_operator — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.manybody_operator

-__all__ = ['one_fermion_annihilation', 'two_fermion', 'four_fermion',
-           'build_opers', 'density_matrix']
-
-import numpy as np
-from collections import defaultdict
-
-
-
-[docs] -def one_fermion_annihilation(iorb, lb, rb): - """ - Build matrix form of a fermionic annihilation operator in the given Fock basis. - - .. math:: - - <F_{l}|\\hat{f}_{i}|F_{r}> - - Parameters - ---------- - iorb: int - Which orbital. - lb: list or array - Left fock basis :math:`<F_{l}|`. - rb: list of array - Right fock basis :math:`|F_{r}>`. - - Returns - ------- - hmat: 2d complex array - The matrix form of :math:`\\hat{f}_{i}`. - """ - - lb, rb = np.array(lb), np.array(rb) - nr, nl, norbs = len(rb), len(lb), len(rb[0]) - indx = defaultdict(lambda: -1) - for i, j in enumerate(lb): - indx[tuple(j)] = i - - hmat = np.zeros((nl, nr), dtype=np.complex128) - tmp_basis = np.zeros(norbs) - for icfg in range(nr): - tmp_basis[:] = rb[icfg] - if tmp_basis[iorb] == 0: - continue - else: - sign = (-1)**np.count_nonzero(tmp_basis[0:iorb]) - tmp_basis[iorb] = 0 - jcfg = indx[tuple(tmp_basis)] - if jcfg != -1: - hmat[jcfg, icfg] += sign - return hmat
- - - -
-[docs] -def two_fermion(emat, lb, rb=None, tol=1E-10): - """ - Build matrix form of a two-fermionic operator in the given Fock basis, - - .. math:: - - <F_{l}|\\sum_{ij}E_{ij}\\hat{f}_{i}^{\\dagger}\\hat{f}_{j}|F_{r}> - - Parameters - ---------- - emat: 2d complex array - The impurity matrix. - lb: list of array - Left fock basis :math:`<F_{l}|`. - rb: list of array - Right fock basis :math:`|F_{r}>`. - rb = lb if rb is None - tol: float (default: 1E-10) - Only consider the elements of emat that are larger than tol. - - Returns - ------- - hmat: 2d complex array - The matrix form of the two-fermionic operator. - """ - if rb is None: - rb = lb - lb, rb = np.array(lb), np.array(rb) - nr, nl, norbs = len(rb), len(lb), len(rb[0]) - indx = defaultdict(lambda: -1) - for i, j in enumerate(lb): - indx[tuple(j)] = i - - a1, a2 = np.nonzero(abs(emat) > tol) - nonzero = np.stack((a1, a2), axis=-1) - - hmat = np.zeros((nl, nr), dtype=np.complex128) - tmp_basis = np.zeros(norbs) - for iorb, jorb in nonzero: - for icfg in range(nr): - tmp_basis[:] = rb[icfg] - if tmp_basis[jorb] == 0: - continue - else: - s1 = (-1)**np.count_nonzero(tmp_basis[0:jorb]) - tmp_basis[jorb] = 0 - if tmp_basis[iorb] == 1: - continue - else: - s2 = (-1)**np.count_nonzero(tmp_basis[0:iorb]) - tmp_basis[iorb] = 1 - jcfg = indx[tuple(tmp_basis)] - if jcfg != -1: - hmat[jcfg, icfg] += emat[iorb, jorb] * s1 * s2 - return hmat
- - - -
-[docs] -def four_fermion(umat, lb, rb=None, tol=1E-10): - """ - Build matrix form of a four-fermionic operator in the given Fock basis, - - .. math:: - - <F_l|\\sum_{ij}U_{ijkl}\\hat{f}_{i}^{\\dagger}\\hat{f}_{j}^{\\dagger} - \\hat{f}_{k}\\hat{f}_{l}|F_r> - - Parameters - ---------- - umat: 4d complex array - The 4 index Coulomb interaction tensor. - lb: list of array - Left fock basis :math:`<F_{l}|`. - rb: list of array - Right fock basis :math:`|F_{r}>`. - rb = lb if rb is None - tol: float (default: 1E-10) - Only consider the elements of umat that are larger than tol. - - Returns - ------- - hmat: 2d complex array - The matrix form of the four-fermionic operator. - """ - if rb is None: - rb = lb - lb, rb = np.array(lb), np.array(rb) - nr, nl, norbs = len(rb), len(lb), len(rb[0]) - indx = defaultdict(lambda: -1) - for i, j in enumerate(lb): - indx[tuple(j)] = i - - a1, a2, a3, a4 = np.nonzero(abs(umat) > tol) - nonzero = np.stack((a1, a2, a3, a4), axis=-1) - - hmat = np.zeros((nl, nr), dtype=np.complex128) - tmp_basis = np.zeros(norbs) - for lorb, korb, jorb, iorb in nonzero: - if iorb == jorb or korb == lorb: - continue - for icfg in range(nr): - tmp_basis[:] = rb[icfg] - if tmp_basis[iorb] == 0: - continue - else: - s1 = (-1)**np.count_nonzero(tmp_basis[0:iorb]) - tmp_basis[iorb] = 0 - if tmp_basis[jorb] == 0: - continue - else: - s2 = (-1)**np.count_nonzero(tmp_basis[0:jorb]) - tmp_basis[jorb] = 0 - if tmp_basis[korb] == 1: - continue - else: - s3 = (-1)**np.count_nonzero(tmp_basis[0:korb]) - tmp_basis[korb] = 1 - if tmp_basis[lorb] == 1: - continue - else: - s4 = (-1)**np.count_nonzero(tmp_basis[0:lorb]) - tmp_basis[lorb] = 1 - jcfg = indx[tuple(tmp_basis)] - if jcfg != -1: - hmat[jcfg, icfg] += umat[lorb, korb, jorb, iorb] * s1 * s2 * s3 * s4 - return hmat
- - - -
-[docs] -def build_opers(nfermion, coeff, lb, rb=None, tol=1E-10): - """ - Build matrix form of many-body operators in the given Fock basis, - - .. math:: - - <F_{l}|\\sum_{ij}E_{ij}\\hat{f}_{i}^{\\dagger}\\hat{f}_{j}|F_{r}> - - or - - .. math:: - - <F_l|\\sum_{ij}U_{ijkl}\\hat{f}_{i}^{\\dagger}\\hat{f}_{j}^{\\dagger} - \\hat{f}_{k}\\hat{f}_{l}|F_r> - - Parameters - ---------- - nfermion: int - Number of fermion operators. Options can only be 2 or 4 now. - coeff: array-like - The coefficients. - - - if nfermion=2, coeff should be at least 2-dimension, and the last 2-dimension is - the matrix of coefficients of an operator. For examples, - - - coeff.shape = (3, 10, 10), means 3 operators with :math:`10 \\times 10` - coefficients matrix. - - - coeff.shape = (2, 3, 10, 10), means :math:`2 \\times 3=6` operators with - :math:`10 \\times 10` coefficients matrix. - - - if nfermion=4, coeff should be at least 4-dimension, and the last 4-dimension is - the rank-4 tensor of coefficients of an operator. For examples, - - - coeff.shape = (3, 10, 10, 10, 10), means 3 operators with - :math:`10 \\times 10 \\times 10 \\times 10` coefficients tensor. - - - coeff.shape = (2, 3, 10, 10, 10, 10), means :math:`2 \\times 3=6` operators with - :math:`10 \\times 10 \\times 10 \\times 10` coefficients tensor. - lb: list of array - Left fock basis :math:`<F_{l}|`. - rb: list of array - Right fock basis :math:`|F_{r}>`. - rb = lb if rb is None - tol: float (default: 1E-10) - Only consider the elements of emat that are larger than tol. - - Returns - ------- - hmat: array-like - At least 2-dimension and the last 2-dimension is matrix form of operators, - For examples, - - - if nfermion=2, coeff.shape=(2, 3, 10, 10), hmat.shape=(2, 3, len(lb), len(rb)) - - - if nfermion=4, coeff.shape=(2, 3, 10, 10, 10, 10), hmat.shape=(2, 3, len(lb), len(rb)) - """ - if nfermion not in [2, 4]: - raise Exception("nfermion is not 2 or 4") - nl = len(lb) - if rb is None: - nr = nl - else: - nr = len(rb) - coeff = np.array(coeff, order='C') - if nfermion == 2: - dim = coeff.shape - if len(dim) < 2: - raise Exception("Dimension of coeff should be at least 2 when nfermion=2") - elif len(dim) == 2: - hmat = two_fermion(coeff, lb, rb, tol) - else: - tot = np.prod(dim[0:-2]) - hmat_tmp = np.zeros((tot, nl, nr), dtype=complex) - coeff_tmp = coeff.reshape((tot, dim[-2], dim[-1])) - for i in range(tot): - hmat_tmp[i] = two_fermion(coeff_tmp[i], lb, rb, tol) - hmat = hmat_tmp.reshape(dim[0:-2] + (nl, nr)) - if nfermion == 4: - dim = coeff.shape - if len(dim) < 4: - raise Exception("Dimension of coeff should be at least 4 when nfermion=4") - elif len(dim) == 4: - hmat = four_fermion(coeff, lb, rb, tol) - else: - tot = np.prod(dim[0:-4]) - hmat_tmp = np.zeros((tot, nl, nr), dtype=complex) - coeff_tmp = coeff.reshape((tot, dim[-4], dim[-3], dim[-2], dim[-1])) - for i in range(tot): - hmat_tmp[i] = four_fermion(coeff_tmp[i], lb, rb, tol) - hmat = hmat_tmp.reshape(dim[0:-4] + (nl, nr)) - - return hmat
- - - -
-[docs] -def density_matrix(iorb, jorb, lb, rb): - """ - Calculate the matrix form of density operators :math:`\\hat{f}_{i}^{\\dagger}\\hat{f}_{j}` - in the given Fock basis, - - .. math:: - - <F_{l}|\\hat{f}_{i}^{\\dagger}\\hat{f}_{j}|F_{r}> - - Parameters - ---------- - iorb: int - Orbital index. - jorb: int - Orbital index. - lb: list or array - Left fock basis :math:`<F_{l}|`. - rb: list or array - Right fock basis :math:`|F_{r}>`. - - Returns - ------- - hmat: 2d complex array - The calculated matrix form of the density operator. - """ - - lb, rb = np.array(lb), np.array(rb) - nr, nl, norbs = len(rb), len(lb), len(rb[0]) - indx = defaultdict(lambda: -1) - for i, j in enumerate(lb): - indx[tuple(j)] = i - - hmat = np.zeros((nl, nr), dtype=np.complex128) - tmp_basis = np.zeros(norbs) - for icfg in range(nr): - tmp_basis[:] = rb[icfg] - if tmp_basis[jorb] == 0: - continue - else: - s1 = (-1)**np.count_nonzero(tmp_basis[0:jorb]) - tmp_basis[jorb] = 0 - if tmp_basis[iorb] == 1: - continue - else: - s2 = (-1)**np.count_nonzero(tmp_basis[0:iorb]) - tmp_basis[iorb] = 1 - jcfg = indx[tuple(tmp_basis)] - if jcfg != -1: - hmat[jcfg, icfg] += s1 * s2 - return hmat
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/photon_transition.html b/edrixs/_modules/edrixs/photon_transition.html deleted file mode 100644 index 695fb301ca..0000000000 --- a/edrixs/_modules/edrixs/photon_transition.html +++ /dev/null @@ -1,689 +0,0 @@ - - - - - - - - edrixs.photon_transition — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.photon_transition

-__all__ = ['dipole_trans_oper', 'quadrupole_trans_oper', 'get_trans_oper',
-           'unit_wavevector', 'wavevector_with_length', 'get_wavevector_rixs',
-           'linear_polvec', 'dipole_polvec_rixs', 'dipole_polvec_xas',
-           'quadrupole_polvec']
-
-import numpy as np
-from sympy.physics.wigner import clebsch_gordan
-from .basis_transform import tmat_c2r, tmat_r2c, tmat_c2j, cb_op2
-from .utils import case_to_shell_name, info_atomic_shell
-
-
-def dipole_trans_oper(l1, l2):
-    from sympy import N
-
-    n1, n2 = 2 * l1 + 1, 2 * l2 + 1
-    op = np.zeros((3, n1, n2), dtype=np.complex128)
-    for i1, m1 in enumerate(range(-l1, l1 + 1)):
-        for i2, m2 in enumerate(range(-l2, l2 + 1)):
-            tmp1 = clebsch_gordan(l2, 1, l1, m2, -1, m1)
-            tmp2 = clebsch_gordan(l2, 1, l1, m2, 1, m1)
-            tmp3 = clebsch_gordan(l2, 1, l1, m2, 0, m1)
-            tmp1, tmp2, tmp3 = N(tmp1), N(tmp2), N(tmp3)
-            op[0, i1, i2] = (tmp1 - tmp2) * np.sqrt(2.0) / 2.0
-            op[1, i1, i2] = (tmp1 + tmp2) * 1j * np.sqrt(2.0) / 2.0
-            op[2, i1, i2] = tmp3
-    op_spin = np.zeros((3, 2 * n1, 2 * n2), dtype=np.complex128)
-    for i in range(3):
-        op_spin[i, 0:2 * n1:2, 0:2 * n2:2] = op[i]
-        op_spin[i, 1:2 * n1:2, 1:2 * n2:2] = op[i]
-
-    return op_spin
-
-
-def quadrupole_trans_oper(l1, l2):
-    from sympy import N
-    n1, n2 = 2 * l1 + 1, 2 * l2 + 1
-    op = np.zeros((5, n1, n2), dtype=np.complex128)
-    for i1, m1 in enumerate(range(-l1, l1 + 1)):
-        for i2, m2 in enumerate(range(-l2, l2 + 1)):
-            t1 = clebsch_gordan(l2, 2, l1, m2, -2, m1)
-            t2 = clebsch_gordan(l2, 2, l1, m2, 2, m1)
-            t3 = clebsch_gordan(l2, 2, l1, m2, 0, m1)
-            t4 = clebsch_gordan(l2, 2, l1, m2, -1, m1)
-            t5 = clebsch_gordan(l2, 2, l1, m2, 1, m1)
-            t1, t2, t3, t4, t5 = N(t1), N(t2), N(t3), N(t4), N(t5)
-
-            op[0, i1, i2] = t3
-            op[1, i1, i2] = (t4 - t5) / np.sqrt(2.0)
-            op[2, i1, i2] = (t4 + t5) * 1j / np.sqrt(2.0)
-            op[3, i1, i2] = (t1 + t2) / np.sqrt(2.0)
-            op[4, i1, i2] = (t1 - t2) * 1j / np.sqrt(2.0)
-
-    op_spin = np.zeros((5, 2 * n1, 2 * n2), dtype=np.complex128)
-    for i in range(5):
-        op_spin[i, 0:2 * n1:2, 0:2 * n2:2] = op[i]
-        op_spin[i, 1:2 * n1:2, 1:2 * n2:2] = op[i]
-
-    return op_spin
-
-
-
-[docs] -def get_trans_oper(case): - """ - Get the matrix of transition operators between two atomic shell in the complex - spherical harmonics basis. - - Parameters - ---------- - case: string - A string indicating the two atomic shells, possible transitions are: - - - 'ss': :math:`s \\rightarrow s` - - 'ps': :math:`s \\rightarrow p` - - 't2gs': :math:`s \\rightarrow t2g` - - 'ds': :math:`s \\rightarrow d` - - 'fs': :math:`s \\rightarrow f` - - 'sp': :math:`p \\rightarrow s` - - 'sp12': :math:`p_{1/2} \\rightarrow s` - - 'sp32': :math:`p_{3/2} \\rightarrow s` - - 'pp': :math:`p \\rightarrow p` - - 'pp12': :math:`p_{1/2} \\rightarrow p` - - 'pp32': :math:`p_{3/2} \\rightarrow p` - - 't2gp': :math:`p \\rightarrow t_{2g}` - - 't2gp12': :math:`p_{1/2} \\rightarrow t_{2g}` - - 't2gp32': :math:`p_{3/2} \\rightarrow t_{2g}` - - 'dp': :math:`p \\rightarrow d` - - 'dp12': :math:`p_{1/2} \\rightarrow d` - - 'dp32': :math:`p_{3/2} \\rightarrow d` - - 'fp': :math:`p \\rightarrow f` - - 'fp12': :math:`p_{1/2} \\rightarrow f` - - 'fp32': :math:`p_{3/2} \\rightarrow f` - - 'sd': :math:`d \\rightarrow s` - - 'sd32': :math:`d_{3/2} \\rightarrow s` - - 'sd52': :math:`d_{5/2} \\rightarrow s` - - 'pd': :math:`d \\rightarrow p` - - 'pd32': :math:`d_{3/2} \\rightarrow p` - - 'pd52': :math:`d_{5/2} \\rightarrow p` - - 't2gd': :math:`d \\rightarrow t_{2g}` - - 't2gd32': :math:`d_{3/2} \\rightarrow t_{2g}` - - 't2gd52': :math:`d_{5/2} \\rightarrow t_{2g}` - - 'dd': :math:`d \\rightarrow d` - - 'dd32': :math:`d_{3/2} \\rightarrow d` - - 'dd52': :math:`d_{5/2} \\rightarrow d` - - 'fd': :math:`d \\rightarrow f` - - 'fd32': :math:`d_{3/2} \\rightarrow f` - - 'fd52': :math:`d_{5/2} \\rightarrow f` - - 'sf': :math:`f \\rightarrow s` - - 'sf52': :math:`f_{5/2} \\rightarrow s` - - 'sf72': :math:`f_{7/2} \\rightarrow s` - - 'pf': :math:`f \\rightarrow p` - - 'pf52': :math:`f_{5/2} \\rightarrow p` - - 'pf72': :math:`f_{7/2} \\rightarrow p` - - 't2gf': :math:`f \\rightarrow t_{2g}` - - 't2gf52': :math:`f_{5/2} \\rightarrow t_{2g}` - - 't2gf72': :math:`f_{7/2} \\rightarrow t_{2g}` - - 'df': :math:`f \\rightarrow d` - - 'df52': :math:`f_{5/2} \\rightarrow d` - - 'df72': :math:`f_{7/2} \\rightarrow d` - - 'ff': :math:`f \\rightarrow f` - - 'ff52': :math:`f_{5/2} \\rightarrow f` - - 'ff72': :math:`f_{7/2} \\rightarrow f` - - Returns - ------- - res: 2d complex array - The calculated transition matrix. - - Examples - -------- - >>> import edrixs - p to d transition - >>> trans_dp = get_trans_oper('dp') - p to t2g transition - >>> trans_t2gp = get_trans_oper('t2gp') - p_{3/2} to d transition - >>> trans_dp32 = get_trans_oper('dp32') - """ - info = info_atomic_shell() - v_name, c_name = case_to_shell_name(case.strip()) - v_orbl, c_orbl = info[v_name][0], info[c_name][0] - v_norb, c_norb = 2 * (2 * v_orbl + 1), 2 * (2 * c_orbl + 1) - if (v_orbl + c_orbl) % 2 == 0: - op = quadrupole_trans_oper(v_orbl, c_orbl) - else: - op = dipole_trans_oper(v_orbl, c_orbl) - - # truncate to a sub-shell if necessary - special_shell = ['t2g', 'p12', 'p32', 'd32', 'd52', 'f52', 'f72'] - orb_indx = { - special_shell[0]: [2, 3, 4, 5, 8, 9], - special_shell[1]: [0, 1], - special_shell[2]: [2, 3, 4, 5], - special_shell[3]: [0, 1, 2, 3], - special_shell[4]: [4, 5, 6, 7, 8, 9], - special_shell[5]: [0, 1, 2, 3, 4, 5], - special_shell[6]: [6, 7, 8, 9, 10, 11, 12, 13] - } - left_tmat = np.eye(v_norb, dtype=complex) - right_tmat = np.eye(c_norb, dtype=complex) - indx1 = list(range(0, v_norb)) - indx2 = list(range(0, c_norb)) - if v_name in special_shell: - if v_name == 't2g': - left_tmat[0:v_norb, 0:v_norb] = tmat_c2r('d', True) - else: - left_tmat[0:v_norb, 0:v_norb] = tmat_c2j(v_orbl) - indx1 = orb_indx[v_name] - if c_name in special_shell[1:]: - right_tmat[0:c_norb, 0:c_norb] = tmat_c2j(c_orbl) - indx2 = orb_indx[c_name] - - if (v_orbl + c_orbl) % 2 == 0: - npol = 5 - else: - npol = 3 - - op_tmp = np.zeros((npol, len(indx1), len(indx2)), dtype=complex) - for i in range(npol): - op[i] = cb_op2(op[i], left_tmat, right_tmat) - op_tmp[i] = op[i, indx1][:, indx2] - if v_name == 't2g': - op_tmp[i] = np.dot(np.conj(np.transpose(tmat_r2c('t2g', True))), op_tmp[i]) - res = op_tmp - return res
- - - -
-[docs] -def unit_wavevector(theta, phi, local_axis=None, direction='in'): - """ - Given incident or scattered angle, and azimuthal angle, return - unit wavevector with respect to global :math:`xyz`-axis. - - Parameters - ---------- - theta: float number - Incident or scattered angle (in radian), with respect to local_aixs. - phi: float number - Azimuthal angle (in radian), with respect to the :math:`x` of local_axis. - local_axis: 3*3 float array - The local axis defining the scattering geometry. - - - :math:`x`-axis: local_axis[:,0] - - - :math:`y`-axis: local_axis[:,1] - - - :math:`z`-axis: local_axis[:,2] - - It will be an identity matrix if not provided. - direction: string - The direction of photon wave, options can be - - - 'in': incident photon - - - 'out': scattered photon - - Returns - ------- - unit_k: list of 3 float numbers - The unit wavevector. - """ - if local_axis is None: - local_axis = np.eye(3) - else: - local_axis = np.array(local_axis) - - if direction.strip() == 'in': - unit_k = np.array([-np.cos(theta) * np.cos(phi), - -np.cos(theta) * np.sin(phi), - -np.sin(theta)]) - unit_k = np.dot(local_axis, unit_k) - elif direction.strip() == 'out': - unit_k = np.array([-np.cos(theta) * np.cos(phi), - -np.cos(theta) * np.sin(phi), - np.sin(theta)]) - unit_k = np.dot(local_axis, unit_k) - else: - raise Exception("Unknown direction in unit_wavevector: ", direction) - - return unit_k
- - - -
-[docs] -def wavevector_with_length(theta, phi, energy, local_axis=None, direction='in'): - """ - Given incident or scattered angle, azimuthal angle, energy of photon, return - wavevector with respect to global :math:`xyz`-axis. - - Parameters - ---------- - theta: float number - Incident or scattered angle (in radian), with respect to local_aixs. - phi: float number - Azimuthal angle (in radian), with respect to the :math:`x` of local_axis. - energy: float number - Energy of photon (in eV). - local_axis: 3*3 float array - The local axis defining the scattering geometry. - - - :math:`x`-axis: local_axis[:,0] - - - :math:`y`-axis: local_axis[:,1] - - - :math:`z`-axis: local_axis[:,2] - - It will be an identity matrix if not provided. - direction: string - The direction of photon wave, options can be - - - 'in': incident photon - - - 'out': scattered photon - - Returns - ------- - k_with_length: list of 3 float numbers - The wavevector with length. - """ - - hbarc = 1.973270533 * 1000 # eV*A - k_len = energy / hbarc - if local_axis is None: - local_axis = np.eye(3) - else: - local_axis = np.array(local_axis) - - k_with_length = k_len * unit_wavevector(theta, phi, local_axis, direction) - - return k_with_length
- - - -
-[docs] -def get_wavevector_rixs(thin, thout, phi, ein, eout, local_axis=None): - """ - Return the wave vector of incident and scattered photons, for RIXS calculation. - - Parameters - ---------- - thin: float - The incident angle in radian. - thout: float - The scattered angle in radian. - phi: float - The azimuthal angle in radian. - ein: float - Energy of the incident photon (eV). - eout: float - Energy of the scattered photon (eV). - local_axis: :math:`3 \\times 3` float array - The local :math:`z` -axis, the angle thin and thout are defined with respect to this axis. - - - :math:`x`-axis: local_axis[:,0] - - - :math:`y`-axis: local_axis[:,1] - - - :math:`z`-axis: local_axis[:,2] - - It will be an identity matrix if not provided. - - Returns - ------- - k_in_global: 3-length float array - The wave vector of the incident photon, with respect to the global :math:`xyz` -axis. - k_out_global: 3-length float array - The wave vector of the scattered photon, with respect to the global :math:`xyz` -axis. - """ - if local_axis is None: - local_axis = np.eye(3) - else: - local_axis = np.array(local_axis) - - k_in_global = wavevector_with_length(thin, phi, ein, local_axis, direction='in') - k_out_global = wavevector_with_length(thout, phi, eout, local_axis, direction='out') - - return k_in_global, k_out_global
- - - -
-[docs] -def linear_polvec(theta, phi, alpha, local_axis=None, direction='in'): - """ - Return linear polarization vector. - - Parameters - ---------- - theta: float number - Incident or scattered angle (in radian) with respect to local_axis. - phi: float number - Azimuthal angle (in radian) with respect to the :math:`x` of local_axis. - alpha: float number - The angle (in radian) between the polarization vector and the scattering plane. - - local_axis: 3*3 float array - The local axis defining the scattering geometry. - - - :math:`x`-axis: local_axis[:,0] - - - :math:`y`-axis: local_axis[:,1] - - - :math:`z`-axis: local_axis[:,2] - - It will be an identity matrix if not provided. - direction: string - The direction of photon wave, options can be - - - 'in': incident photon - - - 'out': scattered photon - - Returns - ------- - polvec: list of 3 float number - The polarization vector. - """ - if local_axis is None: - local_axis = np.eye(3) - else: - local_axis = np.array(local_axis) - - if direction.strip() == 'in': - polvec = ( - np.array([-np.cos(phi) * np.cos(np.pi / 2.0 - theta), - -np.sin(phi) * np.cos(np.pi / 2.0 - theta), - +np.sin(np.pi / 2.0 - theta)]) * np.cos(alpha) + - np.array([-np.sin(phi), np.cos(phi), 0]) * np.sin(alpha) - ) - polvec = np.dot(local_axis, polvec) - elif direction.strip() == 'out': - polvec = ( - np.array([+np.cos(phi) * np.cos(np.pi / 2.0 - theta), - +np.sin(phi) * np.cos(np.pi / 2.0 - theta), - +np.sin(np.pi / 2.0 - theta)]) * np.cos(alpha) + - np.array([-np.sin(phi), np.cos(phi), 0]) * np.sin(alpha) - ) - polvec = np.dot(local_axis, polvec) - else: - raise Exception("Unknown direction in linear_polvec: ", direction) - - return polvec
- - - -
-[docs] -def dipole_polvec_rixs(thin, thout, phi=0, alpha=0, beta=0, local_axis=None, pol_type=None): - """ - Return polarization vector of incident and scattered photons, for RIXS calculation. - - Parameters - ---------- - thin: float - The incident angle (radian). - thout: float - The scattered angle (radian). - phi: float - The azimuthal angle (radian). - alpha: float - The angle between the polarization vector of the incident photon and - the scattering plane (radian) - beta: float - The angle between the polarization vector of the scattered photon and - the scattering plane (radian) - local_axis: 3*3 float array - The local axis defining the scattering geometry. - - - :math:`x`-axis: local_axis[:,0] - - - :math:`y`-axis: local_axis[:,1] - - - :math:`z`-axis: local_axis[:,2] - - It will be an identity matrix if not provided. - pol_type: tuple of two strings - Specify types of polarization for incident and scattered photons. - case[0] for incident photon, case[1] for scattered photon. Options can be - - - 'linear': Linear polarization - - 'left' : Left-circular polarization. - - 'right' : Right-circular polarization. - - It will set pol_type=('linear', 'linear') if not provided. - - Returns - ------- - ei_in_global: 3-length complex array - The linear polarization vector of the incident photon, - with respect to the global :math:`xyz` -axis. - ef_out_global: 3-length complex array - The linear polarization vector of the scattered photon - with respect to the global :math:`xyz` -axis. - """ - if local_axis is None: - local_axis = np.eye(3) - else: - local_axis = np.array(local_axis) - - if pol_type is None: - pol_type = ('linear', 'linear') - - ex = linear_polvec(thin, phi, 0, local_axis, direction='in') - ey = linear_polvec(thin, phi, np.pi/2.0, local_axis, direction='in') - if pol_type[0].strip() == 'linear': - ei_global = linear_polvec(thin, phi, alpha, local_axis, direction='in') - elif pol_type[0].strip() == 'left': - ei_global = (ex + 1j * ey) / np.sqrt(2.0) - elif pol_type[0].strip() == 'right': - ei_global = (ex - 1j * ey) / np.sqrt(2.0) - else: - raise Exception("Unknown polarization type for incident photon: ", pol_type[0]) - - ex = linear_polvec(thout, phi, 0, local_axis, direction='out') - ey = linear_polvec(thout, phi, np.pi/2.0, local_axis, direction='out') - if pol_type[1].strip() == 'linear': - ef_global = linear_polvec(thout, phi, beta, local_axis, direction='out') - elif pol_type[1].strip() == 'left': - ef_global = (ex + 1j * ey) / np.sqrt(2.0) - elif pol_type[1].strip() == 'right': - ef_global = (ex - 1j * ey) / np.sqrt(2.0) - else: - raise Exception("Unknown polarization type for scattered photon: ", pol_type[1]) - - return ei_global, ef_global
- - - -
-[docs] -def dipole_polvec_xas(thin, phi=0, alpha=0, local_axis=None, pol_type='linear'): - """ - Return the linear polarization vector of incident photons, for XAS calculation. - - Parameters - ---------- - thin: float - The incident angle (radian). - phi: float - The azimuthal angle (radian). - alpha: float - The angle between the polarization vector of the incident photon and - the scattering plane (radian) - local_axis: 3*3 float array - The local axis defining the scattering geometry. - - - :math:`x`-axis: local_axis[:,0] - - - :math:`y`-axis: local_axis[:,1] - - - :math:`z`-axis: local_axis[:,2] - - It will be an identity matrix if not provided. - pol_type: string - - - 'linear': Linear polarization. - - 'left' : Left-circular polarization. - - 'right' : Right-circular polarization. - - Returns - ------- - ei_global: 3-length float array - The linear polarization vector of the incident photon, with resepct to the - global :math:`xyz` -axis. - """ - if local_axis is None: - local_axis = np.eye(3) - else: - local_axis = np.array(local_axis) - - ex = linear_polvec(thin, phi, 0, local_axis, direction='in') - ey = linear_polvec(thin, phi, np.pi/2.0, local_axis, direction='in') - if pol_type.strip() == 'linear': - ei_global = linear_polvec(thin, phi, alpha, local_axis, direction='in') - elif pol_type.strip() == 'left': - ei_global = (ex + 1j * ey) / np.sqrt(2.0) - elif pol_type.strip() == 'right': - ei_global = (ex - 1j * ey) / np.sqrt(2.0) - else: - raise Exception("Unknown polarization type for incident photon: ", pol_type) - - return ei_global
- - - -
-[docs] -def quadrupole_polvec(polvec, wavevec): - """ - Given dipolar polarization vector and wave-vector, return quadrupolar polarization vector. - - Parameters - ---------- - polvec: 3 elements of complex array - Dipolar polarization vector of photon, :math:`\\epsilon_{x}, \\epsilon_{y}, \\epsilon_{z}`, - NOTE: they can be complex when the polarization is circular. - wavevec: 3 elements of float array - Wavevector of photon, :math:`k_{x}, k_{y}, k_{z}`. - - Returns - ------- - quad_vec: 5 elements of float array - Quadrupolar polarization vector. - """ - - quad_vec = np.zeros(5, dtype=complex) - kvec = wavevec / np.sqrt(np.dot(wavevec, wavevec)) - - quad_vec[0] = 0.5 * (2 * polvec[2] * kvec[2] - polvec[0] * kvec[0] - polvec[1] * kvec[1]) - quad_vec[1] = np.sqrt(3.0)/2.0 * (polvec[2] * kvec[0] + polvec[0] * kvec[2]) - quad_vec[2] = np.sqrt(3.0)/2.0 * (polvec[1] * kvec[2] + polvec[2] * kvec[1]) - quad_vec[3] = np.sqrt(3.0)/2.0 * (polvec[0] * kvec[0] - polvec[1] * kvec[1]) - quad_vec[4] = np.sqrt(3.0)/2.0 * (polvec[0] * kvec[1] + polvec[1] * kvec[0]) - - return quad_vec
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/plot_spectrum.html b/edrixs/_modules/edrixs/plot_spectrum.html deleted file mode 100644 index 065cfe5b69..0000000000 --- a/edrixs/_modules/edrixs/plot_spectrum.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - - - edrixs.plot_spectrum — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.plot_spectrum

-__all__ = ['get_spectra_from_poles', 'merge_pole_dicts', 'plot_spectrum', 'plot_rixs_map']
-
-import numpy as np
-import matplotlib.pyplot as plt
-from .utils import boltz_dist
-from .iostream import read_poles_from_file
-
-
-
-[docs] -def get_spectra_from_poles(poles_dict, omega_mesh, gamma_mesh, temperature): - """ - Given the dict of poles, calculate XAS or RIXS spectra using continued fraction formula, - - .. math:: - I(\\omega_{i}) =-\\frac{1}{\\pi}\\text{Im} \\left[ \\frac{1}{x - \\alpha_{0} - - \\frac{\\beta_{1}^2}{x-\\alpha_{1} - \\frac{\\beta_{2}^2}{x-\\alpha_{2} - ...}} }\\right], - - where, :math:`x = \\omega_{i}+i\\Gamma_{i} + E_{g}`. - - Parameters - ---------- - poles_dict: dict - Dict containing information of poles, which are calculated from - xas_fsolver and rixs_fsolver. - This dict is constructed by :func:`iostream.read_poles_from_file`. - omega_mesh: 1d float array - Energy grid. - gamma_mesh: 1d float array - Life-time broadening. - temperature: float number - Temperature (K) for boltzmann distribution. - - Returns - ------- - spectra: 1d float array - The calculated XAS or RIXS spectra. - - See also - -------- - iostream.read_poles_from_file: read XAS or RIXS poles files. - """ - nom = len(omega_mesh) - spectra = np.zeros(nom, dtype=np.float64) - gs_dist = boltz_dist(poles_dict['eigval'], temperature) - ngs = len(poles_dict['eigval']) - for i in range(ngs): - tmp_vec = np.zeros(nom, dtype=complex) - neff = poles_dict['npoles'][i] - alpha = poles_dict['alpha'][i] - beta = poles_dict['beta'][i] - eigval = poles_dict['eigval'][i] - norm = poles_dict['norm'][i] - for j in range(neff-1, 0, -1): - tmp_vec = ( - beta[j-1]**2 / (omega_mesh + 1j * gamma_mesh + eigval - alpha[j] - tmp_vec) - ) - tmp_vec = ( - 1.0 / (omega_mesh + 1j * gamma_mesh + eigval - alpha[0] - tmp_vec) - ) - spectra[:] += -1.0 / np.pi * np.imag(tmp_vec) * norm * gs_dist[i] - - return spectra
- - - -
-[docs] -def merge_pole_dicts(list_pole_dict): - """ - Given a list of dict of poles, merge them into one dict of poles - - Parameters - ---------- - list_pole_dict: list of dict - Dict containing information of poles, which are calculated from - xas_fsolver and rixs_fsolver. - - Returns - ------- - new_pole_dict: dict of poles - New dict of poles. - """ - new_pole_dict = { - 'eigval': [], - 'npoles': [], - 'norm': [], - 'alpha': [], - 'beta': [] - } - for poles_dict in list(list_pole_dict): - new_pole_dict['eigval'].extend(poles_dict['eigval']) - new_pole_dict['npoles'].extend(poles_dict['npoles']) - new_pole_dict['norm'].extend(poles_dict['norm']) - new_pole_dict['alpha'].extend(poles_dict['alpha']) - new_pole_dict['beta'].extend(poles_dict['beta']) - - return new_pole_dict
- - - -
-[docs] -def plot_spectrum(file_list, omega_mesh, gamma_mesh, T=1.0, fname='spectrum.dat', - om_shift=0.0, fmt_float='{:.15f}'): - """ - Reading poles :math:`\\alpha` and :math:`\\beta`, and calculate - the spectrum using continued fraction formula, - - .. math:: - I(\\omega_{i}) =-\\frac{1}{\\pi}\\text{Im} \\left[ \\frac{1}{x - \\alpha_{0} - - \\frac{\\beta_{1}^2}{x-\\alpha_{1} - \\frac{\\beta_{2}^2}{x-\\alpha_{2} - ...}} }\\right], - - where, :math:`x = \\omega_{i}+i\\Gamma_{i} + E_{g}`. - - Parameters - ---------- - file_list: list of string - Name of poles file. - omega_mesh: 1d float array - The frequency mesh. - gamma_mesh: 1d float array - The broadening factor, in general, it is frequency dependent. - T: float (default: 1.0K) - Temperature (K). - fname: str (default: 'spectrum.dat') - File name to store spectrum. - om_shift: float (default: 0.0) - Energy shift. - fmt_float: str (default: '{:.15f}') - Format for printing float numbers. - """ - - pole_dict = read_poles_from_file(file_list) - spectrum = get_spectra_from_poles(pole_dict, omega_mesh, gamma_mesh, T) - - space = " " - fmt_string = (fmt_float + space) * 2 + '\n' - f = open(fname, 'w') - for i in range(len(omega_mesh)): - f.write(fmt_string.format(omega_mesh[i] + om_shift, spectrum[i])) - f.close()
- - - -
-[docs] -def plot_rixs_map(rixs_data, ominc_mesh, eloss_mesh, fname='rixsmap.pdf'): - """ - Given 2d RIXS data, plot a RIXS map and save it to a pdf file. - - Parameters - ---------- - rixs_data: 2d float array - Calculated RIXS data as a function of incident energy and energy loss. - ominc_mesh: 1d float array - Incident energy mesh. - eloss_mesh: 1d float array - Energy loss mesh. - fname: string - File name to save RIXS map. - """ - - fig, ax = plt.subplots() - a, b, c, d = min(eloss_mesh), max(eloss_mesh), min(ominc_mesh), max(ominc_mesh) - m, n = np.array(rixs_data).shape - if len(ominc_mesh) == m and len(eloss_mesh) == n: - plt.imshow( - rixs_data, extent=[a, b, c, d], origin='lower', aspect='auto', - cmap='rainbow', interpolation='gaussian' - ) - plt.xlabel(r'Energy loss (eV)') - plt.ylabel(r'Energy of incident photon (eV)') - elif len(eloss_mesh) == m and len(ominc_mesh) == n: - plt.imshow( - rixs_data, extent=[c, d, a, b], origin='lower', aspect='auto', - cmap='rainbow', interpolation='gaussian' - ) - plt.ylabel(r'Energy loss (eV)') - plt.xlabel(r'Energy of incident photon (eV)') - else: - raise Exception( - "Dimension of rixs_data is not consistent with ominc_mesh or eloss_mesh" - ) - - plt.savefig(fname)
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/rixs_utils.html b/edrixs/_modules/edrixs/rixs_utils.html deleted file mode 100644 index 33aa449e0d..0000000000 --- a/edrixs/_modules/edrixs/rixs_utils.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - edrixs.rixs_utils — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.rixs_utils

-__all__ = ['scattering_mat']
-
-import numpy as np
-
-
-
-[docs] -def scattering_mat(eval_i, eval_n, trans_mat_abs, - trans_mat_emi, omega_inc, gamma_n): - """ - Calculate X-ray scattering magnitude. - - .. math:: - - F^{ab}_{fi} = \\sum_{n}\\frac{<f|T_{a}|n><n|T_{b}|i>}{\\omega_{in} - - E_{n} + E_{i} + i\\Gamma_{n}}, - - where, :math:`T_{a}` and :math:`T_{b}` are components of transition - operators( :math:`a,b=x,y,z`). - - Parameters - ---------- - eval_i: 1d float array - Eigenvalues of the initial configuration without core-hole, :math:`E_i`. - eval_n: 1d float array - Eigenvalues of the intermediate configuration with core-hole, :math:`E_n`. - trans_mat_abs: 3d complex array - The transition operator for absorption process, :math:`<n|T_{b}|i>`. - trans_mat_emi: 3d complex array - The transition operator for emission process, :math:`<f|T_{a}|n>`. - omega_inc: float - The energy of incident photon, :math:`\\omega_{in}`. - gamma_n: float - The broadening of the core-hole (eV), :math:`\\Gamma_{n}`. - - Returns - ------- - Ffi: 4d complex array - The calculated scattering magnitude, :math:`F^{ab}_{fi}`. - """ - - num_gs = trans_mat_abs.shape[2] - num_ex = trans_mat_abs.shape[1] - num_fs = trans_mat_emi.shape[1] - - npol_abs = trans_mat_abs.shape[0] - npol_emi = trans_mat_emi.shape[0] - - Ffi = np.zeros((npol_emi, npol_abs, num_fs, num_gs), dtype=np.complex128) - tmp_abs = np.zeros((npol_abs, num_ex, num_gs), dtype=np.complex128) - denomi = np.zeros((num_ex, num_gs), dtype=np.complex128) - - for i in range(num_ex): - for j in range(num_gs): - aa = omega_inc - (eval_n[i] - eval_i[j]) - denomi[i, j] = 1.0 / (aa + 1j * gamma_n) - - for i in range(npol_abs): - tmp_abs[i] = trans_mat_abs[i] * denomi - - for i in range(npol_emi): - for j in range(npol_abs): - Ffi[i, j, :, :] = np.dot(trans_mat_emi[i], tmp_abs[j]) - - return Ffi
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/soc.html b/edrixs/_modules/edrixs/soc.html deleted file mode 100644 index 0aa22d618e..0000000000 --- a/edrixs/_modules/edrixs/soc.html +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - edrixs.soc — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.soc

-__all__ = ['atom_hsoc']
-
-import numpy as np
-
-
-
-[docs] -def atom_hsoc(case, soc): - """ - Return atomic spin-orbit coupling matrix :math:`\\vec{l}\\cdot\\vec{s}` - in complex spherical harmonics basis. - - Parameters - ---------- - case: str - String label indicating atomic shell, - - - 'p': for :math:`p` -shell. - - 't2g': for :math:`t_{2g}` -shell. - - 'd': for :math:`d` -shell. - - 'f': for :math:`f` -shell. - soc: float - The strength of spin-orbit coupling. - - Returns - ------- - hsoc: 2d complex array - The spin-orbit coupling matrix. - """ - - sqrt2 = np.sqrt(2.0) - sqrt6 = np.sqrt(6.0) - sqrt10 = np.sqrt(10.0) - sqrt12 = np.sqrt(12.0) - - if case.strip() == 'p': - hsoc = np.zeros((6, 6), dtype=np.complex128) - hsoc[0, 0] = -1.0 - hsoc[3, 0] = sqrt2 - hsoc[1, 1] = 1.0 - hsoc[5, 2] = sqrt2 - hsoc[0, 3] = sqrt2 - hsoc[4, 4] = 1.0 - hsoc[2, 5] = sqrt2 - hsoc[5, 5] = -1.0 - return 0.5 * soc * hsoc - - elif case.strip() == 't2g': - hsoc = np.zeros((6, 6), dtype=np.complex128) - hsoc[0, 0] = -1.0 - hsoc[3, 0] = sqrt2 - hsoc[1, 1] = 1.0 - hsoc[5, 2] = sqrt2 - hsoc[0, 3] = sqrt2 - hsoc[4, 4] = 1.0 - hsoc[2, 5] = sqrt2 - hsoc[5, 5] = -1.0 - return 0.5 * -soc * hsoc - - elif case.strip() == 'd': - hsoc = np.zeros((10, 10), dtype=np.complex128) - hsoc[0, 0] = -2.0 - hsoc[3, 0] = 2.0 - hsoc[1, 1] = 2.0 - hsoc[2, 2] = -1.0 - hsoc[5, 2] = sqrt6 - hsoc[0, 3] = 2.0 - hsoc[3, 3] = 1.0 - hsoc[7, 4] = sqrt6 - hsoc[2, 5] = sqrt6 - hsoc[6, 6] = 1.0 - hsoc[9, 6] = 2.0 - hsoc[4, 7] = sqrt6 - hsoc[7, 7] = -1.0 - hsoc[8, 8] = 2.0 - hsoc[6, 9] = 2.0 - hsoc[9, 9] = -2.0 - return 0.5 * soc * hsoc - - elif case.strip() == 'f': - hsoc = np.zeros((14, 14), dtype=np.complex128) - hsoc[0, 0] = -3.0 - hsoc[3, 0] = sqrt6 - hsoc[1, 1] = 3.0 - hsoc[2, 2] = -2.0 - hsoc[5, 2] = sqrt10 - hsoc[0, 3] = sqrt6 - hsoc[3, 3] = 2.0 - hsoc[4, 4] = -1.0 - hsoc[7, 4] = sqrt12 - hsoc[2, 5] = sqrt10 - hsoc[5, 5] = 1.0 - hsoc[9, 6] = sqrt12 - hsoc[4, 7] = sqrt12 - hsoc[8, 8] = 1.0 - hsoc[11, 8] = sqrt10 - hsoc[6, 9] = sqrt12 - hsoc[9, 9] = -1.0 - hsoc[10, 10] = 2.0 - hsoc[13, 10] = sqrt6 - hsoc[8, 11] = sqrt10 - hsoc[11, 11] = -2.0 - hsoc[12, 12] = 3.0 - hsoc[10, 13] = sqrt6 - hsoc[13, 13] = -3.0 - return 0.5 * soc * hsoc - - else: - raise Exception("error in atom_hsoc: DO NOT support SOC for this case: ", case)
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/solvers.html b/edrixs/_modules/edrixs/solvers.html deleted file mode 100644 index d73430c521..0000000000 --- a/edrixs/_modules/edrixs/solvers.html +++ /dev/null @@ -1,2849 +0,0 @@ - - - - - - - - edrixs.solvers — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.solvers

-__all__ = ['ed_1v1c_py', 'xas_1v1c_py', 'rixs_1v1c_py',
-           'ed_1v1c_fort', 'xas_1v1c_fort', 'rixs_1v1c_fort',
-           'ed_2v1c_fort', 'xas_2v1c_fort', 'rixs_2v1c_fort',
-           'ed_siam_fort', 'xas_siam_fort', 'rixs_siam_fort']
-
-import numpy as np
-import scipy
-
-from .iostream import (
-    write_tensor, write_emat, write_umat, write_config, read_poles_from_file
-)
-from .angular_momentum import (
-    get_sx, get_sy, get_sz, get_lx, get_ly, get_lz, rmat_to_euler, get_wigner_dmat
-)
-from .photon_transition import (
-    get_trans_oper, quadrupole_polvec, dipole_polvec_xas, dipole_polvec_rixs, unit_wavevector
-)
-from .coulomb_utensor import get_umat_slater, get_umat_slater_3shells
-from .manybody_operator import two_fermion, four_fermion
-from .fock_basis import get_fock_bin_by_N, write_fock_dec_by_N
-from .basis_transform import cb_op2, tmat_r2c, cb_op
-from .utils import info_atomic_shell, slater_integrals_name, boltz_dist
-from .rixs_utils import scattering_mat
-from .plot_spectrum import get_spectra_from_poles, merge_pole_dicts
-from .soc import atom_hsoc
-
-
-
-[docs] -def ed_1v1c_py(shell_name, *, shell_level=None, v_soc=None, c_soc=0, - v_noccu=1, slater=None, ext_B=None, on_which='spin', - v_cfmat=None, v_othermat=None, loc_axis=None, verbose=0): - """ - Perform ED for the case of two atomic shells, one valence plus one Core - shell with pure Python solver. - For example, for Ni-:math:`L_3` edge RIXS, they are 3d valence and 2p core shells. - - It will use scipy.linalag.eigh to exactly diagonalize both the initial and intermediate - Hamiltonians to get all the eigenvalues and eigenvectors, and the transition operators - will be built in the many-body eigenvector basis. - - This solver is only suitable for small size of Hamiltonian, typically the dimension - of both initial and intermediate Hamiltonian are smaller than 10,000. - - Parameters - ---------- - shell_name: tuple of two strings - Names of valence and core shells. The 1st (2nd) string in the tuple is for the - valence (core) shell. - - - The 1st string can only be 's', 'p', 't2g', 'd', 'f', - - - The 2nd string can be 's', 'p', 'p12', 'p32', 'd', 'd32', 'd52', - 'f', 'f52', 'f72'. - - For example: shell_name=('d', 'p32') indicates a :math:`L_3` edge transition from - core :math:`p_{3/2}` shell to valence :math:`d` shell. - shell_level: tuple of two float numbers - Energy level of valence (1st element) and core (2nd element) shells. - - They will be set to zero if not provided. - v_soc: tuple of two float numbers - Spin-orbit coupling strength of valence electrons, for the initial (1st element) - and intermediate (2nd element) Hamiltonians. - - They will be set to zero if not provided. - c_soc: a float number - Spin-orbit coupling strength of core electrons. - v_noccu: int number - Number of electrons in valence shell. - slater: tuple of two lists - Slater integrals for initial (1st list) and intermediate (2nd list) Hamiltonians. - The order of the elements in each list should be like this: - - [FX_vv, FX_vc, GX_vc, FX_cc], - - where X are integers with ascending order, it can be X=0, 2, 4, 6 or X=1, 3, 5. - One can ignore all the continuous zeros at the end of the list. - - For example, if the full list is: [F0_dd, F2_dd, F4_dd, 0, F2_dp, 0, 0, 0, 0], one can - just provide [F0_dd, F2_dd, F4_dd, 0, F2_dp] - - All the Slater integrals will be set to zero if slater=None. - ext_B: tuple of three float numbers - Vector of external magnetic field with respect to global :math:`xyz`-axis. - - They will be set to zero if not provided. - on_which: string - Apply Zeeman exchange field on which sector. Options are 'spin', 'orbital' or 'both'. - v_cfmat: 2d complex array - Crystal field splitting Hamiltonian of valence electrons. The dimension and the orbital - order should be consistent with the type of valence shell. - - They will be zeros if not provided. - v_othermat: 2d complex array - Other possible Hamiltonian of valence electrons. The dimension and the orbital order - should be consistent with the type of valence shell. - - They will be zeros if not provided. - loc_axis: 3*3 float array - The local axis with respect to which local orbitals are defined. - - - x: local_axis[:,0], - - - y: local_axis[:,1], - - - z: local_axis[:,2]. - - It will be an identity matrix if not provided. - verbose: int - Level of writting data to files. Hopping matrices, Coulomb tensors, eigvenvalues - will be written if verbose > 0. - - Returns - ------- - eval_i: 1d float array - The eigenvalues of initial Hamiltonian. - eval_n: 1d float array - The eigenvalues of intermediate Hamiltonian. - trans_op: 3d complex array - The matrices of transition operators in the eigenvector basis. - Their components are defined with respect to the global :math:`xyz`-axis. - """ - print("edrixs >>> Running ED ...") - v_name_options = ['s', 'p', 't2g', 'd', 'f'] - c_name_options = ['s', 'p', 'p12', 'p32', 't2g', 'd', 'd32', 'd52', 'f', 'f52', 'f72'] - v_name = shell_name[0].strip() - c_name = shell_name[1].strip() - if v_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v_name) - if c_name not in c_name_options: - raise Exception("NOT supported type of core shell: ", c_name) - - info_shell = info_atomic_shell() - - # Quantum numbers of angular momentum - v_orbl = info_shell[v_name][0] - - # number of orbitals including spin degree of freedom - v_norb = info_shell[v_name][1] - c_norb = info_shell[c_name][1] - - # total number of orbitals - ntot = v_norb + c_norb - - emat_i = np.zeros((ntot, ntot), dtype=complex) - emat_n = np.zeros((ntot, ntot), dtype=complex) - - # Coulomb interaction - # Get the names of all the required slater integrals - slater_name = slater_integrals_name((v_name, c_name), ('v', 'c')) - nslat = len(slater_name) - - slater_i = np.zeros(nslat, dtype=float) - slater_n = np.zeros(nslat, dtype=float) - - if slater is not None: - if nslat > len(slater[0]): - slater_i[0:len(slater[0])] = slater[0] - else: - slater_i[:] = slater[0][0:nslat] - if nslat > len(slater[1]): - slater_n[0:len(slater[1])] = slater[1] - else: - slater_n[:] = slater[1][0:nslat] - - # print summary of slater integrals - print() - print(" Summary of Slater integrals:") - print(" ------------------------------") - print(" Terms, Initial Hamiltonian, Intermediate Hamiltonian") - for i in range(nslat): - print(" ", slater_name[i], ": {:20.10f}{:20.10f}".format(slater_i[i], slater_n[i])) - print() - - case = v_name + c_name - umat_i = get_umat_slater(case, *slater_i) - umat_n = get_umat_slater(case, *slater_n) - - if verbose > 0: - write_umat(umat_i, 'coulomb_i.in') - write_umat(umat_n, 'coulomb_n.in') - - # SOC - if v_soc is not None: - emat_i[0:v_norb, 0:v_norb] += atom_hsoc(v_name, v_soc[0]) - emat_n[0:v_norb, 0:v_norb] += atom_hsoc(v_name, v_soc[1]) - - # when the core-shell is any of p12, p32, d32, d52, f52, f72, - # do not need to add SOC for core shell - if c_name in ['p', 'd', 'f']: - emat_n[v_norb:ntot, v_norb:ntot] += atom_hsoc(c_name, c_soc) - - # crystal field - if v_cfmat is not None: - emat_i[0:v_norb, 0:v_norb] += np.array(v_cfmat) - emat_n[0:v_norb, 0:v_norb] += np.array(v_cfmat) - - # other hopping matrix - if v_othermat is not None: - emat_i[0:v_norb, 0:v_norb] += np.array(v_othermat) - emat_n[0:v_norb, 0:v_norb] += np.array(v_othermat) - - # energy of shells - if shell_level is not None: - emat_i[0:v_norb, 0:v_norb] += np.eye(v_norb) * shell_level[0] - emat_i[v_norb:ntot, v_norb:ntot] += np.eye(c_norb) * shell_level[1] - emat_n[0:v_norb, 0:v_norb] += np.eye(v_norb) * shell_level[0] - emat_n[v_norb:ntot, v_norb:ntot] += np.eye(c_norb) * shell_level[1] - - # external magnetic field - if v_name == 't2g': - lx, ly, lz = get_lx(1, True), get_ly(1, True), get_lz(1, True) - sx, sy, sz = get_sx(1), get_sy(1), get_sz(1) - lx, ly, lz = -lx, -ly, -lz - else: - lx, ly, lz = get_lx(v_orbl, True), get_ly(v_orbl, True), get_lz(v_orbl, True) - sx, sy, sz = get_sx(v_orbl), get_sy(v_orbl), get_sz(v_orbl) - - if ext_B is not None: - if on_which.strip() == 'spin': - zeeman = ext_B[0] * (2 * sx) + ext_B[1] * (2 * sy) + ext_B[2] * (2 * sz) - elif on_which.strip() == 'orbital': - zeeman = ext_B[0] * lx + ext_B[1] * ly + ext_B[2] * lz - elif on_which.strip() == 'both': - zeeman = ext_B[0] * (lx + 2 * sx) + ext_B[1] * (ly + 2 * sy) + ext_B[2] * (lz + 2 * sz) - else: - raise Exception("Unknown value of on_which", on_which) - emat_i[0:v_norb, 0:v_norb] += zeeman - emat_n[0:v_norb, 0:v_norb] += zeeman - - if verbose > 0: - write_emat(emat_i, 'hopping_i.in') - write_emat(emat_n, 'hopping_n.in') - - basis_i = get_fock_bin_by_N(v_norb, v_noccu, c_norb, c_norb) - basis_n = get_fock_bin_by_N(v_norb, v_noccu+1, c_norb, c_norb - 1) - ncfg_i, ncfg_n = len(basis_i), len(basis_n) - print("edrixs >>> Dimension of the initial Hamiltonian: ", ncfg_i) - print("edrixs >>> Dimension of the intermediate Hamiltonian: ", ncfg_n) - - # Build many-body Hamiltonian in Fock basis - print("edrixs >>> Building Many-body Hamiltonians ...") - hmat_i = np.zeros((ncfg_i, ncfg_i), dtype=complex) - hmat_n = np.zeros((ncfg_n, ncfg_n), dtype=complex) - hmat_i[:, :] += two_fermion(emat_i, basis_i, basis_i) - hmat_i[:, :] += four_fermion(umat_i, basis_i) - hmat_n[:, :] += two_fermion(emat_n, basis_n, basis_n) - hmat_n[:, :] += four_fermion(umat_n, basis_n) - print("edrixs >>> Done !") - - # Do exact-diagonalization to get eigenvalues and eigenvectors - print("edrixs >>> Exact Diagonalization of Hamiltonians ...") - eval_i, evec_i = scipy.linalg.eigh(hmat_i) - eval_n, evec_n = scipy.linalg.eigh(hmat_n) - print("edrixs >>> Done !") - - if verbose > 0: - write_tensor(eval_i, 'eval_i.dat') - write_tensor(eval_n, 'eval_n.dat') - - # Build dipolar transition operators in local-xyz axis - if loc_axis is not None: - local_axis = np.array(loc_axis) - else: - local_axis = np.eye(3) - tmp = get_trans_oper(case) - npol, n, m = tmp.shape - tmp_g = np.zeros((npol, n, m), dtype=complex) - # Transform the transition operators to global-xyz axis - # dipolar transition - if npol == 3: - for i in range(3): - for j in range(3): - tmp_g[i] += local_axis[i, j] * tmp[j] - - # quadrupolar transition - elif npol == 5: - alpha, beta, gamma = rmat_to_euler(local_axis) - wignerD = get_wigner_dmat(4, alpha, beta, gamma) - rotmat = np.dot(np.dot(tmat_r2c('d'), wignerD), np.conj(np.transpose(tmat_r2c('d')))) - for i in range(5): - for j in range(5): - tmp_g[i] += rotmat[i, j] * tmp[j] - else: - raise Exception("Have NOT implemented this case: ", npol) - - tmp2 = np.zeros((npol, ntot, ntot), dtype=complex) - trans_op = np.zeros((npol, ncfg_n, ncfg_i), dtype=complex) - for i in range(npol): - tmp2[i, 0:v_norb, v_norb:ntot] = tmp_g[i] - trans_op[i] = two_fermion(tmp2[i], basis_n, basis_i) - trans_op[i] = cb_op2(trans_op[i], evec_n, evec_i) - - print("edrixs >>> ED Done !") - - return eval_i, eval_n, trans_op
- - - -
-[docs] -def xas_1v1c_py(eval_i, eval_n, trans_op, ominc, *, gamma_c=0.1, thin=1.0, phi=0, - pol_type=None, gs_list=None, temperature=1.0, scatter_axis=None): - - """ - Calculate XAS for the case of one valence shell plus one core shell with Python solver. - - This solver is only suitable for small size of Hamiltonian, typically the dimension - of both initial and intermediate Hamiltonian are smaller than 10,000. - - Parameters - ---------- - eval_i: 1d float array - The eigenvalues of the initial Hamiltonian. - eval_n: 1d float array - The eigenvalues of the intermediate Hamiltonian. - trans_op: 3d complex array - The transition operators in the eigenstates basis. - ominc: 1d float array - Incident energy of photon. - gamma_c: a float number or a 1d float array with the same shape as ominc. - The core-hole life-time broadening factor. It can be a constant value - or incident energy dependent. - thin: float number - The incident angle of photon (in radian). - phi: float number - Azimuthal angle (in radian), defined with respect to the - :math:`x`-axis of the scattering axis: scatter_axis[:,0]. - pol_type: list of tuples - Type of polarization, options can be: - - - ('linear', alpha), linear polarization, where alpha is the angle between the - polarization vector and the scattering plane in radians. - - - ('left', 0), left circular polarization. - - - ('right', 0), right circular polarization. - - - ('isotropic', 0). isotropic polarization. - - It will set pol_type=[('isotropic', 0)] if not provided. - gs_list: 1d list of ints - The indices of initial states which will be used in XAS calculations. - - It will set gs_list=[0] if not provided. - temperature: float number - Temperature (in K) for boltzmann distribution. - scatter_axis: 3*3 float array - The local axis defining the scattering plane. The scattering plane is defined in - the local :math:`zx`-plane. - - local :math:`x`-axis: scatter_axis[:,0] - - local :math:`y`-axis: scatter_axis[:,1] - - local :math:`z`-axis: scatter_axis[:,2] - - It will be set to an identity matrix if not provided. - - Returns - ------- - xas: 2d float array - The calculated XAS spectra. The 1st dimension is for the incident energy, and the - 2nd dimension is for different polarizations. - """ - - print("edrixs >>> Running XAS ...") - n_om = len(ominc) - npol, ncfg_n = trans_op.shape[0], trans_op.shape[1] - if pol_type is None: - pol_type = [('isotropic', 0)] - if gs_list is None: - gs_list = [0] - if scatter_axis is None: - scatter_axis = np.eye(3) - else: - scatter_axis = np.array(scatter_axis) - - xas = np.zeros((n_om, len(pol_type)), dtype=float) - gamma_core = np.zeros(n_om, dtype=float) - prob = boltz_dist([eval_i[i] for i in gs_list], temperature) - if np.isscalar(gamma_c): - gamma_core[:] = np.ones(n_om) * gamma_c - else: - gamma_core[:] = gamma_c - - kvec = unit_wavevector(thin, phi, scatter_axis, 'in') - for i, om in enumerate(ominc): - for it, (pt, alpha) in enumerate(pol_type): - if pt.strip() not in ['left', 'right', 'linear', 'isotropic']: - raise Exception("Unknown polarization type: ", pt) - polvec = np.zeros(npol, dtype=complex) - if pt.strip() == 'left' or pt.strip() == 'right' or pt.strip() == 'linear': - pol = dipole_polvec_xas(thin, phi, alpha, scatter_axis, pt) - if npol == 3: # dipolar transition - polvec[:] = pol - if npol == 5: # quadrupolar transition - polvec[:] = quadrupole_polvec(pol, kvec) - - # loop over all the initial states - for j, igs in enumerate(gs_list): - if pt.strip() == 'isotropic': - for k in range(npol): - xas[i, it] += ( - prob[j] * np.sum(np.abs(trans_op[k, :, igs])**2 * gamma_core[i] / - np.pi / ((om - (eval_n[:] - eval_i[igs]))**2 + - gamma_core[i]**2)) - ) / npol - else: - F_mag = np.zeros(ncfg_n, dtype=complex) - for k in range(npol): - F_mag += trans_op[k, :, igs] * polvec[k] - xas[i, it] += ( - prob[j] * np.sum(np.abs(F_mag)**2 * gamma_core[i] / np.pi / - ((om - (eval_n[:] - eval_i[igs]))**2 + gamma_core[i]**2)) - ) - - print("edrixs >>> XAS Done !") - - return xas
- - - -
-[docs] -def rixs_1v1c_py(eval_i, eval_n, trans_op, ominc, eloss, *, - gamma_c=0.1, gamma_f=0.01, thin=1.0, thout=1.0, phi=0.0, - pol_type=None, gs_list=None, temperature=1.0, scatter_axis=None, skip_gs=False): - """ - Calculate RIXS for the case of one valence shell plus one core shell with Python solver. - - This solver is only suitable for small size of Hamiltonian, typically the dimension - of both initial and intermediate Hamiltonian are smaller than 10,000. - - Parameters - ---------- - eval_i: 1d float array - The eigenvalues of the initial Hamiltonian. - eval_n: 1d float array - The eigenvalues of the intermediate Hamiltonian. - trans_op: 3d complex array - The transition operators in the eigenstates basis. - ominc: 1d float array - Incident energy of photon. - eloss: 1d float array - Energy loss. - gamma_c: a float number or a 1d float array with same shape as ominc. - The core-hole life-time broadening factor. It can be a constant value - or incident energy dependent. - gamma_f: a float number or a 1d float array with same shape as eloss. - The final states life-time broadening factor. It can be a constant value - or energy loss dependent. - thin: float number - The incident angle of photon (in radian). - thout: float number - The scattered angle of photon (in radian). - phi: float number - Azimuthal angle (in radian), defined with respect to the - :math:`x`-axis of scattering axis: scatter_axis[:,0]. - pol_type: list of 4-elements-tuples - Type of polarizations. It has the following form: - - (str1, alpha, str2, beta) - - where, str1 (str2) can be 'linear', 'left', 'right', 'isotropic' and alpha (beta) is - the angle (in radians) between the linear polarization vector and the scattering plane. - - If str1 (or str2) is 'isotropic' then the polarization vector projects equally - along each axis and the other variables are ignored. - - It will set pol_type=[('linear', 0, 'linear', 0)] if not provided. - gs_list: 1d list of ints - The indices of initial states which will be used in RIXS calculations. - - It will set gs_list=[0] if not provided. - temperature: float number - Temperature (in K) for boltzmann distribution. - scatter_axis: 3*3 float array - The local axis defining the scattering plane. The scattering plane is defined in - the local :math:`zx`-plane. - - - local :math:`x`-axis: scatter_axis[:,0] - - - local :math:`y`-axis: scatter_axis[:,1] - - - local :math:`z`-axis: scatter_axis[:,2] - - It will be an identity matrix if not provided. - skip_gs: bool - If True, transitions to the ground state(s) (forming the elastic peak) are omitted from - the calculation. - - Returns - ------- - rixs: 3d float array - The calculated RIXS spectra. The 1st dimension is for the incident energy, - the 2nd dimension is for the energy loss and the 3rd dimension is for - different polarizations. - """ - - print("edrixs >>> Running RIXS ... ") - n_ominc = len(ominc) - n_eloss = len(eloss) - gamma_core = np.zeros(n_ominc, dtype=float) - gamma_final = np.zeros(n_eloss, dtype=float) - if np.isscalar(gamma_c): - gamma_core[:] = np.ones(n_ominc) * gamma_c - else: - gamma_core[:] = gamma_c - - if np.isscalar(gamma_f): - gamma_final[:] = np.ones(n_eloss) * gamma_f - else: - gamma_final[:] = gamma_f - - if pol_type is None: - pol_type = [('linear', 0, 'linear', 0)] - if gs_list is None: - gs_list = [0] - if scatter_axis is None: - scatter_axis = np.eye(3) - else: - scatter_axis = np.array(scatter_axis) - - prob = boltz_dist([eval_i[i] for i in gs_list], temperature) - rixs = np.zeros((len(ominc), len(eloss), len(pol_type)), dtype=float) - npol, n, m = trans_op.shape - trans_emi = np.zeros((npol, m, n), dtype=np.complex128) - for i in range(npol): - trans_emi[i] = np.conj(np.transpose(trans_op[i])) - polvec_i = np.zeros(npol, dtype=complex) - polvec_f = np.zeros(npol, dtype=complex) - - # Calculate RIXS - for i, om in enumerate(ominc): - F_fi = scattering_mat(eval_i, eval_n, trans_op[:, :, 0:max(gs_list)+1], - trans_emi, om, gamma_core[i]) - - for j, (it, alpha, jt, beta) in enumerate(pol_type): - ei, ef = dipole_polvec_rixs(thin, thout, phi, alpha, beta, - scatter_axis, (it, jt)) - if it.lower() == 'isotropic': - ei = np.ones(3)/np.sqrt(3) # Powder spectrum - if jt.lower() == 'isotropic': - ef = np.ones(3)/np.sqrt(3) - # dipolar transition - if npol == 3: - polvec_i[:] = ei - polvec_f[:] = ef - # quadrupolar transition - elif npol == 5: - ki = unit_wavevector(thin, phi, scatter_axis, direction='in') - kf = unit_wavevector(thout, phi, scatter_axis, direction='out') - polvec_i[:] = quadrupole_polvec(ei, ki) - polvec_f[:] = quadrupole_polvec(ef, kf) - else: - raise Exception("Have NOT implemented this type of transition operators") - # scattering magnitude with polarization vectors - F_mag = np.zeros((len(eval_i), len(gs_list)), dtype=complex) - for m in range(npol): - for n in range(npol): - F_mag[:, :] += np.conj(polvec_f[m]) * F_fi[m, n] * polvec_i[n] - - fs_list = np.arange(len(eval_i)) - if skip_gs: - fs_list = np.delete(fs_list, gs_list) - for m, igs in enumerate(gs_list): - for n in fs_list: - rixs[i, :, j] += ( - prob[m] * np.abs(F_mag[n, igs])**2 * gamma_final / np.pi / - ((eloss - (eval_i[n] - eval_i[igs]))**2 + gamma_final**2) - ) - print("edrixs >>> RIXS Done !") - - return rixs
- - - -
-[docs] -def ed_1v1c_fort(comm, shell_name, *, shell_level=None, - v_soc=None, c_soc=0, v_noccu=1, slater=None, - ext_B=None, on_which='spin', - v_cfmat=None, v_othermat=None, - do_ed=True, ed_solver=2, neval=1, nvector=1, ncv=3, - idump=False, maxiter=500, eigval_tol=1e-8, min_ndim=1000): - """ - Perform ED for the case of one valence shell plus one Core-shell with Fortran ED solver. - - The hopping and Coulomb terms of both the initial and intermediate Hamiltonians will be - constructed and written to files (hopping_i.in, hopping_n.in, coulomb_i.in and coulomb_n.in). - Fock basis for the initial Hamiltonian will be written to file (fock_i.in). - - ED will be only performed on the initial Hamiltonian to find a few lowest eigenstates - do_ed=True. Only input files will be written if do_ed=False. - Due to large Hilbert space, the ed_fsolver written in Fortran will be called. - mpi4py and a MPI environment (mpich or openmpi) are required to launch ed_fsolver. - - If do_ed=True, it will output the eigenvalues in file (eigvals.dat) and eigenvectors in files - (eigvec.n), where n means the n-th eigenvectors. The eigvec.n files will be used later - as the inputs for XAS and RIXS calculations. - - Parameters - ---------- - comm: MPI_comm - The MPI communicator from mpi4py. - shell_name: tuple of two strings - Names of valence and core shells. The 1st (2nd) string in the tuple is for the - valence (core) shell. - - - The 1st strings can only be 's', 'p', 't2g', 'd', 'f' - - - The 2nd string can be 's', 'p', 'p12', 'p32', 'd', 'd32', 'd52', - 'f', 'f52', 'f72'. - - For example: shell_name=('d', 'p32') may indicate a :math:`L_3` edge transition from - core :math:`2p_{3/2}` shell to valence :math:`3d` shell for Ni. - shell_level: tuple of two float numbers - Energy level of valence (1st element) and core (2nd element) shells. - - They will be set to zero if not provided. - v_soc: tuple of two float numbers - Spin-orbit coupling strength of the valence shell, - v1_soc[0] for the initial Hamiltonian, and - v1_soc[1] for the intermediate Hamiltonian. - - They will be set to zero if not provided. - c_soc: float number - Spin-orbit coupling strength of core electrons. - v_noccu: int number - Total number of electrons in valence shells. - slater: tuple of two lists - Slater integrals for initial (1st list) and intermediate (2nd list) Hamiltonians. - The order of the elements in each list should be like this: - - [FX_vv, FX_vc, GX_vc, FX_cc], - - where X are integers with ascending order, it can be X=0, 2, 4, 6 or X=1, 3, 5. - One can ignore all the continuous zeros at the end of the list. - - For example, if the full list is: [F0_dd, F2_dd, F4_dd, 0, F2_dp, 0, 0, 0, 0], one can - just provide [F0_dd, F2_dd, F4_dd, 0, F2_dp] - - All the Slater integrals will be set to zero if slater==None. - ext_B: tuple of three float numbers - Vector of external magnetic field with respect to global :math:`xyz`-axis applied - on the valence shell. - - It will be set to zeros if not provided. - on_which: string - Apply Zeeman exchange field on which sector. Options are 'spin', 'orbital' or 'both'. - v_cfmat: 2d complex array - Crystal field splitting Hamiltonian of the valence shell. The dimension and the orbital - order should be consistent with the type of the valence shell. - - They will be zeros if not provided. - v_othermat: 2d complex array - Other possible Hamiltonian of the valence shell. The dimension and the orbital order - should be consistent with the type of the valence shell. - - They will be zeros if not provided. - do_ed: logical - If do_end=True, diagonalize the Hamitlonian to find a few lowest eigenstates, return the - eigenvalues and density matirx, and write the eigenvectors in files eigvec.n, otherwise, - just write out the input files, do not perform the ED. - ed_solver: int - Type of ED solver, options can be 0, 1, 2 - - - 0: use Lapack to fully diagonalize Hamiltonian to get all the eigenvalues. - - - 1: use standard Lanczos algorithm to find only a few lowest eigenvalues, - no re-orthogonalization has been applied, so it is not very accurate. - - - 2: use parallel version of Arpack library to find a few lowest eigenvalues, - it is accurate and is the recommeded choice in real calculations of XAS and RIXS. - neval: int - Number of eigenvalues to be found. For ed_solver=2, the value should not be too small, - neval > 10 is usually a safe value. - nvector: int - Number of eigenvectors to be found and written into files. - ncv: int - Used for ed_solver=2, it should be at least ncv > neval + 2. Usually, set it a little - bit larger than neval, for example, set ncv=200 when neval=100. - idump: logical - Whether to dump the eigenvectors to files "eigvec.n", where n means the n-th vectors. - maxiter: int - Maximum number of iterations in finding all the eigenvalues, used for ed_solver=1, 2. - eigval_tol: float - The convergence criteria of eigenvalues, used for ed_solver=1, 2. - min_ndim: int - The minimum dimension of the Hamiltonian when the ed_solver=1, 2 can be used, otherwise, - ed_solver=1 will be used. - - Returns - ------- - eval_i: 1d float array, shape=(neval, ) - The eigenvalues of initial Hamiltonian. - denmat: 2d complex array, shape=(nvector, v_norb, v_norb)) - The density matrix in the eigenstates. - """ - v_name_options = ['s', 'p', 't2g', 'd', 'f'] - c_name_options = ['s', 'p', 'p12', 'p32', 't2g', 'd', 'd32', 'd52', 'f', 'f52', 'f72'] - v_name = shell_name[0].strip() - c_name = shell_name[1].strip() - if v_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v_name) - if c_name not in c_name_options: - raise Exception("NOT supported type of core shell: ", c_name) - - names = (v_name, 'empty', c_name) - if shell_level is not None: - levels = (shell_level[0], 0, shell_level[1]) - else: - levels = None - - eval_i, denmat = _ed_1or2_valence_1core( - comm, names, shell_level=levels, v1_soc=v_soc, c_soc=c_soc, - v_tot_noccu=v_noccu, slater=slater, v1_ext_B=ext_B, - v1_on_which=on_which, v1_cfmat=v_cfmat, v1_othermat=v_othermat, - do_ed=do_ed, ed_solver=ed_solver, neval=neval, nvector=nvector, - ncv=ncv, idump=idump, maxiter=maxiter, eigval_tol=eigval_tol, - min_ndim=min_ndim - ) - - return eval_i, denmat
- - - -
-[docs] -def ed_2v1c_fort(comm, shell_name, *, shell_level=None, - v1_soc=None, v2_soc=None, c_soc=0, v_tot_noccu=1, slater=None, - v1_ext_B=None, v2_ext_B=None, v1_on_which='spin', v2_on_which='spin', - v1_cfmat=None, v2_cfmat=None, v1_othermat=None, v2_othermat=None, - hopping_v1v2=None, do_ed=True, ed_solver=2, neval=1, nvector=1, ncv=3, - idump=False, maxiter=500, eigval_tol=1e-8, min_ndim=1000): - """ - Perform ED for the case of two valence shell plus one core-shell with Fortran solver. - For example, for Ni :math:`K`-edge RIXS, :math:`1s\\rightarrow 4p` transition, - the valence shells involved in RIXS are :math:`3d` and :math:`4p`. - - The hopping and Coulomb terms of both the initial and intermediate Hamiltonians will be - constructed and written to files (hopping_i.in, hopping_n.in, coulomb_i.in and coulomb_n.in). - Fock basis for the initial Hamiltonian will be written to file (fock_i.in). - - ED will be only performed on the initial Hamiltonian to find a few lowest eigenstates - do_ed=True. Only input files will be written if do_ed=False. - Due to large Hilbert space, the ed_fsolver written in Fortran will be called. - mpi4py and a MPI environment (mpich or openmpi) are required to launch ed_fsolver. - - If do_ed=True, it will output the eigenvalues in file (eigvals.dat) and eigenvectors in files - (eigvec.n), where n means the n-th eigenvectors. The eigvec.n files will be used later - as the inputs for XAS and RIXS calculations. - - Parameters - ---------- - comm: MPI_comm - The MPI communicator from mpi4py. - shell_name: tuple of three strings - Names of valence and core shells. The 1st (2nd) string in the tuple is for the - 1st (2nd) valence shell, and the 3rd one is for the core shell. - - - The 1st and 2nd strings can only be 's', 'p', 't2g', 'd', 'f' - - - The 3nd string can be 's', 'p', 'p12', 'p32', 'd', 'd32', 'd52', - 'f', 'f52', 'f72'. - - For example: shell_name=('d', 'p', 's') may indicate a :math:`K` edge transition from - core :math:`1s` shell to valence :math:`3d` and :math:`4p` shell for Ni. - shell_level: tuple of three float numbers - Energy level of valence (1st and 2nd elements) and core (3nd element) shells. - - They will be set to zero if not provided. - v1_soc: tuple of two float numbers - Spin-orbit coupling strength of the 1st valence shell, - v1_soc[0] for the initial Hamiltonian, and - v1_soc[1] for the intermediate Hamiltonian. - - They will be set to zero if not provided. - v2_soc: tuple of two float numbers - Spin-orbit coupling strength of the 2nd valence shell, - v2_soc[0] for the initial Hamiltonian, and - v2_soc[1] for the intermediate Hamiltonian. - - They will be set to zero if not provided. - c_soc: float number - Spin-orbit coupling strength of core electrons. - v_tot_noccu: int number - Total number of electrons in valence shells. - slater: tuple of two lists - Slater integrals for initial (1st list) and intermediate (2nd list) Hamiltonians. - The order of the elements in each list should be like this: - - [FX_v1v1, FX_v1v2, GX_v1v2, FX_v2v2, FX_v1c, GX_v1c, FX_v2c, GX_v2c], - - where X are integers with ascending order, it can be X=0, 2, 4, 6 or X=1, 3, 5. - One can ignore all the continuous zeros at the end of the list. - - For example, if the full list is: [F0_dd, F2_dd, F4_dd, 0, F2_dp, 0, 0, 0, 0], one can - just provide [F0_dd, F2_dd, F4_dd, 0, F2_dp] - - All the Slater integrals will be set to zero if slater==None. - v1_ext_B: tuple of three float numbers - Vector of external magnetic field with respect to global :math:`xyz`-axis applied - on the 1st valence shell. - - It will be set to zeros if not provided. - v2_ext_B: tuple of three float numbers - Vector of external magnetic field with respect to global :math:`xyz`-axis applied - on the 2nd valence shell. - - It will be set to zeros if not provided. - v1_on_which: string - Apply Zeeman exchange field on which sector. Options are 'spin', 'orbital' or 'both'. - For the 1st valence shell. - v2_on_which: string - Apply Zeeman exchange field on which sector. Options are 'spin', 'orbital' or 'both'. - For the 2nd valence shell. - v1_cfmat: 2d complex array - Crystal field splitting Hamiltonian of the 1st valence shell. The dimension and the orbital - order should be consistent with the type of the 1st valence shell. - - They will be zeros if not provided. - v2_cfmat: 2d complex array - Crystal field splitting Hamiltonian of the 2nd valence shell. The dimension and the orbital - order should be consistent with the type of the 2nd valence shell. - - They will be zeros if not provided. - v1_othermat: 2d complex array - Other possible Hamiltonian of the 1st valence shell. The dimension and the orbital order - should be consistent with the type of the 1st valence shell. - - They will be zeros if not provided. - v2_othermat: 2d complex array - Other possible Hamiltonian of the 2nd valence shell. The dimension and the orbital order - should be consistent with the type of the 2nd valence shell. - - They will be zeros if not provided. - hopping_v1v2: 2d complex array - Hopping between the two valence shells. The 1st-index (2nd-index) is the 1st (2nd) - valence shell. - - They will be zeros if not provided. - do_ed: logical - If do_end=True, diagonalize the Hamitlonian to find a few lowest eigenstates, return the - eigenvalues and density matirx, and write the eigenvectors in files eigvec.n, otherwise, - just write out the input files, do not perform the ED. - ed_solver: int - Type of ED solver, options can be 0, 1, 2 - - - 0: use Lapack to fully diagonalize Hamiltonian to get all the eigenvalues. - - - 1: use standard Lanczos algorithm to find only a few lowest eigenvalues, - no re-orthogonalization has been applied, so it is not very accurate. - - - 2: use parallel version of Arpack library to find a few lowest eigenvalues, - it is accurate and is the recommeded choice in real calculations of XAS and RIXS. - neval: int - Number of eigenvalues to be found. For ed_solver=2, the value should not be too small, - neval > 10 is usually a safe value. - nvector: int - Number of eigenvectors to be found and written into files. - ncv: int - Used for ed_solver=2, it should be at least ncv > neval + 2. Usually, set it a little - bit larger than neval, for example, set ncv=200 when neval=100. - idump: logical - Whether to dump the eigenvectors to files "eigvec.n", where n means the n-th vectors. - maxiter: int - Maximum number of iterations in finding all the eigenvalues, used for ed_solver=1, 2. - eigval_tol: float - The convergence criteria of eigenvalues, used for ed_solver=1, 2. - min_ndim: int - The minimum dimension of the Hamiltonian when the ed_solver=1, 2 can be used, otherwise, - ed_solver=1 will be used. - - Returns - ------- - eval_i: 1d float array, shape=(neval, ) - The eigenvalues of initial Hamiltonian. - denmat: 2d complex array, shape=(nvector, v1v2_norb, v1v2_norb)) - The density matrix in the eigenstates. - """ - v_name_options = ['s', 'p', 't2g', 'd', 'f'] - c_name_options = ['s', 'p', 'p12', 'p32', 't2g', 'd', 'd32', 'd52', 'f', 'f52', 'f72'] - v1_name = shell_name[0].strip() - v2_name = shell_name[1].strip() - c_name = shell_name[2].strip() - if v1_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v1_name) - if v2_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v2_name) - if c_name not in c_name_options: - raise Exception("NOT supported type of core shell: ", c_name) - - eval_i, denmat = _ed_1or2_valence_1core( - comm, shell_name, shell_level=shell_level, v1_soc=v1_soc, v2_soc=v2_soc, c_soc=c_soc, - v_tot_noccu=v_tot_noccu, slater=slater, v1_ext_B=v1_ext_B, v2_ext_B=v2_ext_B, - v1_on_which=v1_on_which, v2_on_which=v2_on_which, v1_cfmat=v1_cfmat, - v2_cfmat=v2_cfmat, v1_othermat=v1_othermat, v2_othermat=v2_othermat, - hopping_v1v2=hopping_v1v2, do_ed=do_ed, ed_solver=ed_solver, neval=neval, - nvector=nvector, ncv=ncv, idump=idump, maxiter=maxiter, eigval_tol=eigval_tol, - min_ndim=min_ndim - ) - return eval_i, denmat
- - - -def _ed_1or2_valence_1core( - comm, shell_name, *, shell_level=None, - v1_soc=None, v2_soc=None, c_soc=0, v_tot_noccu=1, slater=None, - v1_ext_B=None, v2_ext_B=None, v1_on_which='spin', v2_on_which='spin', - v1_cfmat=None, v2_cfmat=None, v1_othermat=None, v2_othermat=None, - hopping_v1v2=None, do_ed=True, ed_solver=2, neval=1, nvector=1, ncv=3, - idump=False, maxiter=500, eigval_tol=1e-8, min_ndim=1000 - ): - from .fedrixs import ed_fsolver - - rank = comm.Get_rank() - size = comm.Get_size() - fcomm = comm.py2f() - if rank == 0: - print("edrixs >>> Running ED ...", flush=True) - v1_name = shell_name[0].strip() - v2_name = shell_name[1].strip() - c_name = shell_name[2].strip() - info_shell = info_atomic_shell() - - # Quantum numbers of angular momentum - v1_orbl = info_shell[v1_name][0] - if v2_name != 'empty': - v2_orbl = info_shell[v2_name][0] - else: - v2_orbl = -1 - - # number of orbitals with spin - v1_norb = info_shell[v1_name][1] - if v2_name != 'empty': - v2_norb = info_shell[v2_name][1] - else: - v2_norb = 0 - c_norb = info_shell[c_name][1] - - # total number of orbitals - ntot = v1_norb + v2_norb + c_norb - v1v2_norb = v1_norb + v2_norb - - # Coulomb interaction - if v2_name == 'empty': - slater_name = slater_integrals_name((v1_name, c_name), ('v', 'c')) - else: - slater_name = slater_integrals_name((v1_name, v2_name, c_name), ('v1', 'v2', 'c1')) - nslat = len(slater_name) - slater_i = np.zeros(nslat, dtype=float) - slater_n = np.zeros(nslat, dtype=float) - - if slater is not None: - if nslat > len(slater[0]): - slater_i[0:len(slater[0])] = slater[0] - else: - slater_i[:] = slater[0][0:nslat] - if nslat > len(slater[1]): - slater_n[0:len(slater[1])] = slater[1] - else: - slater_n[:] = slater[1][0:nslat] - - # print summary of slater integrals - if rank == 0: - print(flush=True) - print(" Summary of Slater integrals:", flush=True) - print(" ------------------------------", flush=True) - print(" Terms, Initial Hamiltonian, Intermediate Hamiltonian", flush=True) - for i in range(nslat): - print( - " ", slater_name[i], - ": {:20.10f}{:20.10f}".format(slater_i[i], slater_n[i]), flush=True - ) - print(flush=True) - - if v2_name == 'empty': - umat_i = get_umat_slater(v1_name + c_name, *slater_i) - umat_n = get_umat_slater(v1_name + c_name, *slater_n) - else: - umat_i = get_umat_slater_3shells((v1_name, v2_name, c_name), *slater_i) - umat_n = get_umat_slater_3shells((v1_name, v2_name, c_name), *slater_n) - - if rank == 0: - write_umat(umat_i, 'coulomb_i.in') - write_umat(umat_n, 'coulomb_n.in') - - emat_i = np.zeros((ntot, ntot), dtype=complex) - emat_n = np.zeros((ntot, ntot), dtype=complex) - # SOC - if v1_soc is not None and v1_name in ['p', 'd', 't2g', 'f']: - emat_i[0:v1_norb, 0:v1_norb] += atom_hsoc(v1_name, v1_soc[0]) - emat_n[0:v1_norb, 0:v1_norb] += atom_hsoc(v1_name, v1_soc[1]) - - if v2_soc is not None and v2_name in ['p', 'd', 't2g', 'f']: - emat_i[v1_norb:v1v2_norb, v1_norb:v1v2_norb] += atom_hsoc(v2_name, v2_soc[0]) - emat_n[v1_norb:v1v2_norb, v1_norb:v1v2_norb] += atom_hsoc(v2_name, v2_soc[1]) - - if c_name in ['p', 'd', 'f']: - emat_n[v1v2_norb:ntot, v1v2_norb:ntot] += atom_hsoc(c_name, c_soc) - - # crystal field - if v1_cfmat is not None: - emat_i[0:v1_norb, 0:v1_norb] += np.array(v1_cfmat) - emat_n[0:v1_norb, 0:v1_norb] += np.array(v1_cfmat) - - if v2_cfmat is not None and v2_name != 'empty': - emat_i[v1_norb:v1v2_norb, v1_norb:v1v2_norb] += np.array(v2_cfmat) - emat_n[v1_norb:v1v2_norb, v1_norb:v1v2_norb] += np.array(v2_cfmat) - - # other mat - if v1_othermat is not None: - emat_i[0:v1_norb, 0:v1_norb] += np.array(v1_othermat) - emat_n[0:v1_norb, 0:v1_norb] += np.array(v1_othermat) - - if v2_othermat is not None and v2_name != 'empty': - emat_i[v1_norb:v1v2_norb, v1_norb:v1v2_norb] += np.array(v2_othermat) - emat_n[v1_norb:v1v2_norb, v1_norb:v1v2_norb] += np.array(v2_othermat) - - # energy of shell - if shell_level is not None: - eval_shift = shell_level[2] * c_norb / v_tot_noccu - emat_i[0:v1_norb, 0:v1_norb] += np.eye(v1_norb) * shell_level[0] - emat_i[0:v1_norb, 0:v1_norb] += np.eye(v1_norb) * eval_shift - emat_n[0:v1_norb, 0:v1_norb] += np.eye(v1_norb) * shell_level[0] - emat_n[v1v2_norb:ntot, v1v2_norb:ntot] += np.eye(c_norb) * shell_level[2] - if v2_name != 'empty': - emat_i[v1_norb:v1v2_norb, v1_norb:v1v2_norb] += np.eye(v2_norb) * shell_level[1] - emat_i[v1_norb:v1v2_norb, v1_norb:v1v2_norb] += np.eye(v2_norb) * eval_shift - emat_n[v1_norb:v1v2_norb, v1_norb:v1v2_norb] += np.eye(v2_norb) * shell_level[1] - - # external magnetic field - for name, l, ext_B, which, i1, i2 in [ - (v1_name, v1_orbl, v1_ext_B, v1_on_which, 0, v1_norb), - (v2_name, v2_orbl, v2_ext_B, v2_on_which, v1_norb, v1v2_norb) - ]: - if name == 'empty': - continue - if name == 't2g': - lx, ly, lz = get_lx(1, True), get_ly(1, True), get_lz(1, True) - sx, sy, sz = get_sx(1), get_sy(1), get_sz(1) - lx, ly, lz = -lx, -ly, -lz - else: - lx, ly, lz = get_lx(l, True), get_ly(l, True), get_lz(l, True) - sx, sy, sz = get_sx(l), get_sy(l), get_sz(l) - if ext_B is not None: - if which.strip() == 'spin': - zeeman = ext_B[0] * (2 * sx) + ext_B[1] * (2 * sy) + ext_B[2] * (2 * sz) - elif which.strip() == 'orbital': - zeeman = ext_B[0] * lx + ext_B[1] * ly + ext_B[2] * lz - elif which.strip() == 'both': - zeeman = (ext_B[0] * (lx + 2 * sx) + - ext_B[1] * (ly + 2 * sy) + - ext_B[2] * (lz + 2 * sz)) - else: - raise Exception("Unknown value of zeeman_on_which", which) - emat_i[i1:i2, i1:i2] += zeeman - emat_n[i1:i2, i1:i2] += zeeman - - # hopping between the two valence shells - if hopping_v1v2 is not None and v2_name != 'empty': - emat_i[0:v1_norb, v1_norb:v1v2_norb] += np.array(hopping_v1v2) - emat_i[v1_norb:v1v2_norb, 0:v1_norb] += np.conj(np.transpose(hopping_v1v2)) - emat_n[0:v1_norb, v1_norb:v1v2_norb] += np.array(hopping_v1v2) - emat_n[v1_norb:v1v2_norb, 0:v1_norb] += np.conj(np.transpose(hopping_v1v2)) - - if rank == 0: - write_emat(emat_i, 'hopping_i.in') - write_emat(emat_n, 'hopping_n.in') - write_config( - './', ed_solver, v1v2_norb, c_norb, neval, nvector, ncv, idump, - maxiter=maxiter, min_ndim=min_ndim, eigval_tol=eigval_tol - ) - write_fock_dec_by_N(v1v2_norb, v_tot_noccu, "fock_i.in") - - if do_ed: - # now, call ed solver - comm.Barrier() - ed_fsolver(fcomm, rank, size) - comm.Barrier() - - # read eigvals.dat and denmat.dat - data = np.loadtxt('eigvals.dat', ndmin=2) - eval_i = np.zeros(neval, dtype=float) - eval_i[0:neval] = data[0:neval, 1] - data = np.loadtxt('denmat.dat', ndmin=2) - tmp = (nvector, v1v2_norb, v1v2_norb) - denmat = data[:, 3].reshape(tmp) + 1j * data[:, 4].reshape(tmp) - - return eval_i, denmat - else: - return None, None - - -
-[docs] -def xas_1v1c_fort(comm, shell_name, ominc, *, gamma_c=0.1, - v_noccu=1, thin=1.0, phi=0, pol_type=None, - num_gs=1, nkryl=200, temperature=1.0, - loc_axis=None, scatter_axis=None): - """ - Calculate XAS for the case with one valence shells plus one core shell with Fortran solver. - - Parameters - ---------- - comm: MPI_comm - MPI communicator. - shell_name: tuple of two strings - Names of valence and core shells. The 1st (2nd) string in the tuple is for the - valence (core) shell. - - - The 1st string can only be 's', 'p', 't2g', 'd', 'f', - - - The 2nd string can be 's', 'p', 'p12', 'p32', 'd', 'd32', 'd52', - 'f', 'f52', 'f72'. - - For example: shell_name=('d', 'p32') may indicate a :math:`L_3` edge transition from - core :math:`2p_{3/2}` shell to valence :math:`3d` shell for Ni. - ominc: 1d float array - Incident energy of photon. - gamma_c: a float number or a 1d float array with the same shape as ominc. - The core-hole life-time broadening factor. It can be a constant value - or incident energy dependent. - v_noccu: int - Total occupancy of valence shells. - thin: float number - The incident angle of photon (in radian). - phi: float number - Azimuthal angle (in radian), defined with respect to the - :math:`x`-axis of the local scattering axis: scatter_axis[:,0]. - pol_type: list of tuples - Type of polarization, options can be: - - - ('linear', alpha), linear polarization, where alpha is the angle between the - polarization vector and the scattering plane in radians. - - - ('left', 0), left circular polarization. - - - ('right', 0), right circular polarization. - - - ('isotropic', 0). isotropic polarization. - - It will set pol_type=[('isotropic', 0)] if not provided. - num_gs: int - Number of initial states used in XAS calculations. - nkryl: int - Maximum number of poles obtained. - temperature: float number - Temperature (in K) for boltzmann distribution. - loc_axis: 3*3 float array - The local axis with respect to which local orbitals are defined. - - - x: local_axis[:,0], - - - y: local_axis[:,1], - - - z: local_axis[:,2]. - - It will be an identity matrix if not provided. - scatter_axis: 3*3 float array - The local axis defining the scattering geometry. The scattering plane is defined in - the local :math:`zx`-plane. - - - local :math:`x`-axis: scatter_axis[:,0] - - - local :math:`y`-axis: scatter_axis[:,1] - - - local :math:`z`-axis: scatter_axis[:,2] - - It will be set to an identity matrix if not provided. - - Returns - ------- - xas: 2d array, shape=(len(ominc), len(pol_type)) - The calculated XAS spectra. The first dimension is for ominc, and the second dimension - if for different polarizations. - poles: list of dict, shape=(len(pol_type), ) - The calculated XAS poles for different polarizations. - """ - v_name_options = ['s', 'p', 't2g', 'd', 'f'] - c_name_options = ['s', 'p', 'p12', 'p32', 't2g', 'd', 'd32', 'd52', 'f', 'f52', 'f72'] - - v_name = shell_name[0].strip() - c_name = shell_name[1].strip() - if v_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v_name) - if c_name not in c_name_options: - raise Exception("NOT supported type of core shell: ", c_name) - - names = (v_name, 'empty', c_name) - - xas, poles = _xas_1or2_valence_1core( - comm, names, ominc, gamma_c=gamma_c, v_tot_noccu=v_noccu, - trans_to_which=1, thin=thin, phi=phi, pol_type=pol_type, - num_gs=num_gs, nkryl=nkryl, temperature=temperature, - loc_axis=loc_axis, scatter_axis=scatter_axis - ) - - return xas, poles
- - - -
-[docs] -def xas_2v1c_fort(comm, shell_name, ominc, *, gamma_c=0.1, - v_tot_noccu=1, trans_to_which=1, thin=1.0, phi=0, - pol_type=None, num_gs=1, nkryl=200, temperature=1.0, - loc_axis=None, scatter_axis=None): - """ - Calculate XAS for the case with two valence shells plus one core shell with Fortran solver. - - Parameters - ---------- - comm: MPI_comm - MPI communicator. - shell_name: tuple of three strings - Names of valence and core shells. The 1st (2nd) string in the tuple is for the - 1st (2nd) valence shell, and the 3rd one is for the core shell. - - - The 1st and 2nd strings can only be 's', 'p', 't2g', 'd', 'f', - - - The 3nd string can be 's', 'p', 'p12', 'p32', 'd', 'd32', 'd52', - 'f', 'f52', 'f72'. - - For example: shell_name=('d', 'p', 's') may indicate a :math:`K` edge transition from - core :math:`1s` shell to valence :math:`3d` and :math:`4p` shell for Ni. - ominc: 1d float array - Incident energy of photon. - gamma_c: a float number or a 1d float array with the same shape as ominc. - The core-hole life-time broadening factor. It can be a constant value - or incident energy dependent. - v_tot_noccu: int - Total occupancy of valence shells. - trans_to_which: int - Photon transition to which valence shell. - - - 1: to 1st valence shell, - - - 2: to 2nd valence shell. - thin: float number - The incident angle of photon (in radian). - phi: float number - Azimuthal angle (in radian), defined with respect to the - :math:`x`-axis of the local scattering axis: scatter_axis[:,0]. - pol_type: list of tuples - Type of polarization, options can be: - - - ('linear', alpha), linear polarization, where alpha is the angle between the - polarization vector and the scattering plane in radians. - - - ('left', 0), left circular polarization. - - - ('right', 0), right circular polarization. - - - ('isotropic', 0). isotropic polarization. - - It will set pol_type=[('isotropic', 0)] if not provided. - num_gs: int - Number of initial states used in XAS calculations. - nkryl: int - Maximum number of poles obtained. - temperature: float number - Temperature (in K) for boltzmann distribution. - loc_axis: 3*3 float array - The local axis with respect to which local orbitals are defined. - - - x: local_axis[:,0], - - - y: local_axis[:,1], - - - z: local_axis[:,2]. - - It will be an identity matrix if not provided. - scatter_axis: 3*3 float array - The local axis defining the scattering geometry. The scattering plane is defined in - the local :math:`zx`-plane. - - - local :math:`x`-axis: scatter_axis[:,0] - - - local :math:`y`-axis: scatter_axis[:,1] - - - local :math:`z`-axis: scatter_axis[:,2] - - It will be set to an identity matrix if not provided. - - Returns - ------- - xas: 2d array, shape=(len(ominc), len(pol_type)) - The calculated XAS spectra. The first dimension is for ominc, and the second dimension - if for different polarizations. - poles: list of dict, shape=(len(pol_type), ) - The calculated XAS poles for different polarizations. - """ - v_name_options = ['s', 'p', 't2g', 'd', 'f'] - c_name_options = ['s', 'p', 'p12', 'p32', 't2g', 'd', 'd32', 'd52', 'f', 'f52', 'f72'] - - v1_name = shell_name[0].strip() - v2_name = shell_name[1].strip() - c_name = shell_name[2].strip() - if v1_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v1_name) - if v2_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v2_name) - if c_name not in c_name_options: - raise Exception("NOT supported type of core shell: ", c_name) - - xas, poles = _xas_1or2_valence_1core( - comm, shell_name, ominc, gamma_c=gamma_c, v_tot_noccu=v_tot_noccu, - trans_to_which=trans_to_which, thin=thin, phi=phi, pol_type=pol_type, - num_gs=num_gs, nkryl=nkryl, temperature=temperature, - loc_axis=loc_axis, scatter_axis=scatter_axis - ) - - return xas, poles
- - - -def _xas_1or2_valence_1core( - comm, shell_name, ominc, *, gamma_c=0.1, - v_tot_noccu=1, trans_to_which=1, thin=1.0, phi=0, - pol_type=None, num_gs=1, nkryl=200, temperature=1.0, - loc_axis=None, scatter_axis=None - ): - from .fedrixs import xas_fsolver - - rank = comm.Get_rank() - size = comm.Get_size() - fcomm = comm.py2f() - - v1_name = shell_name[0].strip() - v2_name = shell_name[1].strip() - c_name = shell_name[2].strip() - - info_shell = info_atomic_shell() - v1_norb = info_shell[v1_name][1] - if v2_name != 'empty': - v2_norb = info_shell[v2_name][1] - else: - v2_norb = 0 - - c_norb = info_shell[c_name][1] - ntot = v1_norb + v2_norb + c_norb - v1v2_norb = v1_norb + v2_norb - if pol_type is None: - pol_type = [('isotropic', 0)] - if loc_axis is None: - loc_axis = np.eye(3) - else: - loc_axis = np.array(loc_axis) - if scatter_axis is None: - scatter_axis = np.eye(3) - else: - scatter_axis = np.array(scatter_axis) - - if rank == 0: - print("edrixs >>> Running XAS ...", flush=True) - write_config(num_val_orbs=v1v2_norb, num_core_orbs=c_norb, - num_gs=num_gs, nkryl=nkryl) - write_fock_dec_by_N(v1v2_norb, v_tot_noccu, "fock_i.in") - write_fock_dec_by_N(v1v2_norb, v_tot_noccu + 1, "fock_n.in") - - # Build transition operators in local-xyz axis - if trans_to_which == 1: - case = v1_name + c_name - elif trans_to_which == 2 and v2_name != 'empty': - case = v2_name + c_name - else: - raise Exception('Unkonwn trans_to_which: ', trans_to_which) - tmp = get_trans_oper(case) - npol, n, m = tmp.shape - tmp_g = np.zeros((npol, n, m), dtype=complex) - trans_mat = np.zeros((npol, ntot, ntot), dtype=complex) - # Transform the transition operators to global-xyz axis - # dipolar transition - if npol == 3: - for i in range(3): - for j in range(3): - tmp_g[i] += loc_axis[i, j] * tmp[j] - # quadrupolar transition - elif npol == 5: - alpha, beta, gamma = rmat_to_euler(loc_axis) - wignerD = get_wigner_dmat(4, alpha, beta, gamma) - rotmat = np.dot(np.dot(tmat_r2c('d'), wignerD), np.conj(np.transpose(tmat_r2c('d')))) - for i in range(5): - for j in range(5): - tmp_g[i] += rotmat[i, j] * tmp[j] - else: - raise Exception("Have NOT implemented this case: ", npol) - if trans_to_which == 1: - trans_mat[:, 0:v1_norb, v1v2_norb:ntot] = tmp_g - else: - trans_mat[:, v1_norb:v1v2_norb, v1v2_norb:ntot] = tmp_g - - n_om = len(ominc) - gamma_core = np.zeros(n_om, dtype=float) - if np.isscalar(gamma_c): - gamma_core[:] = np.ones(n_om) * gamma_c - else: - gamma_core[:] = gamma_c - - # loop over different polarization - xas = np.zeros((n_om, len(pol_type)), dtype=float) - poles = [] - comm.Barrier() - for it, (pt, alpha) in enumerate(pol_type): - if pt.strip() == 'left' or pt.strip() == 'right' or pt.strip() == 'linear': - if rank == 0: - print("edrixs >>> Loop over for polarization: ", it, pt, flush=True) - kvec = unit_wavevector(thin, phi, scatter_axis, 'in') - polvec = np.zeros(npol, dtype=complex) - pol = dipole_polvec_xas(thin, phi, alpha, scatter_axis, pt) - if npol == 3: # Dipolar transition - polvec[:] = pol - if npol == 5: # Quadrupolar transition - polvec[:] = quadrupole_polvec(pol, kvec) - trans = np.zeros((ntot, ntot), dtype=complex) - for i in range(npol): - trans[:, :] += trans_mat[i] * polvec[i] - write_emat(trans, 'transop_xas.in') - - # call XAS solver in fedrixs - comm.Barrier() - xas_fsolver(fcomm, rank, size) - comm.Barrier() - - file_list = ['xas_poles.' + str(i+1) for i in range(num_gs)] - pole_dict = read_poles_from_file(file_list) - poles.append(pole_dict) - xas[:, it] = get_spectra_from_poles(pole_dict, ominc, gamma_core, temperature) - elif pt.strip() == 'isotropic': - pole_dicts = [] - for k in range(npol): - if rank == 0: - print("edrixs >>> Loop over for polarization: ", it, pt, flush=True) - print("edrixs >>> Isotropic, component: ", k, flush=True) - write_emat(trans_mat[k], 'transop_xas.in') - # call XAS solver in fedrixs - comm.Barrier() - xas_fsolver(fcomm, rank, size) - comm.Barrier() - - file_list = ['xas_poles.' + str(i+1) for i in range(num_gs)] - pole_tmp = read_poles_from_file(file_list) - xas[:, it] += get_spectra_from_poles(pole_tmp, ominc, gamma_core, temperature) - pole_dicts.append(pole_tmp) - xas[:, it] = xas[:, it] / npol - poles.append(merge_pole_dicts(pole_dicts)) - else: - raise Exception("Unknown polarization type: ", pt) - - return xas, poles - - -
-[docs] -def rixs_1v1c_fort(comm, shell_name, ominc, eloss, *, gamma_c=0.1, gamma_f=0.1, - v_noccu=1, thin=1.0, thout=1.0, phi=0, pol_type=None, - num_gs=1, nkryl=200, linsys_max=500, linsys_tol=1e-8, - temperature=1.0, loc_axis=None, scatter_axis=None): - """ - Calculate RIXS for the case with one valence shell plus one core shell with Fortran solver. - - Parameters - ---------- - comm: MPI_comm - MPI communicator. - shell_name: tuple of two strings - Names of valence and core shells. The 1st (2nd) string in the tuple is for the - valence (core) shell. - - - The 1st string can only be 's', 'p', 't2g', 'd', 'f', - - - The 2nd string can be 's', 'p', 'p12', 'p32', 'd', 'd32', 'd52', - 'f', 'f52', 'f72'. - - For example: shell_name=('d', 'p32') may indicate a :math:`L_3` edge transition from - core :math:`2p_{3/2}` shell to valence :math:`3d` shell for Ni. - ominc: 1d float array - Incident energy of photon. - eloss: 1d float array - Energy loss. - gamma_c: a float number or a 1d float array with same shape as ominc. - The core-hole life-time broadening factor. It can be a constant value - or incident energy dependent. - gamma_f: a float number or a 1d float array with same shape as eloss. - The final states life-time broadening factor. It can be a constant value - or energy loss dependent. - v_noccu: int - Total occupancy of valence shells. - thin: float number - The incident angle of photon (in radian). - thout: float number - The scattered angle of photon (in radian). - phi: float number - Azimuthal angle (in radian), defined with respect to the - :math:`x`-axis of scattering axis: scatter_axis[:,0]. - pol_type: list of 4-elements-tuples - Type of polarizations. It has the following form: - - (str1, alpha, str2, beta) - - where, str1 (str2) can be 'linear', 'left', 'right', and alpha (beta) is - the angle (in radians) between the linear polarization vector and the scattering plane. - - It will set pol_type=[('linear', 0, 'linear', 0)] if not provided. - num_gs: int - Number of initial states used in RIXS calculations. - nkryl: int - Maximum number of poles obtained. - linsys_max: int - Maximum iterations of solving linear equations. - linsys_tol: float - Convergence for solving linear equations. - temperature: float number - Temperature (in K) for boltzmann distribution. - loc_axis: 3*3 float array - The local axis with respect to which local orbitals are defined. - - - x: local_axis[:,0], - - - y: local_axis[:,1], - - - z: local_axis[:,2]. - - It will be an identity matrix if not provided. - scatter_axis: 3*3 float array - The local axis defining the scattering geometry. The scattering plane is defined in - the local :math:`zx`-plane. - - - local :math:`x`-axis: scatter_axis[:,0] - - - local :math:`y`-axis: scatter_axis[:,1] - - - local :math:`z`-axis: scatter_axis[:,2] - - It will be set to an identity matrix if not provided. - - Returns - ------- - rixs: 3d float array, shape=(len(ominc), len(eloss), len(pol_type)) - The calculated RIXS spectra. The 1st dimension is for the incident energy, - the 2nd dimension is for the energy loss and the 3rd dimension is for - different polarizations. - poles: 2d list of dict, shape=(len(ominc), len(pol_type)) - The calculated RIXS poles. The 1st dimension is for incident energy, and the - 2nd dimension is for different polarizations. - """ - v_name_options = ['s', 'p', 't2g', 'd', 'f'] - c_name_options = ['s', 'p', 'p12', 'p32', 't2g', 'd', 'd32', 'd52', 'f', 'f52', 'f72'] - v_name = shell_name[0].strip() - c_name = shell_name[1].strip() - if v_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v_name) - if c_name not in c_name_options: - raise Exception("NOT supported type of core shell: ", c_name) - - names = (v_name, 'empty', c_name) - rixs, poles = _rixs_1or2_valence_1core( - comm, names, ominc, eloss, gamma_c=gamma_c, gamma_f=gamma_f, - v_tot_noccu=v_noccu, trans_to_which=1, thin=thin, - thout=thout, phi=phi, pol_type=pol_type, num_gs=num_gs, nkryl=nkryl, - linsys_max=linsys_max, linsys_tol=linsys_tol, temperature=temperature, - loc_axis=loc_axis, scatter_axis=loc_axis - ) - - return rixs, poles
- - - -
-[docs] -def rixs_2v1c_fort(comm, shell_name, ominc, eloss, *, gamma_c=0.1, gamma_f=0.1, - v_tot_noccu=1, trans_to_which=1, thin=1.0, thout=1.0, phi=0, - pol_type=None, num_gs=1, nkryl=200, linsys_max=500, linsys_tol=1e-8, - temperature=1.0, loc_axis=None, scatter_axis=None): - """ - Calculate RIXS for the case with 2 valence shells plus 1 core shell. - - Parameters - ---------- - comm: MPI_comm - MPI communicator. - shell_name: tuple of three strings - Names of valence and core shells. The 1st (2nd) string in the tuple is for the - 1st (2nd) valence shell, and the 3rd one is for the core shell. - - - The 1st and 2nd strings can only be 's', 'p', 't2g', 'd', 'f', - - - The 3nd string can be 's', 'p', 'p12', 'p32', 'd', 'd32', 'd52', - 'f', 'f52', 'f72'. - - For example: shell_name=('d', 'p', 's') may indicate a :math:`K` edge transition from - core :math:`1s` shell to valence :math:`3d` and :math:`4p` shell for Ni. - ominc: 1d float array - Incident energy of photon. - eloss: 1d float array - Energy loss. - gamma_c: a float number or a 1d float array with same shape as ominc. - The core-hole life-time broadening factor. It can be a constant value - or incident energy dependent. - gamma_f: a float number or a 1d float array with same shape as eloss. - The final states life-time broadening factor. It can be a constant value - or energy loss dependent. - v_tot_noccu: int - Total occupancy of valence shells. - trans_to_which: int - Photon transition to which valence shell. - - - 1: to 1st valence shell, - - - 2: to 2nd valence shell. - thin: float number - The incident angle of photon (in radian). - thout: float number - The scattered angle of photon (in radian). - phi: float number - Azimuthal angle (in radian), defined with respect to the - :math:`x`-axis of scattering axis: scatter_axis[:,0]. - pol_type: list of 4-elements-tuples - Type of polarizations. It has the following form: - - (str1, alpha, str2, beta) - - where, str1 (str2) can be 'linear', 'left', 'right', and alpha (beta) is - the angle (in radians) between the linear polarization vector and the scattering plane. - - It will set pol_type=[('linear', 0, 'linear', 0)] if not provided. - num_gs: int - Number of initial states used in RIXS calculations. - nkryl: int - Maximum number of poles obtained. - linsys_max: int - Maximum iterations of solving linear equations. - linsys_tol: float - Convergence for solving linear equations. - temperature: float number - Temperature (in K) for boltzmann distribution. - loc_axis: 3*3 float array - The local axis with respect to which local orbitals are defined. - - - x: local_axis[:,0], - - - y: local_axis[:,1], - - - z: local_axis[:,2]. - - It will be an identity matrix if not provided. - scatter_axis: 3*3 float array - The local axis defining the scattering geometry. The scattering plane is defined in - the local :math:`zx`-plane. - - - local :math:`x`-axis: scatter_axis[:,0] - - - local :math:`y`-axis: scatter_axis[:,1] - - - local :math:`z`-axis: scatter_axis[:,2] - - It will be set to an identity matrix if not provided. - - Returns - ------- - rixs: 3d float array, shape=(len(ominc), len(eloss), len(pol_type)) - The calculated RIXS spectra. The 1st dimension is for the incident energy, - the 2nd dimension is for the energy loss and the 3rd dimension is for - different polarizations. - poles: 2d list of dict, shape=(len(ominc), len(pol_type)) - The calculated RIXS poles. The 1st dimension is for incident energy, and the - 2nd dimension is for different polarizations. - """ - v_name_options = ['s', 'p', 't2g', 'd', 'f'] - c_name_options = ['s', 'p', 'p12', 'p32', 't2g', 'd', 'd32', 'd52', 'f', 'f52', 'f72'] - v1_name = shell_name[0].strip() - v2_name = shell_name[1].strip() - c_name = shell_name[2].strip() - if v1_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v1_name) - if v2_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v2_name) - if c_name not in c_name_options: - raise Exception("NOT supported type of core shell: ", c_name) - - rixs, poles = _rixs_1or2_valence_1core( - comm, shell_name, ominc, eloss, gamma_c=gamma_c, gamma_f=gamma_f, - v_tot_noccu=v_tot_noccu, trans_to_which=trans_to_which, thin=thin, - thout=thout, phi=phi, pol_type=pol_type, num_gs=num_gs, nkryl=nkryl, - linsys_max=linsys_max, linsys_tol=linsys_tol, temperature=temperature, - loc_axis=loc_axis, scatter_axis=loc_axis - ) - - return rixs, poles
- - - -def _rixs_1or2_valence_1core( - comm, shell_name, ominc, eloss, *, gamma_c=0.1, gamma_f=0.1, - v_tot_noccu=1, trans_to_which=1, thin=1.0, thout=1.0, phi=0, - pol_type=None, num_gs=1, nkryl=200, linsys_max=500, linsys_tol=1e-8, - temperature=1.0, loc_axis=None, scatter_axis=None - ): - from .fedrixs import rixs_fsolver - - rank = comm.Get_rank() - size = comm.Get_size() - fcomm = comm.py2f() - - v1_name = shell_name[0].strip() - v2_name = shell_name[1].strip() - c_name = shell_name[2].strip() - - info_shell = info_atomic_shell() - - v1_norb = info_shell[v1_name][1] - if v2_name != 'empty': - v2_norb = info_shell[v2_name][1] - else: - v2_norb = 0 - c_norb = info_shell[c_name][1] - ntot = v1_norb + v2_norb + c_norb - v1v2_norb = v1_norb + v2_norb - if pol_type is None: - pol_type = [('linear', 0, 'linear', 0)] - if loc_axis is None: - loc_axis = np.eye(3) - else: - loc_axis = np.array(loc_axis) - if scatter_axis is None: - scatter_axis = np.eye(3) - else: - scatter_axis = np.array(scatter_axis) - - if rank == 0: - print("edrixs >>> Running RIXS ...", flush=True) - write_fock_dec_by_N(v1v2_norb, v_tot_noccu, "fock_i.in") - write_fock_dec_by_N(v1v2_norb, v_tot_noccu + 1, "fock_n.in") - write_fock_dec_by_N(v1v2_norb, v_tot_noccu, "fock_f.in") - - # Build transition operators in local-xyz axis - if trans_to_which == 1: - case = v1_name + c_name - elif trans_to_which == 2: - case = v2_name + c_name - else: - raise Exception('Unkonwn trans_to_which: ', trans_to_which) - tmp = get_trans_oper(case) - npol, n, m = tmp.shape - tmp_g = np.zeros((npol, n, m), dtype=complex) - trans_mat = np.zeros((npol, ntot, ntot), dtype=complex) - # Transform the transition operators to global-xyz axis - # dipolar transition - if npol == 3: - for i in range(3): - for j in range(3): - tmp_g[i] += loc_axis[i, j] * tmp[j] - # quadrupolar transition - elif npol == 5: - alpha, beta, gamma = rmat_to_euler(loc_axis) - wignerD = get_wigner_dmat(4, alpha, beta, gamma) - rotmat = np.dot(np.dot(tmat_r2c('d'), wignerD), np.conj(np.transpose(tmat_r2c('d')))) - for i in range(5): - for j in range(5): - tmp_g[i] += rotmat[i, j] * tmp[j] - else: - raise Exception("Have NOT implemented this case: ", npol) - if trans_to_which == 1: - trans_mat[:, 0:v1_norb, v1v2_norb:ntot] = tmp_g - else: - trans_mat[:, v1_norb:v1v2_norb, v1v2_norb:ntot] = tmp_g - - n_om = len(ominc) - neloss = len(eloss) - gamma_core = np.zeros(n_om, dtype=float) - if np.isscalar(gamma_c): - gamma_core[:] = np.ones(n_om) * gamma_c - else: - gamma_core[:] = gamma_c - gamma_final = np.zeros(neloss, dtype=float) - if np.isscalar(gamma_f): - gamma_final[:] = np.ones(neloss) * gamma_f - else: - gamma_final[:] = gamma_f - - # loop over different polarization - rixs = np.zeros((n_om, neloss, len(pol_type)), dtype=float) - poles = [] - comm.Barrier() - # loop over different polarization - for iom, omega in enumerate(ominc): - if rank == 0: - write_config( - num_val_orbs=v1v2_norb, num_core_orbs=c_norb, - omega_in=omega, gamma_in=gamma_core[iom], - num_gs=num_gs, nkryl=nkryl, linsys_max=linsys_max, - linsys_tol=linsys_tol - ) - poles_per_om = [] - # loop over polarization - for ip, (it, alpha, jt, beta) in enumerate(pol_type): - if rank == 0: - print(flush=True) - print("edrixs >>> Calculate RIXS for incident energy: ", omega, flush=True) - print("edrixs >>> Polarization: ", ip, flush=True) - polvec_i = np.zeros(npol, dtype=complex) - polvec_f = np.zeros(npol, dtype=complex) - ei, ef = dipole_polvec_rixs(thin, thout, phi, alpha, beta, - scatter_axis, (it, jt)) - # dipolar transition - if npol == 3: - polvec_i[:] = ei - polvec_f[:] = ef - # quadrupolar transition - elif npol == 5: - ki = unit_wavevector(thin, phi, scatter_axis, direction='in') - kf = unit_wavevector(thout, phi, scatter_axis, direction='out') - polvec_i[:] = quadrupole_polvec(ei, ki) - polvec_f[:] = quadrupole_polvec(ef, kf) - else: - raise Exception("Have NOT implemented this type of transition operators") - trans_i = np.zeros((ntot, ntot), dtype=complex) - trans_f = np.zeros((ntot, ntot), dtype=complex) - for i in range(npol): - trans_i[:, :] += trans_mat[i] * polvec_i[i] - write_emat(trans_i, 'transop_rixs_i.in') - for i in range(npol): - trans_f[:, :] += trans_mat[i] * polvec_f[i] - write_emat(np.conj(np.transpose(trans_f)), 'transop_rixs_f.in') - - # call RIXS solver in fedrixs - comm.Barrier() - rixs_fsolver(fcomm, rank, size) - comm.Barrier() - - file_list = ['rixs_poles.' + str(i+1) for i in range(num_gs)] - pole_dict = read_poles_from_file(file_list) - poles_per_om.append(pole_dict) - rixs[iom, :, ip] = get_spectra_from_poles(pole_dict, eloss, - gamma_final, temperature) - - poles.append(poles_per_om) - - return rixs, poles - - -
-[docs] -def ed_siam_fort(comm, shell_name, nbath, *, siam_type=0, v_noccu=1, static_core_pot=0, c_level=0, - c_soc=0, trans_c2n=None, imp_mat=None, imp_mat_n=None, bath_level=None, - bath_level_n=None, hyb=None, hyb_n=None, hopping=None, hopping_n=None, - slater=None, ext_B=None, on_which='spin', do_ed=0, ed_solver=2, neval=1, - nvector=1, ncv=3, idump=False, maxiter=1000, eigval_tol=1e-8, min_ndim=1000): - """ - Find the ground state of the initial Hamiltonian of a Single Impuirty Anderson Model (SIAM), - and also prepare input files, *hopping_i.in*, *hopping_n.in*, *coulomb_i.in*, *coulomb_n.in* - for following XAS and RIXS calculations. - - Parameters - ---------- - comm: MPI_Comm - MPI Communicator - shell_name: tuple of two strings - Names of valence and core shells. The 1st (2nd) string in the tuple is for the - valence (core) shell. - - - The 1st string can only be 's', 'p', 't2g', 'd', 'f', - - - The 2nd string can be 's', 'p', 'p12', 'p32', 'd', 'd32', 'd52', - 'f', 'f52', 'f72'. - - For example: shell_name=('d', 'p32') indicates a :math:`L_3` edge transition from - core :math:`p_{3/2}` shell to valence :math:`d` shell. - nbath: int - Number of bath sites. - siam_type: int - Type of SIAM Hamiltonian, - - - 0: diagonal hybridization function, parameterized by *imp_mat*, *bath_level* and *hyb* - - - 1: general hybridization function, parameterized by matrix *hopping* - - if *siam_type=0*, only *imp_mat*, *bath_level* and *hyb* are required, - if *siam_type=1*, only *hopping* is required. - v_noccu: int - Number of total occupancy of impurity and baths orbitals, required when do_ed=1, 2 - static_core_pot: float - Static core hole potential. - c_level: float - Energy level of core shell. - c_soc: float - Spin-orbit coupling strength of core electrons. - trans_c2n: 2d complex array - The transformation matrix from the spherical harmonics basis to the basis on which - the `imp_mat` and hybridization function (`bath_level`, `hyb`, `hopping`) are defined. - imp_mat: 2d complex array - Impurity matrix for the impurity site, including CF or SOC, for siam_type=0 - and the initial configurations. - imp_mat_n: 2d complex array - Impurity matrix for the impurity site, including CF or SOC, for siam_type=0 - and the intermediate configurations. If imp_mat_n=None, imp_mat will be used. - bath_level: 2d complex array - Energy level of bath sites, 1st (2nd) dimension is for different bath sites (orbitals), - for siam_type=0 and the initial configurations. - bath_level_n: 2d complex array - Energy level of bath sites, 1st (2nd) dimension is for different bath sites (orbitals), - for siam_type=0 and the intermediate configurations. If bath_level_n=None, - bath_level will be used. - hyb: 2d complex array - Hybridization strength of bath sites, 1st (2nd) dimension is for different bath - sites (orbitals), for siam_type=0 and the initial configurations. - hyb_n: 2d complex array - Hybridization strength of bath sites, 1st (2nd) dimension is for different bath - sites (orbitals), for siam_type=0 and the intermediate configurations. - If hyb_n=None, hyb will be used. - hopping: 2d complex array - General hopping matrix when siam_type=1, including imp_mat and hybridization functions, - for siam_type=1 and the initial configurations. - hopping_n: 2d complex array - General hopping matrix when siam_type=1, including imp_mat and hybridization functions, - for siam_type=1 and the intermediate configurations. If hopping_n=None, - hopping will be used. - slater: tuple of two lists - Slater integrals for initial (1st list) and intermediate (2nd list) Hamiltonians. - The order of the elements in each list should be like this: - - [FX_vv, FX_vc, GX_vc, FX_cc], - - where X are integers with ascending order, it can be X=0, 2, 4, 6 or X=1, 3, 5. - One can ignore all the continuous zeros at the end of the list. - - For example, if the full list is: [F0_dd, F2_dd, F4_dd, 0, F2_dp, 0, 0, 0, 0], one can - just provide [F0_dd, F2_dd, F4_dd, 0, F2_dp] - - All the Slater integrals will be set to zero if slater=None. - ext_B: tuple of three float numbers - Vector of external magnetic field with respect to global :math:`xyz`-axis. - - They will be set to zero if not provided. - on_which: string - Apply Zeeman exchange field on which sector. Options are 'spin', 'orbital' or 'both'. - do_ed: int - - 0: First, search the ground state in different subspaces of total occupancy - :math:`N` with ed_solver=1, and then do a more accurate ED in the subspace - :math:`N` where the ground state lies to find a few lowest eigenstates, return - the eigenvalues and density matirx, and write the eigenvectors in files eigvec.n - - - 1: Only do ED for given occupancy number *v_noccu*, return eigenvalues and - density matrix, write eigenvectors to files eigvec.n - - - 2: Do not do ED, only write parameters into files: *hopping_i.in*, *hopping_n.in*, - *coulomb_i.in*, *coulomb_n.in* for later XAS or RIXS calculations. - ed_solver: int - Type of ED solver, options can be 0, 1, 2 - - - 0: use Lapack to fully diagonalize Hamiltonian to get all the eigenvalues. - - - 1: use standard Lanczos algorithm to find only a few lowest eigenvalues, - no re-orthogonalization has been applied, so it is not very accurate. - - - 2: use parallel version of Arpack library to find a few lowest eigenvalues, - it is accurate and is the recommeded choice in real calculations of XAS and RIXS. - neval: int - Number of eigenvalues to be found. For ed_solver=2, the value should not be too small, - neval > 10 is usually a safe value. - nvector: int - Number of eigenvectors to be found and written into files. - ncv: int - Used for ed_solver=2, it should be at least ncv > neval + 2. Usually, set it a little - bit larger than neval, for example, set ncv=200 when neval=100. - idump: logical - Whether to dump the eigenvectors to files "eigvec.n", where n means the n-th vectors. - maxiter: int - Maximum number of iterations in finding all the eigenvalues, used for ed_solver=1, 2. - eigval_tol: float - The convergence criteria of eigenvalues, used for ed_solver=1, 2. - min_ndim: int - The minimum dimension of the Hamiltonian when the ed_solver=1, 2 can be used, otherwise, - ed_solver=1 will be used. - - Returns - ------- - eval_i: 1d float array - Eigenvalues of initial Hamiltonian. - denmat: 2d complex array - Density matrix. - noccu_gs: int - Occupancy of the ground state. - """ - from .fedrixs import ed_fsolver - - rank = comm.Get_rank() - size = comm.Get_size() - fcomm = comm.py2f() - if rank == 0: - print("edrixs >>> Running ED ...", flush=True) - - v_name_options = ['s', 'p', 't2g', 'd', 'f'] - c_name_options = ['s', 'p', 'p12', 'p32', 't2g', 'd', 'd32', 'd52', 'f', 'f52', 'f72'] - v_name = shell_name[0].strip() - c_name = shell_name[1].strip() - if v_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v_name) - if c_name not in c_name_options: - raise Exception("NOT supported type of core shell: ", c_name) - - info_shell = info_atomic_shell() - v_orbl = info_shell[v_name][0] - v_norb = info_shell[v_name][1] - c_norb = info_shell[c_name][1] - ntot_v = v_norb * (nbath + 1) - ntot = ntot_v + c_norb - - slater_name = slater_integrals_name((v_name, c_name), ('v', 'c')) - nslat = len(slater_name) - slater_i = np.zeros(nslat, dtype=float) - slater_n = np.zeros(nslat, dtype=float) - - if slater is not None: - if nslat > len(slater[0]): - slater_i[0:len(slater[0])] = slater[0] - else: - slater_i[:] = slater[0][0:nslat] - if nslat > len(slater[1]): - slater_n[0:len(slater[1])] = slater[1] - else: - slater_n[:] = slater[1][0:nslat] - - # print summary of slater integrals - if rank == 0: - print(flush=True) - print(" Summary of Slater integrals:", flush=True) - print(" ------------------------------", flush=True) - print(" Terms, Initial Hamiltonian, Intermediate Hamiltonian", flush=True) - for i in range(nslat): - print( - " ", slater_name[i], - ": {:20.10f}{:20.10f}".format(slater_i[i], slater_n[i]), flush=True - ) - print(flush=True) - - umat_tmp_i = get_umat_slater(v_name + c_name, *slater_i) - umat_tmp_n = get_umat_slater(v_name + c_name, *slater_n) - - umat_i = np.zeros((ntot, ntot, ntot, ntot), dtype=complex) - umat_n = np.zeros((ntot, ntot, ntot, ntot), dtype=complex) - - indx = list(range(0, v_norb)) + [ntot_v + i for i in range(0, c_norb)] - for i in range(v_norb+c_norb): - for j in range(v_norb+c_norb): - for k in range(v_norb+c_norb): - for m in range(v_norb+c_norb): - umat_i[indx[i], indx[j], indx[k], indx[m]] = umat_tmp_i[i, j, k, m] - umat_n[indx[i], indx[j], indx[k], indx[m]] = umat_tmp_n[i, j, k, m] - if rank == 0: - write_umat(umat_i, 'coulomb_i.in') - write_umat(umat_n, 'coulomb_n.in') - - emat_i = np.zeros((ntot, ntot), dtype=complex) - emat_n = np.zeros((ntot, ntot), dtype=complex) - # General hybridization function, including off-diagonal terms - if siam_type == 1: - if hopping is not None: - emat_i[0:ntot_v, 0:ntot_v] += hopping - if hopping_n is not None: - emat_n[0:ntot_v, 0:ntot_v] += hopping_n - elif hopping is not None: - emat_n[0:ntot_v, 0:ntot_v] += hopping - # Diagonal hybridization function - elif siam_type == 0: - # matrix (CF or SOC) for impuirty site - if imp_mat is not None: - emat_i[0:v_norb, 0:v_norb] += imp_mat - if imp_mat_n is not None: - emat_n[0:v_norb, 0:v_norb] += imp_mat_n - elif imp_mat is not None: - emat_n[0:v_norb, 0:v_norb] += imp_mat - # bath levels - if bath_level is not None: - for i in range(nbath): - for j in range(v_norb): - indx = (i + 1) * v_norb + j - emat_i[indx, indx] += bath_level[i, j] - if bath_level_n is not None: - for i in range(nbath): - for j in range(v_norb): - indx = (i + 1) * v_norb + j - emat_n[indx, indx] += bath_level_n[i, j] - elif bath_level is not None: - for i in range(nbath): - for j in range(v_norb): - indx = (i + 1) * v_norb + j - emat_n[indx, indx] += bath_level[i, j] - if hyb is not None: - for i in range(nbath): - for j in range(v_norb): - indx1, indx2 = j, (i + 1) * v_norb + j - emat_i[indx1, indx2] += hyb[i, j] - emat_i[indx2, indx1] += np.conj(hyb[i, j]) - if hyb_n is not None: - for i in range(nbath): - for j in range(v_norb): - indx1, indx2 = j, (i + 1) * v_norb + j - emat_n[indx1, indx2] += hyb_n[i, j] - emat_n[indx2, indx1] += np.conj(hyb_n[i, j]) - elif hyb is not None: - for i in range(nbath): - for j in range(v_norb): - indx1, indx2 = j, (i + 1) * v_norb + j - emat_n[indx1, indx2] += hyb[i, j] - emat_n[indx2, indx1] += np.conj(hyb[i, j]) - else: - raise Exception("Unknown siam_type: ", siam_type) - - if c_name in ['p', 'd', 'f']: - emat_n[ntot_v:ntot, ntot_v:ntot] += atom_hsoc(c_name, c_soc) - - # static core potential - emat_n[0:v_norb, 0:v_norb] -= np.eye(v_norb) * static_core_pot - - if trans_c2n is None: - trans_c2n = np.eye(v_norb, dtype=complex) - else: - trans_c2n = np.array(trans_c2n) - - tmat = np.eye(ntot, dtype=complex) - for i in range(nbath+1): - off = i * v_norb - tmat[off:off+v_norb, off:off+v_norb] = np.conj(np.transpose(trans_c2n)) - emat_i[:, :] = cb_op(emat_i, tmat) - emat_n[:, :] = cb_op(emat_n, tmat) - - # zeeman field - if v_name == 't2g': - lx, ly, lz = get_lx(1, True), get_ly(1, True), get_lz(1, True) - sx, sy, sz = get_sx(1), get_sy(1), get_sz(1) - lx, ly, lz = -lx, -ly, -lz - else: - lx, ly, lz = get_lx(v_orbl, True), get_ly(v_orbl, True), get_lz(v_orbl, True) - sx, sy, sz = get_sx(v_orbl), get_sy(v_orbl), get_sz(v_orbl) - - if ext_B is not None: - if on_which.strip() == 'spin': - zeeman = ext_B[0] * (2 * sx) + ext_B[1] * (2 * sy) + ext_B[2] * (2 * sz) - elif on_which.strip() == 'orbital': - zeeman = ext_B[0] * lx + ext_B[1] * ly + ext_B[2] * lz - elif on_which.strip() == 'both': - zeeman = ext_B[0] * (lx + 2 * sx) + ext_B[1] * (ly + 2 * sy) + ext_B[2] * (lz + 2 * sz) - else: - raise Exception("Unknown value of on_which", on_which) - emat_i[0:v_norb, 0:v_norb] += zeeman - emat_n[0:v_norb, 0:v_norb] += zeeman - - # Perform ED if necessary - if do_ed == 1 or do_ed == 2: - eval_shift = c_level * c_norb / v_noccu - emat_i[0:ntot_v, 0:ntot_v] += np.eye(ntot_v) * eval_shift - emat_n[ntot_v:ntot, ntot_v:ntot] += np.eye(c_norb) * c_level - if rank == 0: - write_emat(emat_i, 'hopping_i.in') - write_emat(emat_n, 'hopping_n.in') - write_config( - ed_solver=ed_solver, num_val_orbs=ntot_v, neval=neval, nvector=nvector, ncv=ncv, - idump=idump, maxiter=maxiter, min_ndim=min_ndim, eigval_tol=eigval_tol - ) - write_fock_dec_by_N(ntot_v, v_noccu, "fock_i.in") - if do_ed == 1: - if rank == 0: - print("edrixs >>> do_ed=1, perform ED at noccu: ", v_noccu, flush=True) - comm.Barrier() - ed_fsolver(fcomm, rank, size) - comm.Barrier() - data = np.loadtxt('eigvals.dat', ndmin=2) - eval_i = np.zeros(neval, dtype=float) - eval_i[0:neval] = data[0:neval, 1] - data = np.loadtxt('denmat.dat', ndmin=2) - tmp = (nvector, ntot_v, ntot_v) - denmat = data[:, 3].reshape(tmp) + 1j * data[:, 4].reshape(tmp) - return eval_i, denmat, v_noccu - else: - if rank == 0: - print("edrixs >>> do_ed=2, Do not perform ED, only write files", flush=True) - return None, None, None - - # Find the ground states by total occupancy N - elif do_ed == 0: - if rank == 0: - print("edrixs >>> do_ed=0, serach ground state by total occupancy N", flush=True) - flog = open('search_gs.log', 'w') - write_emat(emat_i, 'hopping_i.in') - res = [] - num_electron = ntot_v // 2 - noccu_gs = num_electron - if rank == 0: - write_config( - ed_solver=1, num_val_orbs=ntot_v, neval=1, nvector=1, idump=False, - maxiter=maxiter, min_ndim=min_ndim, eigval_tol=eigval_tol - ) - write_fock_dec_by_N(ntot_v, num_electron, "fock_i.in") - comm.Barrier() - ed_fsolver(fcomm, rank, size) - comm.Barrier() - data = np.loadtxt('eigvals.dat', ndmin=2) - eval_gs = data[0, 1] - data = np.loadtxt('denmat.dat', ndmin=2) - tmp = (1, ntot_v, ntot_v) - denmat = data[:, 3].reshape(tmp) + 1j * data[:, 4].reshape(tmp) - imp_occu = np.sum(denmat[0].diagonal()[0:v_norb]).real - res.append((num_electron, eval_gs, imp_occu)) - if rank == 0: - print(num_electron, eval_gs, imp_occu, file=flog, flush=True) - - nplus_list = [num_electron + i + 1 for i in range(ntot_v // 2)] - nminus_list = [num_electron - i - 1 for i in range(ntot_v // 2)] - nplus_direction = True - nminus_direction = True - for i in range(ntot_v // 2): - if nplus_direction: - num_electron = nplus_list[i] - if rank == 0: - write_fock_dec_by_N(ntot_v, num_electron, "fock_i.in") - comm.Barrier() - ed_fsolver(fcomm, rank, size) - comm.Barrier() - data = np.loadtxt('eigvals.dat', ndmin=2) - eigval = data[0, 1] - if eigval > eval_gs: - nplus_direction = False - else: - nminus_direction = False - eval_gs = eigval - noccu_gs = num_electron - data = np.loadtxt('denmat.dat', ndmin=2) - tmp = (1, ntot_v, ntot_v) - denmat = data[:, 3].reshape(tmp) + 1j * data[:, 4].reshape(tmp) - imp_occu = np.sum(denmat[0].diagonal()[0:v_norb]).real - res.append((num_electron, eigval, imp_occu)) - if rank == 0: - print(num_electron, eigval, imp_occu, file=flog, flush=True) - - if nminus_direction: - num_electron = nminus_list[i] - if rank == 0: - write_fock_dec_by_N(ntot_v, num_electron, "fock_i.in") - comm.Barrier() - ed_fsolver(fcomm, rank, size) - comm.Barrier() - data = np.loadtxt('eigvals.dat', ndmin=2) - eigval = data[0, 1] - if eigval > eval_gs: - nminus_direction = False - else: - nplus_direction = False - eval_gs = eigval - noccu_gs = num_electron - data = np.loadtxt('denmat.dat', ndmin=2) - tmp = (1, ntot_v, ntot_v) - denmat = data[:, 3].reshape(tmp) + 1j * data[:, 4].reshape(tmp) - imp_occu = np.sum(denmat[0].diagonal()[0:v_norb]).real - res.append((num_electron, eigval, imp_occu)) - if rank == 0: - print(num_electron, eigval, imp_occu, file=flog, flush=True) - if rank == 0: - flog.close() - res.sort(key=lambda x: x[1]) - f = open('search_result.dat', 'w') - for item in res: - f.write("{:10d}{:20.10f}{:20.10f}\n".format(item[0], item[1], item[2])) - f.close() - print("edrixs >>> do_ed=0, Perform ED at occupancy: ", noccu_gs, - "with more accuracy", flush=True) - # Do ED for the occupancy of ground state with more accuracy - eval_shift = c_level * c_norb / noccu_gs - emat_i[0:ntot_v, 0:ntot_v] += np.eye(ntot_v) * eval_shift - emat_n[ntot_v:ntot, ntot_v:ntot] += np.eye(c_norb) * c_level - if rank == 0: - write_emat(emat_i, 'hopping_i.in') - write_emat(emat_n, 'hopping_n.in') - write_config( - ed_solver=ed_solver, num_val_orbs=ntot_v, neval=neval, nvector=nvector, ncv=ncv, - idump=idump, maxiter=maxiter, min_ndim=min_ndim, eigval_tol=eigval_tol - ) - write_fock_dec_by_N(ntot_v, noccu_gs, "fock_i.in") - comm.Barrier() - ed_fsolver(fcomm, rank, size) - comm.Barrier() - data = np.loadtxt('eigvals.dat', ndmin=2) - eval_i = np.zeros(neval, dtype=float) - eval_i[0:neval] = data[0:neval, 1] - data = np.loadtxt('denmat.dat', ndmin=2) - tmp = (nvector, ntot_v, ntot_v) - denmat = data[:, 3].reshape(tmp) + 1j * data[:, 4].reshape(tmp) - return eval_i, denmat, noccu_gs - else: - raise Exception("Unknown case of do_ed ", do_ed)
- - - -
-[docs] -def xas_siam_fort(comm, shell_name, nbath, ominc, *, gamma_c=0.1, - v_noccu=1, thin=1.0, phi=0, pol_type=None, - num_gs=1, nkryl=200, temperature=1.0, - loc_axis=None, scatter_axis=None): - """ - Calculate XAS for single impurity Anderson model (SIAM) with Fortran solver. - - Parameters - ---------- - comm: MPI_comm - MPI communicator. - shell_name: tuple of two strings - Names of valence and core shells. The 1st (2nd) string in the tuple is for the - valence (core) shell. - - - The 1st string can only be 's', 'p', 't2g', 'd', 'f', - - - The 2nd string can be 's', 'p', 'p12', 'p32', 'd', 'd32', 'd52', - 'f', 'f52', 'f72'. - - For example: shell_name=('d', 'p32') may indicate a :math:`L_3` edge transition from - core :math:`2p_{3/2}` shell to valence :math:`3d` shell for Ni. - nbath: int - Number of bath sites. - ominc: 1d float array - Incident energy of photon. - gamma_c: a float number or a 1d float array with the same shape as ominc. - The core-hole life-time broadening factor. It can be a constant value - or incident energy dependent. - v_noccu: int - Total occupancy of valence shells. - thin: float number - The incident angle of photon (in radian). - phi: float number - Azimuthal angle (in radian), defined with respect to the - :math:`x`-axis of the local scattering axis: scatter_axis[:,0]. - pol_type: list of tuples - Type of polarization, options can be: - - - ('linear', alpha), linear polarization, where alpha is the angle between the - polarization vector and the scattering plane in radians. - - - ('left', 0), left circular polarization. - - - ('right', 0), right circular polarization. - - - ('isotropic', 0). isotropic polarization. - - It will set pol_type=[('isotropic', 0)] if not provided. - num_gs: int - Number of initial states used in XAS calculations. - nkryl: int - Maximum number of poles obtained. - temperature: float number - Temperature (in K) for boltzmann distribution. - loc_axis: 3*3 float array - The local axis with respect to which local orbitals are defined. - - - x: local_axis[:,0], - - - y: local_axis[:,1], - - - z: local_axis[:,2]. - - It will be an identity matrix if not provided. - scatter_axis: 3*3 float array - The local axis defining the scattering geometry. The scattering plane is defined in - the local :math:`zx`-plane. - - - local :math:`x`-axis: scatter_axis[:,0] - - - local :math:`y`-axis: scatter_axis[:,1] - - - local :math:`z`-axis: scatter_axis[:,2] - - It will be set to an identity matrix if not provided. - - Returns - ------- - xas: 2d array, shape=(len(ominc), len(pol_type)) - The calculated XAS spectra. The first dimension is for ominc, and the second dimension - if for different polarizations. - poles: list of dict, shape=(len(pol_type), ) - The calculated XAS poles for different polarizations. - """ - from .fedrixs import xas_fsolver - - rank = comm.Get_rank() - size = comm.Get_size() - fcomm = comm.py2f() - - v_name_options = ['s', 'p', 't2g', 'd', 'f'] - c_name_options = ['s', 'p', 'p12', 'p32', 't2g', 'd', 'd32', 'd52', 'f', 'f52', 'f72'] - - v_name = shell_name[0].strip() - c_name = shell_name[1].strip() - if v_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v_name) - if c_name not in c_name_options: - raise Exception("NOT supported type of core shell: ", c_name) - - info_shell = info_atomic_shell() - v_norb = info_shell[v_name][1] - c_norb = info_shell[c_name][1] - - ntot_v = v_norb * (nbath + 1) - ntot = ntot_v + c_norb - if pol_type is None: - pol_type = [('isotropic', 0)] - if loc_axis is None: - loc_axis = np.eye(3) - else: - loc_axis = np.array(loc_axis) - if scatter_axis is None: - scatter_axis = np.eye(3) - else: - scatter_axis = np.array(scatter_axis) - - if rank == 0: - print("edrixs >>> Running XAS ...", flush=True) - write_config(num_val_orbs=ntot_v, num_core_orbs=c_norb, - num_gs=num_gs, nkryl=nkryl) - write_fock_dec_by_N(ntot_v, v_noccu, "fock_i.in") - write_fock_dec_by_N(ntot_v, v_noccu + 1, "fock_n.in") - - case = v_name + c_name - tmp = get_trans_oper(case) - npol, n, m = tmp.shape - tmp_g = np.zeros((npol, n, m), dtype=complex) - trans_mat = np.zeros((npol, ntot, ntot), dtype=complex) - # Transform the transition operators to global-xyz axis - # dipolar transition - if npol == 3: - for i in range(3): - for j in range(3): - tmp_g[i] += loc_axis[i, j] * tmp[j] - # quadrupolar transition - elif npol == 5: - alpha, beta, gamma = rmat_to_euler(loc_axis) - wignerD = get_wigner_dmat(4, alpha, beta, gamma) - rotmat = np.dot(np.dot(tmat_r2c('d'), wignerD), np.conj(np.transpose(tmat_r2c('d')))) - for i in range(5): - for j in range(5): - tmp_g[i] += rotmat[i, j] * tmp[j] - else: - raise Exception("Have NOT implemented this case: ", npol) - trans_mat[:, 0:v_norb, ntot_v:ntot] = tmp_g - - n_om = len(ominc) - gamma_core = np.zeros(n_om, dtype=float) - if np.isscalar(gamma_c): - gamma_core[:] = np.ones(n_om) * gamma_c - else: - gamma_core[:] = gamma_c - - # loop over different polarization - xas = np.zeros((n_om, len(pol_type)), dtype=float) - poles = [] - comm.Barrier() - for it, (pt, alpha) in enumerate(pol_type): - if pt.strip() == 'left' or pt.strip() == 'right' or pt.strip() == 'linear': - if rank == 0: - print("edrixs >>> Loop over for polarization: ", it, pt, flush=True) - kvec = unit_wavevector(thin, phi, scatter_axis, 'in') - polvec = np.zeros(npol, dtype=complex) - pol = dipole_polvec_xas(thin, phi, alpha, scatter_axis, pt) - if npol == 3: # Dipolar transition - polvec[:] = pol - if npol == 5: # Quadrupolar transition - polvec[:] = quadrupole_polvec(pol, kvec) - - trans = np.zeros((ntot, ntot), dtype=complex) - for i in range(npol): - trans[:, :] += trans_mat[i] * polvec[i] - write_emat(trans, 'transop_xas.in') - - # call XAS solver in fedrixs - comm.Barrier() - xas_fsolver(fcomm, rank, size) - comm.Barrier() - - file_list = ['xas_poles.' + str(i+1) for i in range(num_gs)] - pole_dict = read_poles_from_file(file_list) - poles.append(pole_dict) - xas[:, it] = get_spectra_from_poles(pole_dict, ominc, gamma_core, temperature) - elif pt.strip() == 'isotropic': - pole_dicts = [] - for k in range(npol): - if rank == 0: - print("edrixs >>> Loop over for polarization: ", it, pt, flush=True) - print("edrixs >>> Isotropic, component: ", k, flush=True) - write_emat(trans_mat[k], 'transop_xas.in') - - # call XAS solver in fedrixs - comm.Barrier() - xas_fsolver(fcomm, rank, size) - comm.Barrier() - - file_list = ['xas_poles.' + str(i+1) for i in range(num_gs)] - pole_tmp = read_poles_from_file(file_list) - xas[:, it] += get_spectra_from_poles(pole_tmp, ominc, gamma_core, temperature) - pole_dicts.append(pole_tmp) - xas[:, it] = xas[:, it] / npol - poles.append(merge_pole_dicts(pole_dicts)) - else: - raise Exception("Unknown polarization type: ", pt) - - return xas, poles
- - - -
-[docs] -def rixs_siam_fort(comm, shell_name, nbath, ominc, eloss, *, gamma_c=0.1, gamma_f=0.1, - v_noccu=1, thin=1.0, thout=1.0, phi=0, pol_type=None, num_gs=1, - nkryl=200, linsys_max=1000, linsys_tol=1e-10, temperature=1.0, - loc_axis=None, scatter_axis=None): - """ - Calculate RIXS for single impurity Anderson model with Fortran solver. - - Parameters - ---------- - comm: MPI_comm - MPI communicator. - shell_name: tuple of two strings - Names of valence and core shells. The 1st (2nd) string in the tuple is for the - valence (core) shell. - - - The 1st string can only be 's', 'p', 't2g', 'd', 'f', - - - The 2nd string can be 's', 'p', 'p12', 'p32', 'd', 'd32', 'd52', - 'f', 'f52', 'f72'. - - For example: shell_name=('d', 'p32') may indicate a :math:`L_3` edge transition from - core :math:`2p_{3/2}` shell to valence :math:`3d` shell for Ni. - nbath: int - Number of bath sites. - ominc: 1d float array - Incident energy of photon. - eloss: 1d float array - Energy loss. - gamma_c: a float number or a 1d float array with same shape as ominc. - The core-hole life-time broadening factor. It can be a constant value - or incident energy dependent. - gamma_f: a float number or a 1d float array with same shape as eloss. - The final states life-time broadening factor. It can be a constant value - or energy loss dependent. - v_noccu: int - Total occupancy of valence shells. - thin: float number - The incident angle of photon (in radian). - thout: float number - The scattered angle of photon (in radian). - phi: float number - Azimuthal angle (in radian), defined with respect to the - :math:`x`-axis of scattering axis: scatter_axis[:,0]. - pol_type: list of 4-elements-tuples - Type of polarizations. It has the following form: - - (str1, alpha, str2, beta) - - where, str1 (str2) can be 'linear', 'left', 'right', and alpha (beta) is - the angle (in radians) between the linear polarization vector and the scattering plane. - - It will set pol_type=[('linear', 0, 'linear', 0)] if not provided. - num_gs: int - Number of initial states used in RIXS calculations. - nkryl: int - Maximum number of poles obtained. - linsys_max: int - Maximum iterations of solving linear equations. - linsys_tol: float - Convergence for solving linear equations. - temperature: float number - Temperature (in K) for boltzmann distribution. - loc_axis: 3*3 float array - The local axis with respect to which local orbitals are defined. - - - x: local_axis[:,0], - - - y: local_axis[:,1], - - - z: local_axis[:,2]. - - It will be an identity matrix if not provided. - scatter_axis: 3*3 float array - The local axis defining the scattering geometry. The scattering plane is defined in - the local :math:`zx`-plane. - - - local :math:`x`-axis: scatter_axis[:,0] - - - local :math:`y`-axis: scatter_axis[:,1] - - - local :math:`z`-axis: scatter_axis[:,2] - - It will be set to an identity matrix if not provided. - - Returns - ------- - rixs: 3d float array, shape=(len(ominc), len(eloss), len(pol_type)) - The calculated RIXS spectra. The 1st dimension is for the incident energy, - the 2nd dimension is for the energy loss and the 3rd dimension is for - different polarizations. - poles: 2d list of dict, shape=(len(ominc), len(pol_type)) - The calculated RIXS poles. The 1st dimension is for incident energy, and the - 2nd dimension is for different polarizations. - """ - from .fedrixs import rixs_fsolver - - rank = comm.Get_rank() - size = comm.Get_size() - fcomm = comm.py2f() - - v_name_options = ['s', 'p', 't2g', 'd', 'f'] - c_name_options = ['s', 'p', 'p12', 'p32', 't2g', 'd', 'd32', 'd52', 'f', 'f52', 'f72'] - v_name = shell_name[0].strip() - c_name = shell_name[1].strip() - if v_name not in v_name_options: - raise Exception("NOT supported type of valence shell: ", v_name) - if c_name not in c_name_options: - raise Exception("NOT supported type of core shell: ", c_name) - - info_shell = info_atomic_shell() - v_norb = info_shell[v_name][1] - c_norb = info_shell[c_name][1] - ntot_v = v_norb * (nbath + 1) - ntot = ntot_v + c_norb - - if pol_type is None: - pol_type = [('linear', 0, 'linear', 0)] - if loc_axis is None: - loc_axis = np.eye(3) - else: - loc_axis = np.array(loc_axis) - if scatter_axis is None: - scatter_axis = np.eye(3) - else: - scatter_axis = np.array(scatter_axis) - - if rank == 0: - print("edrixs >>> Running RIXS ...", flush=True) - write_fock_dec_by_N(ntot_v, v_noccu, "fock_i.in") - write_fock_dec_by_N(ntot_v, v_noccu + 1, "fock_n.in") - write_fock_dec_by_N(ntot_v, v_noccu, "fock_f.in") - - case = v_name + c_name - tmp = get_trans_oper(case) - npol, n, m = tmp.shape - tmp_g = np.zeros((npol, n, m), dtype=complex) - trans_mat = np.zeros((npol, ntot, ntot), dtype=complex) - # Transform the transition operators to global-xyz axis - # dipolar transition - if npol == 3: - for i in range(3): - for j in range(3): - tmp_g[i] += loc_axis[i, j] * tmp[j] - # quadrupolar transition - elif npol == 5: - alpha, beta, gamma = rmat_to_euler(loc_axis) - wignerD = get_wigner_dmat(4, alpha, beta, gamma) - rotmat = np.dot(np.dot(tmat_r2c('d'), wignerD), np.conj(np.transpose(tmat_r2c('d')))) - for i in range(5): - for j in range(5): - tmp_g[i] += rotmat[i, j] * tmp[j] - else: - raise Exception("Have NOT implemented this case: ", npol) - trans_mat[:, 0:v_norb, ntot_v:ntot] = tmp_g - - n_om = len(ominc) - neloss = len(eloss) - gamma_core = np.zeros(n_om, dtype=float) - if np.isscalar(gamma_c): - gamma_core[:] = np.ones(n_om) * gamma_c - else: - gamma_core[:] = gamma_c - gamma_final = np.zeros(neloss, dtype=float) - if np.isscalar(gamma_f): - gamma_final[:] = np.ones(neloss) * gamma_f - else: - gamma_final[:] = gamma_f - - # loop over different polarization - rixs = np.zeros((n_om, neloss, len(pol_type)), dtype=float) - poles = [] - comm.Barrier() - # loop over different polarization - for iom, omega in enumerate(ominc): - if rank == 0: - write_config( - num_val_orbs=ntot_v, num_core_orbs=c_norb, - omega_in=omega, gamma_in=gamma_core[iom], - num_gs=num_gs, nkryl=nkryl, linsys_max=linsys_max, - linsys_tol=linsys_tol - ) - poles_per_om = [] - # loop over polarization - for ip, (it, alpha, jt, beta) in enumerate(pol_type): - if rank == 0: - print(flush=True) - print("edrixs >>> Calculate RIXS for incident energy: ", omega, flush=True) - print("edrixs >>> Polarization: ", ip, flush=True) - polvec_i = np.zeros(npol, dtype=complex) - polvec_f = np.zeros(npol, dtype=complex) - ei, ef = dipole_polvec_rixs(thin, thout, phi, alpha, beta, - scatter_axis, (it, jt)) - # dipolar transition - if npol == 3: - polvec_i[:] = ei - polvec_f[:] = ef - # quadrupolar transition - elif npol == 5: - ki = unit_wavevector(thin, phi, scatter_axis, direction='in') - kf = unit_wavevector(thout, phi, scatter_axis, direction='out') - polvec_i[:] = quadrupole_polvec(ei, ki) - polvec_f[:] = quadrupole_polvec(ef, kf) - else: - raise Exception("Have NOT implemented this type of transition operators") - trans_i = np.zeros((ntot, ntot), dtype=complex) - trans_f = np.zeros((ntot, ntot), dtype=complex) - for i in range(npol): - trans_i[:, :] += trans_mat[i] * polvec_i[i] - write_emat(trans_i, 'transop_rixs_i.in') - for i in range(npol): - trans_f[:, :] += trans_mat[i] * polvec_f[i] - write_emat(np.conj(np.transpose(trans_f)), 'transop_rixs_f.in') - - # call RIXS solver in fedrixs - comm.Barrier() - rixs_fsolver(fcomm, rank, size) - comm.Barrier() - - file_list = ['rixs_poles.' + str(i+1) for i in range(num_gs)] - pole_dict = read_poles_from_file(file_list) - poles_per_om.append(pole_dict) - rixs[iom, :, ip] = get_spectra_from_poles(pole_dict, eloss, - gamma_final, temperature) - - poles.append(poles_per_om) - - return rixs, poles
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/utils.html b/edrixs/_modules/edrixs/utils.html deleted file mode 100644 index 2e17cf1370..0000000000 --- a/edrixs/_modules/edrixs/utils.html +++ /dev/null @@ -1,1093 +0,0 @@ - - - - - - - - edrixs.utils — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.utils

-__all__ = ['beta_to_kelvin', 'kelvin_to_beta', 'boltz_dist', 'UJ_to_UdJH',
-           'UdJH_to_UJ', 'UdJH_to_F0F2F4', 'UdJH_to_F0F2F4F6', 'F0F2F4_to_UdJH',
-           'F0F2F4_to_UJ', 'F0F2F4F6_to_UdJH', 'CT_imp_bath',
-           'CT_imp_bath_core_hole', 'info_atomic_shell',
-           'case_to_shell_name', 'edge_to_shell_name', 'slater_integrals_name',
-           'get_atom_data', 'rescale']
-
-import numpy as np
-import json
-import pkg_resources
-
-
-
-[docs] -def beta_to_kelvin(beta): - """ - Convert :math:`\\beta` to Kelvin. - - Parameters - ---------- - beta: float - Inversion temperature. - - Returns - ------- - T: float - Temperature (K). - """ - - kb = 8.6173303E-5 - ev = 1.0 / float(beta) - T = ev / kb - return T
- - - -
-[docs] -def kelvin_to_beta(k): - """ - Convert temperature from Kelvin to :math:`\\beta`. - - Parameters - ---------- - k: float - Temperature in Kelvin. - - Returns - ------- - beta: float - Inversion temperature. - """ - - kb = 8.6173303E-5 - beta = 1.0 / (kb * k) - return beta
- - - -
-[docs] -def boltz_dist(gs, T): - """ - Return Boltzmann distributition. - - Parameters - ---------- - gs: 1d float array - Energy levels. - T: float - Temperature in Kelvin. - - Returns - ------- - res: 1d float array - The Boltzmann distributition. - """ - tmp_gs = np.array(gs) - beta = kelvin_to_beta(T) - res = np.exp(-beta * (tmp_gs - min(tmp_gs))) / np.sum(np.exp(-beta * (tmp_gs - min(tmp_gs)))) - return res
- - - -
-[docs] -def UJ_to_UdJH(U, J): - """ - Given Kanamori :math:`U` and :math:`J`, return :math:`U_d` and :math:`J_H`, - for :math:`t2g`-orbitals. - - Parameters - ---------- - U: float - Coulomb interaction :math:`U`. - J: float - Hund's coupling :math:`J`. - - Returns - ------- - Ud: float - Coulomb interaction :math:`U_d`. - JH: float - Hund's coupling :math:`J_{H}`. - """ - - F2 = J / (3.0 / 49.0 + 20 * 0.625 / 441.0) - F4 = 0.625 * F2 - JH = (F2 + F4) / 14.0 - Ud = U - 4.0 / 49.0 * (F2 + F4) - - return Ud, JH
- - - -
-[docs] -def UdJH_to_UJ(Ud, JH): - """ - Given :math:`U_d` and :math:`J_H`, return Kanamori :math:`U` and :math:`J`, - for :math:`t2g`-orbitals. - - Parameters - ---------- - Ud: float - Coulomb interaction :math:`U_d`. - JH: float - Hund's coupling :math:`J_H`. - - Returns - ------- - U: float - Coulomb interaction :math:`U` in Kanamori form. - J: float - Hund's coupling :math:`J` in Kanamori form. - """ - - F2 = 14.0 / 1.625 * JH - F4 = 0.625 * F2 - J = 3.0 / 49.0 * F2 + 20 / 441.0 * F4 - U = Ud + 4.0 / 49.0 * (F2 + F4) - - return U, J
- - - -
-[docs] -def UdJH_to_F0F2F4(Ud, JH): - """ - Given :math:`U_d` and :math:`J_H`, return :math:`F_0`, :math:`F_2` and :math:`F_4`, - for :math:`d`-orbitals. - - Parameters - ---------- - Ud: float - Coulomb interaction :math:`U_d`. - JH: float - Hund's coupling :math:`J_H`. - - Returns - ------- - F0: float - Slater integral :math:`F_0`. - F2: float - Slater integral :math:`F_2`. - F4: float - Slater integral :math:`F_4`. - """ - - F0 = Ud - F2 = 14 / 1.625 * JH - F4 = 0.625 * F2 - - return F0, F2, F4
- - - -
-[docs] -def UdJH_to_F0F2F4F6(Ud, JH): - """ - Given :math:`U_d` and :math:`J_H`, return :math:`F_0`, :math:`F_2`, :math:`F_4` and :math:`F_6`, - for :math:`f`-orbitals. - - Parameters - ---------- - Ud: float - Coulomb interaction :math:`U_d`. - JH: float - Hund's coupling :math:`J_H`. - - Returns - ------- - F0: float - Slater integral :math:`F_0`. - F2: float - Slater integral :math:`F_2`. - F4: float - Slater integral :math:`F_4`. - F6: float - Slater integral :math:`F_6`. - - """ - - F0 = Ud - F2 = 6435 / (286.0 + (195 * 451) / 675.0 + (250 * 1001) / 2025.0) * JH - F4 = 451 / 675.0 * F2 - F6 = 1001 / 2025.0 * F2 - - return F0, F2, F4, F6
- - - -
-[docs] -def F0F2F4_to_UdJH(F0, F2, F4): - """ - Given :math:`F_0`, :math:`F_2` and :math:`F_4`, return :math:`U_d` and :math:`J_H`, - for :math:`d`-orbitals. - - Parameters - ---------- - F0: float - Slater integral :math:`F_0`. - F2: float - Slater integral :math:`F_2`. - F4: float - Slater integral :math:`F_4`. - - Returns - ------- - Ud: float - Coulomb interaction :math:`U_d`. - JH: float - Hund's coupling :math:`J_H`. - """ - - Ud = F0 - JH = (F2 + F4) / 14.0 - - return Ud, JH
- - - -
-[docs] -def F0F2F4_to_UJ(F0, F2, F4): - """ - Given :math:`F_0`, :math:`F_2` and :math:`F_4`, return :math:`U` and :math:`J`, - for :math:`t2g`-orbitals. - - Parameters - ---------- - F0: float - Slater integral :math:`F_0`. - F2: float - Slater integral :math:`F_2`. - F4: float - Slater integral :math:`F_4`. - - Returns - ------- - U: float - Coulomb interaction :math:`U`. - J: float - Hund's coupling :math:`J`. - """ - - U = F0 + 4.0 / 49.0 * (F2 + F4) - J = 3.0 / 49.0 * F2 + 20 / 441.0 * F4 - - return U, J
- - - -
-[docs] -def F0F2F4F6_to_UdJH(F0, F2, F4, F6): - """ - Given :math:`F_0`, :math:`F_2`, :math:`F_4` and :math:`F_6`, - return :math:`U_d` and :math:`J_H`, for :math:`f`-orbitals. - - Parameters - ---------- - F0: float - Slater integral :math:`F_0`. - F2: float - Slater integral :math:`F_2`. - F4: float - Slater integral :math:`F_4`. - F6: float - Slater integral :math:`F_6`. - - Returns - ------- - Ud: float - Coulomb interaction :math:`U_d`. - JH: float - Hund's coupling :math:`J_H`. - """ - - Ud = F0 - JH = (286 * F2 + 195 * F4 + 250 * F6) / 6435.0 - return Ud, JH
- - - -
-[docs] -def CT_imp_bath(U_dd, Delta, n): - """ - Compute energies of the impurity and bath for an - Anderson impurity or charge-transfer model - appropriate for a :math:`d`-shell transition metal compound. - - Parameters - ---------- - U_dd: float - Coulomb interaction :math:`U_{dd}` - Delta: float - Charge-transfer energy :math:`\\Delta` - n : integer - Number of electrons in the :math:`d`-shell - - Returns - ------- - E_d : float - Energy of the impurity states :math:`E_d` - E_L : float - Energy of the bath states :math:`E_L` - - Notes - ----- - We credit our approach to Maurits Hakverkort, - Heidelberg University. - We define the state with a full set of bath orbitals to be zero - energy and write the energy levels using the same definitions - as [1]_ [2]_ [3]_. - - * :math:`d^{n}L^{10}` has energy :math:`0` - - * :math:`d^{n+1}L^9` has energy :math:`\\Delta` - - * :math:`d^{n+2}L^8` has energy :math:`2\\Delta + U_{dd}` - - Using this we can write and solve three linear equations to get - :math:`E_d` and :math:`E_L` the energies of the impurity and bath. - - .. math:: - \\begin{aligned} - 10 E_L + n E_d + n(n-1) \\frac{U_{dd}}{2} &= 0 \\\\ - 9 E_L + (n+1) E_d + (n+1)n \\frac{U_{dd}}{2} &= \\Delta \\\\ - 8 E_L + (n+2) E_d + (n+1)(n+2) \\frac{U_{dd}}{2} - &= 2\\Delta + U_{dd} - \\end{aligned} - - The solutions are: - - .. math:: - \\begin{aligned} - E_d &= - \\frac{10 \\Delta - n (19 + n) U_{dd}/2}{10 + n} \\\\ - E_L &= - \\frac{n ((1+n) U_{dd}/2-\\Delta)}{10 + n} - \\end{aligned}. - - References - ---------- - .. [1] J. Zaanen, G. A. Sawatzky, and J. W. Allen - `Phys. Rev. Lett. 55, 418 (1985) <https://doi.org/10.1103/PhysRevLett.55.418>`_ - .. [2] Maurits Haverkort et al., - `Phys. Rev. B 85, 165113 (2012) <https://doi.org/10.1103/PhysRevB.85.165113>`_ - .. [3] A. E. Bocquet et al., - `Phys. Rev. B 53, 1161 (1996) <https://doi.org/10.1103/PhysRevB.53.1161>`_ - """ - E_d = (10*Delta - n*(19 + n)*U_dd/2)/(10 + n) - E_L = n*((1 + n)*U_dd/2-Delta)/(10 + n) - return E_d, E_L
- - - -
-[docs] -def CT_imp_bath_core_hole(U_dd, U_pd, Delta, n): - """ - Compute energies of the impurity and bath for an - Anderson impurity or charge-transfer model - appropriate for a :math:`d`-shell transition metal compound - with a core hole. - - Parameters - ---------- - U_dd: float - Coulomb interaction :math:`U_{dd}` - U_pd: float - Coulomb interaction :math:`U_{pd}` - Delta: float - Charge-transfer energy :math:`\\Delta` - n : integer - Number of electrons in the :math:`d`-shell :math:`n` - - Returns - ------- - E_dc : float - Energy of the impurity states :math:`E_{dc}` with - a core hole - E_Lc : float - Energy of the bath states :math:`E_{Lc}` with a core - hole - E_p : float - Energy of the core hole state :math:`E_\\textrm{E_p}` - - Notes - ----- - We credit our approach to Maurits Hakverkort, - Heidelberg University. - We define the state with a full set of bath orbitals to be zero - energy and write the energy levels using the same definitions as - [1]_ [2]_ [3]_. - - * :math:`2p^5 d^{n}L^{10}` has energy :math:`0` - - * :math:`2p^5 d^{n+1}L^9` has energy :math:`\\Delta + U_{dd} - U_{pd}` - - * :math:`2p^5 d^{n+2}L^8` has energy :math:`2\\Delta + 3 U_{dd} - 2 U_{pd}` - - Using this we can write and solve linear equations to get - :math:`E_{dc}`, :math:`E_{Lc}` and :math:`E_p` the energies of the - impurity and bath with a core hole and the energy of the core hole. - - .. math:: - \\begin{aligned} - 6 E_p + 10 E_{Lc} + n E_{dc} + n(n-1) \\frac{U_{dd}}{2} - + 6 n U_{pd} &= 0 \\\\ - 6 E_p + 9 E_{Lc} + (n+1) E_{dc} + (n+1)n \\frac{U_{dd}}{2} - + 6 (n+1) U_{pd} &= \\Delta \\\\ - 6 E_p + 8 E_{Lc} + (n+2) E_{d} + (n+1)(n+2) \\frac{U_{dd}}{2} - + 6 (n+2) U_{pd} &= 2 \\Delta+U_{dd} \\\\ - 5 E_p + 10 E_{Lc} + (n+1) E_{d} + (n+1) n \\frac{U_{dd}}{2} - + 5 (n+1) U_{pd} &= 0 \\\\ - 5 E_p + 9 E_{Lc} + (n+2) E_{dc} + (n+2)(n+1) \\frac{U_{dd}}{2} - + 5 (n+2) U_{pd} &= \\Delta+U_{dd}-U_{pd} \\\\ - 5 E_p + 8 E_{Lc} + (n+3) E_{dc} + (n+3)(n+2) \\frac{U_{dd}}{2} - + 5 (n+3) U_{pd} &= 2 \\Delta+3 U_{dd}-2 U_{pd} - \\end{aligned} - - The solutions are: - - .. math:: - \\begin{aligned} - E_{dc} &= \\frac{10 \\Delta - n (31+n) \\frac{U_{dd}}{2}-90 U_{pd}}{16+n} \\\\ - E_{Lc} &= \\frac{(1+n) (n \\frac{U_{dd}}{2}+6*U_{pd})-(6+n) \\Delta}{16+n} \\\\ - E_p &= \\frac{10 \\Delta + (1+n)(n\\frac{U_{dd}}{2}-(10+n)*U_{pd}}{16+n} - \\end{aligned} - - References - ---------- - .. [1] J. Zaanen, G. A. Sawatzky, and J. W. Allen - `Phys. Rev. Lett. 55, 418 (1985) <https://doi.org/10.1103/PhysRevLett.55.418>`_ - .. [2] Maurits Haverkort et al., - `Phys. Rev. B 85, 165113 (2012) <https://doi.org/10.1103/PhysRevB.85.165113>`_ - .. [3] A. E. Bocquet et al., - `Phys. Rev. B 53, 1161 (1996) <https://doi.org/10.1103/PhysRevB.53.1161>`_ - """ - E_dc = (10*Delta - n*(31 + n)*U_dd/2 - 90*U_pd) / (16 + n) - E_Lc = ((1 + n)*(n*U_dd/2 + 6*U_pd) - (6 + n)*Delta) / (16 + n) - E_p = (10*Delta + (1 + n)*(n*U_dd/2 - (10 + n)*U_pd)) / (16 + n) - return E_dc, E_Lc, E_p
- - - -
-[docs] -def info_atomic_shell(): - """ - Return a dict to describe the information of atomic shell. - The key is a string of the shell's name, the value is a 2-elments tuple, - the first value is the orbital angular moment number and - the second value is the dimension of the Hilbert space. - - Returns - ------- - info: dict - The dict describing info of atomic shell. - """ - - info = {'s': (0, 2), - 'p': (1, 6), - 'p12': (1, 2), - 'p32': (1, 4), - 't2g': (2, 6), - 'd': (2, 10), - 'd32': (2, 4), - 'd52': (2, 6), - 'f': (3, 14), - 'f52': (3, 6), - 'f72': (3, 8) - } - - return info
- - - -
-[docs] -def case_to_shell_name(case): - """ - Return the shell names for different cases. - - Parameters - ---------- - case: string - A string describing the shells included. - - Returns - ------- - shell_name: tuple of one or two strings - The name of shells. - - Examples - -------- - >>> import edrixs - >>> edrixs.case_to_shell_name('d') - ('d',) - >>> edrixs.case_to_shell_name('t2gp32') - ('t2g', 'p32') - """ - - shell = ['s', 'p', 'p12', 'p32', 't2g', 'd', 'd32', 'd52', 'f', 'f52', 'f72'] - - shell_name = {} - for str1 in shell: - shell_name[str1] = (str1,) - - for str1 in shell: - for str2 in shell: - shell_name[str1+str2] = (str1, str2) - - return shell_name[case.strip()]
- - - -
-[docs] -def edge_to_shell_name(edge_name, with_main_qn=False): - """ - Given edge name, return shell name. - If one needs to include both spin-orbit split edges of one shell, - one can use string, for example, 'L23' means both L2 and L3 edges - are considered in the calculations, and the shell name will be 'p'. - - Parameters - ---------- - edge_name: string - Standard edge name. - with_main_qn: logical - If true, the shell name will include the main quantum number. - Returns - ------- - shell_name: string - Shell name. - - - with_main_qn=True, shell_name will include the main quantum number, - for example, *2p* - - - with_main_qn=False, shell_name will not include the main quantum number, - for example, *p* - """ - shell_name = { - 'K': ('s', '1s'), - 'L1': ('s', '2s'), - 'L2': ('p12', '2p12'), - 'L3': ('p32', '2p32'), - 'L23': ('p', '2p'), - 'M1': ('s', '3s'), - 'M2': ('p12', '3p12'), - 'M3': ('p32', '3p32'), - 'M23': ('p', '3p'), - 'M4': ('d32', '3d32'), - 'M5': ('d52', '3d52'), - 'M45': ('d', '3d'), - 'N1': ('s', '4s'), - 'N2': ('p12', '4p12'), - 'N3': ('p32', '4p32'), - 'N23': ('p', '4p'), - 'N4': ('d32', '4d32'), - 'N5': ('d52', '4d52'), - 'N45': ('d', '4d'), - 'N6': ('f52', '4f52'), - 'N7': ('f72', '4f72'), - 'N67': ('f', '4f'), - 'O1': ('s', '5s'), - 'O2': ('p12', '5p12'), - 'O3': ('p32', '5p32'), - 'O23': ('p', '5p'), - 'O4': ('d32', '5d32'), - 'O5': ('d52', '5d52'), - 'O45': ('d', '5d'), - 'P1': ('s', '6s'), - 'P2': ('p12', '6p12'), - 'P3': ('p32', '6p32'), - 'P23': ('p', '6p') - } - - if with_main_qn: - return shell_name[edge_name.strip()][1] - else: - return shell_name[edge_name.strip()][0]
- - - -
-[docs] -def slater_integrals_name(shell_name, label=None): - """ - Given shell names, return the names of required Slater integrals. - The order of these names in the return list is according to the convention: - - - For 1 shell: [FX_11] - - - For 2 shells: [FX_11, FX_12, GX_12, FX_22] - - - For 3 shells: [FX_11, FX_12, GX_12, FX_22, FX_13, GX_13, FX_23, GX_23, FX_33] - - where, X=0, 2, 4, 6, or X=1, 3, 5, X shoule be in ascending order. - - Parameters - ---------- - shell_name: tuple of strings - Name of shells. Its length should be less and equal than 3. - label: tuple of strings - Label of shells, same shape as shell_name. - - If not provided, label will be set to - - - label=(1,) for one shell, or - - - label=(1,2) for two shells, or - - - label=(1,2,3) for three shells - - Returns - ------- - res: list of strings - Names of Slater integrals. - """ - info = info_atomic_shell() - # one shell - if len(shell_name) == 1: - res = [] - l1 = info[shell_name[0]][0] - if label is not None: - x = label[0] - else: - x = '1' - res.extend(['F' + str(i) + '_' + x + x for i in range(0, 2*l1+1, 2)]) - elif len(shell_name) == 2: - res = [] - l1 = info[shell_name[0]][0] - l2 = info[shell_name[1]][0] - if label is not None: - x, y = label[0], label[1] - else: - x, y = '1', '2' - res.extend(['F' + str(i) + '_' + x + x for i in range(0, 2*l1+1, 2)]) - res.extend(['F' + str(i) + '_' + x + y for i in range(0, min(2*l1, 2*l2)+1, 2)]) - res.extend(['G' + str(i) + '_' + x + y for i in range(abs(l1-l2), l1+l2+1, 2)]) - res.extend(['F' + str(i) + '_' + y + y for i in range(0, 2*l2+1, 2)]) - elif len(shell_name) == 3: - res = [] - l1 = info[shell_name[0]][0] - l2 = info[shell_name[1]][0] - l3 = info[shell_name[2]][0] - if label is not None: - x, y, z = label[0], label[1], label[2] - else: - x, y, z = '1', '2', '3' - res.extend(['F' + str(i) + '_' + x + x for i in range(0, 2*l1+1, 2)]) - res.extend(['F' + str(i) + '_' + x + y for i in range(0, min(2*l1, 2*l2)+1, 2)]) - res.extend(['G' + str(i) + '_' + x + y for i in range(abs(l1-l2), l1+l2+1, 2)]) - res.extend(['F' + str(i) + '_' + y + y for i in range(0, 2*l2+1, 2)]) - res.extend(['F' + str(i) + '_' + x + z for i in range(0, min(2*l1, 2*l3)+1, 2)]) - res.extend(['G' + str(i) + '_' + x + z for i in range(abs(l1-l3), l1+l3+1, 2)]) - res.extend(['F' + str(i) + '_' + y + z for i in range(0, min(2*l2, 2*l3)+1, 2)]) - res.extend(['G' + str(i) + '_' + y + z for i in range(abs(l2-l3), l2+l3+1, 2)]) - res.extend(['F' + str(i) + '_' + z + z for i in range(0, 2*l3+1, 2)]) - else: - raise Exception("Not implemented for this case: ", shell_name) - - return res
- - - -
-[docs] -def get_atom_data(atom, v_name, v_noccu, edge=None, trans_to_which=1, label=None): - """ - Return Slater integrals, spin-orbit coupling strength, edge energy and core hole - life-time broadening for an atom with given type of valence shells, occupancy of - valence shells and the x-ray resonant edge. - - The Slater integrals and spin-orbit coupling are calculated by Cowan's code - (https://github.com/mretegan/atomic-parameters) based on Hartree-Fock - approximation. These numbers are just initial guess and serve as a start point, - you need to rescale them to reproduce your XAS or RIXS spectra. - - NOTE: F0 is not calculated by Cowan's code, they are all set to be zero, you need to - set F0 by yourself. - - Parameters - ---------- - atom: string - Name of atom, for example, 'Ni', 'Cu', 'Ir', 'U'. - v_name: a string or a tuple of one or two strings - Names of one or two valence shells. Set it to a single string if there is only - one valence shell, or set it to a tuple of two strings if there are two valence - shells. For example, *v_name='3d'*, *v_name=('3d', '4p')* - v_noccu: a int or a tuple of one or two ints - Occupancy of valence shells before x-ray absorption (without a core hole). - Set it to a single int if there is only one valence shell, or set it to a - tuple of two ints if there are two valence shells. The order should be - consistent with that in v_name. - For example, *v_name='3d', v_noccu=8*, *v_name=('3d', '4p'), v_noccu=(8, 0)*. - edge: a string - X-ray resonant edge. If edge is not None, both the information of - the initial (without a core hole) and intermediate (with a core hole) Hamiltonians - will be returned, otherwise, only the information of the initial Hamiltonian - will be returned. It can be, - - - K, L1, L2, L3, M1, M2, M3, M4, M5, N1, N2, N3, N4, N5, - N6, N7, O1, O2, O3, O4, O5, P1, P2, P3 - - - L23 (both L2 and L3), M23 (both M2 and M3), M45 (both M4 and M5) - N23 (both N2 and N3), N45 (both N4 and N5), N67 (both N6 and N7) - O23 (both O2 and O3), O45 (both O4 and O5), P23 (both P2 and P3) - trans_to_which: int - If there are two valence shells, this variable is used to indicate which - valence shell the photon transition happens. - - - 1: to the first valence shell - - - 2: to the second valence shell - label: a string or tuple of strings - User-defined symbols to label the names of Slater integrals. - - - one element, for the valence shell - - - two elements, 1st (2nd)-element for the 1st (2nd) valence shells or - 1st-element for the 1st valence shell and the 2nd one for the core shell. - - - three elements, the 1st (2nd)-element is for the 1st (2nd) valence shell, - the 3rd one is for the core shell - - - Returns - ------- - res: dict - Atomic data. A dict likes this if edge is None: - - .. code-block:: python - - res={ - 'slater_i': [(name of slater integrals, vaule of slater integrals), (), ...], - 'v_soc': [list of SOC for each atomic shell in v_name], - } - - otherwise, - - .. code-block:: python - - res={ - 'slater_i': [(name of slater integrals, value of slater integrals), (), ...], - 'slater_n': [(name of slater integrals, value of slater integrals), (), ...], - 'v_soc': [list of SOC for each atomic shell in v_name], - 'c_soc': SOC of core shell, - 'edge_ene': [list of edge energy, 2 elements if edge is any of - "L23, M23, M45, N23, N45, N67, O23, O45, P23", othewise only 1 element], - 'gamma_c': [list of core hole life-time broadening, 2 elements if edge is any of - "L23, M23, M45, N23, N45, N67, O23, O45, P23", othewise only 1 element], - } - - - Examples - -------- - >>> import edrixs - >>> res = edrixs.get_atom_data('Ni', v_name='3d', v_noccu=8) - >>> res - {'slater_i': [('F0_11', 0.0), ('F2_11', 13.886), ('F4_11', 8.67)], - 'v_soc_i': [0.112]} - >>> name, slater = [list(i) for i in zip(*res['slater_i'])] - >>> name - ['F0_11', 'F2_11', 'F4_11'] - >>> slater - [0.0, 13.886, 8.67] - >>> slater = [i * 0.8 for i in slater] - >>> slater[0] = edrixs.get_F0('d', slater[1], slater[2]) - >>> slater - [0.5728507936507936, 11.1088, 6.936] - - >>> import edrixs - >>> res=edrixs.get_atom_data('Ni', v_name='3d', v_noccu=8, edge='L3', label=('d', 'p')) - >>> res - {'slater_i': [('F0_dd', 0.0), ('F2_dd', 12.234), ('F4_dd', 7.598)], - 'v_soc_i': [0.083], - 'slater_n': [('F0_dd', 0.0), ('F2_dd', 12.234), ('F4_dd', 7.598), - ('F0_dp', 0.0), ('F2_dp', 7.721), ('G1_dp', 5.787), ('G3_dp', 3.291), - ('F0_pp', 0.0), ('F2_pp', 0.0)], - 'v_soc_n': [0.102], - 'c_soc': 11.507, - 'edge_ene': [852.7], - 'gamma_c': [0.275]} - >>> name_i, slater_i = [list(i) for i in zip(*res['slater_i'])] - >>> name_n, slater_n = [list(i) for i in zip(*res['slater_n'])] - >>> name_i - ['F0_dd', 'F2_dd', 'F4_dd'] - >>> slater_i - [0.0, 12.234, 7.598] - >>> name_n - ['F0_dd', 'F2_dd', 'F4_dd', 'F0_dp', 'F2_dp', 'G1_dp', 'G3_dp', 'F0_pp', 'F2_pp'] - >>> slater_n - [0.0, 12.234, 7.598, 0.0, 7.721, 5.787, 3.291, 0.0, 0.0] - >>> slater_n[0] = edrixs.get_F0('d', slater_n[1], slater_n[2]) - >>> slater_n[3] = edrixs.get_F0('dp', slater_n[5], slater_n[6]) - >>> slater_n - [0.6295873015873016, 12.234, 7.598, 0.5268428571428572, 7.721, 5.787, 3.291, 0.0, 0.0] - - >>> import edrixs - >>> import collections - >>> res=edrixs.get_atom_data('Ni', v_name=('3d', '4p'), v_noccu=(8, 0), - ... edge='K', trans_to_which=2, label=('d', 'p', 's')) - >>> res - {'slater_i': [('F0_dd', 0.0), ('F2_dd', 12.234), ('F4_dd', 7.598), - ('F0_dp', 0.0), ('F2_dp', 0.0), ('G1_dp', 0.0), ('G3_dp', 0.0), - ('F0_pp', 0.0), ('F2_pp', 0.0)], - 'v_soc_i': [0.083, 0.0], - 'slater_n': [('F0_dd', 0.0), ('F2_dd', 13.851), ('F4_dd', 8.643), - ('F0_dp', 0.0), ('F2_dp', 2.299), ('G1_dp', 0.828), ('G3_dp', 0.713), - ('F0_pp', 0.0), ('F2_pp', 0.0), - ('F0_ds', 0.0), ('G2_ds', 0.079), - ('F0_ps', 0.0), ('G1_ps', 0.194), - ('F0_ss', 0.0)], - 'v_soc_n': [0.113, 0.093], - 'c_soc': 0.0, - 'edge_ene': [8333.0], - 'gamma_c': [0.81]} - >>> slat_i = collections.OrderedDict(res['slater_i']) - >>> slat_n = collections.OrderedDict(res['slater_n']) - >>> list(slat_i.keys()) - ['F0_dd', 'F2_dd', 'F4_dd', 'F0_dp', 'F2_dp', 'G1_dp', 'G3_dp', 'F0_pp', 'F2_pp'] - >>> list(slat_i.values()) - [0.0, 12.234, 7.598, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - >>> list(slat_n.keys()) - ['F0_dd', 'F2_dd', 'F4_dd', 'F0_dp', 'F2_dp', 'G1_dp', 'G3_dp', 'F0_pp', 'F2_pp', - 'F0_ds', 'G2_ds', 'F0_ps', 'G1_ps', 'F0_ss'] - >>> list(slat_n.values()) - [0.0, 13.851, 8.643, 0.0, 2.299, 0.828, 0.713, 0.0, 0.0, - 0.0, 0.079, 0.0, 0.194, 0.0] - """ - c_norb = {'s': 2, 'p': 6, 'd': 10, 'f': 14} - atom = atom.strip() - avail_atoms = ['Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', - 'Re', 'Os', 'Ir', - 'Sm', - 'U', 'Pu'] - avail_shells = ['1s', '2s', '2p', '3s', '3p', '3d', '4s', '4p', '4d', '4f', - '5s', '5p', '5d', '5f', '6s', '6p', '6d'] - - if atom not in avail_atoms: - raise Exception("Atom data is Not available for this atom: ", atom) - - if not isinstance(v_name, (list, tuple)): - v_name = (v_name,) - if not isinstance(v_noccu, (list, tuple)): - v_noccu = (v_noccu,) - - if label is not None: - if not isinstance(label, (list, tuple)): - label = (label,) - - if len(v_name) != len(v_noccu): - raise Exception("The shape of v_name is not same as noccu") - - for ishell in v_name: - if ishell not in avail_shells: - raise Exception("Not available for this shell: ", ishell) - - fname = pkg_resources.resource_filename('edrixs', 'atom_data/'+atom+'.json') - with open(fname, 'r') as f: - atom_dict = json.load(f) - - res = {} - shell_name = [] - for name in v_name: - shell_name.append(name[-1]) - if label is not None: - my_label = label[0:len(shell_name)] - else: - my_label = None - slater_name = slater_integrals_name(shell_name, label=my_label) - - if len(v_name) == 1: - case = v_name[0] + str(v_noccu[0]) - else: - case = v_name[0] + str(v_noccu[0]) + '_' + v_name[1] + str(v_noccu[1]) - if case not in atom_dict: - raise Exception("This configuration is not available in atom_data", case) - - nslat = len(slater_name) - slater_i = [0.0] * nslat - tmp = atom_dict[case]['slater'] - slater_i[0:len(tmp)] = tmp - res['slater_i'] = list(zip(slater_name, slater_i)) - res['v_soc_i'] = atom_dict[case]['soc'] - - if edge is not None: - edge = edge.strip() - edge_name = edge_to_shell_name(edge, with_main_qn=True) - shell_name = [] - for name in v_name: - shell_name.append(name[-1]) - shell_name.append(edge_name[1:2]) - if label is not None: - my_label = label[0:len(shell_name)] - else: - my_label = None - slater_name = slater_integrals_name(shell_name, label=my_label) - - if len(v_name) == 1: - case = (v_name[0] + str(v_noccu[0]+1) + '_' + - edge_name[0:2] + str(c_norb[edge_name[1]]-1)) - else: - if trans_to_which == 1: - case = (v_name[0] + str(v_noccu[0]+1) + '_' + - v_name[1] + str(v_noccu[1]) + '_' + - edge_name[0:2] + str(c_norb[edge_name[1]]-1)) - else: - case = (v_name[0] + str(v_noccu[0]) + '_' + - v_name[1] + str(v_noccu[1]+1) + '_' + - edge_name[0:2] + str(c_norb[edge_name[1]]-1)) - if case not in atom_dict: - raise Exception("This configuration is currently not available in atom_data", case) - - nslat = len(slater_name) - slater_n = [0.0] * nslat - tmp = atom_dict[case]['slater'] - slater_n[0:len(tmp)] = tmp - res['slater_n'] = list(zip(slater_name, slater_n)) - - res['v_soc_n'] = atom_dict[case]['soc'][0:-1] - res['c_soc'] = atom_dict[case]['soc'][-1] - - res['edge_ene'] = atom_dict[edge]['ene'] - res['gamma_c'] = [i / 2 for i in atom_dict[edge]['gamma']] - - return res
- - - -
-[docs] -def rescale(old_list, scale=None): - """ - Rescale a 1d list. - - Parameters - ---------- - old_list: 1d list of numerical values - Input list. - scale: a list of tuples - The scaling factors. - - Returns - ------- - new_list: 1d list - The rescaled list. - """ - - new_list = [i for i in old_list] - if scale is not None: - for pos, val in zip(scale[0], scale[1]): - new_list[pos] = new_list[pos] * val - return new_list
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/edrixs/wannier_ham.html b/edrixs/_modules/edrixs/wannier_ham.html deleted file mode 100644 index 6c5bae4c4e..0000000000 --- a/edrixs/_modules/edrixs/wannier_ham.html +++ /dev/null @@ -1,489 +0,0 @@ - - - - - - - - edrixs.wannier_ham — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for edrixs.wannier_ham

-__all__ = ['HR', 'KVec', 'SymKVec', 'UniKVec']
-
-import numpy as np
-
-
-
-[docs] -class HR(): - """ - Class for post-process of the Wannier90 tight-binding (TB) Hamiltonian in real space. - - Parameters - ---------- - nwann: int - Number of Wannier orbitals. - nrpt: int - Number of :math:`r` points. - irpt0: int - Index of the point (0,0,0). - rpts: float array - The coordinates of :math:`r` points. - deg_rpt: int array - Degenerancy of :math:`r` points. - hr: complex array - Hamiltonian :math:`H(r)` from Wannier90. - """ - - def __init__(self, nwann, nrpt, irpt0, rpts, deg_rpt, hr): - self.nwann = nwann - self.nrpt = nrpt - self.irpt0 = irpt0 - self.deg_rpt = deg_rpt - self.rpts = rpts - self.hr = hr - -
-[docs] - @staticmethod - def from_file(fname='wannier90_hr.dat'): - """ - Generate a TB Hamiltonian from Wannier90 output file "case_hr.dat". - - Parameters - ---------- - fname: str - The file that contains the Wannier90 output file: "case_hr.dat". - - Returns - ------- - HR: HR object - A HR object. - """ - - with open(fname, 'r') as f: - # skip the header (1 line) - f.readline() - nwann = int(f.readline().strip()) - nrpt = int(f.readline().strip()) - # the degeneracy of R points - nline = nrpt // 15 + 1 - tmp = [] - for i in range(nline): - tmp.extend(f.readline().strip().split()) - tmp = [np.int(item) for item in tmp] - deg_rpt = np.array(tmp, dtype=int) - # read hr for each r-point - rpts = np.zeros((nrpt, 3), dtype=int) - hr = np.zeros((nrpt, nwann, nwann), dtype=np.complex128) - for i in range(nrpt): - for j in range(nwann): - for k in range(nwann): - rx, ry, rz, hr_i, hr_j, hr_real, hr_imag = f.readline().strip().split() - rpts[i, :] = int(rx), int(ry), int(rz) - if int(rx) == 0 and int(ry) == 0 and int(rz) == 0: - irpt0 = i - hr[i, k, j] = np.float64( - hr_real) + np.float64(hr_imag) * 1j - # construct the HR instance - return HR(nwann, nrpt, irpt0, rpts, deg_rpt, hr)
- - -
-[docs] - @staticmethod - def copy_hr(other): - """ - Copy instance of HR. - - Parameters - ---------- - other: HR object - A HR object to be copied. - - Returns - ------- - HR: HR object - Return a new HR object. - """ - - return HR(other.nwann, - other.nrpt, - other.irpt0, - np.copy(other.rpts), - np.copy(other.deg_rpt), - np.copy(other.hr))
- - -
-[docs] - def get_hr0(self, ispin=False): - """ - Return the on-site term :math:`H(r=0)`. - - Parameters - ---------- - ispin: logical - Whether to include spin degree of freedom or not (default: False). - - Returns - ------- - hr: 2d complex array - The on-site Hamiltonian. - """ - - if ispin: - norbs = 2 * self.nwann - hr0_spin = np.zeros((norbs, norbs), dtype=np.complex128) - hr0_spin[0:norbs:2, 0:norbs:2] = self.hr[self.irpt0, :, :] - hr0_spin[1:norbs:2, 1:norbs:2] = self.hr[self.irpt0, :, :] - return hr0_spin - else: - return self.hr[self.irpt0, :, :]
- - -
-[docs] - def get_hr(self, ispin): - """ - Return the Hamiltonian of :math:`H(r)`. - - Parameters - ---------- - ispin: logical - Whether to include spin degree of freedom or not (default: False) - - Returns - ------- - hr: 3d complex array - The Hamiltonian :math:`H(r)`. - """ - - # with spin, spin order: up dn up dn up dn - if ispin == 1: - norbs = 2 * self.nwann - hr_spin = np.zeros((self.nrpt, norbs, norbs), dtype=np.complex128) - hr_spin[:, 0:norbs:2, 0:norbs:2] = self.hr - hr_spin[:, 1:norbs:2, 1:norbs:2] = self.hr - return hr_spin - # with spin, spin order: up up up dn dn dn - elif ispin == 2: - norbs = 2 * self.nwann - hr_spin = np.zeros((self.nrpt, norbs, norbs), dtype=np.complex128) - hr_spin[:, 0:self.nwann, 0:self.nwann] = self.hr - hr_spin[:, self.nwann:norbs, self.nwann:norbs] = self.hr - return hr_spin - # without spin - else: - return self.hr[:, :, :]
-
- - - -
-[docs] -class KVec(): - """ - Define :math:`k` points in BZ, high symmetry line or uniform grid. - - Parameters - ---------- - kpt_type: str - The type of :math:`k` points, 'uni' or 'sym'. - kbase: :math:`3 \\times 3` float array - The basis vectors of the primitive reciprocal space. - nkpt: int - Number of :math:`k` points. - kvec: float array - The :math:`k` points. - """ - - def __init__(self, kpt_type='uni', kbase=None, nkpt=None, kvec=None): - self.nkpt = nkpt - self.kbase = np.array(kbase, dtype=np.float64) - self.kvec = np.array(kvec, dtype=np.float64) - self.kpt_type = kpt_type - -
-[docs] - def set_base(self, kbase): - """ - Set the basis of the primitive reciprocal. - - Parameters - ---------- - kbase: :math:`3 \\times 3` float array - The basis with respect to the global axis. - """ - - self.kbase = np.array(kbase, dtype=np.float64)
- - -
-[docs] - def kvec_from_file(self, fname): - """ - Read :math:`k` points from file. - - Parameters - ---------- - fname: str - File name. - """ - - tmp = [] - with open(fname, 'r') as f: - for line in f: - line = line.strip().split() - if line != []: - tmp.append(line) - self.kvec = np.array(tmp, dtype=np.float64) - self.nkpt = len(tmp)
-
- - - -
-[docs] -class SymKVec(KVec): - """ - Class for defining :math:`k` points in high symmetry line, derived from :class:`KVec`. - - Parameters - ---------- - kbase: :math:`3 \\times 3` float array - Basis of the primitive reciprocal lattice. - hsymkpt: float array - Starting and end :math:`k` points along high symmetry lines. - klen: float array - Length of segments of :math:`k` points line. - """ - - def __init__(self, kbase=None, hsymkpt=None, klen=None): - self.klen = np.array(klen, dtype=np.float64) - self.hsymkpt = np.array(hsymkpt, dtype=np.float64) - KVec.__init__(self, 'sym', kbase) - -
-[docs] - def get_klen(self): - """ - Return length of :math:`k` points segments. - """ - - self.klen = np.zeros(self.nkpt, dtype=np.float64) - self.klen[0] = 0.0 - prev_kpt = self.kvec[0] - - for i in range(1, self.nkpt): - curr_kpt = self.kvec[i, :] - tmp_kpt = curr_kpt - prev_kpt - kx = np.dot(tmp_kpt, self.kbase[:, 0]) - ky = np.dot(tmp_kpt, self.kbase[:, 1]) - kz = np.dot(tmp_kpt, self.kbase[:, 2]) - self.klen[i] = self.klen[i - 1] + \ - np.sqrt(np.dot((kx, ky, kz), (kx, ky, kz))) - prev_kpt = curr_kpt
- - -
-[docs] - def from_hsymkpt(self, nkpt_per_path=20): - """ - Given starting and end :math:`k` points of each segment, - and the number of points per each segment, - return the high symmetry :math:`k` points. - - Parameters - ---------- - nkpt_per_path: int - Number of :math:`k` points per each segment. - """ - - self.nkpt = nkpt_per_path * (len(self.hsymkpt) - 1) - self.kvec = np.zeros((self.nkpt, 3), dtype=np.float64) - for i in range(1, len(self.hsymkpt)): - kpt_prev = self.hsymkpt[i - 1, :] - kpt_curr = self.hsymkpt[i, :] - for j in range(nkpt_per_path): - ikpt = (i - 1) * nkpt_per_path + j - self.kvec[ikpt, :] = (float(j) / float(nkpt_per_path - 1) * - (kpt_curr - kpt_prev) + kpt_prev)
- - -
-[docs] - def from_hsymkpt_uni(self, step): - """ - Given a step, return high symmetry :math:`k` points. - - Parameters - ---------- - step: float - Step size. - """ - - kvec = [] - self.hsym_dis = np.zeros(len(self.hsymkpt), dtype=np.float64) - self.hsym_dis[0] = 0.0 - for i in range(0, len(self.hsymkpt) - 1): - kpt_prev = self.hsymkpt[i, :] - kpt_curr = self.hsymkpt[i + 1, :] - tmp = np.dot(self.kbase.transpose(), kpt_curr - kpt_prev) - dis = np.sqrt(np.dot(tmp, tmp)) - self.hsym_dis[i + 1] = self.hsym_dis[i] + dis - pts = np.arange(0, dis, step) / dis - for ipt in pts: - kvec.append(ipt * (kpt_curr - kpt_prev) + kpt_prev) - self.kvec = np.array(kvec, dtype=np.float64) - self.nkpt = len(self.kvec)
-
- - - -
-[docs] -class UniKVec(KVec): - """ - Class for defining uniform :math:`k` points grid, derived from :class:`KVec`. - - Parameters - ---------- - grid: 3-elements tuple - Three numbers defining a uniform grid, for example: :math:`11 \\times 11 \\times 11`. - """ - - def __init__(self, grid=None): - self.grid = grid - KVec.__init__(self, 'uni') - -
-[docs] - def from_grid(self): - """ - Return uniform :math:`k` points. - """ - - delta = 0.001 - nx, ny, nz = self.grid - self.nkpt = nx * ny * nz - self.kvec = np.zeros((self.nkpt, 3), dtype=np.float64) - ikpt = 0 - for i in range(nx): - if nx == 1: - kx = 0.0 - else: - kx = float(i) / float(nx) - for j in range(ny): - if ny == 1: - ky = 0.0 - else: - ky = float(j) / float(ny) - for k in range(nz): - if nz == 1: - kz = 0.0 - else: - kz = float(k) / float(nz) - ikpt = ikpt + 1 - self.kvec[ikpt - 1, :] = kx + delta, ky + delta, kz + delta
-
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_modules/index.html b/edrixs/_modules/index.html deleted file mode 100644 index 520a66631e..0000000000 --- a/edrixs/_modules/index.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - Overview: module code — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
-
    -
  • - -
  • -
  • -
-
-
- -
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/_sources/auto_examples/example_0_ed_calculator.rst.txt b/edrixs/_sources/auto_examples/example_0_ed_calculator.rst.txt deleted file mode 100644 index c4a833541a..0000000000 --- a/edrixs/_sources/auto_examples/example_0_ed_calculator.rst.txt +++ /dev/null @@ -1,584 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_0_ed_calculator.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_0_ed_calculator.py: - - -Exact diagonalization -===================================== -Here we show how to find the eigenvalues and eigenvectors of a many-body -Hamiltonian of fermions with Coulomb interactions. We then determine their spin -and orbital angular momentum and how this changes when we switch on spin-orbit -coupling. - -.. GENERATED FROM PYTHON SOURCE LINES 12-13 - -Import the necessary modules. - -.. GENERATED FROM PYTHON SOURCE LINES 13-18 - -.. code-block:: Python - - import numpy as np - import matplotlib.pyplot as plt - import scipy - import edrixs - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 19-24 - -Parameters ------------------------------------------------------------------------------- -Define the orbital angular momentum number :math:`l=1` (i.e. a `p` shell), -the number of spin-orbitals, the occupancy and the Slater integrals. -:math:`F^{k}` with :math:`k=0,2`: - -.. GENERATED FROM PYTHON SOURCE LINES 24-29 - -.. code-block:: Python - - l = 1 - norb = 6 - noccu = 2 - F0, F2 = 4.0, 1.0 - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 30-36 - -Coulomb interactions ------------------------------------------------------------------------------- -The Coulomb interactions in EDRIXS are described by a tensor. Understanding this -in full is complicated and requires careful consideration of the symmetry of the -interactions. See example 6 for more discussion if desired. -EDRIXS can construct the matrix via - -.. GENERATED FROM PYTHON SOURCE LINES 36-38 - -.. code-block:: Python - - umat = edrixs.get_umat_slater('p', F0, F2) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 39-47 - -Create basis ------------------------------------------------------------------------------- -Now we build the binary form of the Fock basis :math:`|F>` (we consider it -preferable to use the standard :math:`F` and trust the reader to avoid -confusing it with the interaction parameters.) -The Fock basis is the simplest legitimate form for the basis and it consists -of a series of 1s and 0s where 1 means occupied and -0 means empty. These are in order up, down, up, down, up, down. - -.. GENERATED FROM PYTHON SOURCE LINES 47-49 - -.. code-block:: Python - - basis = edrixs.get_fock_bin_by_N(norb, noccu) - print(np.array(basis)) - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - [[1 1 0 0 0 0] - [1 0 1 0 0 0] - [1 0 0 1 0 0] - [1 0 0 0 1 0] - [1 0 0 0 0 1] - [0 1 1 0 0 0] - [0 1 0 1 0 0] - [0 1 0 0 1 0] - [0 1 0 0 0 1] - [0 0 1 1 0 0] - [0 0 1 0 1 0] - [0 0 1 0 0 1] - [0 0 0 1 1 0] - [0 0 0 1 0 1] - [0 0 0 0 1 1]] - - - - -.. GENERATED FROM PYTHON SOURCE LINES 50-53 - -We expect the number of these states to be given by the mathematical -combination of two electrons distributed among six states (three spin-orbitals -with two spins per orbital). - -.. GENERATED FROM PYTHON SOURCE LINES 53-56 - -.. code-block:: Python - - message = ("We predict C(norb={}, noccu={})={:.0f} states and we got {:d}, " - "which is reassuring!") - print(message.format(norb, noccu, edrixs.combination(norb, noccu), len(basis))) - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - We predict C(norb=6, noccu=2)=15 states and we got 15, which is reassuring! - - - - -.. GENERATED FROM PYTHON SOURCE LINES 57-59 - -Note that in more complicated problems with both valence and core -electrons, the edrixs convention is to list the valence electrons first. - -.. GENERATED FROM PYTHON SOURCE LINES 61-74 - -Transform interactions into Fock basis ------------------------------------------------------------------------------- -edrixs works by initiailly creating a Hamiltonian matrix -:math:`\hat{H}` in the single particle basis and then transforming into -our chosen Fock basis. In the single particle basis, we have four fermion -interactions with this form - - .. math:: - \hat{H} = - -generated as - -.. GENERATED FROM PYTHON SOURCE LINES 74-77 - -.. code-block:: Python - - n_fermion = 4 - H = edrixs.build_opers(n_fermion, umat, basis) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 78-80 - -We needed to specify :code:`n_fermion = 4` because the -:code:`edrixs.build_opers` function can also make two fermion terms. - -.. GENERATED FROM PYTHON SOURCE LINES 82-88 - -Diagonalize the matrix ------------------------------------------------------------------------------- -For a small problem such as this it is convenient to use the native -`scipy `_ diagonalization routine. This returns eigenvalues -:code:`e` and eignvectors :code:`v` where eigenvalue :code:`e[i]` corresponds -to eigenvector :code:`v[:,i]`. - -.. GENERATED FROM PYTHON SOURCE LINES 88-93 - -.. code-block:: Python - - e, v = scipy.linalg.eigh(H) - print("{} eignvalues and {} eigvenvectors {} elements long.".format(len(e), - v.shape[1], - v.shape[0])) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 15 eignvalues and 15 eigvenvectors 15 elements long. - - - - -.. GENERATED FROM PYTHON SOURCE LINES 94-101 - -Computing expectation values ------------------------------------------------------------------------------- -To interpret the results, it is informative to compute the expectations values -related to the spin :math:`\mathbf{S}`, orbital :math:`\mathbf{L}`, -and total :math:`\mathbf{J}`, angular momentum. We first load the relevant -matrices for these quantities for a `p` atomic shell. We need to specify -that we would like to include spin when loading the orbital operator. - -.. GENERATED FROM PYTHON SOURCE LINES 101-105 - -.. code-block:: Python - - orb_mom = edrixs.get_orb_momentum(l, ispin=True) - spin_mom = edrixs.get_spin_momentum(l) - tot_mom = orb_mom + spin_mom - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 106-107 - -We again transform these matrices to our Fock basis to build the operators - -.. GENERATED FROM PYTHON SOURCE LINES 107-111 - -.. code-block:: Python - - n_fermion = 2 - opL, opS, opJ = edrixs.build_opers(n_fermion, [orb_mom, spin_mom, tot_mom], - basis) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 112-121 - -Recall that quantum mechanics forbids us from knowing all three Cartesian -components of angular momentum at once, so we want to compute the squares of -these operators i.e. - - .. math:: - \mathbf{S}^2 = S^2_x + S^2_y + S^2_z\\ - \mathbf{L}^2 = L^2_x + L^2_y + L^2_z\\ - \mathbf{J}^2 = J^2_x + J^2_y + J^2_z - - -.. GENERATED FROM PYTHON SOURCE LINES 121-125 - -.. code-block:: Python - - L2 = np.dot(opL[0], opL[0]) + np.dot(opL[1], opL[1]) + np.dot(opL[2], opL[2]) - S2 = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2]) - J2 = np.dot(opJ[0], opJ[0]) + np.dot(opJ[1], opJ[1]) + np.dot(opJ[2], opJ[2]) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 126-129 - -Remember that the eigenvalues of :math:`\mathbf{S}^2` are in the form -:math:`S(S+1)` etc. and that they can be obtained by calculating the -projection of the operators onto our eigenvectors. - -.. GENERATED FROM PYTHON SOURCE LINES 129-132 - -.. code-block:: Python - - L2_val = edrixs.cb_op(L2, v).diagonal().real - S2_val = edrixs.cb_op(S2, v).diagonal().real - J2_val = edrixs.cb_op(J2, v).diagonal().real - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 133-135 - -We can determine the degeneracy of the eigenvalues numerically and print out -the values as follows - -.. GENERATED FROM PYTHON SOURCE LINES 135-143 - -.. code-block:: Python - - e = np.round(e, decimals=6) - degeneracy = [sum(eval == e) for eval in e] - header = "{:<3s}\t{:>8s}\t{:>8s}\t{:>8s}\t{:>8s}" - print(header.format("# ", "E ", "S(S+1)", "L(L+1)", "Degen.")) - for i, eigenvalue in enumerate(e): - values_list = [i, eigenvalue, S2_val[i], L2_val[i], degeneracy[i]] - print("{:<3d}\t{:8.3f}\t{:8.3f}\t{:8.3f}\t{:>3d}".format(*values_list)) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - # E S(S+1) L(L+1) Degen. - 0 3.800 2.000 2.000 9 - 1 3.800 2.000 2.000 9 - 2 3.800 2.000 2.000 9 - 3 3.800 2.000 2.000 9 - 4 3.800 2.000 2.000 9 - 5 3.800 2.000 2.000 9 - 6 3.800 2.000 2.000 9 - 7 3.800 2.000 2.000 9 - 8 3.800 2.000 2.000 9 - 9 4.040 0.000 6.000 5 - 10 4.040 0.000 6.000 5 - 11 4.040 0.000 6.000 5 - 12 4.040 0.000 6.000 5 - 13 4.040 0.000 6.000 5 - 14 4.400 0.000 -0.000 1 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 144-153 - -We see :math:`S=0` and :math:`S=1` states coming from the -two combinations of the spin 1/2 particles. :math:`L` can take values of -0, 1, 2. Remember that spin states have degeneracy of :math:`2S+1` and the -same is true for orbital states. -We must multiply these :math:`S` and -:math:`L` degeneracies to get the total degeneracy. -Since these particles are fermions, the -overall state must be antisymmetric, which dictates the allowed combinations -of :math:`S` and :math:`L`. - -.. GENERATED FROM PYTHON SOURCE LINES 155-158 - -Energy level diagram ------------------------------------------------------------------------------- -Let us show our findings graphically - -.. GENERATED FROM PYTHON SOURCE LINES 158-178 - -.. code-block:: Python - - fig, ax = plt.subplots() - for i, eigenvalue in enumerate(np.unique(e)): - art = ax.plot([0, 1], [eigenvalue, eigenvalue], '-', color='C{}'.format(i)) - ind = np.where(eigenvalue == e)[0][0] - L = (-1 + np.sqrt(1 + 4*L2_val[ind]))/2 - S = (-1 + np.sqrt(1 + 4*S2_val[ind]))/2 - message = "L={:.0f}, S={:.0f} ({:.0f})" - ax.text(1, eigenvalue, message.format(L, S, degeneracy[ind]), - horizontalalignment='right', - verticalalignment='bottom', - color='C{}'.format(i)) - - ax.set_ylabel('Energy') - for loc in ['right', 'top', 'bottom']: - ax.spines[loc].set_visible(False) - - ax.yaxis.set_ticks_position('left') - ax.set_xticks([]) - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_0_ed_calculator_001.png - :alt: example 0 ed calculator - :srcset: /auto_examples/images/sphx_glr_example_0_ed_calculator_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 179-182 - -We see Hund's rules in action! Rule 1 says that the highest spin :math:`S=1` -state has the lowest energy. Of the two :math:`S=0` states, the state with -larger :math:`L=1` is lower energy following rule 2. - -.. GENERATED FROM PYTHON SOURCE LINES 184-191 - -Spin orbit coupling ------------------------------------------------------------------------------- -For fun, we can see how this changes when we add spin orbit coupling (SOC). -This is a two-fermion operator that we create, transform into the Fock basis -and add to the prior Hamiltonian. To make things easy, let us make the SOC -small so that the LS coupling approximation is valid and we can -still track the states. - -.. GENERATED FROM PYTHON SOURCE LINES 191-195 - -.. code-block:: Python - - soc = edrixs.atom_hsoc('p', 0.1) - n_fermion = 2 - H2 = H + edrixs.build_opers(n_fermion, soc, basis) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 196-197 - -Then, we redo the diagonalization and print the results. - -.. GENERATED FROM PYTHON SOURCE LINES 197-211 - -.. code-block:: Python - - e2, v2 = scipy.linalg.eigh(H2) - e2 = np.round(e2, decimals=6) - degeneracy2 = [sum(eval == e2) for eval in e2] - print() - message = "With SOC\n {:<3s}\t{:>8s}\t{:>8s}\t{:>8s}\t{:>8s}\t{:>8s}" - print(message.format("#", "E", "S(S+1)", "L(L+1)", "J(J+1)", "degen.")) - J2_val_soc = edrixs.cb_op(J2, v2).diagonal().real - L2_val_soc = edrixs.cb_op(L2, v2).diagonal().real - S2_val_soc = edrixs.cb_op(S2, v2).diagonal().real - for i, eigenvalue in enumerate(e2): - values_list = [i, eigenvalue, S2_val_soc[i], L2_val_soc[i], J2_val_soc[i], - degeneracy2[i]] - print("{:<3d}\t{:8.3f}\t{:8.3f}\t{:8.3f}\t{:8.3f}\t{:8.3f}".format(*values_list)) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - - With SOC - # E S(S+1) L(L+1) J(J+1) degen. - 0 3.673 1.927 1.927 -0.000 1.000 - 1 3.750 2.000 2.000 2.000 3.000 - 2 3.750 2.000 2.000 2.000 3.000 - 3 3.750 2.000 2.000 2.000 3.000 - 4 3.827 1.802 2.396 6.000 5.000 - 5 3.827 1.802 2.396 6.000 5.000 - 6 3.827 1.802 2.396 6.000 5.000 - 7 3.827 1.802 2.396 6.000 5.000 - 8 3.827 1.802 2.396 6.000 5.000 - 9 4.063 0.198 5.604 6.000 5.000 - 10 4.063 0.198 5.604 6.000 5.000 - 11 4.063 0.198 5.604 6.000 5.000 - 12 4.063 0.198 5.604 6.000 5.000 - 13 4.063 0.198 5.604 6.000 5.000 - 14 4.427 0.073 0.073 -0.000 1.000 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 212-213 - -and we make an equivalent energy level diagram. - -.. GENERATED FROM PYTHON SOURCE LINES 213-233 - -.. code-block:: Python - - - fig, ax = plt.subplots() - for i, eigenvalue in enumerate(np.unique(e2)): - art = ax.plot([0, 1], [eigenvalue, eigenvalue], '-', color='C{}'.format(i)) - ind = np.where(eigenvalue == e2)[0][0] - J = (-1 + np.sqrt(1+4*J2_val_soc[ind]))/2 - message = "J={:.0f} ({:.0f})" - ax.text(1, eigenvalue, message.format(J, degeneracy2[ind]), - horizontalalignment='right', - verticalalignment='bottom', - color='C{}'.format(i)) - - ax.set_ylabel('Energy') - for loc in ['right', 'top', 'bottom']: - ax.spines[loc].set_visible(False) - - ax.yaxis.set_ticks_position('left') - ax.set_xticks([]) - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_0_ed_calculator_002.png - :alt: example 0 ed calculator - :srcset: /auto_examples/images/sphx_glr_example_0_ed_calculator_002.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 234-238 - -It is clear that we have split the :math:`S=1` state, which branches into -three states from :math:`J=|L-S|, |L-S|+1, ..., |L+S|`. Since the shell is -less than half full, Hund's third rule dictates that the smaller :math:`J` -states have the lower energies. - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 0.138 seconds) - - -.. _sphx_glr_download_auto_examples_example_0_ed_calculator.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_0_ed_calculator.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_0_ed_calculator.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_0_ed_calculator.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_1_crystal_field.rst.txt b/edrixs/_sources/auto_examples/example_1_crystal_field.rst.txt deleted file mode 100644 index a907cfff9a..0000000000 --- a/edrixs/_sources/auto_examples/example_1_crystal_field.rst.txt +++ /dev/null @@ -1,608 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_1_crystal_field.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_1_crystal_field.py: - - -Crystal fields -===================================== -This example explains how to implement crystal fields in edrixs. - -.. GENERATED FROM PYTHON SOURCE LINES 8-9 - -We need to import these modules. - -.. GENERATED FROM PYTHON SOURCE LINES 9-15 - -.. code-block:: Python - - import edrixs - import numpy as np - import scipy - - np.set_printoptions(precision=2, suppress=True, linewidth=90) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 16-22 - -Crystal field matrices ------------------------------------------------------------------------------- -Let us start by considering the common case of a :math:`d` atomic shell in a -cubic crystal field. This is controlled by parameter :math:`10D_q` and is -described in terms of a matrix which we will assign to :code:`cfmat`. edrixs -can make this matrix via. - -.. GENERATED FROM PYTHON SOURCE LINES 22-25 - -.. code-block:: Python - - ten_dq = 10 - cfmat = edrixs.angular_momentum.cf_cubic_d(ten_dq) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 26-33 - -Note this matrix is in a complex harmonic basis :math:`Y^m_l` where :math:`m` -goes from :math:`-l,-l+1,...,l-1, l`. There is an up spin and a down -spin for each :math:`Y^m_l`. This matrix is not diagonal in the complex -harmonic basis, but it would be diagonal in the real harmonic basis -:math:`d_{3z^2-r^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}`. -Let us diagonalize this matrix as a check and print out the energies -and their degeneracies. - -.. GENERATED FROM PYTHON SOURCE LINES 33-44 - -.. code-block:: Python - - - e, v = scipy.linalg.eigh(cfmat) - e = e.round(decimals=6) - unique_e = np.unique(e) - degeneracies = [sum(evalue == e) for evalue in unique_e] - - print("E \tDegeneracy") - for evalue, degenvalue in zip(unique_e, degeneracies): - print("{:.1f}\t{:.0f}".format(evalue, degenvalue)) - print("{} distinct energies".format(len(unique_e))) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - E Degeneracy - -4.0 6 - 6.0 4 - 2 distinct energies - - - - -.. GENERATED FROM PYTHON SOURCE LINES 45-47 - -This makes sense! We see two different energies split by :math:`10D_q=10`. Let -us look at the six columns corresponding to the lower energy eigenvalues. - -.. GENERATED FROM PYTHON SOURCE LINES 47-50 - -.. code-block:: Python - - - print(v[:, :6].real) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - [[ 0. 0. 0. 0. 0.71 0. ] - [ 0. 0. 0. 0. 0. 0.71] - [ 0. 0. -1. 0. 0. 0. ] - [ 0. 0. 0. -1. 0. 0. ] - [ 0. 0. 0. 0. 0. 0. ] - [ 0. 0. 0. 0. 0. 0. ] - [ 1. 0. 0. 0. 0. 0. ] - [ 0. 1. 0. 0. 0. 0. ] - [ 0. 0. 0. 0. -0.71 0. ] - [ 0. 0. 0. 0. 0. -0.71]] - - - - -.. GENERATED FROM PYTHON SOURCE LINES 51-54 - -These are the set of so-called :math:`t_{2g}` orbitals, composed of -:math:`Y^2_2, Y^{-2}_2, Y^{1}_2, Y^{-1}_2`. The rest of the eigenvectors -(the last four) are - -.. GENERATED FROM PYTHON SOURCE LINES 54-56 - -.. code-block:: Python - - print(v[:, 6:].real) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - [[-0.71 0. 0. 0. ] - [ 0. -0.71 0. 0. ] - [ 0. 0. 0. 0. ] - [ 0. 0. 0. 0. ] - [ 0. 0. 0. 1. ] - [ 0. 0. 1. 0. ] - [ 0. 0. 0. 0. ] - [ 0. 0. 0. 0. ] - [-0.71 0. 0. 0. ] - [ 0. -0.71 0. 0. ]] - - - - -.. GENERATED FROM PYTHON SOURCE LINES 57-69 - -These are the set of so-called :math:`e_{g}` orbitals, composed of -:math:`Y^2_2, Y^{-2}_2, Y^{0}_2`. We can use edrixs to prove that -:code:`cfmat` would be diagonal in the real -harmonic basis. An operator :math:`\hat{O}` can be transformed into an -operator in another basis :math:`\hat{O}^{\prime}` using a unitary -transformation matrix :math:`T` as - - .. math:: - - \hat{O}^{\prime} = (T)^{\dagger} \hat{O} (T). - -This is computed as follows - -.. GENERATED FROM PYTHON SOURCE LINES 69-72 - -.. code-block:: Python - - cfmat_rhb = edrixs.cb_op(cfmat, edrixs.tmat_c2r('d', ispin=True)) - print(cfmat_rhb.real) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - [[ 6. 0. 0. 0. 0. 0. 0. 0. 0. 0.] - [ 0. 6. 0. 0. 0. 0. 0. 0. 0. 0.] - [ 0. 0. -4. 0. 0. 0. 0. 0. 0. 0.] - [ 0. 0. 0. -4. 0. 0. 0. 0. 0. 0.] - [ 0. 0. 0. 0. -4. 0. 0. 0. 0. 0.] - [ 0. 0. 0. 0. 0. -4. 0. 0. 0. 0.] - [ 0. 0. 0. 0. 0. 0. 6. 0. 0. 0.] - [ 0. 0. 0. 0. 0. 0. 0. 6. 0. 0.] - [ 0. 0. 0. 0. 0. 0. 0. 0. -4. 0.] - [ 0. 0. 0. 0. 0. 0. 0. 0. 0. -4.]] - - - - -.. GENERATED FROM PYTHON SOURCE LINES 73-78 - -where :code:`edrixs.tmat_c2r('d', ispin=True)` is the transformation matrix. -We needed to tell edrixs that we are working with a :math:`d`-shell and that it -should include spin. We could also have transformed :code:`v` to see how these -eignevectors are composed of the real harmonic basis. We will see an example -of this later. - -.. GENERATED FROM PYTHON SOURCE LINES 80-84 - -Crystal field on an atom ------------------------------------------------------------------------------- -To simulate the solid state, we need to combine the crystal field with Coulomb -interactions. Let us choose an atomic model for Ni. - -.. GENERATED FROM PYTHON SOURCE LINES 84-90 - -.. code-block:: Python - - l = 2 - norb = 10 - noccu = 8 - basis = edrixs.get_fock_bin_by_N(norb, noccu) - slater = edrixs.get_atom_data('Ni', '3d', noccu, edge='L3')['slater_i'] - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 91-94 - -Let us implement a tetragonal crystal field, for which we need to pass -:code:`d1` the splitting of :math:`d_{yz}/d_{zx}` and :math:`d_{xy}` and -:code:`d3` the splitting of :math:`d_{3z^2-r^2}` and :math:`d_{x^2-y^2}`. - -.. GENERATED FROM PYTHON SOURCE LINES 94-96 - -.. code-block:: Python - - ten_dq, d1, d3 = 2.5, 0.9, .2 - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 97-101 - -To determine the eigenvalues and eigenvectors we need to transform both our -Coulomb matrix and our crystal field matrix into the same basis. See the -example on exact diagonalization if needed. In this case, we put this -procedure into a function, with the option to scale the Coulomb interactions. - -.. GENERATED FROM PYTHON SOURCE LINES 101-115 - -.. code-block:: Python - - - - def diagonlize(scaleU=1): - umat = edrixs.get_umat_slater('d', - slater[0][1]*scaleU, - slater[1][1]*scaleU, - slater[2][1]*scaleU) - cfmat = edrixs.angular_momentum.cf_tetragonal_d(ten_dq=ten_dq, d1=d1, d3=d3) - H = edrixs.build_opers(2, cfmat, basis) + edrixs.build_opers(4, umat, basis) - e, v = scipy.linalg.eigh(H) - e = e - np.min(e) # define ground state as zero energy - return e, v - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 116-121 - -Let us look what happens when we run the function with the Coulomb -interactions switched off and check the degeneracy of the output. Look at this -python -`string formatting tutorial `_ -if the code is confusing. - -.. GENERATED FROM PYTHON SOURCE LINES 121-131 - -.. code-block:: Python - - e, v = diagonlize(scaleU=0) - e = e.round(decimals=6) - unique_e = np.unique(e) - degeneracies = [sum(evalue == e) for evalue in unique_e] - - print("E \tDegeneracy") - for evalue, degenvalue in zip(unique_e, degeneracies): - print("{:.1f}\t{:.0f}".format(evalue, degenvalue)) - print("{} distinct energies".format(len(unique_e))) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - E Degeneracy - 0.0 1 - 0.2 4 - 0.4 1 - 2.5 4 - 2.7 4 - 3.4 8 - 3.6 8 - 5.0 1 - 5.9 8 - 6.8 6 - 10 distinct energies - - - - -.. GENERATED FROM PYTHON SOURCE LINES 132-146 - -We see 10 distinct energies, which is the number of ways one can arrange -two holes among 4 energy levels -- which makes sense as the tetragonal field -involves four levels :math:`zx/zy, xy, 3z^2-r^2, x^2-y^2`. To see what is going -on in more detail, we can also calculate the expectation -values of the occupancy number of the orbitals -:math:`3z^2-r^2, zx, zy, x^2-y^2, xy`. -To create the operator, first write the matrix in the real harmonics basis -:math:`|3z^2-r^2,\uparrow>`, :math:`|3z^2-r^2,\downarrow>`, -:math:`|zx,\uparrow>`, :math:`|zx,\downarrow>`, etc. -In this basis, they take a simple form: only the diagonal terms have element -1. We therefore make a 3D empty array and assign the diagonal as 1. Check -out the -`numpy indexing notes `_ -if needed. - -.. GENERATED FROM PYTHON SOURCE LINES 146-150 - -.. code-block:: Python - - nd_real_harmoic_basis = np.zeros((norb, norb, norb), dtype=complex) - indx = np.arange(norb) - nd_real_harmoic_basis[indx, indx, indx] = 1 - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 151-153 - -Recalling the necessity to put everything in the same basis, we transform -into the complex harmonic basis and then transform into our Fock basis - -.. GENERATED FROM PYTHON SOURCE LINES 153-158 - -.. code-block:: Python - - nd_complex_harmoic_basis = edrixs.cb_op(nd_real_harmoic_basis, - edrixs.tmat_r2c('d', True)) - nd_op = edrixs.build_opers(2, nd_complex_harmoic_basis, basis) - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 159-163 - -We apply the operator and print out as follows. Check the -`numpy docs `_ -if the details of how the spin pairs have been added up is not immediately -transparent. - -.. GENERATED FROM PYTHON SOURCE LINES 163-173 - -.. code-block:: Python - - nd_expt = np.array([edrixs.cb_op(nd_vec, v).diagonal().real for nd_vec in nd_op]) - - message = "{:>3s}" + "\t{:>6s}"*5 - print(message.format(*"E 3z2-r2 zx zy x2-y2 xy".split(" "))) - - message = "{:>3.1f}" + "\t{:>6.1f}"*5 - for evalue, row in zip(e, nd_expt.T): - spin_pairs = row.reshape(-1, 2).sum(1) - print(message.format(evalue, *spin_pairs)) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - E 3z2-r2 zx zy x2-y2 xy - 0.0 2.0 2.0 2.0 0.0 2.0 - 0.2 1.0 2.0 2.0 1.0 2.0 - 0.2 1.0 2.0 2.0 1.0 2.0 - 0.2 1.0 2.0 2.0 1.0 2.0 - 0.2 1.0 2.0 2.0 1.0 2.0 - 0.4 0.0 2.0 2.0 2.0 2.0 - 2.5 2.0 2.0 2.0 1.0 1.0 - 2.5 2.0 2.0 2.0 1.0 1.0 - 2.5 2.0 2.0 2.0 1.0 1.0 - 2.5 2.0 2.0 2.0 1.0 1.0 - 2.7 1.0 2.0 2.0 2.0 1.0 - 2.7 1.0 2.0 2.0 2.0 1.0 - 2.7 1.0 2.0 2.0 2.0 1.0 - 2.7 1.0 2.0 2.0 2.0 1.0 - 3.4 2.0 1.5 1.5 1.0 2.0 - 3.4 2.0 1.5 1.5 1.0 2.0 - 3.4 2.0 1.5 1.5 1.0 2.0 - 3.4 2.0 1.5 1.5 1.0 2.0 - 3.4 2.0 1.5 1.5 1.0 2.0 - 3.4 2.0 1.5 1.5 1.0 2.0 - 3.4 2.0 1.5 1.5 1.0 2.0 - 3.4 2.0 1.5 1.5 1.0 2.0 - 3.6 1.0 1.6 1.4 2.0 2.0 - 3.6 1.0 1.5 1.5 2.0 2.0 - 3.6 1.0 1.5 1.5 2.0 2.0 - 3.6 1.0 1.6 1.4 2.0 2.0 - 3.6 1.0 1.3 1.7 2.0 2.0 - 3.6 1.0 1.5 1.5 2.0 2.0 - 3.6 1.0 1.4 1.6 2.0 2.0 - 3.6 1.0 1.6 1.4 2.0 2.0 - 5.0 2.0 2.0 2.0 2.0 0.0 - 5.9 2.0 1.5 1.5 2.0 1.0 - 5.9 2.0 1.5 1.5 2.0 1.0 - 5.9 2.0 1.5 1.5 2.0 1.0 - 5.9 2.0 1.5 1.5 2.0 1.0 - 5.9 2.0 1.5 1.5 2.0 1.0 - 5.9 2.0 1.5 1.5 2.0 1.0 - 5.9 2.0 1.5 1.5 2.0 1.0 - 5.9 2.0 1.5 1.5 2.0 1.0 - 6.8 2.0 0.4 1.6 2.0 2.0 - 6.8 2.0 1.3 0.7 2.0 2.0 - 6.8 2.0 1.0 1.0 2.0 2.0 - 6.8 2.0 1.0 1.0 2.0 2.0 - 6.8 2.0 1.0 1.0 2.0 2.0 - 6.8 2.0 1.2 0.8 2.0 2.0 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 174-178 - -The lowest energy state involves putting both holes in the :math:`x^2-y^2` -orbital, which makes sense. Now, let us redo the proceedure including Coulomb -repulsion, which imposes an energy cost to putting multiple electrons in the -same orbital. - -.. GENERATED FROM PYTHON SOURCE LINES 178-191 - -.. code-block:: Python - - - e, v = diagonlize(scaleU=1) - - nd_expt = np.array([edrixs.cb_op(nd_vec, v).diagonal().real for nd_vec in nd_op]) - - message = "{:>3s}" + "\t{:>6s}"*5 - print(message.format(*"E 3z2-r2 zx zy x2-y2 xy".split(" "))) - - message = "{:>3.1f}" + "\t{:>6.1f}"*5 - for evalue, row in zip(e, nd_expt.T): - spin_pairs = row.reshape(-1, 2).sum(1) - print(message.format(evalue, *spin_pairs)) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - E 3z2-r2 zx zy x2-y2 xy - 0.0 1.0 2.0 2.0 1.0 2.0 - 0.0 1.0 2.0 2.0 1.0 2.0 - 0.0 1.0 2.0 2.0 1.0 2.0 - 2.4 1.2 2.0 2.0 0.8 2.0 - 2.5 1.0 2.0 2.0 1.0 2.0 - 2.5 1.0 2.0 2.0 2.0 1.0 - 2.5 1.0 2.0 2.0 2.0 1.0 - 2.5 1.0 2.0 2.0 2.0 1.0 - 3.2 1.8 1.2 1.8 1.2 2.0 - 3.2 1.8 1.7 1.3 1.2 2.0 - 3.2 1.8 1.5 1.5 1.2 2.0 - 3.2 1.8 1.7 1.3 1.2 2.0 - 3.2 1.8 1.4 1.6 1.2 2.0 - 3.2 1.8 1.5 1.5 1.2 2.0 - 4.0 2.0 1.9 1.9 1.1 1.1 - 4.0 2.0 1.9 1.9 1.1 1.1 - 4.0 2.0 1.9 1.9 1.1 1.1 - 4.3 0.9 2.0 2.0 1.2 1.9 - 4.7 1.4 1.4 1.6 1.9 1.7 - 4.7 1.4 1.5 1.5 1.9 1.7 - 4.7 1.4 1.6 1.4 1.9 1.7 - 4.7 1.4 1.4 1.6 1.9 1.7 - 4.7 1.4 1.4 1.6 1.9 1.7 - 4.7 1.4 1.6 1.4 1.9 1.7 - 4.9 1.0 2.0 2.0 2.0 1.0 - 5.5 2.0 2.0 2.0 1.0 1.0 - 5.6 1.8 1.6 1.4 1.2 2.0 - 5.6 1.8 1.4 1.6 1.2 2.0 - 6.5 1.2 1.6 1.4 1.8 2.0 - 6.5 1.2 1.4 1.6 1.8 2.0 - 6.8 1.8 1.4 1.6 1.9 1.3 - 6.8 1.8 1.5 1.5 1.9 1.3 - 6.8 1.8 1.5 1.5 1.9 1.3 - 6.8 1.8 1.6 1.4 1.9 1.3 - 6.8 1.8 1.4 1.6 1.9 1.3 - 6.8 1.8 1.6 1.4 1.9 1.3 - 7.4 2.0 1.1 1.1 1.9 1.9 - 7.4 2.0 1.1 1.1 1.9 1.9 - 7.4 2.0 1.1 1.1 1.9 1.9 - 8.0 2.0 1.8 1.8 2.0 0.4 - 8.5 2.0 1.5 1.5 2.0 1.0 - 8.5 2.0 1.5 1.5 2.0 1.0 - 9.3 2.0 1.0 1.0 2.0 2.0 - 9.4 2.0 1.0 1.0 2.0 2.0 - 12.8 1.9 1.2 1.2 1.9 1.7 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 192-197 - -Now the lowest energy state involves splitting the holes between the two -highest energy :math:`x^2-y^2` and :math:`3z^2-r^2` orbitals. i.e. we have -gone from low-spin to high spin. Working out the balance between these two -states is often one of the first things one wants to determine upon the -discovery of an interesting new material [1]_. - -.. GENERATED FROM PYTHON SOURCE LINES 199-202 - -.. rubric:: Footnotes - -.. [1] M. Rossi et al., `arXiv:2011.00595 (2021) `_. - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 0.149 seconds) - - -.. _sphx_glr_download_auto_examples_example_1_crystal_field.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_1_crystal_field.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_1_crystal_field.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_1_crystal_field.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_2_single_atom_RIXS.rst.txt b/edrixs/_sources/auto_examples/example_2_single_atom_RIXS.rst.txt deleted file mode 100644 index 7bb847adff..0000000000 --- a/edrixs/_sources/auto_examples/example_2_single_atom_RIXS.rst.txt +++ /dev/null @@ -1,483 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_2_single_atom_RIXS.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_2_single_atom_RIXS.py: - - -RIXS calculations for an atomic model -===================================== -Here we show how to compute RIXS for a single site atomic model with crystal -field and electron-electron interactions. We take the case of -Sr\ :sub:`2`\ YIrO\ :sub:`6` -from Ref. [1]_ as the material in question. The aim of this example is to -illustrate the proceedure and to provide what we hope is useful advice. What is -written is not meant to be a replacement for reading the docstrings of the -functions, which can always be accessed on the -`edrixs website `_ or -by executing functions with ?? in IPython. - -.. GENERATED FROM PYTHON SOURCE LINES 15-19 - -.. code-block:: Python - - import edrixs - import numpy as np - import matplotlib.pyplot as plt - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 20-26 - -Specify active core and valence orbitals ------------------------------------------------------------------------------- -Sr\ :sub:`2`\ YIrO\ :sub:`6`\ has a :math:`5d^4` electronic configuration and -we want to calculate the :math:`L_3` edge spectrum i.e. resonating with a -:math:`2p_{3/2}` core hole. We will start by including only the -:math:`t_{2g}` valance orbitals. - -.. GENERATED FROM PYTHON SOURCE LINES 26-29 - -.. code-block:: Python - - shell_name = ('t2g', 'p32') - v_noccu = 4 - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 30-38 - -Slater parameters ------------------------------------------------------------------------------- -Here we want to use Hund's interaction -:math:`J_H` and spin orbit coupling :math:`\lambda` as adjustable parameters -to match experiment. We will take -the core hole interaction parameter from the Hartree Fock numbers EDRIXS has -in its database. These need to be converted and arranged into the order -required by EDRIXS. - -.. GENERATED FROM PYTHON SOURCE LINES 38-58 - -.. code-block:: Python - - Ud = 2 - JH = 0.25 - lam = 0.42 - F0_d, F2_d, F4_d = edrixs.UdJH_to_F0F2F4(Ud, JH) - info = edrixs.utils.get_atom_data('Ir', '5d', v_noccu, edge='L3') - G1_dp = info['slater_n'][5][1] - G3_dp = info['slater_n'][6][1] - F0_dp = edrixs.get_F0('dp', G1_dp, G3_dp) - F2_dp = info['slater_n'][4][1] - - slater_i = [F0_d, F2_d, F4_d] # Fk for d - slater_n = [ - F0_d, F2_d, F4_d, # Fk for d - F0_dp, F2_dp, # Fk for dp - G1_dp, G3_dp, # Gk for dp - 0.0, 0.0 # Fk for p - ] - slater = [slater_i, slater_n] - v_soc = (lam, lam) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 59-70 - -Diagonalization ------------------------------------------------------------------------------- -We obtain the ground and intermediate state eigenenergies and the transition -operators via matrix diagonalization. Note that the calculation does not know -the core hole energy, so we need to adjust the energy that the resonance will -appear at by hand. We know empirically that the resonance is at 11215 eV -and that putting four electrons into the valance band costs about -:math:`4 F^0_d\approx6` eV. In this case -we are assuming a perfectly cubic crystal field, which we have already -implemented when we specified the use of the :math:`t_{2g}` subshell only -so we do not need to pass an additional :code:`v_cfmat` matrix. - -.. GENERATED FROM PYTHON SOURCE LINES 70-76 - -.. code-block:: Python - - - off = 11215 - 6 - out = edrixs.ed_1v1c_py(shell_name, shell_level=(0, -off), v_soc=v_soc, - c_soc=info['c_soc'], v_noccu=v_noccu, slater=slater) - eval_i, eval_n, trans_op = out - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - edrixs >>> Running ED ... - - Summary of Slater integrals: - ------------------------------ - Terms, Initial Hamiltonian, Intermediate Hamiltonian - F0_vv : 2.0000000000 2.0000000000 - F2_vv : 2.1538461538 2.1538461538 - F4_vv : 1.3461538462 1.3461538462 - F0_vc : 0.0000000000 0.0881857143 - F2_vc : 0.0000000000 1.0700000000 - G1_vc : 0.0000000000 0.9570000000 - G3_vc : 0.0000000000 0.5690000000 - F0_cc : 0.0000000000 0.0000000000 - F2_cc : 0.0000000000 0.0000000000 - - edrixs >>> Dimension of the initial Hamiltonian: 15 - edrixs >>> Dimension of the intermediate Hamiltonian: 24 - edrixs >>> Building Many-body Hamiltonians ... - edrixs >>> Done ! - edrixs >>> Exact Diagonalization of Hamiltonians ... - edrixs >>> Done ! - edrixs >>> ED Done ! - - - - -.. GENERATED FROM PYTHON SOURCE LINES 77-105 - -Compute XAS ------------------------------------------------------------------------------- -To calculate XAS we need to correctly specify the orientation of the x-rays -with respect to the sample. By default, the :math:`x, y, z` coordinates -of the sample's crystal field, will be aligned with our lab frame, passing -:code:`loc_axis` to :code:`ed_1v1c_py` can be used to specify a different -convention. The experimental geometry is specified following the angles -shown in Figure 1 of Y. Wang et al., -`Computer Physics Communications 243, 151-165 (2019) -`_. The default -setting has x-rays along :math:`z` for :math:`\theta=\pi/2` rad -and the x-ray beam along :math:`-x` for -:math:`\theta=\phi=0`. Parameter :code:`scatter_axis` can be passed to -:code:`xas_1v1c_py` to specify a different geometry if desired. - -Variable :code:`pol_type` specifies a list of different x-ray -polarizations to calculate. Here we will use so-called :math:`\pi`-polarization -where the x-rays are parallel to the plane spanned by the incident -beam and the sample :math:`z`-axis. - -EDRIXS represents the system's ground state using a set of -low energy eigenstates weighted by Boltzmann thermal factors. -These eigenstates are specified by :code:`gs_list`, -which is of the form :math:`[0, 1, 2, 3, \dots]`. In this example, we -calculate these states as those that have non-negligible thermal -population. The function :code:`xas_1v1c_py` assumes that the spectral -broadening is dominated by the inverse core hole lifetime :code:`gamma_c`, -which is the Lorentzian half width at half maximum. - -.. GENERATED FROM PYTHON SOURCE LINES 105-121 - -.. code-block:: Python - - - ominc = np.linspace(11200, 11230, 50) - temperature = 300 # in K - prob = edrixs.boltz_dist(eval_i, temperature) - gs_list = [n for n, prob in enumerate(prob) if prob > 1e-6] - - thin = 30*np.pi/180 - phi = 0 - pol_type = [('linear', 0)] - - xas = edrixs.xas_1v1c_py( - eval_i, eval_n, trans_op, ominc, gamma_c=info['gamma_c'], - thin=thin, phi=phi, pol_type=pol_type, - gs_list=gs_list) - - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - edrixs >>> Running XAS ... - edrixs >>> XAS Done ! - - - - -.. GENERATED FROM PYTHON SOURCE LINES 122-136 - -Compute RIXS ------------------------------------------------------------------------------- -Calculating RIXS is overall similar to XAS, but with a few additional -considerations. The spectral width in the energy loss axis of RIXS it -not set by the core hole lifetime, but by either the final state lifetime -or the experimental resolution and is parameterized by :code:`gamma_f` --- the Lorentzian half width at half maximum. - -The angle and polarization of the emitted beam must also be specified, so -we pass :code:`pol_type_rixs` to the function, which specifies the -includes the incoming and outgoing x-ray states. If, as is common in -experiments, the emitted polarization is not resolved -one needs to add both emitted polarization channels, which is what we will -do later on in this example. - -.. GENERATED FROM PYTHON SOURCE LINES 136-151 - -.. code-block:: Python - - - eloss = np.linspace(-.5, 6, 400) - pol_type_rixs = [('linear', 0, 'linear', 0), ('linear', 0, 'linear', np.pi/2)] - - thout = 60*np.pi/180 - gamma_f = 0.02 - - rixs = edrixs.rixs_1v1c_py( - eval_i, eval_n, trans_op, ominc, eloss, - gamma_c=info['gamma_c'], gamma_f=gamma_f, - thin=thin, thout=thout, phi=phi, - pol_type=pol_type_rixs, gs_list=gs_list, - temperature=temperature - ) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - edrixs >>> Running RIXS ... - edrixs >>> RIXS Done ! - - - - -.. GENERATED FROM PYTHON SOURCE LINES 152-154 - -The array :code:`xas` will have shape -:code:`(len(ominc_xas), len(pol_type))` - -.. GENERATED FROM PYTHON SOURCE LINES 156-162 - -Plot XAS and RIXS ------------------------------------------------------------------------------- -Let's plot everything. We will use a function so we can reuse the code later. -Note that the rixs array :code:`rixs` has shape -:code:`(len(ominc_xas), len(ominc_xas), len(pol_type))`. We will use some numpy -tricks to sum over the two different emitted polarizations. - -.. GENERATED FROM PYTHON SOURCE LINES 162-196 - -.. code-block:: Python - - - fig, axs = plt.subplots(2, 2, figsize=(10, 10)) - - - def plot_it(axs, ominc, xas, eloss, rixscut, rixsmap=None, label=None): - axs[0].plot(ominc, xas[:, 0], label=label) - axs[0].set_xlabel('Energy (eV)') - axs[0].set_ylabel('Intensity') - axs[0].set_title('XAS') - - axs[1].plot(eloss, rixscut, label=f"{label}") - axs[1].set_xlabel('Energy loss (eV)') - axs[1].set_ylabel('Intensity') - axs[1].set_title(f'RIXS at resonance') - - if rixsmap is not None: - art = axs[2].pcolormesh(ominc, eloss, rixsmap.T, shading='auto') - plt.colorbar(art, ax=axs[2], label='Intensity') - axs[2].set_xlabel('Incident energy (eV)') - axs[2].set_ylabel('Energy loss') - axs[2].set_title('RIXS map') - - - rixs_pol_sum = rixs.sum(-1) - cut_index = np.argmax(rixs_pol_sum[:, eloss < 2].sum(1)) - rixscut = rixs_pol_sum[cut_index] - - plot_it(axs.ravel(), ominc, xas, eloss, rixscut, rixsmap=rixs_pol_sum) - axs[0, 1].set_xlim(right=3) - axs[1, 0].set_ylim(top=3) - axs[1, 1].remove() - - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_2_single_atom_RIXS_001.png - :alt: XAS, RIXS at resonance, RIXS map - :srcset: /auto_examples/images/sphx_glr_example_2_single_atom_RIXS_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 197-204 - -Full d shell calculation ------------------------------------------------------------------------------- -Some researchers have questioned the appropriateness of only including the -:math:`t_{2g}` subshell for iridates [2]_. Let's test this. We specify that -the full :math:`d` shell should be used and apply cubic crystal field matrix -:code:`v_cfmat`. We shift the energy offset by :math:`\frac{2}{5}10D_q`, which -is the amount the crystal field moves the :math:`t_{2g}` subshell. - -.. GENERATED FROM PYTHON SOURCE LINES 204-234 - -.. code-block:: Python - - - ten_dq = 3.5 - v_cfmat = edrixs.cf_cubic_d(ten_dq) - off = 11215 - 6 + ten_dq*2/5 - out = edrixs.ed_1v1c_py(('d', 'p32'), shell_level=(0, -off), v_soc=v_soc, - v_cfmat=v_cfmat, - c_soc=info['c_soc'], v_noccu=v_noccu, slater=slater) - eval_i, eval_n, trans_op = out - - xas_full_d_shell = edrixs.xas_1v1c_py( - eval_i, eval_n, trans_op, ominc, gamma_c=info['gamma_c'], - thin=thin, phi=phi, pol_type=pol_type, - gs_list=gs_list) - - rixs_full_d_shell = edrixs.rixs_1v1c_py( - eval_i, eval_n, trans_op, np.array([11215]), eloss, - gamma_c=info['gamma_c'], gamma_f=gamma_f, - thin=thin, thout=thout, phi=phi, - pol_type=pol_type_rixs, gs_list=gs_list, - temperature=temperature) - - fig, axs = plt.subplots(1, 2, figsize=(10, 4)) - plot_it(axs, ominc, xas, eloss, rixscut, label='$t_{2g}$ subshell') - rixscut = rixs_full_d_shell.sum((0, -1)) - plot_it(axs, ominc, xas_full_d_shell, eloss, rixscut, label='$d$ shell') - - axs[0].legend() - axs[1].legend() - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_2_single_atom_RIXS_002.png - :alt: XAS, RIXS at resonance - :srcset: /auto_examples/images/sphx_glr_example_2_single_atom_RIXS_002.png - :class: sphx-glr-single-img - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - edrixs >>> Running ED ... - - Summary of Slater integrals: - ------------------------------ - Terms, Initial Hamiltonian, Intermediate Hamiltonian - F0_vv : 2.0000000000 2.0000000000 - F2_vv : 2.1538461538 2.1538461538 - F4_vv : 1.3461538462 1.3461538462 - F0_vc : 0.0000000000 0.0881857143 - F2_vc : 0.0000000000 1.0700000000 - G1_vc : 0.0000000000 0.9570000000 - G3_vc : 0.0000000000 0.5690000000 - F0_cc : 0.0000000000 0.0000000000 - F2_cc : 0.0000000000 0.0000000000 - - edrixs >>> Dimension of the initial Hamiltonian: 210 - edrixs >>> Dimension of the intermediate Hamiltonian: 1008 - edrixs >>> Building Many-body Hamiltonians ... - edrixs >>> Done ! - edrixs >>> Exact Diagonalization of Hamiltonians ... - edrixs >>> Done ! - edrixs >>> ED Done ! - edrixs >>> Running XAS ... - edrixs >>> XAS Done ! - edrixs >>> Running RIXS ... - edrixs >>> RIXS Done ! - - - - -.. GENERATED FROM PYTHON SOURCE LINES 235-239 - -As expected, we see the appearance of excitations on the energy scale of -:math:`10D_q` in the XAS and RIXS. The low energy manifold is qualitatively, -but not quantiatively similar. This makes it clear that the parameterization -of Sr\ :sub:`2`\ YIrO\ :sub:`6`\ is dependent on the model. - -.. GENERATED FROM PYTHON SOURCE LINES 241-248 - -.. rubric:: Footnotes - -.. [1] Bo Yuan et al., - `Phys. Rev. B 95, 235114 (2017) `_. - -.. [2] Georgios L. Stamokostas and Gregory A. Fiete - `Phys. Rev. B 97, 085150 (2018) `_. - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 3.985 seconds) - - -.. _sphx_glr_download_auto_examples_example_2_single_atom_RIXS.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_2_single_atom_RIXS.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_2_single_atom_RIXS.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_2_single_atom_RIXS.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_3_AIM_XAS.rst.txt b/edrixs/_sources/auto_examples/example_3_AIM_XAS.rst.txt deleted file mode 100644 index 5f3111c264..0000000000 --- a/edrixs/_sources/auto_examples/example_3_AIM_XAS.rst.txt +++ /dev/null @@ -1,748 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_3_AIM_XAS.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_3_AIM_XAS.py: - - -Anderson impurity model for NiO XAS -================================================================================ -Here we calculate the :math:`L`-edge XAS spectrum of an Anderson impurity model, -which is sometimes also called a charge-transfer multiplet model. This model -considers a set of correlated orbitals, often called the impurity or metal -states, that hybridize with a set of uncorrelated orbitals, often called the -ligands or bath states. Everyone's favorite test case for x-ray spectroscopic -calculations of the Anderson impurity model is NiO and we won't risk being -original! This means that our correlated states will -be the Ni :math:`3d` orbitals and the uncorrelated states come from O -:math:`2p` orbitals. The fact that we include these interactions means that our -spectrum can include processes where electrons transition from the bath to the -impurity, as such the Anderson Impurity Model is often more accurate than atomic -models, especially if the material has strong covalency. - -When defining the bath states, it is useful to use the so-called -symmetry adapted linear combinations of orbitals as the basis. These states -take into account the symmetry relationships between the different bath atom -orbitals and the fact that there are bath orbital combinations that do not -interact with the impurity by symmetry. By doing this the problem can be -represented with fewer orbitals, which makes the calculation far more efficient. -The standard EDRIXS solver that we will use assumes that the bath states are -represented by an integer number of bath sites set by :code:`nbath`, each of -which hosts the same number of spin-orbits as the impurity e.g. 10 for a -:math:`d`-electron material. - -NiO has a rocksalt structure in which all Ni atoms are surrounded by six O -atoms. This NiO cluster used to simulate the -crystal would then contain 10 Ni :math:`3d` spin-orbitals and :math:`6` -spin-orbitals per O :math:`\times 6` O atoms :math:`=36` oxygen -spin-orbitals. As explained by, for example, Maurits Haverkort -et al. in [1]_ symmetry allows us to represent the bath with 10 symmetry -adapted linear combinations of the different O :math:`p_x, p_y, p_z` states. -The crystal field and hopping parameters for -such a calculation can be obtained by post-processing DFT calculations. We will -use values for NiO from [1]_. If you use values from a paper the relevant -references should, of course, be cited. - -.. GENERATED FROM PYTHON SOURCE LINES 42-46 - -.. code-block:: Python - - import edrixs - import numpy as np - import matplotlib.pyplot as plt - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 47-56 - -Number of electrons ------------------------------------------------------------------------------- -When formulating problems of this type, one usually thinks of a nominal -valence for the impurity atom in this case :code:`nd = 8` and assume that the -bath is full. The solver that we will -use can simulate multiple bath sites. In our case we specify -:code:`nbath = 1` sites. Electrons will be able to transition from O to Ni -during our calculation, but the total number of valance electrons -:code:`v_noccu` will be conserved. - -.. GENERATED FROM PYTHON SOURCE LINES 56-63 - -.. code-block:: Python - - nd = 8 - norb_d = 10 - norb_bath = 10 - nbath = 1 - v_noccu = nd + nbath*norb_d - shell_name = ('d', 'p') # valence and core shells for XAS calculation - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 64-70 - -Coulomb interactions ------------------------------------------------------------------------------- -The atomic Coulomb interactions are usually initialized based on Hartree-Fock -calculations from, for example, -`Cowan's code `_. -edrixs has a database of these. - -.. GENERATED FROM PYTHON SOURCE LINES 70-72 - -.. code-block:: Python - - info = edrixs.utils.get_atom_data('Ni', '3d', nd, edge='L3') - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 73-77 - -The atomic values are typically scaled to account for screening in the solid. -Here we use 80% scaling. Let's write these out in full, so that nothing is -hidden. Values for :math:`U_{dd}` and :math:`U_{dp}` are those of Ref. [1]_ -obtained by comparing theory and experiment [2]_ [3]_. - -.. GENERATED FROM PYTHON SOURCE LINES 77-93 - -.. code-block:: Python - - scale_dd = 0.8 - F2_dd = info['slater_i'][1][1] * scale_dd - F4_dd = info['slater_i'][2][1] * scale_dd - U_dd = 7.3 - F0_dd = U_dd + edrixs.get_F0('d', F2_dd, F4_dd) - - scale_dp = 0.8 - F2_dp = info['slater_n'][4][1] * scale_dp - G1_dp = info['slater_n'][5][1] * scale_dp - G3_dp = info['slater_n'][6][1] * scale_dp - U_dp = 8.5 - F0_dp = U_dp + edrixs.get_F0('dp', G1_dp, G3_dp) - - slater = ([F0_dd, F2_dd, F4_dd], # initial - [F0_dd, F2_dd, F4_dd, F0_dp, F2_dp, G1_dp, G3_dp]) # with core hole - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 94-112 - -Energy of the bath states ------------------------------------------------------------------------------- -In the notation used in EDRIXS, :math:`\Delta` sets the energy difference -between the bath and impurity states. :math:`\Delta` is defined in the atomic -limit without crystal field (i.e. in terms of the centers of the impurity and -bath states before hybridization is considered) as the energy for a -:math:`d^{n_d} \rightarrow d^{n_d + 1} \underline{L}` transition. -Note that as electrons are moved one has to pay energy -costs associated with the Coulomb interactions. The -energy splitting between the bath and impurity is consequently not simply -:math:`\Delta`. One must therefore determine the energies by solving -a set of linear equations. See the :ref:`edrixs.utils functions ` -for details. We can call these functions to get the impurity energy -:math:`E_d`, bath energy :math:`E_L`, impurity energy with a core hole -:math:`E_{dc}`, bath energy with a core hole :math:`E_{Lc}` and the -core hole energy :math:`E_p`. The -:code:`if __name__ == '__main__'` code specifies that this command -should only be executed if the file is explicitly run. - -.. GENERATED FROM PYTHON SOURCE LINES 112-124 - -.. code-block:: Python - - Delta = 4.7 - E_d, E_L = edrixs.CT_imp_bath(U_dd, Delta, nd) - E_dc, E_Lc, E_p = edrixs.CT_imp_bath_core_hole(U_dd, U_dp, Delta, nd) - message = ("E_d = {:.3f} eV\n" - "E_L = {:.3f} eV\n" - "E_dc = {:.3f} eV\n" - "E_Lc = {:.3f} eV\n" - "E_p = {:.3f} eV\n") - if __name__ == '__main__': - print(message.format(E_d, E_L, E_dc, E_Lc, E_p)) - - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - E_d = -41.189 eV - E_L = 12.511 eV - E_dc = -77.367 eV - E_Lc = 27.333 eV - E_p = -44.467 eV - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 125-128 - -The spin-orbit coupling for the valence electrons in the ground state, the -valence electrons with the core hole present, and for the core hole itself -are initialized using the atomic values. - -.. GENERATED FROM PYTHON SOURCE LINES 128-132 - -.. code-block:: Python - - zeta_d_i = info['v_soc_i'][0] - zeta_d_n = info['v_soc_n'][0] - c_soc = info['c_soc'] - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 133-143 - -Build matrices describing interactions ------------------------------------------------------------------------------- -edrixs uses complex spherical harmonics as its default basis set. If we want to -use another basis set, we need to pass a matrix to the solver, which transforms -from complex spherical harmonics into the basis we use. -The solver will use this matrix when implementing the Coulomb interactions -using the :code:`slater` list of Coulomb parameters. -Here it is easiest to -use real harmonics. We make the complex harmonics to real harmonics transformation -matrix via - -.. GENERATED FROM PYTHON SOURCE LINES 143-145 - -.. code-block:: Python - - trans_c2n = edrixs.tmat_c2r('d',True) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 146-156 - -The crystal field and SOC needs to be passed to the solver by constructing -the impurity matrix in the real harmonic basis. For cubic symmetry, we need -to set the energies of the orbitals along the -diagonal of the matrix. These need to be in pairs as there are two -spin-orbitals for each orbital energy. Python -`list comprehension `_ -and -`numpy indexing `_ -are used here. See :ref:`sphx_glr_auto_examples_example_1_crystal_field.py` -for more details if needed. - -.. GENERATED FROM PYTHON SOURCE LINES 156-171 - -.. code-block:: Python - - ten_dq = 0.56 - CF = np.zeros((norb_d, norb_d), dtype=complex) - diagonal_indices = np.arange(norb_d) - - orbital_energies = np.array([e for orbital_energy in - [+0.6 * ten_dq, # dz2 - -0.4 * ten_dq, # dzx - -0.4 * ten_dq, # dzy - +0.6 * ten_dq, # dx2-y2 - -0.4 * ten_dq] # dxy) - for e in [orbital_energy]*2]) - - - CF[diagonal_indices, diagonal_indices] = orbital_energies - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 172-174 - -The valence band SOC is constructed in the normal way and transformed into the -real harmonic basis. - -.. GENERATED FROM PYTHON SOURCE LINES 174-176 - -.. code-block:: Python - - soc = edrixs.cb_op(edrixs.atom_hsoc('d', zeta_d_i), edrixs.tmat_c2r('d', True)) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 177-181 - -The total impurity matrices for the ground and core-hole states are then -the sum of crystal field and spin-orbit coupling. We further needed to apply -an energy shift along the matrix diagonal, which we do using the -:code:`np.eye` function which creates a diagonal matrix of ones. - -.. GENERATED FROM PYTHON SOURCE LINES 181-186 - -.. code-block:: Python - - E_d_mat = E_d*np.eye(norb_d) - E_dc_mat = E_dc*np.eye(norb_d) - imp_mat = CF + soc + E_d_mat - imp_mat_n = CF + soc + E_dc_mat - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 187-191 - -The energy level of the bath(s) is described by a matrix where the row index -denotes which bath and the column index denotes which orbital. Here we have -only one bath, with 10 spin-orbitals. We initialize the matrix to -:code:`norb_d` and then split the energies according to :code:`ten_dq_bath`. - -.. GENERATED FROM PYTHON SOURCE LINES 191-203 - -.. code-block:: Python - - ten_dq_bath = 1.44 - bath_level = np.full((nbath, norb_d), E_L, dtype=complex) - bath_level[0, :2] += ten_dq_bath*.6 # 3z2-r2 - bath_level[0, 2:6] -= ten_dq_bath*.4 # zx/yz - bath_level[0, 6:8] += ten_dq_bath*.6 # x2-y2 - bath_level[0, 8:] -= ten_dq_bath*.4 # xy - bath_level_n = np.full((nbath, norb_d), E_Lc, dtype=complex) - bath_level_n[0, :2] += ten_dq_bath*.6 # 3z2-r2 - bath_level_n[0, 2:6] -= ten_dq_bath*.4 # zx/yz - bath_level_n[0, 6:8] += ten_dq_bath*.6 # x2-y2 - bath_level_n[0, 8:] -= ten_dq_bath*.4 # xy - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 204-209 - -The hybridization matrix describes the hopping between the bath -and the impurity. This is called either :math:`V` or :math:`T` in the -literature and matrix sign can either be positive or negative based. -This is the same shape as the bath matrix. We take our -values from Maurits Haverkort et al.'s DFT calculations [1]_. - -.. GENERATED FROM PYTHON SOURCE LINES 209-218 - -.. code-block:: Python - - Veg = 2.06 - Vt2g = 1.21 - - hyb = np.zeros((nbath, norb_d), dtype=complex) - hyb[0, :2] = Veg # 3z2-r2 - hyb[0, 2:6] = Vt2g # zx/yz - hyb[0, 6:8] = Veg # x2-y2 - hyb[0, 8:] = Vt2g # xy - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 219-221 - -We now need to define the parameters describing the XAS. X-ray polarization -can be linear, circular or isotropic (appropriate for a powder). - -.. GENERATED FROM PYTHON SOURCE LINES 221-222 - -.. code-block:: Python - - poltype_xas = [('isotropic', 0)] - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 223-225 - -edrixs uses the temperature in Kelvin to work out the population of the low-lying -states via a Boltzmann distribution. - -.. GENERATED FROM PYTHON SOURCE LINES 225-226 - -.. code-block:: Python - - temperature = 300 - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 227-228 - -The x-ray beam is specified by the incident angle and azimuthal angle in radians - -.. GENERATED FROM PYTHON SOURCE LINES 228-230 - -.. code-block:: Python - - thin = 0 / 180.0 * np.pi - phi = 0.0 - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 231-234 - -these are with respect to the crystal field :math:`z` and :math:`x` axes -written above. (That is, unless you specify the :code:`loc_axis` parameter -described in the :code:`edrixs.xas_siam_fort` function documentation.) - -.. GENERATED FROM PYTHON SOURCE LINES 236-242 - -The spectrum in the raw calculation is offset by the energy involved with the -core hole state, which is roughly :math:`5 E_p`, so we offset the spectrum by -this and use :code:`om_shift` as an adjustable parameters for comparing -theory to experiment. We also use this to specify :code:`ominc_xas` -the range we want to compute the spectrum over. The core hole lifetime -broadening also needs to be set via :code:`gamma_c_stat`. - -.. GENERATED FROM PYTHON SOURCE LINES 242-246 - -.. code-block:: Python - - om_shift = 857.6 - c_level = -om_shift - 5*E_p - ominc_xas = om_shift + np.linspace(-15, 25, 1000) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 247-251 - -The final state broadening is specified in terms of half-width at half-maximum -You can either pass a constant value or an array the same size as -:code:`om_shift` with varying values to simulate, for example, different state -lifetimes for higher energy states. - -.. GENERATED FROM PYTHON SOURCE LINES 251-253 - -.. code-block:: Python - - gamma_c = np.full(ominc_xas.shape, 0.48/2) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 254-263 - -Magnetic field is a three-component vector in eV specified with respect to the -same local axis as the x-ray beam. Since we are considering a powder here -we create an isotropic normalized vector. :code:`on_which = 'both'` specifies to -apply the operator to the total spin plus orbital angular momentum as is -appropriate for a physical external magnetic field. You can use -:code:`on_which = 'spin'` to apply the operator to spin in order to simulate -magnetic order in the sample. The value of the Bohr Magneton can -be useful for converting here :math:`\mu_B = 5.7883818012\times 10^{−5}`. -For this example, we will account for magnetic order in the sample by - -.. GENERATED FROM PYTHON SOURCE LINES 263-266 - -.. code-block:: Python - - ext_B = np.array([0.00, 0.00, 0.12]) - on_which = 'spin' - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 267-278 - -The number crunching uses -`mpi4py `_. You can safely ignore -this for most purposes, but see -`Y. L. Wang et al., Computer Physics Communications 243, 151-165 (2019) `_ -if you would like more details. -The main thing to remember is that you should call this script via:: - - mpirun -n python example_AIM_XAS.py - -where :code:`` is the number of processors -you'd like to us. Running it as normal will work, it will just be slower. - -.. GENERATED FROM PYTHON SOURCE LINES 278-284 - -.. code-block:: Python - - if __name__ == '__main__': - from mpi4py import MPI - comm = MPI.COMM_WORLD - rank = comm.Get_rank() - size = comm.Get_size() - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 285-293 - -Calling the :code:`edrixs.ed_siam_fort` solver will find the ground state and -write input files, *hopping_i.in*, *hopping_n.in*, *coulomb_i.in*, *coulomb_n.in* -for following XAS (or RIXS) calculation. We need to specify :code:`siam_type=0` -which says that we will pass *imp_mat*, *bath_level* and *hyb*. -We need to specify :code:`do_ed = 1`. For this example, we cannot use -:code:`do_ed = 0` for a ground state search as we have set the impurity and -bath energy levels artificially, which means edrixs will have trouble to know -which subspace to search to find the ground state. - -.. GENERATED FROM PYTHON SOURCE LINES 293-301 - -.. code-block:: Python - - if __name__ == '__main__': - do_ed = 1 - eval_i, denmat, noccu_gs = edrixs.ed_siam_fort( - comm, shell_name, nbath, siam_type=0, imp_mat=imp_mat, imp_mat_n=imp_mat_n, - bath_level=bath_level, bath_level_n=bath_level_n, hyb=hyb, c_level=c_level, - c_soc=c_soc, slater=slater, ext_B=ext_B, - on_which=on_which, trans_c2n=trans_c2n, v_noccu=v_noccu, do_ed=do_ed, - ed_solver=2, neval=50, nvector=3, ncv=100, idump=True) - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - edrixs >>> Running ED ... - - Summary of Slater integrals: - ------------------------------ - Terms, Initial Hamiltonian, Intermediate Hamiltonian - F0_vv : 7.8036698413 7.8036698413 - F2_vv : 9.7872000000 9.7872000000 - F4_vv : 6.0784000000 6.0784000000 - F0_vc : 0.0000000000 8.9214742857 - F2_vc : 0.0000000000 6.1768000000 - G1_vc : 0.0000000000 4.6296000000 - G3_vc : 0.0000000000 2.6328000000 - F0_cc : 0.0000000000 0.0000000000 - F2_cc : 0.0000000000 0.0000000000 - - edrixs >>> do_ed=1, perform ED at noccu: 18 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 302-304 - -Let's check that we have all the electrons we think we have and print how -the electron are distributed between the Ni (impurity) and O (bath). - -.. GENERATED FROM PYTHON SOURCE LINES 304-310 - -.. code-block:: Python - - if __name__ == '__main__': - assert np.abs(noccu_gs - v_noccu) < 1e-6 - impurity_occupation = np.sum(denmat[0].diagonal()[0:norb_d]).real - bath_occupation = np.sum(denmat[0].diagonal()[norb_d:]).real - print('Impurity occupation = {:.6f}\n'.format(impurity_occupation)) - print('Bath occupation = {:.6f}\n'.format(bath_occupation)) - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - Impurity occupation = 8.179506 - - Bath occupation = 9.820494 - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 311-317 - -We see that 0.18 electrons move from the O to the Ni in the ground state. - -We can now construct the XAS spectrum edrixs by applying a transition -operator to create the excited state. We need to be careful to specify how -many of the low energy states are thermally populated. In this case -:code:`num_gs=3`. This can be determined by inspecting the function output. - -.. GENERATED FROM PYTHON SOURCE LINES 317-322 - -.. code-block:: Python - - if __name__ == '__main__': - xas, xas_poles = edrixs.xas_siam_fort( - comm, shell_name, nbath, ominc_xas, gamma_c=gamma_c, v_noccu=v_noccu, thin=thin, - phi=phi, num_gs=3, nkryl=200, pol_type=poltype_xas, temperature=temperature - ) - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - edrixs >>> Running XAS ... - edrixs >>> Loop over for polarization: 0 isotropic - edrixs >>> Isotropic, component: 0 - edrixs >>> Loop over for polarization: 0 isotropic - edrixs >>> Isotropic, component: 1 - edrixs >>> Loop over for polarization: 0 isotropic - edrixs >>> Isotropic, component: 2 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 323-324 - -Let's plot the data and save it just in case - -.. GENERATED FROM PYTHON SOURCE LINES 324-335 - -.. code-block:: Python - - if __name__ == '__main__': - fig, ax = plt.subplots() - - ax.plot(ominc_xas, xas) - ax.set_xlabel('Energy (eV)') - ax.set_ylabel('XAS intensity') - ax.set_title('Anderson impurity model for NiO') - plt.show() - - np.savetxt('xas.dat', np.concatenate((np.array([ominc_xas]).T, xas), axis=1)) - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_3_AIM_XAS_001.png - :alt: Anderson impurity model for NiO - :srcset: /auto_examples/images/sphx_glr_example_3_AIM_XAS_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 336-344 - -.. rubric:: Footnotes - -.. [1] Maurits Haverkort et al - `Phys. Rev. B 85, 165113 (2012) `_. -.. [2] A. E. Bocquet et al., - `Phys. Rev. B 53, 1161 (1996) `_. -.. [3] Arata Tanaka, and Takeo Jo, - `J. Phys. Soc. Jpn. 63, 2788-2807(1994) `_. - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 0.548 seconds) - - -.. _sphx_glr_download_auto_examples_example_3_AIM_XAS.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_3_AIM_XAS.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_3_AIM_XAS.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_3_AIM_XAS.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_4_GS_analysis.rst.txt b/edrixs/_sources/auto_examples/example_4_GS_analysis.rst.txt deleted file mode 100644 index c04d815ec1..0000000000 --- a/edrixs/_sources/auto_examples/example_4_GS_analysis.rst.txt +++ /dev/null @@ -1,387 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_4_GS_analysis.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_4_GS_analysis.py: - - -Ground state analysis for NiO -================================================================================ -This example follows the :ref:`sphx_glr_auto_examples_example_3_AIM_XAS.py` -example and considers the same model. This time we show how to analyze -the wavevectors in terms of a -:math:`\alpha |d^8L^{10}> + \beta |d^9L^9> \gamma |d^{10}L^8>` -representation. - -In doing this we will go through the exercise of building and diagonalizing -the Hamiltonian in a way that hopefully clarifies how to analyze other -properties of the model. - -.. GENERATED FROM PYTHON SOURCE LINES 15-23 - -.. code-block:: Python - - import edrixs - import numpy as np - import matplotlib.pyplot as plt - import scipy - import example_3_AIM_XAS - import importlib - _ = importlib.reload(example_3_AIM_XAS) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 24-40 - -Hamiltonian ------------------------------------------------------------------------------- -edrixs builds model Hamiltonians based on two fermion and four fermion terms. -The four fermion terms come from Coulomb interactions and will be -assigned to :code:`umat`. All other interactions contribute to two fermion -terms in :code:`emat`. - - .. math:: - \begin{equation} - \hat{H}_{i} = \sum_{\alpha,\beta} t_{\alpha,\beta} - \hat{f}^{\dagger}_{\alpha} \hat{f}_{\beta} - + \sum_{\alpha,\beta,\gamma,\delta} U_{\alpha,\beta,\gamma,\delta} - \hat{f}^{\dagger}_{\alpha}\hat{f}^{\dagger}_{\beta} - \hat{f}_{\gamma}\hat{f}_{\delta}, - \end{equation} - - -.. GENERATED FROM PYTHON SOURCE LINES 42-48 - -Import parameters ------------------------------------------------------------------------------- -Let's get the parammeters we need from the -:ref:`sphx_glr_auto_examples_example_3_AIM_XAS.py` example. We need to -consider :code:`ntot=20` spin-orbitals -for this problem. - -.. GENERATED FROM PYTHON SOURCE LINES 48-54 - -.. code-block:: Python - - - from example_3_AIM_XAS import (F0_dd, F2_dd, F4_dd, - nd, norb_d, norb_bath, v_noccu, - imp_mat, bath_level, - hyb, ext_B, trans_c2n) - ntot = 20 - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 55-64 - -Four fermion matrix ------------------------------------------------------------------------------- -The Coulomb interactions in the :math:`d` shell of this problem are described -by a :math:`10\times10\times10\times10` matrix. We -need to specify a :math:`20\times20\times20\times 20` matrix since we need to -include the full problem with :code:`ntot=20` spin-orbitals. The edrixs -convention is to put the :math:`d` orbitals first, so we assign them to the -first :math:`10\times10\times10\times 10` indices of the matrix. edrixs -creates this matrix in the complex harmmonic basis by default. - -.. GENERATED FROM PYTHON SOURCE LINES 64-69 - -.. code-block:: Python - - umat_delectrons = edrixs.get_umat_slater('d', F0_dd, F2_dd, F4_dd) - umat = np.zeros((ntot, ntot, ntot, ntot), dtype=complex) - umat[:norb_d, :norb_d, :norb_d, :norb_d] += umat_delectrons - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 70-76 - -Two fermion matrix ------------------------------------------------------------------------------- -Previously we made a :math:`10\times10` two-fermion matrix describing the -:math:`d`-shell interactions. Keep in mind we did this in the real harmonic -basis. We need to specify the two-fermion matrix for -the full problem :math:`20\times20` spin-orbitals in size. - -.. GENERATED FROM PYTHON SOURCE LINES 76-79 - -.. code-block:: Python - - emat_rhb = np.zeros((ntot, ntot), dtype='complex') - emat_rhb[0:norb_d, 0:norb_d] += imp_mat - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 80-82 - -The :code:`bath_level` energies need to be applied to the diagonal of the -last :math:`10\times10` region of the matrix. - -.. GENERATED FROM PYTHON SOURCE LINES 82-85 - -.. code-block:: Python - - indx = np.arange(norb_d, norb_d*2) - emat_rhb[indx, indx] += bath_level[0] - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 86-88 - -The :code:`hyb` terms mix the impurity and bath states and are therefore -applied to the off-diagonal terms of :code:`emat`. - -.. GENERATED FROM PYTHON SOURCE LINES 88-93 - -.. code-block:: Python - - indx1 = np.arange(norb_d) - indx2 = np.arange(norb_d, norb_d*2) - emat_rhb[indx1, indx2] += hyb[0] - emat_rhb[indx2, indx1] += np.conj(hyb[0]) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 94-97 - -We now need to transform into the complex harmonic basis. We assign -the two diagonal blocks of a :math:`20\times20` matrix to the -conjugate transpose of the transition matrix. - -.. GENERATED FROM PYTHON SOURCE LINES 97-104 - -.. code-block:: Python - - tmat = np.eye(ntot, dtype=complex) - for i in range(2): - off = i * norb_d - tmat[off:off+norb_d, off:off+norb_d] = np.conj(np.transpose(trans_c2n)) - - emat_chb = edrixs.cb_op(emat_rhb, tmat) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 105-107 - -The spin exchange is built from the spin operators and the effective field -is applied to the :math:`d`-shell region of the matrix. - -.. GENERATED FROM PYTHON SOURCE LINES 107-114 - -.. code-block:: Python - - v_orbl = 2 - sx = edrixs.get_sx(v_orbl) - sy = edrixs.get_sy(v_orbl) - sz = edrixs.get_sz(v_orbl) - zeeman = ext_B[0] * (2 * sx) + ext_B[1] * (2 * sy) + ext_B[2] * (2 * sz) - emat_chb[0:norb_d, 0:norb_d] += zeeman - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 115-122 - -Build the Fock basis and Hamiltonain and Diagonalize ------------------------------------------------------------------------------- -We create the fock basis and build the Hamiltonian using the full set of -:math:`20` spin orbitals, specifying that they are occuplied by :math:`18` -electrons. See the :ref:`sphx_glr_auto_examples_example_0_ed_calculator.py` -example for more details if needed. We also set the ground state to zero -energy. - -.. GENERATED FROM PYTHON SOURCE LINES 122-129 - -.. code-block:: Python - - basis = np.array(edrixs.get_fock_bin_by_N(ntot, v_noccu)) - H = (edrixs.build_opers(2, emat_chb, basis) - + edrixs.build_opers(4, umat, basis)) - - e, v = scipy.linalg.eigh(H) - e -= e[0] - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 130-136 - -State analysis ------------------------------------------------------------------------------- -Now we have all the eigenvectors in the Fock basis, we need to pick out the -states that have 8, 9 and 10 :math:`d`-electrons, respectively. -The modulus squared of these coeffcients need to be added up to get -:math:`\alpha`, :math:`\beta`, and :math:`\gamma`. - -.. GENERATED FROM PYTHON SOURCE LINES 136-143 - -.. code-block:: Python - - - num_d_electrons = basis[:, :norb_d].sum(1) - - alphas = np.sum(np.abs(v[num_d_electrons==8, :])**2, axis=0) - betas = np.sum(np.abs(v[num_d_electrons==9, :])**2, axis=0) - gammas = np.sum(np.abs(v[num_d_electrons==10, :])**2, axis=0) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 144-145 - -The ground state is the first entry. - -.. GENERATED FROM PYTHON SOURCE LINES 145-148 - -.. code-block:: Python - - message = "Ground state\nalpha={:.3f}\tbeta={:.3f}\tgamma={:.3f}" - print(message.format(alphas[0], betas[0], gammas[0])) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - Ground state - alpha=0.825 beta=0.171 gamma=0.004 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 149-153 - -Plot ------------------------------------------------------------------------------- -Let's look how :math:`\alpha`, :math:`\beta`, and :math:`\gamma` vary with -energy. - -.. GENERATED FROM PYTHON SOURCE LINES 153-166 - -.. code-block:: Python - - - fig, ax = plt.subplots() - - ax.plot(e, alphas, label=r'$\alpha$ $d^8L^{10}$') - ax.plot(e, betas, label=r'$\beta$ $d^9L^{9}$') - ax.plot(e, gammas, label=r'$\gamma$ $d^{10}L^{8}$') - - ax.set_xlabel('Energy (eV)') - ax.set_ylabel('Population') - ax.set_title('NiO') - ax.legend() - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_4_GS_analysis_001.png - :alt: NiO - :srcset: /auto_examples/images/sphx_glr_example_4_GS_analysis_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 167-171 - -We see that the ligand states are mixed into the ground state, but the -majority of the weight for the :math:`L^9` and :math:`L^8` states -live at :math:`\Delta` and :math:`2\Delta`. With a lot of additional -structure from the other interactions. - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 0.421 seconds) - - -.. _sphx_glr_download_auto_examples_example_4_GS_analysis.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_4_GS_analysis.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_4_GS_analysis.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_4_GS_analysis.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_5_Hubbard_dimer.rst.txt b/edrixs/_sources/auto_examples/example_5_Hubbard_dimer.rst.txt deleted file mode 100644 index f784fff8d1..0000000000 --- a/edrixs/_sources/auto_examples/example_5_Hubbard_dimer.rst.txt +++ /dev/null @@ -1,371 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_5_Hubbard_dimer.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - Click :ref:`here ` - to download the full example code - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_5_Hubbard_dimer.py: - - -Hubbard Dimer -===================================== -This exercise will demonstrate how to handle hopping and multi-site problems within -edrixs using the example of a Hubbard dimer. We want to solve the equation - - .. math:: - \begin{equation} - \hat{H} = \sum_{i,j} \sum_{\sigma} t_{i,j} \hat{f}^{\dagger}_{i,\sigma} \hat{f}_{j, \sigma} - + U \sum_{i} \hat{n}_{i,\uparrow}\hat{n}_{i,\downarrow}, - \end{equation} - -which involves two sites labeled with indices :math:`i` or :math:`j` with two -electrons of spin :math:`\sigma\in{\uparrow,\downarrow}`. :math:`t_{i,j}` -is the hopping between sites, :math:`\hat{f}^{\dagger}_{i,\sigma}` is the -creation operators, and -:math:`\hat{n}^{\dagger}_{i,\sigma}=\hat{f}^{\dagger}_{i,\sigma}\hat{f}_{i,\sigma}` -is the number operator. The main task is to represent this Hamiltonian and -the related spin operator using the EDRIXS two-fermion and four-fermion form -where :math:`\alpha,\beta,\delta,\gamma` are the indices of the single -particle basis. - - .. math:: - \begin{equation} - \hat{H} = \sum_{\alpha,\beta} t_{\alpha,\beta} \hat{f}^{\dagger}_{\alpha} \hat{f}_{\beta} - + \sum_{\alpha,\beta,\gamma,\delta} U_{\alpha,\beta,\gamma,\delta} - \hat{f}^{\dagger}_{\alpha}\hat{f}^{\dagger}_{\beta}\hat{f}_{\gamma}\hat{f}_{\delta}. - \end{equation} - -.. GENERATED FROM PYTHON SOURCE LINES 34-39 - -Initialize matrices ------------------------------------------------------------------------------- -We start by noting that each of the two sites is like an :math:`l=0` -:math:`s`-orbital with two spin-orbitals each. We will include -two electron occupation and build the Fock basis. - -.. GENERATED FROM PYTHON SOURCE LINES 39-52 - -.. code-block:: default - - import numpy as np - import matplotlib.pyplot as plt - import scipy - import edrixs - np.set_printoptions(precision=4) - - - ll = 0 - case = 's' - norb = 4 - noccu = 2 - basis = edrixs.get_fock_bin_by_N(norb, noccu) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 53-69 - -Create function to populate and diagonalize matrices ------------------------------------------------------------------------------- -The Coulomb and hopping matrices :code:`umat` and :code:`emat` will be -represented by :math:`4\times4\times4\times4` and :math:`4\times4` matrices, -respectively. Note that we needed to specify -that these are, in general, complex, although -they happen to contain only real numbers in this case. We follow the convention -that these are ordered first by site and then by spin: -:math:`|0\uparrow>, |0\downarrow>, |1\uparrow>, |1\downarrow>`. -Consequently the :math:`2\times2` and :math:`2\times2\times2\times2` block -diagonal structures of the matrices will contain the on-site interactions. -The converse is true for the hopping between the sites. -From here let us generate a function to build and diagonalize the Hamiltonian. -We need to generate the Coulomb matrix for the on-site interactions and -apply it to the block diagonal. The hopping connects off-site indices with -the same spin. - -.. GENERATED FROM PYTHON SOURCE LINES 69-86 - -.. code-block:: default - - def diagonalize(U, t, extra_emat=None): - """Diagonalize 2 site Hubbard Hamiltonian""" - umat = np.zeros((norb, norb, norb, norb), dtype=np.complex128) - emat = np.zeros((norb, norb), dtype=np.complex128) - U_mat_1site = edrixs.get_umat_slater('s', U) - umat[:2, :2, :2, :2,] = umat[2:, 2:, 2:, 2:] = U_mat_1site - emat[2, 0] = emat[3, 1] = emat[0, 2] = emat[1, 3] = t - - if extra_emat is not None: - emat = emat + extra_emat - - H = (edrixs.build_opers(2, emat, basis) - + edrixs.build_opers(4, umat, basis)) - - e, v = scipy.linalg.eigh(H) - return e, v - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 87-90 - -The large :math:`U` limit ------------------------------------------------------------------------------- -Let us see what happens with :math:`U \gg t`. - -.. GENERATED FROM PYTHON SOURCE LINES 90-94 - -.. code-block:: default - - e, v = diagonalize(1000, 1) - print("Energies are") - print(e) - - - - - -.. rst-class:: sphx-glr-script-out - - Out: - - .. code-block:: none - - Energies are - [ -0.004 0. 0. 0. 1000. 1000.004] - - - - -.. GENERATED FROM PYTHON SOURCE LINES 95-98 - -To analyze what is going on we can determine the spin expectation values -of the cluster. Building the operators follows the same form as the -Hamiltonian and the previous example. - -.. GENERATED FROM PYTHON SOURCE LINES 98-106 - -.. code-block:: default - - spin_mom_one_site = edrixs.get_spin_momentum(ll) - spin_mom = np.zeros((3, norb, norb), dtype=np.complex128) - spin_mom[:, :2, :2] = spin_mom[:, 2:, 2:] = spin_mom_one_site - - opS = edrixs.build_opers(2, spin_mom, basis) - opS_squared = (np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) - + np.dot(opS[2], opS[2])) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 107-110 - -This time let us include a tiny magnetic field along the :math:`z`-axis, so -that we have a well-defined measurement axis and print out the expectation -values. - -.. GENERATED FROM PYTHON SOURCE LINES 110-122 - -.. code-block:: default - - zeeman = np.zeros((norb, norb), dtype=np.complex128) - zeeman[:2, :2] = zeeman[2:, 2:] = 1e-8*spin_mom_one_site[2] - e, v = diagonalize(1000, 1, extra_emat=zeeman) - - Ssq_exp = edrixs.cb_op(opS_squared, v).diagonal().real - Sz_exp = edrixs.cb_op(opS[2], v).diagonal().real - - header = "{:<10s}\t{:<6s}\t{:<6s}" - print(header.format("E", "S(S+1)", "")) - for i in range(len(e)): - print("{:<2f}\t{:.1f}\t{:.1f}".format(e[i], Ssq_exp[i], Sz_exp[i])) - - - - - -.. rst-class:: sphx-glr-script-out - - Out: - - .. code-block:: none - - E S(S+1) - -0.004000 0.0 0.0 - -0.000000 2.0 -1.0 - -0.000000 2.0 0.0 - 0.000000 2.0 1.0 - 1000.000000 0.0 0.0 - 1000.004000 0.0 0.0 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 123-127 - -For :math:`U \gg t` the two states with double occupancy acquire an energy of -approximately :math:`U`. The low energy states are a :math:`S=0` singlet and -and :math:`S=1` triplet, which are split by :math:`4t^2/U`, which is the -magnetic exchange term. - -.. GENERATED FROM PYTHON SOURCE LINES 129-132 - -:math:`U` dependence ------------------------------------------------------------------------------- -Let us plot the changes in energy with :math:`U`. - -.. GENERATED FROM PYTHON SOURCE LINES 132-143 - -.. code-block:: default - - plt.figure() - - t = 1 - Us = np.linspace(0.01, 10, 50) - Es = np.array([diagonalize(U, t, extra_emat=zeeman)[0] for U in Us]) - - plt.plot(Us/t, Es/t) - plt.xlabel('U/t') - plt.ylabel('Eigenstate energies/t') - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_5_Hubbard_dimer_001.png - :alt: example 5 Hubbard dimer - :srcset: /auto_examples/images/sphx_glr_example_5_Hubbard_dimer_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 144-146 - -To help interpret this, we can represent the eigenvectors in terms of a sum -of the single particle states. - -.. GENERATED FROM PYTHON SOURCE LINES 146-164 - -.. code-block:: default - - - def get_single_particle_repesentations(v): - reps = [] - for i in range(6): - rep = sum([vec*weight for weight, vec - in zip(v[:, i], np.array(basis))]) - reps.append(rep) - - return np.array(reps) - - t = 1 - for U in [10000, 0.0001]: - e, v = diagonalize(U, t, extra_emat=zeeman) - repesentations = get_single_particle_repesentations(v) - print("For U={} t={} states are".format(U, t)) - print(repesentations.round(3).real) - print("\n") - - - - - -.. rst-class:: sphx-glr-script-out - - Out: - - .. code-block:: none - - For U=10000 t=1 states are - [[-0.707 0.707 0.707 -0.707] - [ 0. 1. 0. 1. ] - [ 0.707 0.707 0.707 0.707] - [-1. 0. -1. 0. ] - [-0.707 -0.707 0.707 0.707] - [ 0.707 0.707 0.707 0.707]] - - - For U=0.0001 t=1 states are - [[-0. 1. 1. -0. ] - [ 0. 1. 0. 1. ] - [ 0.707 0.707 0.707 0.707] - [-1. 0. -1. 0. ] - [-0.707 -0.707 0.707 0.707] - [-1. -0. -0. -1. ]] - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 165-170 - -For :math:`U \gg t` the ground state maximizes its magnetic exchange -energy saving. In the :math:`U \ll t` condition the ground state maximizes -its kinetic energy saving. Since both states share the same parity, the -cross-over between them is smooth. This type of physics is at play in current -research on quantum materials [1]_ [2]_. - -.. GENERATED FROM PYTHON SOURCE LINES 172-176 - -.. rubric:: Footnotes - -.. [1] Y. Wang et al., `Phys. Rev. Lett. 122, 106401 (2019) `_. -.. [2] A. Revelli et al., `Science Advances 5, eaav4020 (2019) `_. - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** ( 0 minutes 0.191 seconds) - - -.. _sphx_glr_download_auto_examples_example_5_Hubbard_dimer.py: - - -.. only :: html - - .. container:: sphx-glr-footer - :class: sphx-glr-footer-example - - - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_5_Hubbard_dimer.py ` - - - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_5_Hubbard_dimer.ipynb ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_5_charge_transfer.rst.txt b/edrixs/_sources/auto_examples/example_5_charge_transfer.rst.txt deleted file mode 100644 index 12e8b5eae6..0000000000 --- a/edrixs/_sources/auto_examples/example_5_charge_transfer.rst.txt +++ /dev/null @@ -1,290 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_5_charge_transfer.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_5_charge_transfer.py: - - -Charge-transfer energy for NiO -================================================================================ -This example follows the :ref:`sphx_glr_auto_examples_example_3_AIM_XAS.py` -example and considers the same model. This time we outline how to determine -the charge transfer energy in the sense defined by Zaanen, Sawatzky, and Allen -[1]_. That is, a :math:`d^{n_d} \rightarrow d^{n_d + 1} \underline{L}` transition -in the atomic limit, after considering Coulomb interactions and crystal field. Although -this can be determined analytically in some cases, the easiest way is often just to -calculate it, as we will do here. - -.. GENERATED FROM PYTHON SOURCE LINES 13-21 - -.. code-block:: Python - - import edrixs - import numpy as np - import matplotlib.pyplot as plt - import scipy - import example_3_AIM_XAS - import importlib - _ = importlib.reload(example_3_AIM_XAS) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 22-27 - -Determine eigenvectors and occupations ------------------------------------------------------------------------------- -The first step repeats what was done in -:ref:`sphx_glr_auto_examples_example_4_GS_analysis.py` but it does not apply -the hybridization between the impurity and both states. - -.. GENERATED FROM PYTHON SOURCE LINES 27-63 - -.. code-block:: Python - - - from example_3_AIM_XAS import (F0_dd, F2_dd, F4_dd, - nd, norb_d, norb_bath, v_noccu, - imp_mat, bath_level, - hyb, ext_B, trans_c2n) - ntot = 20 - umat_delectrons = edrixs.get_umat_slater('d', F0_dd, F2_dd, F4_dd) - umat = np.zeros((ntot, ntot, ntot, ntot), dtype=complex) - umat[:norb_d, :norb_d, :norb_d, :norb_d] += umat_delectrons - emat_rhb = np.zeros((ntot, ntot), dtype='complex') - emat_rhb[0:norb_d, 0:norb_d] += imp_mat - indx = np.arange(norb_d, norb_d*2) - emat_rhb[indx, indx] += bath_level[0] - tmat = np.eye(ntot, dtype=complex) - for i in range(2): - off = i * norb_d - tmat[off:off+norb_d, off:off+norb_d] = np.conj(np.transpose(trans_c2n)) - - emat_chb = edrixs.cb_op(emat_rhb, tmat) - v_orbl = 2 - sx = edrixs.get_sx(v_orbl) - sy = edrixs.get_sy(v_orbl) - sz = edrixs.get_sz(v_orbl) - zeeman = ext_B[0] * (2 * sx) + ext_B[1] * (2 * sy) + ext_B[2] * (2 * sz) - emat_chb[0:norb_d, 0:norb_d] += zeeman - basis = np.array(edrixs.get_fock_bin_by_N(ntot, v_noccu)) - H = (edrixs.build_opers(2, emat_chb, basis) - + edrixs.build_opers(4, umat, basis)) - - e, v = scipy.linalg.eigh(H) - e -= e[0] - - num_d_electrons = basis[:, :norb_d].sum(1) - alphas = np.sum(np.abs(v[num_d_electrons == 8, :])**2, axis=0) - betas = np.sum(np.abs(v[num_d_electrons == 9, :])**2, axis=0) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 64-67 - -Energy to lowest energy ligand orbital ------------------------------------------------------------------------------- -Let's vizualize :math:`\alpha` and :math:`\beta`. - -.. GENERATED FROM PYTHON SOURCE LINES 67-79 - -.. code-block:: Python - - - fig, ax = plt.subplots() - - ax.plot(e, alphas, '.-', label=r'$\alpha$ $d^8L^{10}$') - ax.plot(e, betas, '.-', label=r'$\beta$ $d^9L^{9}$') - - ax.set_xlabel('Energy (eV)') - ax.set_ylabel('Population') - ax.set_title('NiO') - ax.legend() - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_5_charge_transfer_001.png - :alt: NiO - :srcset: /auto_examples/images/sphx_glr_example_5_charge_transfer_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 80-82 - -One can see that the mixing between impurity and bath states has disappered -because we have turned off the hybridization. The energy required to - -.. GENERATED FROM PYTHON SOURCE LINES 82-88 - -.. code-block:: Python - - - GS_energy = min(e[np.isclose(alphas, 1)]) - lowest_energy_to_transfer_electron = min(e[np.isclose(betas, 1)]) - E_to_ligand = lowest_energy_to_transfer_electron - GS_energy - print(f"Energy to lowest energy ligand state is {E_to_ligand:.3f} eV") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - Energy to lowest energy ligand state is 5.517 eV - - - - -.. GENERATED FROM PYTHON SOURCE LINES 89-91 - -where we have used :code:`np.isclose` to avoid errors from finite numerical -precision. - -.. GENERATED FROM PYTHON SOURCE LINES 93-98 - -Diagonalizing by blocks ------------------------------------------------------------------------------- -When working on a problem with a large basis, one can take advantage of the -lack of hybridization and separately diagonalize the impurity and bath -states - -.. GENERATED FROM PYTHON SOURCE LINES 98-116 - -.. code-block:: Python - - - energies = [] - - for n_ligand_holes in [0, 1]: - basis_d = edrixs.get_fock_bin_by_N(10, nd + n_ligand_holes) - Hd = (edrixs.build_opers(2, emat_chb[:10, :10], basis_d) - + edrixs.build_opers(4, umat[:10, :10, :10, :10], basis_d)) - ed = scipy.linalg.eigh(Hd, eigvals_only=True, subset_by_index=[0, 0])[0] - - basis_L = edrixs.get_fock_bin_by_N(10, 10 - n_ligand_holes) - HL = (edrixs.build_opers(2, emat_chb[10:, 10:], basis_L) - + edrixs.build_opers(4, umat[10:, 10:, 10:, 10:], basis_L)) - eL = scipy.linalg.eigh(HL, eigvals_only=True, subset_by_index=[0, 0])[0] - - energies.append(ed + eL) - - print(f"Energy to lowest energy ligand state is {energies[1] - energies[0]:.3f} eV") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - Energy to lowest energy ligand state is 5.517 eV - - - - -.. GENERATED FROM PYTHON SOURCE LINES 117-118 - -which yields the same result. - -.. GENERATED FROM PYTHON SOURCE LINES 120-130 - -Energy splitting in ligand states ------------------------------------------------------------------------------- -The last thing to consider is that our definition of the charge transfer -energy refers to the atomic limit with all hopping terms switched off, whereas -the ligand states in the model are already split by the oxygen-oxygen hopping -term :math:`T_{pp}` as illustrated below. So the final charge transer energy -needs to account for this. - - .. image:: /_static/energy_level.png - - -.. GENERATED FROM PYTHON SOURCE LINES 130-135 - -.. code-block:: Python - - - T_pp = 1 - print(f"Charge transfer is {energies[1] - energies[0] + T_pp:.3f} eV") - - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - Charge transfer is 6.517 eV - - - - -.. GENERATED FROM PYTHON SOURCE LINES 136-140 - -.. rubric:: Footnotes - -.. [1] J. Zaanen, G. A. Sawatzky, and J. W. Allen, - `Phys. Rev. Lett. 55, 418 (1985) `_. - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 0.478 seconds) - - -.. _sphx_glr_download_auto_examples_example_5_charge_transfer.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_5_charge_transfer.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_5_charge_transfer.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_5_charge_transfer.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_5_transitions.rst.txt b/edrixs/_sources/auto_examples/example_5_transitions.rst.txt deleted file mode 100644 index d50e104e09..0000000000 --- a/edrixs/_sources/auto_examples/example_5_transitions.rst.txt +++ /dev/null @@ -1,359 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_5_transitions.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_5_transitions.py: - - -X-ray transitions -================================================================================ -This example explains how to calculate x-ray transition amplitudes between -specific orbital and spin states. We take the case of a cuprate which has one -hole in the :math:`d_{x^2-y^2}` orbital and a spin ordering direction along the -in-plane diagaonal direction and compute the angular dependence of spin-flip -and non-spin-flip processes. - -This case was chosen because the eigenvectors in question are simple enough -for us to write them out more-or-less by hand, so this example helps the reader -to understand what happens under the hood in more complex cases. - -Some of the code here is credited to Yao Shen who used this approach for the -analysis of a low valence nickelate material [1]_. The task performed repeats -analysis done by many researchers e.g. Luuk Ament et al [2]_ as well as -several other groups. - -.. GENERATED FROM PYTHON SOURCE LINES 20-25 - -.. code-block:: Python - - import edrixs - import numpy as np - import matplotlib.pyplot as plt - import scipy - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 26-42 - -Eigenvectors ------------------------------------------------------------------------------- -Let us start by determining the eigenvectors involved in the transitions. -The spin direction can be set using a vector -:math:`\vec{B}` to represent a magnetic field in terms of generalized spin -operator :math:`\tilde{\sigma}=\vec{B}\cdot\sigma` based on the Pauli matrices -:math:`\sigma`. Let's put the spin along the :math:`[1, 1, 0]` direction -and formuate the problem in the hole basis. -For one particle, we know that the Hamiltonian will be diagonal in the real -harmonic basis. -We can generate the required eigenvectors by making a diagonal -matrix, transforming it to the required -complex harmonic basis (as is standard for EDRIXS) and diagonalizing it. -As long as the crystal field splitting is much larger than the magnetic -field, the eigenvectors will be independent of the exact values of both -these parameters. - -.. GENERATED FROM PYTHON SOURCE LINES 42-56 - -.. code-block:: Python - - - B = 1e-3*np.array([1, 1, 0]) - cf_splitting = 1e3 - zeeman = sum(s*b for s, b in zip(edrixs.get_spin_momentum(2), B)) - dd_levels = np.array([energy for dd_level in cf_splitting*np.arange(5) - for energy in [dd_level]*2], dtype=complex) - emat_rhb = np.diag(dd_levels) - emat = edrixs.cb_op(emat_rhb, edrixs.tmat_r2c('d', ispin=True)) + zeeman - _, eigenvectors = np.linalg.eigh(emat) - - def get_eigenvector(orbital_index, spin_index): - return eigenvectors[:, 2*orbital_index + spin_index] - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 57-63 - -Let's examine the :math:`d_{x^2-y^2}` orbital first. Recall from the -:ref:`sphx_glr_auto_examples_example_1_crystal_field.py` -example that edrixs uses the standard orbital order of -:math:`d_{3z^2-r^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}`. So we want -:code:`orbital_index = 3` element. Using this, we can build spin-up and -down -eigenvectors. - -.. GENERATED FROM PYTHON SOURCE LINES 63-68 - -.. code-block:: Python - - orbital_index = 3 - - groundstate_vector = get_eigenvector(orbital_index, 0) - excitedstate_vector = get_eigenvector(orbital_index, 1) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 69-96 - -Transition operators and scattering matrix ------------------------------------------------------------------------------- -Here we are considering the :math:`L_3`-edge. This means -a :math:`2p_{3/2} \rightarrow 3d` -absoprtion transition and a :math:`2p_{3/2} \rightarrow 3d` -emission transition. We can read the relevant matrix from the edrixs database, -keeping in mind that there are in fact three operations for -:math:`x, y,` & :math:`z` directions. Note that edrixs provides operators -in electron notation. If we define :math:`D` as the transition operator in -electron language, :math:`D^\dagger` is the operator in the hole language -we are using for this example. -The angular dependence of a RIXS transition can be conveniently described -using the scattering matrix, which is a :math:`3\times3` element object that -specifies the transition amplitude for each incoming and outgoing x-ray -polarization. Correspondingly, we have - - .. math:: - \begin{equation} - \mathcal{F}=\sum_n\langle f|D|n\rangle\langle n|D^{\dagger}|g\rangle - \end{equation}. - -In matrix form this is - - .. math:: - \begin{equation} - \mathcal{F}(m,n)=\{f^{\dagger} \cdot D(m)\} \cdot \{D^{\dagger}(n) \cdot g\} - \end{equation}. - -.. GENERATED FROM PYTHON SOURCE LINES 96-107 - -.. code-block:: Python - - - D_Tmat = edrixs.get_trans_oper('dp32') - - def get_F(vector_i, vector_f): - F = np.zeros((3, 3), dtype=complex) - for i in range(3): - for j in range(3): - F[i, j] = np.dot(np.dot(np.conj(vector_f.T), D_Tmat[i]), - np.dot(np.conj(D_Tmat[j].T), vector_i)) - return F - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 108-111 - -Using this function, we can obtain non-spin-flip (NSF) and spin-flip (SF) -scattering matrices by choosing whether we return to the ground state or -whether we access the excited state with the spin flipped. - -.. GENERATED FROM PYTHON SOURCE LINES 111-114 - -.. code-block:: Python - - F_NSF = get_F(groundstate_vector, groundstate_vector) - F_SF = get_F(groundstate_vector, excitedstate_vector) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 115-122 - -Angular dependence ------------------------------------------------------------------------------- -Let's consider the common case of fixing the total scattering angle at -:code:`two_theta = 90` and choosing a series of incident angles :code:`thins`. -Since the detector does not resolve polarization, we need to add both outgoing -polarizations. It is then convenient to use function :func:`.dipole_polvec_rixs` -to obtain the incoming and outgoing polarization vectors. - -.. GENERATED FROM PYTHON SOURCE LINES 122-137 - -.. code-block:: Python - - thins = np.linspace(0, 90) - two_theta = 90 - phi = 0 - - - def get_I(thin, alpha, F): - intensity = 0 - for beta in [0, np.pi/2]: - thout = two_theta - thin - ei, ef = edrixs.dipole_polvec_rixs(thin*np.pi/180, thout*np.pi/180, - phi*np.pi/180, alpha, beta) - intensity += np.abs(np.dot(ef, np.dot(F, ei)))**2 - return intensity - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 138-143 - -Plot ------------------------------------------------------------------------------- -We now run through a few configurations specified in terms of incoming -polarization angle :math:`\alpha` (defined in radians w.r.t. the scattering -plane), :math:`F`, plotting label, and plotting color. - -.. GENERATED FROM PYTHON SOURCE LINES 143-159 - -.. code-block:: Python - - fig, ax = plt.subplots() - - config = [[0, F_NSF, r'$\pi$ NSF', 'C0'], - [np.pi/2, F_NSF, r'$\sigma$ NSF', 'C1'], - [0, F_SF, r'$\pi$ SF', 'C2'], - [np.pi/2, F_SF, r'$\sigma$ SF', 'C3']] - - for alpha, F, label, color in config: - Is = np.array([get_I(thin, alpha, F) for thin in thins]) - ax.plot(thins, Is, label=label, color=color) - - ax.legend() - ax.set_xlabel(r'Theta ($^\circ$)') - ax.set_ylabel('Relative intensity') - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_5_transitions_001.png - :alt: example 5 transitions - :srcset: /auto_examples/images/sphx_glr_example_5_transitions_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 160-164 - -Run through orbitals ------------------------------------------------------------------------------- -For completeness, let's look at transitions from :math:`x^2-y^2` to all other -orbitals. - -.. GENERATED FROM PYTHON SOURCE LINES 164-191 - -.. code-block:: Python - - fig, axs = plt.subplots(5, 1, figsize=(7, 7), - sharex=True, sharey=True) - - orbitals = ['$d_{3z^2-r^2}$', '$d_{xz}$', '$d_{yz}$', - '$d_{x^2-y^2}$', '$d_{xy}$'] - orbital_order = [4, 1, 2, 0, 3] - - plot_index = 0 - for ax, orbital_index in zip(axs, orbital_order): - for spin_index, spin_label in zip([0, 1], ['NSF', 'SF']): - excitedstate_vector = get_eigenvector(orbital_index, spin_index) - F = get_F(groundstate_vector, excitedstate_vector) - for alpha, pol_label in zip([0, np.pi/2], [r'$\pi$', r'$\sigma$']): - Is = np.array([get_I(thin, alpha, F) for thin in thins]) - ax.plot(thins, Is*10, label=f'{pol_label} {spin_label}', - color=f'C{plot_index%4}') - plot_index += 1 - ax.legend(title=orbitals[orbital_index], bbox_to_anchor=(1.1, 1), - loc="upper left", fontsize=8) - - - axs[-1].set_xlabel(r'$\theta$ ($^\circ$)') - axs[2].set_ylabel('Scattering intensity') - - fig.subplots_adjust(hspace=0, left=.3, right=.6) - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_5_transitions_002.png - :alt: example 5 transitions - :srcset: /auto_examples/images/sphx_glr_example_5_transitions_002.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 192-198 - -.. rubric:: Footnotes - -.. [1] Yao Shen et al., - `arXiv:2110.08937 (2022) `_. -.. [2] Luuk J. P. Ament et al., - `Phys. Rev. Lett. 103, 117003 (2009) `_ - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 0.559 seconds) - - -.. _sphx_glr_download_auto_examples_example_5_transitions.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_5_transitions.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_5_transitions.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_5_transitions.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_6_Coulomb.rst.txt b/edrixs/_sources/auto_examples/example_6_Coulomb.rst.txt deleted file mode 100644 index 0242ad43fb..0000000000 --- a/edrixs/_sources/auto_examples/example_6_Coulomb.rst.txt +++ /dev/null @@ -1,649 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_6_Coulomb.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - Click :ref:`here ` - to download the full example code - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_6_Coulomb.py: - - -Coulomb interactions -===================================== -In this example we provide more details on how Coulomb interactions are -implemented in multiplet calculations and EDRIXS in particular. We aim -to clarify the form of the matrices, how they are parametrized, -and how the breaking of spherical symmetry can switch on additional elements -that one might not anticipate. Our example is based on a :math:`d` atomic shell. - -.. GENERATED FROM PYTHON SOURCE LINES 13-50 - -Create matrix ------------------------------------------------------------------------------- -The Coulomb interaction between two particles can be written as - - .. math:: - \begin{equation} - \hat{H} = \frac{1}{2} - \int d\mathbf{r} \int d\mathbf{r}^\prime - \Sigma_{\sigma, \sigma^\prime} - |\hat{\psi}^\sigma(\mathbf{r})|^2 \frac{e^2}{R} - |\hat{\psi}^{\sigma^\prime}(\mathbf{r})|^2, - \end{equation} - -where :math:`\hat{\psi}^\sigma(\mathbf{r})` is the electron wavefunction, with -spin :math:`\sigma`, and :math:`R=|r-r^\prime|` is the electron separation. -Solving our problem in this form is difficult due to the need to symmeterize -the wavefunction to follow fermionic statistics. -Using second quantization, we can use operators to impose the required -particle exchange statistics and write the equation in terms of -a tensor :math:`U` - - .. math:: - \begin{equation} - \hat{H} = \sum_{\alpha,\beta,\gamma,\delta,\sigma,\sigma^\prime} - U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} - \hat{f}^{\dagger}_{\alpha\sigma} - \hat{f}^{\dagger}_{\beta\sigma^\prime} - \hat{f}_{t\sigma^\prime}\hat{f}_{\delta\sigma}, - \end{equation} - -where :math:`\alpha`, :math:`\beta`, :math:`\gamma`, :math:`\delta` are -orbital indices and :math:`\hat{f}^{\dagger}` -(:math:`\hat{f}`) are the creation (anihilation) operators. -For a :math:`d`-electron system, we have :math:`10` distinct spin-orbitals -(:math:`5` orbitals each with :math:`2` spins), which makes matrix the -:math:`10\times10\times10\times10` in total size. -In EDRIXS the matrix can be created as follows: - -.. GENERATED FROM PYTHON SOURCE LINES 50-58 - -.. code-block:: default - - import edrixs - import numpy as np - import scipy - import matplotlib.pyplot as plt - import itertools - - F0, F2, F4 = 6.94, 14.7, 4.41 - umat_chb = edrixs.get_umat_slater('d', F0, F2, F4) - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 59-61 - -We stored this under variable :code:`umat_chb` where "cbh" stands for -complex harmonic basis, which is the default basis in EDRIXS. - -.. GENERATED FROM PYTHON SOURCE LINES 63-92 - -Parameterizing interactions ------------------------------------------------------------------------------- -EDRIXS parameterizes the interactions in :math:`U` via Slater integral -parameters :math:`F^{k}`. These relate to integrals of various spherical -Harmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients, -and Wigner 3J symbols. Textbooks such as [1]_ can be used for further -reference. If you are interested in the details of how -EDRIXS does this (and you probably aren't) function :func:`.umat_slater`, -constructs the required matrix via Gaunt coeficents from -:func:`.get_gaunt`. Two alternative parameterizations are common. -The first are the Racah parameters, which are - - .. math:: - \begin{eqnarray} - A &=& F^0 - \frac{49}{441} F^4 \\ - B &=& \frac{1}{49}F^2 - \frac{5}{441}F^4 \\ - C &=& \frac{35}{441}F^4. - \end{eqnarray} - -or an alternative form for the Slater integrals - - .. math:: - \begin{eqnarray} - F_0 &=& F^0 \\ - F_2 &=& \frac{1}{49}F^2 \\ - F_4 &=& \frac{1}{441}F^4, - \end{eqnarray} - -which involves different normalization parameters. - -.. GENERATED FROM PYTHON SOURCE LINES 94-101 - -Basis transform ------------------------------------------------------------------------------- -If we want to use the real harmonic basis, we can use a tensor -transformation, which imposes the following orbital order -:math:`3z^2-r^2, xz, yz, x^2-y^2, xy`, each of which involves -:math:`\uparrow, \downarrow` spin pairs. Let's perform this transformation and -store a list of these orbitals. - -.. GENERATED FROM PYTHON SOURCE LINES 101-104 - -.. code-block:: default - - umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True)) - orbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy'] - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 105-158 - -Interactions ------------------------------------------------------------------------------- -Tensor :math:`U` is a series of matrix -elements - - .. math:: - \begin{equation} - \langle\psi_{\gamma,\delta}^{\bar{\sigma},\bar{\sigma}^\prime} - |\hat{H}| - \psi_{\alpha,\beta}^{\sigma,\sigma^\prime}\rangle - \end{equation} - -the combination of which defines the energetic cost of pairwise -electron-electron interactions between states :math:`\alpha,\sigma` -and :math:`\beta,\sigma^\prime`. In EDRIXS we follow the convention of -summing over all orbital pairs. Some other texts count each pair of -indices only once. The matrix elements here will consequently -be half the magnitude of those in other references. -We can express the interactions in terms of -the orbitals involved. It is common to distinguish "direct Coulomb" and -"exchange" interactions. The former come from electrons in the same orbital -and the later involve swapping orbital labels for electrons. We will use -:math:`U_0` and :math:`J` as a shorthand for distinguishing these. - -Before we describe the different types of interactions, we note that since -the Coulomb interaction is real, and due to the spin symmmetry properties -of the process :math:`U` always obeys - - .. math:: - \begin{equation} - U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} = - U_{\beta\sigma,\alpha\sigma^\prime,\delta\sigma^\prime,\gamma\sigma} = - U_{\delta\sigma,\gamma\sigma^\prime,\beta\sigma^\prime,\alpha\sigma} = - U_{\gamma\sigma,\delta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}. - \end{equation} - - -1. Intra orbital -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The direct Coulomb energy cost to double-occupy an orbital comes from terms -like :math:`U_{\alpha\sigma,\alpha\bar\sigma,\alpha\bar\sigma,\alpha\sigma}`. -In this notation, we use :math:`\sigma^\prime` to denote that the matrix -element is summed over all pairs and :math:`\bar{\sigma}` to denote sums -over all opposite spin pairs. Due to rotational symmetry, all these -elements are the same and equal to - - .. math:: - \begin{eqnarray} - U_0 &=& \frac{A}{2} + 2B + \frac{3C}{2}\\ - &=& \frac{F_0}{2} + 2F_2 + 18F_4 - \end{eqnarray} - -Let's print these to demonstrate where these live in the array - -.. GENERATED FROM PYTHON SOURCE LINES 158-162 - -.. code-block:: default - - for i in range(0, 5): - val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - Out: - - .. code-block:: none - - 3z^2-r^2 4.250 - xz 4.250 - yz 4.250 - x^2-y^2 4.250 - xy 4.250 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 163-170 - -2. Inter orbital Coulomb interactions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Direct Coulomb repulsion between different orbitals depends on terms like -:math:`U_{\alpha\sigma,\beta\sigma^\prime,\beta\sigma^\prime,\alpha\sigma}`. -Expresions for these parameters are provided in column :math:`U` in -:ref:`table_2_orbital`. We can print the values from :code:`umat` -like this: - -.. GENERATED FROM PYTHON SOURCE LINES 170-174 - -.. code-block:: default - - for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - Out: - - .. code-block:: none - - 3z^2-r^2 xz 3.650 - 3z^2-r^2 yz 3.650 - 3z^2-r^2 x^2-y^2 2.900 - 3z^2-r^2 xy 2.900 - xz yz 3.150 - xz x^2-y^2 3.150 - xz xy 3.150 - yz x^2-y^2 3.150 - yz xy 3.150 - x^2-y^2 xy 3.900 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 175-181 - -3. Inter-orbital exchange interactions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Exchange terms exist with the form -:math:`U_{\alpha\sigma,\beta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}`. -Expresions for these parameters are provided in column :math:`J` of -:ref:`table_2_orbital`. These come from terms like this in the matrix: - -.. GENERATED FROM PYTHON SOURCE LINES 181-185 - -.. code-block:: default - - for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - Out: - - .. code-block:: none - - 3z^2-r^2 xz 0.300 - 3z^2-r^2 yz 0.300 - 3z^2-r^2 x^2-y^2 0.675 - 3z^2-r^2 xy 0.675 - xz yz 0.550 - xz x^2-y^2 0.550 - xz xy 0.550 - yz x^2-y^2 0.550 - yz xy 0.550 - x^2-y^2 xy 0.175 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 186-193 - -4. Pair hopping term -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Terms that swap pairs of electrons exist as -:math:`(1-\delta_{\sigma\sigma'})U_{\alpha\sigma,\alpha\bar\sigma,\beta\bar\sigma,\beta\sigma}` -and depend on exchange interactions column :math:`J` from -:ref:`table_2_orbital` -and here in the matrix. - -.. GENERATED FROM PYTHON SOURCE LINES 193-197 - -.. code-block:: default - - for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - Out: - - .. code-block:: none - - 3z^2-r^2 xz 0.300 - 3z^2-r^2 yz 0.300 - 3z^2-r^2 x^2-y^2 0.675 - 3z^2-r^2 xy 0.675 - xz yz 0.550 - xz x^2-y^2 0.550 - xz xy 0.550 - yz x^2-y^2 0.550 - yz xy 0.550 - x^2-y^2 xy 0.175 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 198-215 - -5. Three orbital -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Another set of terms that one might not immediately anticipate involve three -orbitals like - - .. math:: - \begin{equation} - U_{\alpha\sigma, \gamma\sigma', \beta\sigma', \gamma\sigma} \\ - U_{\alpha\sigma, \gamma\sigma', \gamma\sigma', \beta\sigma} \\ - (1-\delta_{\sigma\sigma'}) - U_{\alpha\sigma, \beta\sigma', \gamma\sigma', \gamma\sigma} - \end{equation} - -for :math:`\alpha=3z^2-r^2, \beta=x^2-y^2, \gamma=xz/yz`. -These are needed to maintain the rotational symmetry of the interations. -See :ref:`table_3_orbital` for the expressions. We can print some of -these via: - -.. GENERATED FROM PYTHON SOURCE LINES 215-227 - -.. code-block:: default - - ijkl = [[0, 1, 3, 1], - [0, 2, 3, 2], - [1, 0, 3, 1], - [1, 1, 3, 0], - [2, 0, 3, 2], - [2, 2, 3, 0]] - - for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t" - f"{orbitals[k]:<8} \t {orbitals[l]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - Out: - - .. code-block:: none - - 3z^2-r^2 xz x^2-y^2 xz 0.217 - 3z^2-r^2 yz x^2-y^2 yz -0.217 - xz 3z^2-r^2 x^2-y^2 xz -0.433 - xz xz x^2-y^2 3z^2-r^2 0.217 - yz 3z^2-r^2 x^2-y^2 yz 0.433 - yz yz x^2-y^2 3z^2-r^2 -0.217 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 228-233 - -6. Four orbital -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Futher multi-orbital terms include -:math:`U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma}`. -We can find these here in the matrix: - -.. GENERATED FROM PYTHON SOURCE LINES 233-249 - -.. code-block:: default - - ijkl = [[0, 1, 2, 4], - [0, 1, 4, 2], - [0, 2, 1, 4], - [0, 2, 4, 1], - [0, 4, 1, 2], - [0, 4, 2, 1], - [3, 1, 4, 2], - [3, 2, 4, 1], - [3, 4, 1, 2], - [3, 4, 2, 1]] - - for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {orbitals[k]:<8}" - f"\t {orbitals[l]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - Out: - - .. code-block:: none - - 3z^2-r^2 xz yz xy -0.433 - 3z^2-r^2 xz xy yz 0.217 - 3z^2-r^2 yz xz xy -0.433 - 3z^2-r^2 yz xy xz 0.217 - 3z^2-r^2 xy xz yz 0.217 - 3z^2-r^2 xy yz xz 0.217 - x^2-y^2 xz xy yz -0.375 - x^2-y^2 yz xy xz 0.375 - x^2-y^2 xy xz yz -0.375 - x^2-y^2 xy yz xz 0.375 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 250-256 - -Effects of multi-orbital terms ------------------------------------------------------------------------------- -To test the effects of the multi-orbital terms, let's plot the eigenenergy -spectra with and without multi-orbital terms switched on for system with and -without a cubic crystal field. We will use a :math:`d`-shell with two -electrons. - -.. GENERATED FROM PYTHON SOURCE LINES 256-292 - -.. code-block:: default - - ten_dqs = [0, 2, 4, 12] - - def diagonalize(ten_dq, umat): - emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq), - edrixs.tmat_c2r('d', ispin=True)) - H = (edrixs.build_opers(4, umat, basis) - + edrixs.build_opers(2, emat, basis)) - e, v = scipy.linalg.eigh(H) - return e - e.min() - - basis = edrixs.get_fock_bin_by_N(10, 2) - umat_no_multiorbital = np.copy(umat) - B = F2/49 - 5*F4/441 - for val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]: - umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0 - - fig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3)) - - for cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)): - ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1, - label='on', color=f'C{cind}') - ax.hlines(diagonalize(ten_dq, umat_no_multiorbital), - xmin=1.5, xmax=2.5, - label='off', - linestyle=':', color=f'C{cind}') - ax.set_title(f"$10D_q={ten_dq}$") - ax.set_ylim([-.5, 20]) - ax.set_xticks([]) - ax.legend() - - fig.suptitle("Eigenvalues with 3&4-orbital effects on/off") - fig.subplots_adjust(wspace=.3) - axs[0].set_ylabel('Eigenvalues (eV)') - fig.subplots_adjust(top=.8) - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_6_Coulomb_001.png - :alt: Eigenvalues with 3&4-orbital effects on/off, $10D_q=0$, $10D_q=2$, $10D_q=4$, $10D_q=12$ - :srcset: /auto_examples/images/sphx_glr_example_6_Coulomb_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 293-382 - -On the left of the plot Coulomb interactions in spherical symmetry cause -substantial mxing between :math:`t_{2g}` and :math:`e_{g}` orbitals in the -eigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the -the right eigenenergies. As :math:`10D_q` get large, this mixing is switched -off and the spectra start to become independent of whether the 3 & 4 orbital -orbital terms are included or not. - - - -.. _table_2_orbital: -.. table:: Table of 2 orbital interactions - - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |Orbitals :math:`\alpha,\beta`|:math:`U_0` Racah | :math:`U_0` Slater |:math:`J` Racah |:math:`J` Slater | - +=============================+==================+=======================+================+====================+ - |:math:`3z^2-r^2, xz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`3z^2-r^2, yz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`3z^2-r^2, x^2-y^2` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`3z^2-r^2, xy` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`xz, yz` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`xz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`xz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`yz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`yz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`x^2-y^2, xy` |:math:`A/2+2B+C/2`|:math:`F_0+4F_2-34F_4` | :math:`C/2` |:math:`35F_4/2` | - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - - -.. _table_3_orbital: -.. table:: Table of 3 orbital interactions - - +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ - |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| - +=============================+=============+====================================================+=====================================================+ - |:math:`3z^2-r^2, xz, x^2-y^2, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, yz, x^2-y^2, yz` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`xz, 3z^2-r^2, x^2-y^2, xz` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`xz, xz, x^2-y^2, 3z^2-r^2` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`yz, 3z^2-r^2, x^2-y^2, yz` | :math:`\sqrt{3}B` | :math:`\sqrt{3}F_2-5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`yz, yz, x^2-y^2, 3z^2-r^2` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - - -.. _table_4_orbital: -.. table:: Table of 4 orbital interactions - - +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ - |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| - +=============================+=============+====================================================+=====================================================+ - |:math:`3z^2-r^2, xz, yz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, xz, xy, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, yz, xz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, yz, xy, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, xy, xz, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, xy, yz, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , xz, xy, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , yz, xy, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , xy, xz, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , xy, yz, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - - -.. rubric:: Footnotes - -.. [1] MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of - Transition-Metal Ions in Crystals. Academic Press, New York and London. - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** ( 0 minutes 0.694 seconds) - - -.. _sphx_glr_download_auto_examples_example_6_Coulomb.py: - - -.. only :: html - - .. container:: sphx-glr-footer - :class: sphx-glr-footer-example - - - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_6_Coulomb.py ` - - - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_6_Coulomb.ipynb ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_6_Hubbard_dimer.rst.txt b/edrixs/_sources/auto_examples/example_6_Hubbard_dimer.rst.txt deleted file mode 100644 index e39b68637f..0000000000 --- a/edrixs/_sources/auto_examples/example_6_Hubbard_dimer.rst.txt +++ /dev/null @@ -1,363 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_6_Hubbard_dimer.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_6_Hubbard_dimer.py: - - -Hubbard Dimer -===================================== -This exercise will demonstrate how to handle hopping and multi-site problems within -edrixs using the example of a Hubbard dimer. We want to solve the equation - - .. math:: - \begin{equation} - \hat{H} = \sum_{i,j} \sum_{\sigma} t_{i,j} \hat{f}^{\dagger}_{i,\sigma} \hat{f}_{j, \sigma} - + U \sum_{i} \hat{n}_{i,\uparrow}\hat{n}_{i,\downarrow}, - \end{equation} - -which involves two sites labeled with indices :math:`i` or :math:`j` with two -electrons of spin :math:`\sigma\in{\uparrow,\downarrow}`. :math:`t_{i,j}` -is the hopping between sites, :math:`\hat{f}^{\dagger}_{i,\sigma}` is the -creation operators, and -:math:`\hat{n}^{\dagger}_{i,\sigma}=\hat{f}^{\dagger}_{i,\sigma}\hat{f}_{i,\sigma}` -is the number operator. The main task is to represent this Hamiltonian and -the related spin operator using the EDRIXS two-fermion and four-fermion form -where :math:`\alpha,\beta,\delta,\gamma` are the indices of the single -particle basis. - - .. math:: - \begin{equation} - \hat{H} = \sum_{\alpha,\beta} t_{\alpha,\beta} \hat{f}^{\dagger}_{\alpha} \hat{f}_{\beta} - + \sum_{\alpha,\beta,\gamma,\delta} U_{\alpha,\beta,\gamma,\delta} - \hat{f}^{\dagger}_{\alpha}\hat{f}^{\dagger}_{\beta}\hat{f}_{\gamma}\hat{f}_{\delta}. - \end{equation} - -.. GENERATED FROM PYTHON SOURCE LINES 34-39 - -Initialize matrices ------------------------------------------------------------------------------- -We start by noting that each of the two sites is like an :math:`l=0` -:math:`s`-orbital with two spin-orbitals each. We will include -two electron occupation and build the Fock basis. - -.. GENERATED FROM PYTHON SOURCE LINES 39-52 - -.. code-block:: Python - - import numpy as np - import matplotlib.pyplot as plt - import scipy - import edrixs - np.set_printoptions(precision=4) - - - ll = 0 - case = 's' - norb = 4 - noccu = 2 - basis = edrixs.get_fock_bin_by_N(norb, noccu) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 53-69 - -Create function to populate and diagonalize matrices ------------------------------------------------------------------------------- -The Coulomb and hopping matrices :code:`umat` and :code:`emat` will be -represented by :math:`4\times4\times4\times4` and :math:`4\times4` matrices, -respectively. Note that we needed to specify -that these are, in general, complex, although -they happen to contain only real numbers in this case. We follow the convention -that these are ordered first by site and then by spin: -:math:`|0\uparrow>, |0\downarrow>, |1\uparrow>, |1\downarrow>`. -Consequently the :math:`2\times2` and :math:`2\times2\times2\times2` block -diagonal structures of the matrices will contain the on-site interactions. -The converse is true for the hopping between the sites. -From here let us generate a function to build and diagonalize the Hamiltonian. -We need to generate the Coulomb matrix for the on-site interactions and -apply it to the block diagonal. The hopping connects off-site indices with -the same spin. - -.. GENERATED FROM PYTHON SOURCE LINES 69-86 - -.. code-block:: Python - - def diagonalize(U, t, extra_emat=None): - """Diagonalize 2 site Hubbard Hamiltonian""" - umat = np.zeros((norb, norb, norb, norb), dtype=np.complex128) - emat = np.zeros((norb, norb), dtype=np.complex128) - U_mat_1site = edrixs.get_umat_slater('s', U) - umat[:2, :2, :2, :2,] = umat[2:, 2:, 2:, 2:] = U_mat_1site - emat[2, 0] = emat[3, 1] = emat[0, 2] = emat[1, 3] = t - - if extra_emat is not None: - emat = emat + extra_emat - - H = (edrixs.build_opers(2, emat, basis) - + edrixs.build_opers(4, umat, basis)) - - e, v = scipy.linalg.eigh(H) - return e, v - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 87-90 - -The large :math:`U` limit ------------------------------------------------------------------------------- -Let us see what happens with :math:`U \gg t`. - -.. GENERATED FROM PYTHON SOURCE LINES 90-94 - -.. code-block:: Python - - e, v = diagonalize(1000, 1) - print("Energies are") - print(e) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - Energies are - [ -0.004 0. 0. 0. 1000. 1000.004] - - - - -.. GENERATED FROM PYTHON SOURCE LINES 95-98 - -To analyze what is going on we can determine the spin expectation values -of the cluster. Building the operators follows the same form as the -Hamiltonian and the previous example. - -.. GENERATED FROM PYTHON SOURCE LINES 98-106 - -.. code-block:: Python - - spin_mom_one_site = edrixs.get_spin_momentum(ll) - spin_mom = np.zeros((3, norb, norb), dtype=np.complex128) - spin_mom[:, :2, :2] = spin_mom[:, 2:, 2:] = spin_mom_one_site - - opS = edrixs.build_opers(2, spin_mom, basis) - opS_squared = (np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) - + np.dot(opS[2], opS[2])) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 107-110 - -This time let us include a tiny magnetic field along the :math:`z`-axis, so -that we have a well-defined measurement axis and print out the expectation -values. - -.. GENERATED FROM PYTHON SOURCE LINES 110-122 - -.. code-block:: Python - - zeeman = np.zeros((norb, norb), dtype=np.complex128) - zeeman[:2, :2] = zeeman[2:, 2:] = 1e-8*spin_mom_one_site[2] - e, v = diagonalize(1000, 1, extra_emat=zeeman) - - Ssq_exp = edrixs.cb_op(opS_squared, v).diagonal().real - Sz_exp = edrixs.cb_op(opS[2], v).diagonal().real - - header = "{:<10s}\t{:<6s}\t{:<6s}" - print(header.format("E", "S(S+1)", "")) - for i in range(len(e)): - print("{:<2f}\t{:.1f}\t{:.1f}".format(e[i], Ssq_exp[i], Sz_exp[i])) - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - E S(S+1) - -0.004000 0.0 0.0 - -0.000000 2.0 -1.0 - -0.000000 2.0 0.0 - 0.000000 2.0 1.0 - 1000.000000 0.0 0.0 - 1000.004000 0.0 0.0 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 123-127 - -For :math:`U \gg t` the two states with double occupancy acquire an energy of -approximately :math:`U`. The low energy states are a :math:`S=0` singlet and -and :math:`S=1` triplet, which are split by :math:`4t^2/U`, which is the -magnetic exchange term. - -.. GENERATED FROM PYTHON SOURCE LINES 129-132 - -:math:`U` dependence ------------------------------------------------------------------------------- -Let us plot the changes in energy with :math:`U`. - -.. GENERATED FROM PYTHON SOURCE LINES 132-143 - -.. code-block:: Python - - plt.figure() - - t = 1 - Us = np.linspace(0.01, 10, 50) - Es = np.array([diagonalize(U, t, extra_emat=zeeman)[0] for U in Us]) - - plt.plot(Us/t, Es/t) - plt.xlabel('U/t') - plt.ylabel('Eigenstate energies/t') - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_6_Hubbard_dimer_001.png - :alt: example 6 Hubbard dimer - :srcset: /auto_examples/images/sphx_glr_example_6_Hubbard_dimer_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 144-146 - -To help interpret this, we can represent the eigenvectors in terms of a sum -of the single particle states. - -.. GENERATED FROM PYTHON SOURCE LINES 146-164 - -.. code-block:: Python - - - def get_single_particle_repesentations(v): - reps = [] - for i in range(6): - rep = sum([vec*weight for weight, vec - in zip(v[:, i], np.array(basis))]) - reps.append(rep) - - return np.array(reps) - - t = 1 - for U in [10000, 0.0001]: - e, v = diagonalize(U, t, extra_emat=zeeman) - repesentations = get_single_particle_repesentations(v) - print("For U={} t={} states are".format(U, t)) - print(repesentations.round(3).real) - print("\n") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - For U=10000 t=1 states are - [[-0.707 0.707 0.707 -0.707] - [ 0. 1. 0. 1. ] - [ 0.707 0.707 0.707 0.707] - [-1. 0. -1. 0. ] - [-0.707 -0.707 0.707 0.707] - [ 0.707 0.707 0.707 0.707]] - - - For U=0.0001 t=1 states are - [[-0. 1. 1. -0. ] - [ 0. 1. 0. 1. ] - [ 0.707 0.707 0.707 0.707] - [-1. 0. -1. 0. ] - [-0.707 -0.707 0.707 0.707] - [-1. -0. -0. -1. ]] - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 165-170 - -For :math:`U \gg t` the ground state maximizes its magnetic exchange -energy saving. In the :math:`U \ll t` condition the ground state maximizes -its kinetic energy saving. Since both states share the same parity, the -cross-over between them is smooth. This type of physics is at play in current -research on quantum materials [1]_ [2]_. - -.. GENERATED FROM PYTHON SOURCE LINES 172-176 - -.. rubric:: Footnotes - -.. [1] Y. Wang et al., `Phys. Rev. Lett. 122, 106401 (2019) `_. -.. [2] A. Revelli et al., `Science Advances 5, eaav4020 (2019) `_. - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 0.095 seconds) - - -.. _sphx_glr_download_auto_examples_example_6_Hubbard_dimer.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_6_Hubbard_dimer.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_6_Hubbard_dimer.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_6_Hubbard_dimer.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_7_Coulomb.rst.txt b/edrixs/_sources/auto_examples/example_7_Coulomb.rst.txt deleted file mode 100644 index 3b800cd926..0000000000 --- a/edrixs/_sources/auto_examples/example_7_Coulomb.rst.txt +++ /dev/null @@ -1,632 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_7_Coulomb.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - Click :ref:`here ` - to download the full example code - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_7_Coulomb.py: - - -Coulomb interactions -===================================== -In this example we provide more details on how Coulomb interactions are -implemented in multiplet calculations and EDRIXS in particular. We aim -to clarify the form of the matrices, how they are parametrized, -and how the breaking of spherical symmetry can switch on additional elements -that one might not anticipate. Our example is based on a :math:`d` atomic shell. - -.. GENERATED FROM PYTHON SOURCE LINES 13-50 - -Create matrix ------------------------------------------------------------------------------- -The Coulomb interaction between two particles can be written as - - .. math:: - \begin{equation} - \hat{H} = \frac{1}{2} - \int d\mathbf{r} \int d\mathbf{r}^\prime - \Sigma_{\sigma, \sigma^\prime} - |\hat{\psi}^\sigma(\mathbf{r})|^2 \frac{e^2}{R} - |\hat{\psi}^{\sigma^\prime}(\mathbf{r})|^2, - \end{equation} - -where :math:`\hat{\psi}^\sigma(\mathbf{r})` is the electron wavefunction, with -spin :math:`\sigma`, and :math:`R=|r-r^\prime|` is the electron separation. -Solving our problem in this form is difficult due to the need to symmeterize -the wavefunction to follow fermionic statistics. -Using second quantization, we can use operators to impose the required -particle exchange statistics and write the equation in terms of -a tensor :math:`U` - - .. math:: - \begin{equation} - \hat{H} = \sum_{\alpha,\beta,\gamma,\delta,\sigma,\sigma^\prime} - U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} - \hat{f}^{\dagger}_{\alpha\sigma} - \hat{f}^{\dagger}_{\beta\sigma^\prime} - \hat{f}_{t\sigma^\prime}\hat{f}_{\delta\sigma}, - \end{equation} - -where :math:`\alpha`, :math:`\beta`, :math:`\gamma`, :math:`\delta` are -orbital indices and :math:`\hat{f}^{\dagger}` -(:math:`\hat{f}`) are the creation (anihilation) operators. -For a :math:`d`-electron system, we have :math:`10` distinct spin-orbitals -(:math:`5` orbitals each with :math:`2` spins), which makes matrix the -:math:`10\times10\times10\times10` in total size. -In EDRIXS the matrix can be created as follows: - -.. GENERATED FROM PYTHON SOURCE LINES 50-58 - -.. code-block:: default - - import edrixs - import numpy as np - import scipy - import matplotlib.pyplot as plt - import itertools - - F0, F2, F4 = 6.94, 14.7, 4.41 - umat_chb = edrixs.get_umat_slater('d', F0, F2, F4) - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 59-61 - -We stored this under variable :code:`umat_chb` where "cbh" stands for -complex harmonic basis, which is the default basis in EDRIXS. - -.. GENERATED FROM PYTHON SOURCE LINES 63-92 - -Parameterizing interactions ------------------------------------------------------------------------------- -EDRIXS parameterizes the interactions in :math:`U` via Slater integral -parameters :math:`F^{k}`. These relate to integrals of various spherical -Harmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients, -and Wigner 3J symbols. Textbooks such as [1]_ can be used for further -reference. If you are interested in the details of how -EDRIXS does this (and you probably aren't) function :func:`.umat_slater`, -constructs the required matrix via Gaunt coeficents from -:func:`.get_gaunt`. Two alternative parameterizations are common. -The first are the Racah parameters, which are - - .. math:: - \begin{eqnarray} - A &=& F^0 - \frac{49}{441} F^4 \\ - B &=& \frac{1}{49}F^2 - \frac{5}{441}F^4 \\ - C &=& \frac{35}{441}F^4. - \end{eqnarray} - -or an alternative form for the Slater integrals - - .. math:: - \begin{eqnarray} - F_0 &=& F^0 \\ - F_2 &=& \frac{1}{49}F^2 \\ - F_4 &=& \frac{1}{441}F^4, - \end{eqnarray} - -which involves different normalization parameters. - -.. GENERATED FROM PYTHON SOURCE LINES 94-101 - -Basis transform ------------------------------------------------------------------------------- -If we want to use the real harmonic basis, we can use a tensor -transformation, which imposes the following orbital order -:math:`3z^2-r^2, xz, yz, x^2-y^2, xy`, each of which involves -:math:`\uparrow, \downarrow` spin pairs. Let's perform this transformation and -store a list of these orbitals. - -.. GENERATED FROM PYTHON SOURCE LINES 101-104 - -.. code-block:: default - - umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True)) - orbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy'] - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 105-158 - -Interactions ------------------------------------------------------------------------------- -Tensor :math:`U` is a series of matrix -elements - - .. math:: - \begin{equation} - \langle\psi_{\gamma,\delta}^{\bar{\sigma},\bar{\sigma}^\prime} - |\hat{H}| - \psi_{\alpha,\beta}^{\sigma,\sigma^\prime}\rangle - \end{equation} - -the combination of which defines the energetic cost of pairwise -electron-electron interactions between states :math:`\alpha,\sigma` -and :math:`\beta,\sigma^\prime`. In EDRIXS we follow the convention of -summing over all orbital pairs. Some other texts count each pair of -indices only once. The matrix elements here will consequently -be half the magnitude of those in other references. -We can express the interactions in terms of -the orbitals involved. It is common to distinguish "direct Coulomb" and -"exchange" interactions. The former come from electrons in the same orbital -and the later involve swapping orbital labels for electrons. We will use -:math:`U_0` and :math:`J` as a shorthand for distinguishing these. - -Before we describe the different types of interactions, we note that since -the Coulomb interaction is real, and due to the spin symmmetry properties -of the process :math:`U` always obeys - - .. math:: - \begin{equation} - U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} = - U_{\beta\sigma,\alpha\sigma^\prime,\delta\sigma^\prime,\gamma\sigma} = - U_{\delta\sigma,\gamma\sigma^\prime,\beta\sigma^\prime,\alpha\sigma} = - U_{\gamma\sigma,\delta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}. - \end{equation} - - -1. Intra orbital -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The direct Coulomb energy cost to double-occupy an orbital comes from terms -like :math:`U_{\alpha\sigma,\alpha\bar\sigma,\alpha\bar\sigma,\alpha\sigma}`. -In this notation, we use :math:`\sigma^\prime` to denote that the matrix -element is summed over all pairs and :math:`\bar{\sigma}` to denote sums -over all opposite spin pairs. Due to rotational symmetry, all these -elements are the same and equal to - - .. math:: - \begin{eqnarray} - U_0 &=& \frac{A}{2} + 2B + \frac{3C}{2}\\ - &=& \frac{F_0}{2} + 2F_2 + 18F_4 - \end{eqnarray} - -Let's print these to demonstrate where these live in the array - -.. GENERATED FROM PYTHON SOURCE LINES 158-162 - -.. code-block:: default - - for i in range(0, 5): - val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 4.250 - xz 4.250 - yz 4.250 - x^2-y^2 4.250 - xy 4.250 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 163-170 - -2. Inter orbital Coulomb interactions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Direct Coulomb repulsion between different orbitals depends on terms like -:math:`U_{\alpha\sigma,\beta\sigma^\prime,\beta\sigma^\prime,\alpha\sigma}`. -Expresions for these parameters are provided in column :math:`U` in -:ref:`table_2_orbital`. We can print the values from :code:`umat` -like this: - -.. GENERATED FROM PYTHON SOURCE LINES 170-174 - -.. code-block:: default - - for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz 3.650 - 3z^2-r^2 yz 3.650 - 3z^2-r^2 x^2-y^2 2.900 - 3z^2-r^2 xy 2.900 - xz yz 3.150 - xz x^2-y^2 3.150 - xz xy 3.150 - yz x^2-y^2 3.150 - yz xy 3.150 - x^2-y^2 xy 3.900 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 175-181 - -3. Inter-orbital exchange interactions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Exchange terms exist with the form -:math:`U_{\alpha\sigma,\beta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}`. -Expresions for these parameters are provided in column :math:`J` of -:ref:`table_2_orbital`. These come from terms like this in the matrix: - -.. GENERATED FROM PYTHON SOURCE LINES 181-185 - -.. code-block:: default - - for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz 0.300 - 3z^2-r^2 yz 0.300 - 3z^2-r^2 x^2-y^2 0.675 - 3z^2-r^2 xy 0.675 - xz yz 0.550 - xz x^2-y^2 0.550 - xz xy 0.550 - yz x^2-y^2 0.550 - yz xy 0.550 - x^2-y^2 xy 0.175 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 186-193 - -4. Pair hopping term -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Terms that swap pairs of electrons exist as -:math:`(1-\delta_{\sigma\sigma'})U_{\alpha\sigma,\alpha\bar\sigma,\beta\bar\sigma,\beta\sigma}` -and depend on exchange interactions column :math:`J` from -:ref:`table_2_orbital` -and here in the matrix. - -.. GENERATED FROM PYTHON SOURCE LINES 193-197 - -.. code-block:: default - - for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz 0.300 - 3z^2-r^2 yz 0.300 - 3z^2-r^2 x^2-y^2 0.675 - 3z^2-r^2 xy 0.675 - xz yz 0.550 - xz x^2-y^2 0.550 - xz xy 0.550 - yz x^2-y^2 0.550 - yz xy 0.550 - x^2-y^2 xy 0.175 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 198-215 - -5. Three orbital -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Another set of terms that one might not immediately anticipate involve three -orbitals like - - .. math:: - \begin{equation} - U_{\alpha\sigma, \gamma\sigma', \beta\sigma', \gamma\sigma} \\ - U_{\alpha\sigma, \gamma\sigma', \gamma\sigma', \beta\sigma} \\ - (1-\delta_{\sigma\sigma'}) - U_{\alpha\sigma, \beta\sigma', \gamma\sigma', \gamma\sigma} - \end{equation} - -for :math:`\alpha=3z^2-r^2, \beta=x^2-y^2, \gamma=xz/yz`. -These are needed to maintain the rotational symmetry of the interations. -See :ref:`table_3_orbital` for the expressions. We can print some of -these via: - -.. GENERATED FROM PYTHON SOURCE LINES 215-227 - -.. code-block:: default - - ijkl = [[0, 1, 3, 1], - [0, 2, 3, 2], - [1, 0, 3, 1], - [1, 1, 3, 0], - [2, 0, 3, 2], - [2, 2, 3, 0]] - - for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t" - f"{orbitals[k]:<8} \t {orbitals[l]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz x^2-y^2 xz 0.217 - 3z^2-r^2 yz x^2-y^2 yz -0.217 - xz 3z^2-r^2 x^2-y^2 xz -0.433 - xz xz x^2-y^2 3z^2-r^2 0.217 - yz 3z^2-r^2 x^2-y^2 yz 0.433 - yz yz x^2-y^2 3z^2-r^2 -0.217 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 228-233 - -6. Four orbital -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Futher multi-orbital terms include -:math:`U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma}`. -We can find these here in the matrix: - -.. GENERATED FROM PYTHON SOURCE LINES 233-249 - -.. code-block:: default - - ijkl = [[0, 1, 2, 4], - [0, 1, 4, 2], - [0, 2, 1, 4], - [0, 2, 4, 1], - [0, 4, 1, 2], - [0, 4, 2, 1], - [3, 1, 4, 2], - [3, 2, 4, 1], - [3, 4, 1, 2], - [3, 4, 2, 1]] - - for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {orbitals[k]:<8}" - f"\t {orbitals[l]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz yz xy -0.433 - 3z^2-r^2 xz xy yz 0.217 - 3z^2-r^2 yz xz xy -0.433 - 3z^2-r^2 yz xy xz 0.217 - 3z^2-r^2 xy xz yz 0.217 - 3z^2-r^2 xy yz xz 0.217 - x^2-y^2 xz xy yz -0.375 - x^2-y^2 yz xy xz 0.375 - x^2-y^2 xy xz yz -0.375 - x^2-y^2 xy yz xz 0.375 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 250-256 - -Effects of multi-orbital terms ------------------------------------------------------------------------------- -To test the effects of the multi-orbital terms, let's plot the eigenenergy -spectra with and without multi-orbital terms switched on for system with and -without a cubic crystal field. We will use a :math:`d`-shell with two -electrons. - -.. GENERATED FROM PYTHON SOURCE LINES 256-292 - -.. code-block:: default - - ten_dqs = [0, 2, 4, 12] - - def diagonalize(ten_dq, umat): - emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq), - edrixs.tmat_c2r('d', ispin=True)) - H = (edrixs.build_opers(4, umat, basis) - + edrixs.build_opers(2, emat, basis)) - e, v = scipy.linalg.eigh(H) - return e - e.min() - - basis = edrixs.get_fock_bin_by_N(10, 2) - umat_no_multiorbital = np.copy(umat) - B = F2/49 - 5*F4/441 - for val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]: - umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0 - - fig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3)) - - for cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)): - ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1, - label='on', color=f'C{cind}') - ax.hlines(diagonalize(ten_dq, umat_no_multiorbital), - xmin=1.5, xmax=2.5, - label='off', - linestyle=':', color=f'C{cind}') - ax.set_title(f"$10D_q={ten_dq}$") - ax.set_ylim([-.5, 20]) - ax.set_xticks([]) - ax.legend() - - fig.suptitle("Eigenvalues with 3&4-orbital effects on/off") - fig.subplots_adjust(wspace=.3) - axs[0].set_ylabel('Eigenvalues (eV)') - fig.subplots_adjust(top=.8) - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_7_Coulomb_001.png - :alt: Eigenvalues with 3&4-orbital effects on/off, $10D_q=0$, $10D_q=2$, $10D_q=4$, $10D_q=12$ - :srcset: /auto_examples/images/sphx_glr_example_7_Coulomb_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 293-382 - -On the left of the plot Coulomb interactions in spherical symmetry cause -substantial mxing between :math:`t_{2g}` and :math:`e_{g}` orbitals in the -eigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the -the right eigenenergies. As :math:`10D_q` get large, this mixing is switched -off and the spectra start to become independent of whether the 3 & 4 orbital -orbital terms are included or not. - - - -.. _table_2_orbital: -.. table:: Table of 2 orbital interactions - - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |Orbitals :math:`\alpha,\beta`|:math:`U_0` Racah | :math:`U_0` Slater |:math:`J` Racah |:math:`J` Slater | - +=============================+==================+=======================+================+====================+ - |:math:`3z^2-r^2, xz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`3z^2-r^2, yz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`3z^2-r^2, x^2-y^2` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`3z^2-r^2, xy` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`xz, yz` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`xz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`xz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`yz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`yz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`x^2-y^2, xy` |:math:`A/2+2B+C/2`|:math:`F_0+4F_2-34F_4` | :math:`C/2` |:math:`35F_4/2` | - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - - -.. _table_3_orbital: -.. table:: Table of 3 orbital interactions - - +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ - |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| - +=============================+=============+====================================================+=====================================================+ - |:math:`3z^2-r^2, xz, x^2-y^2, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, yz, x^2-y^2, yz` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`xz, 3z^2-r^2, x^2-y^2, xz` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`xz, xz, x^2-y^2, 3z^2-r^2` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`yz, 3z^2-r^2, x^2-y^2, yz` | :math:`\sqrt{3}B` | :math:`\sqrt{3}F_2-5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`yz, yz, x^2-y^2, 3z^2-r^2` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - - -.. _table_4_orbital: -.. table:: Table of 4 orbital interactions - - +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ - |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| - +=============================+=============+====================================================+=====================================================+ - |:math:`3z^2-r^2, xz, yz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, xz, xy, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, yz, xz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, yz, xy, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, xy, xz, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, xy, yz, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , xz, xy, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , yz, xy, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , xy, xz, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , xy, yz, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - - -.. rubric:: Footnotes - -.. [1] MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of - Transition-Metal Ions in Crystals. Academic Press, New York and London. - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** ( 0 minutes 0.579 seconds) - - -.. _sphx_glr_download_auto_examples_example_7_Coulomb.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_7_Coulomb.py ` - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_7_Coulomb.ipynb ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_7_Hunds_interactions.rst.txt b/edrixs/_sources/auto_examples/example_7_Hunds_interactions.rst.txt deleted file mode 100644 index f27f9b31a9..0000000000 --- a/edrixs/_sources/auto_examples/example_7_Hunds_interactions.rst.txt +++ /dev/null @@ -1,478 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_7_Hunds_interactions.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_7_Hunds_interactions.py: - - -Hund's Interactions in charge transfer insulators -================================================= -In this exercise we will solve a toy model relevant to cubic :math:`d^8` charge transfer insulators -such as NiO or NiPS\ :sub:`3`. We are interested in better understanding the interplay between the -Hund's interactions and the charge transfer energy in terms of the energy of the triplet-singlet -excitations of this model. These seem to act against each other in that the Hund's interactions -impose a energy cost for the triplet-singlet excitations whenever there are two holes on -the Ni :math:`d` orbitals. The charge transfer physics, on the other hand, will promote a -:math:`d^9\underline{L}` ground state in which the Hund's interactions are not active. - -The simplest model that captures this physics requires four Ni spin-orbitals, representing the Ni -:math:`e_g` manifold. We will represent the ligand states in the same way as the Anderson impurity -model in terms of one effective ligand spin-orbital per Ni spin-orbital. We assume these effective -orbitals have been constructed so that each Ni orbital only bonds to one sister orbital. For -simplicity, we will treat all Ni and all ligand orbitals as equivalent, even though a more -realistic model would account for the different Coulomb and hopping of the :math:`d_{3z^2-r^2}` -and :math:`d_{x^2-y^2}` orbitals. We therefore simply connect Ni and ligand orbitals via a constant -hopping :math:`t`. We also include the ligand energy parameter :math:`e_L`. - -The easiest way to implement the requried Coulomb interactions is to use the so-called Kanamori -Hamiltonian, which is a simplfied form for the interactions, which treats all orbitals as -equivalent. Daniel Khomskii's book provides a great explanation of this physics [1]_. We -parameterize the interactions via Coulomb repulsion parameter :math:`U` and Hund's exchange -:math:`J_H`. EDRIXS provides this functionality via the more general -:func:`.get_umat_kanamori` function. - -It's also easiest to consider this problem in hole langauge, which means our eight spin-orbitals -are populated by two fermions. - -.. GENERATED FROM PYTHON SOURCE LINES 34-38 - -Setup ------------------------------------------------------------------------------- -We start by loading the necessary modules, and defining the total number of -orbitals and electrons. - -.. GENERATED FROM PYTHON SOURCE LINES 38-46 - -.. code-block:: Python - - import edrixs - import scipy - import numpy as np - import matplotlib.pyplot as plt - - norb = 8 - noccu = 2 - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 47-55 - -Diagonalization ------------------------------------------------------------------------------- -Let's write a function to diagonalize our model in a similar way to -the :ref:`sphx_glr_auto_examples_example_6_Hubbard_dimer.py` example. -Within this function, we also create operators to count the number of -:math:`d` holes and operators to calculate expectation values for -:math:`S^2` and :math:`S_z`. For the latter to make sense, we also include a -small effective spin interaction along :math:`z`. - -.. GENERATED FROM PYTHON SOURCE LINES 55-103 - -.. code-block:: Python - - - - def diagonalize(U, JH, t, eL, n=1): - # Setup Coulomb matrix - umat = np.zeros((norb, norb, norb, norb), dtype=complex) - uNi = edrixs.get_umat_kanamori(norb//2, U, JH) - umat[:norb//2, :norb//2, :norb//2, :norb//2] = uNi - - # Setup hopping matrix - emat = np.zeros((norb, norb), dtype=complex) - ind = np.arange(norb//2) - emat[ind, ind + norb//2] = t - emat[ind+norb//2, ind] = np.conj(t) # conj is not needed, but is good practise. - ind = np.arange(norb//2, norb) - emat[ind, ind] += eL - - # Spin operator - spin_mom = np.zeros((3, norb, norb), dtype=complex) - spin_mom[:, :2, :2] = edrixs.get_spin_momentum(0) - spin_mom[:, 2:4, 2:4] = edrixs.get_spin_momentum(0) - spin_mom[:, 4:6, 4:6] = edrixs.get_spin_momentum(0) - spin_mom[:, 6:8, 6:8] = edrixs.get_spin_momentum(0) - - # add small effective field along z - emat += 1e-6*spin_mom[2] - - # Diagonalize - basis = edrixs.get_fock_bin_by_N(norb, noccu) - H = edrixs.build_opers(2, emat, basis) + edrixs.build_opers(4, umat, basis) - e, v = scipy.linalg.eigh(H) - e -= e[0] # Define ground state as zero energy - - # Operator for holes on Ni - basis = np.array(basis) - num_d_electrons = basis[:, :4].sum(1) - d0 = np.sum(np.abs(v[num_d_electrons == 0, :])**2, axis=0) - d1 = np.sum(np.abs(v[num_d_electrons == 1, :])**2, axis=0) - d2 = np.sum(np.abs(v[num_d_electrons == 2, :])**2, axis=0) - - # S^2 and Sz operators - opS = edrixs.build_opers(2, spin_mom, basis) - S_squared_op = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2]) - S_squared_exp = edrixs.cb_op(S_squared_op, v).diagonal().real - S_z_exp = edrixs.cb_op(opS[2], v).diagonal().real - - return e[:n], d0[:n], d1[:n], d2[:n], S_squared_exp[:n], S_z_exp[:n] - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 104-110 - -The atomic limit ------------------------------------------------------------------------------- -For simplicity, let's start in the atomic limit with :math:`e_L \gg t \gg U` -where all holes are on nickel. In this case, there are six ways to distribute -two holes on the four Ni spin-orbitals. Let's examine the expectation values -of the :math:`S^2` and :math:`S_z` operators. - -.. GENERATED FROM PYTHON SOURCE LINES 110-125 - -.. code-block:: Python - - U = 10 - JH = 2 - t = 100 - eL = 1e10 - - e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6) - - print("Ground state\nE\t") - for i in range(3): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - - print("\nExcited state\nE\t") - for i in range(3, 6): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - Ground state - E - 0.00 2.00 1.00 - 0.00 2.00 0.00 - 0.00 2.00 -1.00 - - Excited state - E - 4.00 0.00 0.00 - 4.00 0.00 0.00 - 8.00 0.00 0.00 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 126-132 - -The ground state is a high-spin triplet. The fourth and fifth -states (the first excited state) are low-spin singlet excitons at -:math:`2 J_H`. These have one hole on each orbital in the antisymmetric -combination of :math:`|\uparrow\downarrow>-|\downarrow\uparrow>`. -The state at :math:`3 J_H` also has one hole on each orbital in the symmetric -:math:`|\uparrow\downarrow>+|\downarrow\uparrow>` configuration. - -.. GENERATED FROM PYTHON SOURCE LINES 134-140 - -Where are the holes for large hopping ------------------------------------------------------------------------------- -As discussed at the start, we are interested to see interplay between Hund's -and charge-transfer physics, which will obviously depend strongly on whether -the holes are on Ni or the ligand. Let's see what happens as :math:`e_L` is -reduced while observing the location of the ground state and exciton holes. - -.. GENERATED FROM PYTHON SOURCE LINES 140-164 - -.. code-block:: Python - - U = 10 - JH = 2 - t = 100 - - eLs = np.linspace(0, 1000, 30) - - fig, axs = plt.subplots(1, 2, figsize=(8, 4)) - - for ax, ind in zip(axs.ravel(), [0, 3]): - ds = np.array([diagonalize(U, JH, t, eL, n=6) - for eL in eLs]) - - ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$') - ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$') - ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$') - ax.set_xlabel("Energy of ligands $e_L$") - ax.set_ylabel("Number of electrons") - ax.legend() - - axs[0].set_title("Location of ground state holes") - axs[1].set_title("Location of exciton holes") - - plt.tight_layout() - plt.show() - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_7_Hunds_interactions_001.png - :alt: Location of ground state holes, Location of exciton holes - :srcset: /auto_examples/images/sphx_glr_example_7_Hunds_interactions_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 165-171 - -For large :math:`e_L`, we see that both holes are on nickel as expected. In -the opposite limit of :math:`|e_L| \ll t` and :math:`U \ll t` the holes are -shared in the ratio 0.25:0.5:0.25 as there are two ways to have one hole on -Ni. In the limit of large :math:`e_L`, all holes move onto Ni. Since -:math:`t` is large, this applies equally to both the ground state and the -exciton. - -.. GENERATED FROM PYTHON SOURCE LINES 174-179 - -Connecton between atomic and charge transfer limits ------------------------------------------------------------------------------- -We now examine the quantum numbers during cross over between the two limits -with :math:`e_L`. Let's first look at the how :math:`` changes for the -ground state and exciton and then examine how the exciton energy changes. - -.. GENERATED FROM PYTHON SOURCE LINES 179-216 - -.. code-block:: Python - - - U = 10 - JH = 2 - t = 100 - - eLs = np.linspace(0, 1000, 30) - - info = np.array([diagonalize(U, JH, t, eL, n=6) - for eL in eLs]) - - fig, axs = plt.subplots(1, 2, figsize=(8, 4)) - - - axs[0].plot(eLs, info[:, 4, 0], label='Ground state') - axs[0].plot(eLs, info[:, 4, 3], label='Exciton') - axs[0].set_xlabel("Energy of ligands $e_L$") - axs[0].set_ylabel('$$') - axs[0].set_title('Quantum numbers') - axs[0].legend() - - axs[1].plot(eLs, info[:, 0, 3], '+', color='C0') - axs[1].set_xlabel("Energy of ligands $e_L$") - axs[1].set_ylabel('Exciton energy', color='C0') - axr = axs[1].twinx() - axr.plot(eLs, info[:, 3, 5], 'x', color='C1') - axr.set_ylabel('$d^2$ fraction', color='C1') - - for ax, color in zip([axs[1], axr], ['C0', 'C1']): - for tick in ax.get_yticklabels(): - tick.set_color(color) - - axs[1].set_ylim(0, 2*JH) - axr.set_ylim(0, 1) - - axs[1].set_title('Exciton energy vs. $d^2$ character') - plt.tight_layout() - plt.show() - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_7_Hunds_interactions_002.png - :alt: Quantum numbers, Exciton energy vs. $d^2$ character - :srcset: /auto_examples/images/sphx_glr_example_7_Hunds_interactions_002.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 217-229 - -In the left panel, we see that the two limits are adiabatically connected -as they preseve the same quantum numbers. This is because there is always -an appreciable double occupancy under conditions where the -:math:`d^9\underline{L}` character is maximized and this continues to favor -the high spin ground state. Other interactions such as strong tetragonal -crystal field would be needed to overcome the Hund's interactions and break -this paradigm. In the right panel, we see that the exciton energy simply -scales with the double occupancy. Overall, even though -Hund's interactions are irrelevant for the :math:`d^9\underline{L}` -electronic configuration, whenever :math:`t` is appreciable there is a -strong mixing with the :math:`d^8` component is always present, which -dominates the energy of the exciton. - -.. GENERATED FROM PYTHON SOURCE LINES 231-237 - -Charge transfer excitons ------------------------------------------------------------------------------- -Another limiting case of the model is where :math:`t` is smaller than the -Coulomb interactions. This, however, tends to produce -ground state and exciton configurations that correspond to those of distinct -atomic models. Let's look at the :math:`e_L` dependence in this case. - -.. GENERATED FROM PYTHON SOURCE LINES 237-265 - -.. code-block:: Python - - U = 10 - JH = 2 - t = .5 - eL = 7 - - eLs = np.linspace(0, 20, 30) - - fig, axs = plt.subplots(1, 2, figsize=(8, 4)) - - for ax, ind in zip(axs.ravel(), [0, 3]): - ds = np.array([diagonalize(U, JH, t, eL, n=6) - for eL in eLs]) - - ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$') - ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$') - ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$') - ax.set_xlabel("Energy of ligands $e_L$") - ax.set_ylabel("Number of electrons") - ax.legend() - - axs[0].axvline(x=eL, linestyle=':', color='k') - axs[1].axvline(x=eL, linestyle=':', color='k') - - axs[0].set_title("Location of ground state holes") - axs[1].set_title("Location of exciton holes") - - plt.tight_layout() - plt.show() - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_7_Hunds_interactions_003.png - :alt: Location of ground state holes, Location of exciton holes - :srcset: /auto_examples/images/sphx_glr_example_7_Hunds_interactions_003.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 266-270 - -Around :math:`e_L = 7` the plot shows that the excition is primairly a -:math:`d^2 \rightarrow d^1` transition or a -:math:`d^8 \rightarrow d^{9}\underline{L}` transition in electron language. -Let's examine the energy and quantum numbers. - -.. GENERATED FROM PYTHON SOURCE LINES 270-281 - -.. code-block:: Python - - - e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6) - - print("Ground state\nE\t") - for i in range(3): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - - print("\nExcited state\nE\t") - for i in range(3, 6): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - Ground state - E - 0.00 2.00 -1.00 - 0.00 2.00 -0.00 - 0.00 2.00 1.00 - - Excited state - E - 2.74 0.00 0.00 - 2.74 0.00 0.00 - 2.99 0.00 0.00 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 282-284 - -We once again see the same quantum numbers, despite the differences in mixing -in the ground state and exciton. - -.. GENERATED FROM PYTHON SOURCE LINES 287-290 - -.. rubric:: Footnotes - -.. [1] D. Khomskii, Transition Metal Compounds, Cambridge University Press (2014) - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 1.206 seconds) - - -.. _sphx_glr_download_auto_examples_example_7_Hunds_interactions.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_7_Hunds_interactions.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_7_Hunds_interactions.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_7_Hunds_interactions.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_7_transitions.rst.txt b/edrixs/_sources/auto_examples/example_7_transitions.rst.txt deleted file mode 100644 index c57976e1eb..0000000000 --- a/edrixs/_sources/auto_examples/example_7_transitions.rst.txt +++ /dev/null @@ -1,359 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_7_transitions.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_7_transitions.py: - - -X-ray transitions -================================================================================ -This example explains how to calculate x-ray transition amplitudes between -specific orbital and spin states. We take the case of a cuprate which has one -hole in the :math:`d_{x^2-y^2}` orbital and a spin ordering direction along the -in-plane diagaonal direction and compute the angular dependence of spin-flip -and non-spin-flip processes. - -This case was chosen because the eigenvectors in question are simple enough -for us to write them out more-or-less by hand, so this example helps the reader -to understand what happens under the hood in more complex cases. - -Some of the code here is credited to Yao Shen who used this approach for the -analysis of a low valence nickelate material [1]_. The task performed repeats -analysis done by many researchers e.g. Luuk Ament et al [2]_ as well as -several other groups. - -.. GENERATED FROM PYTHON SOURCE LINES 20-25 - -.. code-block:: Python - - import edrixs - import numpy as np - import matplotlib.pyplot as plt - import scipy - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 26-42 - -Eigenvectors ------------------------------------------------------------------------------- -Let us start by determining the eigenvectors involved in the transitions. -The spin direction can be set using a vector -:math:`\vec{B}` to represent a magnetic field in terms of generalized spin -operator :math:`\tilde{\sigma}=\vec{B}\cdot\sigma` based on the Pauli matrices -:math:`\sigma`. Let's put the spin along the :math:`[1, 1, 0]` direction -and formuate the problem in the hole basis. -For one particle, we know that the Hamiltonian will be diagonal in the real -harmonic basis. -We can generate the required eigenvectors by making a diagonal -matrix, transforming it to the required -complex harmonic basis (as is standard for EDRIXS) and diagonalizing it. -As long as the crystal field splitting is much larger than the magnetic -field, the eigenvectors will be independent of the exact values of both -these parameters. - -.. GENERATED FROM PYTHON SOURCE LINES 42-56 - -.. code-block:: Python - - - B = 1e-3*np.array([1, 1, 0]) - cf_splitting = 1e3 - zeeman = sum(s*b for s, b in zip(edrixs.get_spin_momentum(2), B)) - dd_levels = np.array([energy for dd_level in cf_splitting*np.arange(5) - for energy in [dd_level]*2], dtype=complex) - emat_rhb = np.diag(dd_levels) - emat = edrixs.cb_op(emat_rhb, edrixs.tmat_r2c('d', ispin=True)) + zeeman - _, eigenvectors = np.linalg.eigh(emat) - - def get_eigenvector(orbital_index, spin_index): - return eigenvectors[:, 2*orbital_index + spin_index] - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 57-63 - -Let's examine the :math:`d_{x^2-y^2}` orbital first. Recall from the -:ref:`sphx_glr_auto_examples_example_1_crystal_field.py` -example that edrixs uses the standard orbital order of -:math:`d_{3z^2-r^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}`. So we want -:code:`orbital_index = 3` element. Using this, we can build spin-up and -down -eigenvectors. - -.. GENERATED FROM PYTHON SOURCE LINES 63-68 - -.. code-block:: Python - - orbital_index = 3 - - groundstate_vector = get_eigenvector(orbital_index, 0) - excitedstate_vector = get_eigenvector(orbital_index, 1) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 69-96 - -Transition operators and scattering matrix ------------------------------------------------------------------------------- -Here we are considering the :math:`L_3`-edge. This means -a :math:`2p_{3/2} \rightarrow 3d` -absoprtion transition and a :math:`2p_{3/2} \rightarrow 3d` -emission transition. We can read the relevant matrix from the edrixs database, -keeping in mind that there are in fact three operations for -:math:`x, y,` & :math:`z` directions. Note that edrixs provides operators -in electron notation. If we define :math:`D` as the transition operator in -electron language, :math:`D^\dagger` is the operator in the hole language -we are using for this example. -The angular dependence of a RIXS transition can be conveniently described -using the scattering matrix, which is a :math:`3\times3` element object that -specifies the transition amplitude for each incoming and outgoing x-ray -polarization. Correspondingly, we have - - .. math:: - \begin{equation} - \mathcal{F}=\sum_n\langle f|D|n\rangle\langle n|D^{\dagger}|g\rangle - \end{equation}. - -In matrix form this is - - .. math:: - \begin{equation} - \mathcal{F}(m,n)=\{f^{\dagger} \cdot D(m)\} \cdot \{D^{\dagger}(n) \cdot g\} - \end{equation}. - -.. GENERATED FROM PYTHON SOURCE LINES 96-107 - -.. code-block:: Python - - - D_Tmat = edrixs.get_trans_oper('dp32') - - def get_F(vector_i, vector_f): - F = np.zeros((3, 3), dtype=complex) - for i in range(3): - for j in range(3): - F[i, j] = np.dot(np.dot(np.conj(vector_f.T), D_Tmat[i]), - np.dot(np.conj(D_Tmat[j].T), vector_i)) - return F - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 108-111 - -Using this function, we can obtain non-spin-flip (NSF) and spin-flip (SF) -scattering matrices by choosing whether we return to the ground state or -whether we access the excited state with the spin flipped. - -.. GENERATED FROM PYTHON SOURCE LINES 111-114 - -.. code-block:: Python - - F_NSF = get_F(groundstate_vector, groundstate_vector) - F_SF = get_F(groundstate_vector, excitedstate_vector) - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 115-122 - -Angular dependence ------------------------------------------------------------------------------- -Let's consider the common case of fixing the total scattering angle at -:code:`two_theta = 90` and choosing a series of incident angles :code:`thins`. -Since the detector does not resolve polarization, we need to add both outgoing -polarizations. It is then convenient to use function :func:`.dipole_polvec_rixs` -to obtain the incoming and outgoing polarization vectors. - -.. GENERATED FROM PYTHON SOURCE LINES 122-137 - -.. code-block:: Python - - thins = np.linspace(0, 90) - two_theta = 90 - phi = 0 - - - def get_I(thin, alpha, F): - intensity = 0 - for beta in [0, np.pi/2]: - thout = two_theta - thin - ei, ef = edrixs.dipole_polvec_rixs(thin*np.pi/180, thout*np.pi/180, - phi*np.pi/180, alpha, beta) - intensity += np.abs(np.dot(ef, np.dot(F, ei)))**2 - return intensity - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 138-143 - -Plot ------------------------------------------------------------------------------- -We now run through a few configurations specified in terms of incoming -polarization angle :math:`\alpha` (defined in radians w.r.t. the scattering -plane), :math:`F`, plotting label, and plotting color. - -.. GENERATED FROM PYTHON SOURCE LINES 143-159 - -.. code-block:: Python - - fig, ax = plt.subplots() - - config = [[0, F_NSF, r'$\pi$ NSF', 'C0'], - [np.pi/2, F_NSF, r'$\sigma$ NSF', 'C1'], - [0, F_SF, r'$\pi$ SF', 'C2'], - [np.pi/2, F_SF, r'$\sigma$ SF', 'C3']] - - for alpha, F, label, color in config: - Is = np.array([get_I(thin, alpha, F) for thin in thins]) - ax.plot(thins, Is, label=label, color=color) - - ax.legend() - ax.set_xlabel(r'Theta ($^\circ$)') - ax.set_ylabel('Relative intensity') - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_7_transitions_001.png - :alt: example 7 transitions - :srcset: /auto_examples/images/sphx_glr_example_7_transitions_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 160-164 - -Run through orbitals ------------------------------------------------------------------------------- -For completeness, let's look at transitions from :math:`x^2-y^2` to all other -orbitals. - -.. GENERATED FROM PYTHON SOURCE LINES 164-191 - -.. code-block:: Python - - fig, axs = plt.subplots(5, 1, figsize=(7, 7), - sharex=True, sharey=True) - - orbitals = ['$d_{3z^2-r^2}$', '$d_{xz}$', '$d_{yz}$', - '$d_{x^2-y^2}$', '$d_{xy}$'] - orbital_order = [4, 1, 2, 0, 3] - - plot_index = 0 - for ax, orbital_index in zip(axs, orbital_order): - for spin_index, spin_label in zip([0, 1], ['NSF', 'SF']): - excitedstate_vector = get_eigenvector(orbital_index, spin_index) - F = get_F(groundstate_vector, excitedstate_vector) - for alpha, pol_label in zip([0, np.pi/2], [r'$\pi$', r'$\sigma$']): - Is = np.array([get_I(thin, alpha, F) for thin in thins]) - ax.plot(thins, Is*10, label=f'{pol_label} {spin_label}', - color=f'C{plot_index%4}') - plot_index += 1 - ax.legend(title=orbitals[orbital_index], bbox_to_anchor=(1.1, 1), - loc="upper left", fontsize=8) - - - axs[-1].set_xlabel(r'$\theta$ ($^\circ$)') - axs[2].set_ylabel('Scattering intensity') - - fig.subplots_adjust(hspace=0, left=.3, right=.6) - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_7_transitions_002.png - :alt: example 7 transitions - :srcset: /auto_examples/images/sphx_glr_example_7_transitions_002.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 192-198 - -.. rubric:: Footnotes - -.. [1] Yao Shen et al., - `arXiv:2110.08937 (2022) `_. -.. [2] Luuk J. P. Ament et al., - `Phys. Rev. Lett. 103, 117003 (2009) `_ - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 0.514 seconds) - - -.. _sphx_glr_download_auto_examples_example_7_transitions.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_7_transitions.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_7_transitions.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_7_transitions.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_8_Coulomb.rst.txt b/edrixs/_sources/auto_examples/example_8_Coulomb.rst.txt deleted file mode 100644 index a0832e5714..0000000000 --- a/edrixs/_sources/auto_examples/example_8_Coulomb.rst.txt +++ /dev/null @@ -1,635 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_8_Coulomb.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_8_Coulomb.py: - - -Coulomb interactions -===================================== -In this example we provide more details on how Coulomb interactions are -implemented in multiplet calculations and EDRIXS in particular. We aim -to clarify the form of the matrices, how they are parametrized, -and how the breaking of spherical symmetry can switch on additional elements -that one might not anticipate. Our example is based on a :math:`d` atomic shell. - -.. GENERATED FROM PYTHON SOURCE LINES 13-50 - -Create matrix ------------------------------------------------------------------------------- -The Coulomb interaction between two particles can be written as - - .. math:: - \begin{equation} - \hat{H} = \frac{1}{2} - \int d\mathbf{r} \int d\mathbf{r}^\prime - \Sigma_{\sigma, \sigma^\prime} - |\hat{\psi}^\sigma(\mathbf{r})|^2 \frac{e^2}{R} - |\hat{\psi}^{\sigma^\prime}(\mathbf{r^\prime})|^2, - \end{equation} - -where :math:`\hat{\psi}^\sigma(\mathbf{r})` is the electron wavefunction, with -spin :math:`\sigma`, and :math:`R=|r-r^\prime|` is the electron separation. -Solving our problem in this form is difficult due to the need to symmeterize -the wavefunction to follow fermionic statistics. -Using second quantization, we can use operators to impose the required -particle exchange statistics and write the equation in terms of -a tensor :math:`U` - - .. math:: - \begin{equation} - \hat{H} = \sum_{\alpha,\beta,\gamma,\delta,\sigma,\sigma^\prime} - U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} - \hat{f}^{\dagger}_{\alpha\sigma} - \hat{f}^{\dagger}_{\beta\sigma^\prime} - \hat{f}_{\gamma\sigma^\prime}\hat{f}_{\delta\sigma}, - \end{equation} - -where :math:`\alpha`, :math:`\beta`, :math:`\gamma`, :math:`\delta` are -orbital indices and :math:`\hat{f}^{\dagger}` -(:math:`\hat{f}`) are the creation (anihilation) operators. -For a :math:`d`-electron system, we have :math:`10` distinct spin-orbitals -(:math:`5` orbitals each with :math:`2` spins), which makes matrix the -:math:`10\times10\times10\times10` in total size. -In EDRIXS the matrix can be created as follows: - -.. GENERATED FROM PYTHON SOURCE LINES 50-58 - -.. code-block:: Python - - import edrixs - import numpy as np - import scipy - import matplotlib.pyplot as plt - import itertools - - F0, F2, F4 = 6.94, 14.7, 4.41 - umat_chb = edrixs.get_umat_slater('d', F0, F2, F4) - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 59-61 - -We stored this under variable :code:`umat_chb` where "cbh" stands for -complex harmonic basis, which is the default basis in EDRIXS. - -.. GENERATED FROM PYTHON SOURCE LINES 63-92 - -Parameterizing interactions ------------------------------------------------------------------------------- -EDRIXS parameterizes the interactions in :math:`U` via Slater integral -parameters :math:`F^{k}`. These relate to integrals of various spherical -Harmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients, -and Wigner 3J symbols. Textbooks such as [1]_ can be used for further -reference. If you are interested in the details of how -EDRIXS does this (and you probably aren't) function :func:`.umat_slater`, -constructs the required matrix via Gaunt coeficents from -:func:`.get_gaunt`. Two alternative parameterizations are common. -The first are the Racah parameters, which are - - .. math:: - \begin{eqnarray} - A &=& F^0 - \frac{49}{441} F^4 \\ - B &=& \frac{1}{49}F^2 - \frac{5}{441}F^4 \\ - C &=& \frac{35}{441}F^4. - \end{eqnarray} - -or an alternative form for the Slater integrals - - .. math:: - \begin{eqnarray} - F_0 &=& F^0 \\ - F_2 &=& \frac{1}{49}F^2 \\ - F_4 &=& \frac{1}{441}F^4, - \end{eqnarray} - -which involves different normalization parameters. - -.. GENERATED FROM PYTHON SOURCE LINES 94-101 - -Basis transform ------------------------------------------------------------------------------- -If we want to use the real harmonic basis, we can use a tensor -transformation, which imposes the following orbital order -:math:`3z^2-r^2, xz, yz, x^2-y^2, xy`, each of which involves -:math:`\uparrow, \downarrow` spin pairs. Let's perform this transformation and -store a list of these orbitals. - -.. GENERATED FROM PYTHON SOURCE LINES 101-104 - -.. code-block:: Python - - umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True)) - orbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy'] - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 105-158 - -Interactions ------------------------------------------------------------------------------- -Tensor :math:`U` is a series of matrix -elements - - .. math:: - \begin{equation} - \langle\psi_{\gamma,\delta}^{\bar{\sigma},\bar{\sigma}^\prime} - |\hat{H}| - \psi_{\alpha,\beta}^{\sigma,\sigma^\prime}\rangle - \end{equation} - -the combination of which defines the energetic cost of pairwise -electron-electron interactions between states :math:`\alpha,\sigma` -and :math:`\beta,\sigma^\prime`. In EDRIXS we follow the convention of -summing over all orbital pairs. Some other texts count each pair of -indices only once. The matrix elements here will consequently -be half the magnitude of those in other references. -We can express the interactions in terms of -the orbitals involved. It is common to distinguish "direct Coulomb" and -"exchange" interactions. The former come from electrons in the same orbital -and the later involve swapping orbital labels for electrons. We will use -:math:`U_0` and :math:`J` as a shorthand for distinguishing these. - -Before we describe the different types of interactions, we note that since -the Coulomb interaction is real, and due to the spin symmmetry properties -of the process :math:`U` always obeys - - .. math:: - \begin{equation} - U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} = - U_{\beta\sigma,\alpha\sigma^\prime,\delta\sigma^\prime,\gamma\sigma} = - U_{\delta\sigma,\gamma\sigma^\prime,\beta\sigma^\prime,\alpha\sigma} = - U_{\gamma\sigma,\delta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}. - \end{equation} - - -1. Intra orbital -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The direct Coulomb energy cost to double-occupy an orbital comes from terms -like :math:`U_{\alpha\sigma,\alpha\bar\sigma,\alpha\bar\sigma,\alpha\sigma}`. -In this notation, we use :math:`\sigma^\prime` to denote that the matrix -element is summed over all pairs and :math:`\bar{\sigma}` to denote sums -over all opposite spin pairs. Due to rotational symmetry, all these -elements are the same and equal to - - .. math:: - \begin{eqnarray} - U_0 &=& \frac{A}{2} + 2B + \frac{3C}{2}\\ - &=& \frac{F_0}{2} + 2F_2 + 18F_4 - \end{eqnarray} - -Let's print these to demonstrate where these live in the array - -.. GENERATED FROM PYTHON SOURCE LINES 158-162 - -.. code-block:: Python - - for i in range(0, 5): - val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 4.250 - xz 4.250 - yz 4.250 - x^2-y^2 4.250 - xy 4.250 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 163-170 - -2. Inter orbital Coulomb interactions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Direct Coulomb repulsion between different orbitals depends on terms like -:math:`U_{\alpha\sigma,\beta\sigma^\prime,\beta\sigma^\prime,\alpha\sigma}`. -Expresions for these parameters are provided in column :math:`U` in -:ref:`table_2_orbital`. We can print the values from :code:`umat` -like this: - -.. GENERATED FROM PYTHON SOURCE LINES 170-174 - -.. code-block:: Python - - for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz 3.650 - 3z^2-r^2 yz 3.650 - 3z^2-r^2 x^2-y^2 2.900 - 3z^2-r^2 xy 2.900 - xz yz 3.150 - xz x^2-y^2 3.150 - xz xy 3.150 - yz x^2-y^2 3.150 - yz xy 3.150 - x^2-y^2 xy 3.900 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 175-181 - -3. Inter-orbital exchange interactions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Exchange terms exist with the form -:math:`U_{\alpha\sigma,\beta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}`. -Expresions for these parameters are provided in column :math:`J` of -:ref:`table_2_orbital`. These come from terms like this in the matrix: - -.. GENERATED FROM PYTHON SOURCE LINES 181-185 - -.. code-block:: Python - - for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz 0.300 - 3z^2-r^2 yz 0.300 - 3z^2-r^2 x^2-y^2 0.675 - 3z^2-r^2 xy 0.675 - xz yz 0.550 - xz x^2-y^2 0.550 - xz xy 0.550 - yz x^2-y^2 0.550 - yz xy 0.550 - x^2-y^2 xy 0.175 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 186-193 - -4. Pair hopping term -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Terms that swap pairs of electrons exist as -:math:`(1-\delta_{\sigma\sigma'})U_{\alpha\sigma,\alpha\bar\sigma,\beta\bar\sigma,\beta\sigma}` -and depend on exchange interactions column :math:`J` from -:ref:`table_2_orbital` -and here in the matrix. - -.. GENERATED FROM PYTHON SOURCE LINES 193-197 - -.. code-block:: Python - - for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz 0.300 - 3z^2-r^2 yz 0.300 - 3z^2-r^2 x^2-y^2 0.675 - 3z^2-r^2 xy 0.675 - xz yz 0.550 - xz x^2-y^2 0.550 - xz xy 0.550 - yz x^2-y^2 0.550 - yz xy 0.550 - x^2-y^2 xy 0.175 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 198-215 - -5. Three orbital -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Another set of terms that one might not immediately anticipate involve three -orbitals like - - .. math:: - \begin{equation} - U_{\alpha\sigma, \gamma\sigma', \beta\sigma', \gamma\sigma} \\ - U_{\alpha\sigma, \gamma\sigma', \gamma\sigma', \beta\sigma} \\ - (1-\delta_{\sigma\sigma'}) - U_{\alpha\sigma, \beta\sigma', \gamma\sigma', \gamma\sigma} - \end{equation} - -for :math:`\alpha=3z^2-r^2, \beta=x^2-y^2, \gamma=xz/yz`. -These are needed to maintain the rotational symmetry of the interations. -See :ref:`table_3_orbital` for the expressions. We can print some of -these via: - -.. GENERATED FROM PYTHON SOURCE LINES 215-227 - -.. code-block:: Python - - ijkl = [[0, 1, 3, 1], - [0, 2, 3, 2], - [1, 0, 3, 1], - [1, 1, 3, 0], - [2, 0, 3, 2], - [2, 2, 3, 0]] - - for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t" - f"{orbitals[k]:<8} \t {orbitals[l]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz x^2-y^2 xz 0.217 - 3z^2-r^2 yz x^2-y^2 yz -0.217 - xz 3z^2-r^2 x^2-y^2 xz -0.433 - xz xz x^2-y^2 3z^2-r^2 0.217 - yz 3z^2-r^2 x^2-y^2 yz 0.433 - yz yz x^2-y^2 3z^2-r^2 -0.217 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 228-233 - -6. Four orbital -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Futher multi-orbital terms include -:math:`U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma}`. -We can find these here in the matrix: - -.. GENERATED FROM PYTHON SOURCE LINES 233-249 - -.. code-block:: Python - - ijkl = [[0, 1, 2, 4], - [0, 1, 4, 2], - [0, 2, 1, 4], - [0, 2, 4, 1], - [0, 4, 1, 2], - [0, 4, 2, 1], - [3, 1, 4, 2], - [3, 2, 4, 1], - [3, 4, 1, 2], - [3, 4, 2, 1]] - - for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {orbitals[k]:<8}" - f"\t {orbitals[l]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz yz xy -0.433 - 3z^2-r^2 xz xy yz 0.217 - 3z^2-r^2 yz xz xy -0.433 - 3z^2-r^2 yz xy xz 0.217 - 3z^2-r^2 xy xz yz 0.217 - 3z^2-r^2 xy yz xz 0.217 - x^2-y^2 xz xy yz -0.375 - x^2-y^2 yz xy xz 0.375 - x^2-y^2 xy xz yz -0.375 - x^2-y^2 xy yz xz 0.375 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 250-256 - -Effects of multi-orbital terms ------------------------------------------------------------------------------- -To test the effects of the multi-orbital terms, let's plot the eigenenergy -spectra with and without multi-orbital terms switched on for system with and -without a cubic crystal field. We will use a :math:`d`-shell with two -electrons. - -.. GENERATED FROM PYTHON SOURCE LINES 256-292 - -.. code-block:: Python - - ten_dqs = [0, 2, 4, 12] - - def diagonalize(ten_dq, umat): - emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq), - edrixs.tmat_c2r('d', ispin=True)) - H = (edrixs.build_opers(4, umat, basis) - + edrixs.build_opers(2, emat, basis)) - e, v = scipy.linalg.eigh(H) - return e - e.min() - - basis = edrixs.get_fock_bin_by_N(10, 2) - umat_no_multiorbital = np.copy(umat) - B = F2/49 - 5*F4/441 - for val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]: - umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0 - - fig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3)) - - for cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)): - ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1, - label='on', color=f'C{cind}') - ax.hlines(diagonalize(ten_dq, umat_no_multiorbital), - xmin=1.5, xmax=2.5, - label='off', - linestyle=':', color=f'C{cind}') - ax.set_title(f"$10D_q={ten_dq}$") - ax.set_ylim([-.5, 20]) - ax.set_xticks([]) - ax.legend() - - fig.suptitle("Eigenvalues with 3&4-orbital effects on/off") - fig.subplots_adjust(wspace=.3) - axs[0].set_ylabel('Eigenvalues (eV)') - fig.subplots_adjust(top=.8) - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_8_Coulomb_001.png - :alt: Eigenvalues with 3&4-orbital effects on/off, $10D_q=0$, $10D_q=2$, $10D_q=4$, $10D_q=12$ - :srcset: /auto_examples/images/sphx_glr_example_8_Coulomb_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 293-382 - -On the left of the plot Coulomb interactions in spherical symmetry cause -substantial mxing between :math:`t_{2g}` and :math:`e_{g}` orbitals in the -eigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the -the right eigenenergies. As :math:`10D_q` get large, this mixing is switched -off and the spectra start to become independent of whether the 3 & 4 orbital -orbital terms are included or not. - - - -.. _table_2_orbital: -.. table:: Table of 2 orbital interactions - - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |Orbitals :math:`\alpha,\beta`|:math:`U_0` Racah | :math:`U_0` Slater |:math:`J` Racah |:math:`J` Slater | - +=============================+==================+=======================+================+====================+ - |:math:`3z^2-r^2, xz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`3z^2-r^2, yz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`3z^2-r^2, x^2-y^2` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`3z^2-r^2, xy` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`xz, yz` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`xz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`xz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`yz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`yz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`x^2-y^2, xy` |:math:`A/2+2B+C/2`|:math:`F_0+4F_2-34F_4` | :math:`C/2` |:math:`35F_4/2` | - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - - -.. _table_3_orbital: -.. table:: Table of 3 orbital interactions - - +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ - |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| - +=============================+=============+====================================================+=====================================================+ - |:math:`3z^2-r^2, xz, x^2-y^2, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, yz, x^2-y^2, yz` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`xz, 3z^2-r^2, x^2-y^2, xz` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`xz, xz, x^2-y^2, 3z^2-r^2` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`yz, 3z^2-r^2, x^2-y^2, yz` | :math:`\sqrt{3}B` | :math:`\sqrt{3}F_2-5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`yz, yz, x^2-y^2, 3z^2-r^2` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - - -.. _table_4_orbital: -.. table:: Table of 4 orbital interactions - - +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ - |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| - +=============================+=============+====================================================+=====================================================+ - |:math:`3z^2-r^2, xz, yz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, xz, xy, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, yz, xz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, yz, xy, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, xy, xz, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, xy, yz, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , xz, xy, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , yz, xy, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , xy, xz, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , xy, yz, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - - -.. rubric:: Footnotes - -.. [1] MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of - Transition-Metal Ions in Crystals. Academic Press, New York and London. - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 0.360 seconds) - - -.. _sphx_glr_download_auto_examples_example_8_Coulomb.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_8_Coulomb.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_8_Coulomb.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_8_Coulomb.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_8_Hunds_interactions.rst.txt b/edrixs/_sources/auto_examples/example_8_Hunds_interactions.rst.txt deleted file mode 100644 index 1e13dfccc0..0000000000 --- a/edrixs/_sources/auto_examples/example_8_Hunds_interactions.rst.txt +++ /dev/null @@ -1,478 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_8_Hunds_interactions.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_8_Hunds_interactions.py: - - -Hund's Interactions in charge transfer insulators -================================================= -In this exercise we will solve a toy model relevant to cubic :math:`d^8` charge transfer insulators -such as NiO or NiPS\ :sub:`3`. We are interested in better understanding the interplay between the -Hund's interactions and the charge transfer energy in terms of the energy of the triplet-singlet -excitations of this model. These seem to act against each other in that the Hund's interactions -impose a energy cost for the triplet-singlet excitations whenever there are two holes on -the Ni :math:`d` orbitals. The charge transfer physics, on the other hand, will promote a -:math:`d^9\underline{L}` ground state in which the Hund's interactions are not active. - -The simplest model that captures this physics requires four Ni spin-orbitals, representing the Ni -:math:`e_g` manifold. We will represent the ligand states in the same way as the Anderson impurity -model in terms of one effective ligand spin-orbital per Ni spin-orbital. We assume these effective -orbitals have been constructed so that each Ni orbital only bonds to one sister orbital. For -simplicity, we will treat all Ni and all ligand orbitals as equivalent, even though a more -realistic model would account for the different Coulomb and hopping of the :math:`d_{3z^2-r^2}` -and :math:`d_{x^2-y^2}` orbitals. We therefore simply connect Ni and ligand orbitals via a constant -hopping :math:`t`. We also include the ligand energy parameter :math:`e_L`. - -The easiest way to implement the requried Coulomb interactions is to use the so-called Kanamori -Hamiltonian, which is a simplfied form for the interactions, which treats all orbitals as -equivalent. Daniel Khomskii's book provides a great explanation of this physics [1]_. We -parameterize the interactions via Coulomb repulsion parameter :math:`U` and Hund's exchange -:math:`J_H`. EDRIXS provides this functionality via the more general -:func:`.get_umat_kanamori` function. - -It's also easiest to consider this problem in hole langauge, which means our eight spin-orbitals -are populated by two fermions. - -.. GENERATED FROM PYTHON SOURCE LINES 34-38 - -Setup ------------------------------------------------------------------------------- -We start by loading the necessary modules, and defining the total number of -orbitals and electrons. - -.. GENERATED FROM PYTHON SOURCE LINES 38-46 - -.. code-block:: Python - - import edrixs - import scipy - import numpy as np - import matplotlib.pyplot as plt - - norb = 8 - noccu = 2 - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 47-55 - -Diagonalization ------------------------------------------------------------------------------- -Let's write a function to diagonalize our model in a similar way to -the :ref:`sphx_glr_auto_examples_example_6_Hubbard_dimer.py` example. -Within this function, we also create operators to count the number of -:math:`d` holes and operators to calculate expectation values for -:math:`S^2` and :math:`S_z`. For the latter to make sense, we also include a -small effective spin interaction along :math:`z`. - -.. GENERATED FROM PYTHON SOURCE LINES 55-103 - -.. code-block:: Python - - - - def diagonalize(U, JH, t, eL, n=1): - # Setup Coulomb matrix - umat = np.zeros((norb, norb, norb, norb), dtype=complex) - uNi = edrixs.get_umat_kanamori(norb//2, U, JH) - umat[:norb//2, :norb//2, :norb//2, :norb//2] = uNi - - # Setup hopping matrix - emat = np.zeros((norb, norb), dtype=complex) - ind = np.arange(norb//2) - emat[ind, ind + norb//2] = t - emat[ind+norb//2, ind] = np.conj(t) # conj is not needed, but is good practise. - ind = np.arange(norb//2, norb) - emat[ind, ind] += eL - - # Spin operator - spin_mom = np.zeros((3, norb, norb), dtype=complex) - spin_mom[:, :2, :2] = edrixs.get_spin_momentum(0) - spin_mom[:, 2:4, 2:4] = edrixs.get_spin_momentum(0) - spin_mom[:, 4:6, 4:6] = edrixs.get_spin_momentum(0) - spin_mom[:, 6:8, 6:8] = edrixs.get_spin_momentum(0) - - # add small effective field along z - emat += 1e-6*spin_mom[2] - - # Diagonalize - basis = edrixs.get_fock_bin_by_N(norb, noccu) - H = edrixs.build_opers(2, emat, basis) + edrixs.build_opers(4, umat, basis) - e, v = scipy.linalg.eigh(H) - e -= e[0] # Define ground state as zero energy - - # Operator for holes on Ni - basis = np.array(basis) - num_d_electrons = basis[:, :4].sum(1) - d0 = np.sum(np.abs(v[num_d_electrons == 0, :])**2, axis=0) - d1 = np.sum(np.abs(v[num_d_electrons == 1, :])**2, axis=0) - d2 = np.sum(np.abs(v[num_d_electrons == 2, :])**2, axis=0) - - # S^2 and Sz operators - opS = edrixs.build_opers(2, spin_mom, basis) - S_squared_op = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2]) - S_squared_exp = edrixs.cb_op(S_squared_op, v).diagonal().real - S_z_exp = edrixs.cb_op(opS[2], v).diagonal().real - - return e[:n], d0[:n], d1[:n], d2[:n], S_squared_exp[:n], S_z_exp[:n] - - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 104-110 - -The atomic limit ------------------------------------------------------------------------------- -For simplicity, let's start in the atomic limit with :math:`e_L \gg t \gg U` -where all holes are on nickel. In this case, there are six ways to distribute -two holes on the four Ni spin-orbitals. Let's examine the expectation values -of the :math:`S^2` and :math:`S_z` operators. - -.. GENERATED FROM PYTHON SOURCE LINES 110-125 - -.. code-block:: Python - - U = 10 - JH = 2 - t = 100 - eL = 1e10 - - e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6) - - print("Ground state\nE\t") - for i in range(3): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - - print("\nExcited state\nE\t") - for i in range(3, 6): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - Ground state - E - 0.00 2.00 1.00 - 0.00 2.00 0.00 - 0.00 2.00 -1.00 - - Excited state - E - 4.00 0.00 0.00 - 4.00 0.00 0.00 - 8.00 0.00 0.00 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 126-132 - -The ground state is a high-spin triplet. The fourth and fifth -states (the first excited state) are low-spin singlet excitons at -:math:`2 J_H`. These have one hole on each orbital in the antisymmetric -combination of :math:`|\uparrow\downarrow>-|\downarrow\uparrow>`. -The state at :math:`3 J_H` also has one hole on each orbital in the symmetric -:math:`|\uparrow\downarrow>+|\downarrow\uparrow>` configuration. - -.. GENERATED FROM PYTHON SOURCE LINES 134-140 - -Where are the holes for large hopping ------------------------------------------------------------------------------- -As discussed at the start, we are interested to see interplay between Hund's -and charge-transfer physics, which will obviously depend strongly on whether -the holes are on Ni or the ligand. Let's see what happens as :math:`e_L` is -reduced while observing the location of the ground state and exciton holes. - -.. GENERATED FROM PYTHON SOURCE LINES 140-164 - -.. code-block:: Python - - U = 10 - JH = 2 - t = 100 - - eLs = np.linspace(0, 1000, 30) - - fig, axs = plt.subplots(1, 2, figsize=(8, 4)) - - for ax, ind in zip(axs.ravel(), [0, 3]): - ds = np.array([diagonalize(U, JH, t, eL, n=6) - for eL in eLs]) - - ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$') - ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$') - ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$') - ax.set_xlabel("Energy of ligands $e_L$") - ax.set_ylabel("Number of electrons") - ax.legend() - - axs[0].set_title("Location of ground state holes") - axs[1].set_title("Location of exciton holes") - - plt.tight_layout() - plt.show() - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_8_Hunds_interactions_001.png - :alt: Location of ground state holes, Location of exciton holes - :srcset: /auto_examples/images/sphx_glr_example_8_Hunds_interactions_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 165-171 - -For large :math:`e_L`, we see that both holes are on nickel as expected. In -the opposite limit of :math:`|e_L| \ll t` and :math:`U \ll t` the holes are -shared in the ratio 0.25:0.5:0.25 as there are two ways to have one hole on -Ni. In the limit of large :math:`e_L`, all holes move onto Ni. Since -:math:`t` is large, this applies equally to both the ground state and the -exciton. - -.. GENERATED FROM PYTHON SOURCE LINES 174-179 - -Connecton between atomic and charge transfer limits ------------------------------------------------------------------------------- -We now examine the quantum numbers during cross over between the two limits -with :math:`e_L`. Let's first look at the how :math:`` changes for the -ground state and exciton and then examine how the exciton energy changes. - -.. GENERATED FROM PYTHON SOURCE LINES 179-216 - -.. code-block:: Python - - - U = 10 - JH = 2 - t = 100 - - eLs = np.linspace(0, 1000, 30) - - info = np.array([diagonalize(U, JH, t, eL, n=6) - for eL in eLs]) - - fig, axs = plt.subplots(1, 2, figsize=(8, 4)) - - - axs[0].plot(eLs, info[:, 4, 0], label='Ground state') - axs[0].plot(eLs, info[:, 4, 3], label='Exciton') - axs[0].set_xlabel("Energy of ligands $e_L$") - axs[0].set_ylabel('$$') - axs[0].set_title('Quantum numbers') - axs[0].legend() - - axs[1].plot(eLs, info[:, 0, 3], '+', color='C0') - axs[1].set_xlabel("Energy of ligands $e_L$") - axs[1].set_ylabel('Exciton energy', color='C0') - axr = axs[1].twinx() - axr.plot(eLs, info[:, 3, 5], 'x', color='C1') - axr.set_ylabel('$d^2$ fraction', color='C1') - - for ax, color in zip([axs[1], axr], ['C0', 'C1']): - for tick in ax.get_yticklabels(): - tick.set_color(color) - - axs[1].set_ylim(0, 2*JH) - axr.set_ylim(0, 1) - - axs[1].set_title('Exciton energy vs. $d^2$ character') - plt.tight_layout() - plt.show() - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_8_Hunds_interactions_002.png - :alt: Quantum numbers, Exciton energy vs. $d^2$ character - :srcset: /auto_examples/images/sphx_glr_example_8_Hunds_interactions_002.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 217-229 - -In the left panel, we see that the two limits are adiabatically connected -as they preseve the same quantum numbers. This is because there is always -an appreciable double occupancy under conditions where the -:math:`d^9\underline{L}` character is maximized and this continues to favor -the high spin ground state. Other interactions such as strong tetragonal -crystal field would be needed to overcome the Hund's interactions and break -this paradigm. In the right panel, we see that the exciton energy simply -scales with the double occupancy. Overall, even though -Hund's interactions are irrelevant for the :math:`d^9\underline{L}` -electronic configuration, whenever :math:`t` is appreciable there is a -strong mixing with the :math:`d^8` component is always present, which -dominates the energy of the exciton. - -.. GENERATED FROM PYTHON SOURCE LINES 231-237 - -Charge transfer excitons ------------------------------------------------------------------------------- -Another limiting case of the model is where :math:`t` is smaller than the -Coulomb interactions. This, however, tends to produce -ground state and exciton configurations that correspond to those of distinct -atomic models. Let's look at the :math:`e_L` dependence in this case. - -.. GENERATED FROM PYTHON SOURCE LINES 237-265 - -.. code-block:: Python - - U = 10 - JH = 2 - t = .5 - eL = 7 - - eLs = np.linspace(0, 20, 30) - - fig, axs = plt.subplots(1, 2, figsize=(8, 4)) - - for ax, ind in zip(axs.ravel(), [0, 3]): - ds = np.array([diagonalize(U, JH, t, eL, n=6) - for eL in eLs]) - - ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$') - ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$') - ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$') - ax.set_xlabel("Energy of ligands $e_L$") - ax.set_ylabel("Number of electrons") - ax.legend() - - axs[0].axvline(x=eL, linestyle=':', color='k') - axs[1].axvline(x=eL, linestyle=':', color='k') - - axs[0].set_title("Location of ground state holes") - axs[1].set_title("Location of exciton holes") - - plt.tight_layout() - plt.show() - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_8_Hunds_interactions_003.png - :alt: Location of ground state holes, Location of exciton holes - :srcset: /auto_examples/images/sphx_glr_example_8_Hunds_interactions_003.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 266-270 - -Around :math:`e_L = 7` the plot shows that the excition is primairly a -:math:`d^2 \rightarrow d^1` transition or a -:math:`d^8 \rightarrow d^{9}\underline{L}` transition in electron language. -Let's examine the energy and quantum numbers. - -.. GENERATED FROM PYTHON SOURCE LINES 270-281 - -.. code-block:: Python - - - e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6) - - print("Ground state\nE\t") - for i in range(3): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - - print("\nExcited state\nE\t") - for i in range(3, 6): - print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - Ground state - E - 0.00 2.00 -1.00 - 0.00 2.00 -0.00 - 0.00 2.00 1.00 - - Excited state - E - 2.74 0.00 0.00 - 2.74 0.00 0.00 - 2.99 0.00 0.00 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 282-284 - -We once again see the same quantum numbers, despite the differences in mixing -in the ground state and exciton. - -.. GENERATED FROM PYTHON SOURCE LINES 287-290 - -.. rubric:: Footnotes - -.. [1] D. Khomskii, Transition Metal Compounds, Cambridge University Press (2014) - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 1.236 seconds) - - -.. _sphx_glr_download_auto_examples_example_8_Hunds_interactions.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_8_Hunds_interactions.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_8_Hunds_interactions.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_8_Hunds_interactions.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/example_9_Coulomb.rst.txt b/edrixs/_sources/auto_examples/example_9_Coulomb.rst.txt deleted file mode 100644 index d5a697fbc8..0000000000 --- a/edrixs/_sources/auto_examples/example_9_Coulomb.rst.txt +++ /dev/null @@ -1,635 +0,0 @@ - -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/example_9_Coulomb.py" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code. - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_auto_examples_example_9_Coulomb.py: - - -Coulomb interactions -===================================== -In this example we provide more details on how Coulomb interactions are -implemented in multiplet calculations and EDRIXS in particular. We aim -to clarify the form of the matrices, how they are parametrized, -and how the breaking of spherical symmetry can switch on additional elements -that one might not anticipate. Our example is based on a :math:`d` atomic shell. - -.. GENERATED FROM PYTHON SOURCE LINES 13-50 - -Create matrix ------------------------------------------------------------------------------- -The Coulomb interaction between two particles can be written as - - .. math:: - \begin{equation} - \hat{H} = \frac{1}{2} - \int d\mathbf{r} \int d\mathbf{r}^\prime - \Sigma_{\sigma, \sigma^\prime} - |\hat{\psi}^\sigma(\mathbf{r})|^2 \frac{e^2}{R} - |\hat{\psi}^{\sigma^\prime}(\mathbf{r^\prime})|^2, - \end{equation} - -where :math:`\hat{\psi}^\sigma(\mathbf{r})` is the electron wavefunction, with -spin :math:`\sigma`, and :math:`R=|r-r^\prime|` is the electron separation. -Solving our problem in this form is difficult due to the need to symmeterize -the wavefunction to follow fermionic statistics. -Using second quantization, we can use operators to impose the required -particle exchange statistics and write the equation in terms of -a tensor :math:`U` - - .. math:: - \begin{equation} - \hat{H} = \sum_{\alpha,\beta,\gamma,\delta,\sigma,\sigma^\prime} - U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} - \hat{f}^{\dagger}_{\alpha\sigma} - \hat{f}^{\dagger}_{\beta\sigma^\prime} - \hat{f}_{\gamma\sigma^\prime}\hat{f}_{\delta\sigma}, - \end{equation} - -where :math:`\alpha`, :math:`\beta`, :math:`\gamma`, :math:`\delta` are -orbital indices and :math:`\hat{f}^{\dagger}` -(:math:`\hat{f}`) are the creation (anihilation) operators. -For a :math:`d`-electron system, we have :math:`10` distinct spin-orbitals -(:math:`5` orbitals each with :math:`2` spins), which makes matrix the -:math:`10\times10\times10\times10` in total size. -In EDRIXS the matrix can be created as follows: - -.. GENERATED FROM PYTHON SOURCE LINES 50-58 - -.. code-block:: Python - - import edrixs - import numpy as np - import scipy - import matplotlib.pyplot as plt - import itertools - - F0, F2, F4 = 6.94, 14.7, 4.41 - umat_chb = edrixs.get_umat_slater('d', F0, F2, F4) - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 59-61 - -We stored this under variable :code:`umat_chb` where "cbh" stands for -complex harmonic basis, which is the default basis in EDRIXS. - -.. GENERATED FROM PYTHON SOURCE LINES 63-92 - -Parameterizing interactions ------------------------------------------------------------------------------- -EDRIXS parameterizes the interactions in :math:`U` via Slater integral -parameters :math:`F^{k}`. These relate to integrals of various spherical -Harmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients, -and Wigner 3J symbols. Textbooks such as [1]_ can be used for further -reference. If you are interested in the details of how -EDRIXS does this (and you probably aren't) function :func:`.umat_slater`, -constructs the required matrix via Gaunt coeficents from -:func:`.get_gaunt`. Two alternative parameterizations are common. -The first are the Racah parameters, which are - - .. math:: - \begin{eqnarray} - A &=& F^0 - \frac{49}{441} F^4 \\ - B &=& \frac{1}{49}F^2 - \frac{5}{441}F^4 \\ - C &=& \frac{35}{441}F^4. - \end{eqnarray} - -or an alternative form for the Slater integrals - - .. math:: - \begin{eqnarray} - F_0 &=& F^0 \\ - F_2 &=& \frac{1}{49}F^2 \\ - F_4 &=& \frac{1}{441}F^4, - \end{eqnarray} - -which involves different normalization parameters. - -.. GENERATED FROM PYTHON SOURCE LINES 94-101 - -Basis transform ------------------------------------------------------------------------------- -If we want to use the real harmonic basis, we can use a tensor -transformation, which imposes the following orbital order -:math:`3z^2-r^2, xz, yz, x^2-y^2, xy`, each of which involves -:math:`\uparrow, \downarrow` spin pairs. Let's perform this transformation and -store a list of these orbitals. - -.. GENERATED FROM PYTHON SOURCE LINES 101-104 - -.. code-block:: Python - - umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True)) - orbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy'] - - - - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 105-158 - -Interactions ------------------------------------------------------------------------------- -Tensor :math:`U` is a series of matrix -elements - - .. math:: - \begin{equation} - \langle\psi_{\gamma,\delta}^{\bar{\sigma},\bar{\sigma}^\prime} - |\hat{H}| - \psi_{\alpha,\beta}^{\sigma,\sigma^\prime}\rangle - \end{equation} - -the combination of which defines the energetic cost of pairwise -electron-electron interactions between states :math:`\alpha,\sigma` -and :math:`\beta,\sigma^\prime`. In EDRIXS we follow the convention of -summing over all orbital pairs. Some other texts count each pair of -indices only once. The matrix elements here will consequently -be half the magnitude of those in other references. -We can express the interactions in terms of -the orbitals involved. It is common to distinguish "direct Coulomb" and -"exchange" interactions. The former come from electrons in the same orbital -and the later involve swapping orbital labels for electrons. We will use -:math:`U_0` and :math:`J` as a shorthand for distinguishing these. - -Before we describe the different types of interactions, we note that since -the Coulomb interaction is real, and due to the spin symmmetry properties -of the process :math:`U` always obeys - - .. math:: - \begin{equation} - U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} = - U_{\beta\sigma,\alpha\sigma^\prime,\delta\sigma^\prime,\gamma\sigma} = - U_{\delta\sigma,\gamma\sigma^\prime,\beta\sigma^\prime,\alpha\sigma} = - U_{\gamma\sigma,\delta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}. - \end{equation} - - -1. Intra orbital -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The direct Coulomb energy cost to double-occupy an orbital comes from terms -like :math:`U_{\alpha\sigma,\alpha\bar\sigma,\alpha\bar\sigma,\alpha\sigma}`. -In this notation, we use :math:`\sigma^\prime` to denote that the matrix -element is summed over all pairs and :math:`\bar{\sigma}` to denote sums -over all opposite spin pairs. Due to rotational symmetry, all these -elements are the same and equal to - - .. math:: - \begin{eqnarray} - U_0 &=& \frac{A}{2} + 2B + \frac{3C}{2}\\ - &=& \frac{F_0}{2} + 2F_2 + 18F_4 - \end{eqnarray} - -Let's print these to demonstrate where these live in the array - -.. GENERATED FROM PYTHON SOURCE LINES 158-162 - -.. code-block:: Python - - for i in range(0, 5): - val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 4.250 - xz 4.250 - yz 4.250 - x^2-y^2 4.250 - xy 4.250 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 163-170 - -2. Inter orbital Coulomb interactions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Direct Coulomb repulsion between different orbitals depends on terms like -:math:`U_{\alpha\sigma,\beta\sigma^\prime,\beta\sigma^\prime,\alpha\sigma}`. -Expresions for these parameters are provided in column :math:`U` in -:ref:`table_2_orbital`. We can print the values from :code:`umat` -like this: - -.. GENERATED FROM PYTHON SOURCE LINES 170-174 - -.. code-block:: Python - - for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz 3.650 - 3z^2-r^2 yz 3.650 - 3z^2-r^2 x^2-y^2 2.900 - 3z^2-r^2 xy 2.900 - xz yz 3.150 - xz x^2-y^2 3.150 - xz xy 3.150 - yz x^2-y^2 3.150 - yz xy 3.150 - x^2-y^2 xy 3.900 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 175-181 - -3. Inter-orbital exchange interactions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Exchange terms exist with the form -:math:`U_{\alpha\sigma,\beta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}`. -Expresions for these parameters are provided in column :math:`J` of -:ref:`table_2_orbital`. These come from terms like this in the matrix: - -.. GENERATED FROM PYTHON SOURCE LINES 181-185 - -.. code-block:: Python - - for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz 0.300 - 3z^2-r^2 yz 0.300 - 3z^2-r^2 x^2-y^2 0.675 - 3z^2-r^2 xy 0.675 - xz yz 0.550 - xz x^2-y^2 0.550 - xz xy 0.550 - yz x^2-y^2 0.550 - yz xy 0.550 - x^2-y^2 xy 0.175 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 186-193 - -4. Pair hopping term -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Terms that swap pairs of electrons exist as -:math:`(1-\delta_{\sigma\sigma'})U_{\alpha\sigma,\alpha\bar\sigma,\beta\bar\sigma,\beta\sigma}` -and depend on exchange interactions column :math:`J` from -:ref:`table_2_orbital` -and here in the matrix. - -.. GENERATED FROM PYTHON SOURCE LINES 193-197 - -.. code-block:: Python - - for i, j in itertools.combinations(range(5), 2): - val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz 0.300 - 3z^2-r^2 yz 0.300 - 3z^2-r^2 x^2-y^2 0.675 - 3z^2-r^2 xy 0.675 - xz yz 0.550 - xz x^2-y^2 0.550 - xz xy 0.550 - yz x^2-y^2 0.550 - yz xy 0.550 - x^2-y^2 xy 0.175 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 198-215 - -5. Three orbital -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Another set of terms that one might not immediately anticipate involve three -orbitals like - - .. math:: - \begin{equation} - U_{\alpha\sigma, \gamma\sigma', \beta\sigma', \gamma\sigma} \\ - U_{\alpha\sigma, \gamma\sigma', \gamma\sigma', \beta\sigma} \\ - (1-\delta_{\sigma\sigma'}) - U_{\alpha\sigma, \beta\sigma', \gamma\sigma', \gamma\sigma} - \end{equation} - -for :math:`\alpha=3z^2-r^2, \beta=x^2-y^2, \gamma=xz/yz`. -These are needed to maintain the rotational symmetry of the interations. -See :ref:`table_3_orbital` for the expressions. We can print some of -these via: - -.. GENERATED FROM PYTHON SOURCE LINES 215-227 - -.. code-block:: Python - - ijkl = [[0, 1, 3, 1], - [0, 2, 3, 2], - [1, 0, 3, 1], - [1, 1, 3, 0], - [2, 0, 3, 2], - [2, 2, 3, 0]] - - for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t" - f"{orbitals[k]:<8} \t {orbitals[l]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz x^2-y^2 xz 0.217 - 3z^2-r^2 yz x^2-y^2 yz -0.217 - xz 3z^2-r^2 x^2-y^2 xz -0.433 - xz xz x^2-y^2 3z^2-r^2 0.217 - yz 3z^2-r^2 x^2-y^2 yz 0.433 - yz yz x^2-y^2 3z^2-r^2 -0.217 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 228-233 - -6. Four orbital -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Futher multi-orbital terms include -:math:`U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma}`. -We can find these here in the matrix: - -.. GENERATED FROM PYTHON SOURCE LINES 233-249 - -.. code-block:: Python - - ijkl = [[0, 1, 2, 4], - [0, 1, 4, 2], - [0, 2, 1, 4], - [0, 2, 4, 1], - [0, 4, 1, 2], - [0, 4, 2, 1], - [3, 1, 4, 2], - [3, 2, 4, 1], - [3, 4, 1, 2], - [3, 4, 2, 1]] - - for i, j, k, l in ijkl: - val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real - print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {orbitals[k]:<8}" - f"\t {orbitals[l]:<8} \t {val:.3f}") - - - - - -.. rst-class:: sphx-glr-script-out - - .. code-block:: none - - 3z^2-r^2 xz yz xy -0.433 - 3z^2-r^2 xz xy yz 0.217 - 3z^2-r^2 yz xz xy -0.433 - 3z^2-r^2 yz xy xz 0.217 - 3z^2-r^2 xy xz yz 0.217 - 3z^2-r^2 xy yz xz 0.217 - x^2-y^2 xz xy yz -0.375 - x^2-y^2 yz xy xz 0.375 - x^2-y^2 xy xz yz -0.375 - x^2-y^2 xy yz xz 0.375 - - - - -.. GENERATED FROM PYTHON SOURCE LINES 250-256 - -Effects of multi-orbital terms ------------------------------------------------------------------------------- -To test the effects of the multi-orbital terms, let's plot the eigenenergy -spectra with and without multi-orbital terms switched on for system with and -without a cubic crystal field. We will use a :math:`d`-shell with two -electrons. - -.. GENERATED FROM PYTHON SOURCE LINES 256-292 - -.. code-block:: Python - - ten_dqs = [0, 2, 4, 12] - - def diagonalize(ten_dq, umat): - emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq), - edrixs.tmat_c2r('d', ispin=True)) - H = (edrixs.build_opers(4, umat, basis) - + edrixs.build_opers(2, emat, basis)) - e, v = scipy.linalg.eigh(H) - return e - e.min() - - basis = edrixs.get_fock_bin_by_N(10, 2) - umat_no_multiorbital = np.copy(umat) - B = F2/49 - 5*F4/441 - for val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]: - umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0 - - fig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3)) - - for cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)): - ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1, - label='on', color=f'C{cind}') - ax.hlines(diagonalize(ten_dq, umat_no_multiorbital), - xmin=1.5, xmax=2.5, - label='off', - linestyle=':', color=f'C{cind}') - ax.set_title(f"$10D_q={ten_dq}$") - ax.set_ylim([-.5, 20]) - ax.set_xticks([]) - ax.legend() - - fig.suptitle("Eigenvalues with 3&4-orbital effects on/off") - fig.subplots_adjust(wspace=.3) - axs[0].set_ylabel('Eigenvalues (eV)') - fig.subplots_adjust(top=.8) - plt.show() - - - - -.. image-sg:: /auto_examples/images/sphx_glr_example_9_Coulomb_001.png - :alt: Eigenvalues with 3&4-orbital effects on/off, $10D_q=0$, $10D_q=2$, $10D_q=4$, $10D_q=12$ - :srcset: /auto_examples/images/sphx_glr_example_9_Coulomb_001.png - :class: sphx-glr-single-img - - - - - -.. GENERATED FROM PYTHON SOURCE LINES 293-382 - -On the left of the plot Coulomb interactions in spherical symmetry cause -substantial mxing between :math:`t_{2g}` and :math:`e_{g}` orbitals in the -eigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the -the right eigenenergies. As :math:`10D_q` get large, this mixing is switched -off and the spectra start to become independent of whether the 3 & 4 orbital -orbital terms are included or not. - - - -.. _table_2_orbital: -.. table:: Table of 2 orbital interactions - - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |Orbitals :math:`\alpha,\beta`|:math:`U_0` Racah | :math:`U_0` Slater |:math:`J` Racah |:math:`J` Slater | - +=============================+==================+=======================+================+====================+ - |:math:`3z^2-r^2, xz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`3z^2-r^2, yz` |:math:`A/2+B+C/2` |:math:`F_0/2+F_2-12F_4`| :math:`B/2+C/2`|:math:`F_2/2+15F_4` | - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`3z^2-r^2, x^2-y^2` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`3z^2-r^2, xy` |:math:`A/2-2B+C/2`|:math:`F_0/2-2F_2+3F_4`|:math:`2B+C/2` |:math:`2F_2+15F_4/2`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`xz, yz` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`xz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`xz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`yz, x^2-y^2` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`yz, xy` |:math:`A/2-B+C/2` |:math:`F_0/2-F_2-12F_4`|:math:`3B/2+C/2`|:math:`3F_2/2+10F_4`| - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - |:math:`x^2-y^2, xy` |:math:`A/2+2B+C/2`|:math:`F_0+4F_2-34F_4` | :math:`C/2` |:math:`35F_4/2` | - +-----------------------------+------------------+-----------------------+----------------+--------------------+ - - -.. _table_3_orbital: -.. table:: Table of 3 orbital interactions - - +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ - |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| - +=============================+=============+====================================================+=====================================================+ - |:math:`3z^2-r^2, xz, x^2-y^2, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, yz, x^2-y^2, yz` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`xz, 3z^2-r^2, x^2-y^2, xz` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`xz, xz, x^2-y^2, 3z^2-r^2` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`yz, 3z^2-r^2, x^2-y^2, yz` | :math:`\sqrt{3}B` | :math:`\sqrt{3}F_2-5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`yz, yz, x^2-y^2, 3z^2-r^2` | :math:`-\sqrt{3}B/2` | :math:`-\sqrt{3}F_2/2+5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - - -.. _table_4_orbital: -.. table:: Table of 4 orbital interactions - - +-----------------------------+-------------+----------------------------------------------------+-----------------------------------------------------+ - |Orbitals :math:`\alpha,\beta,\gamma,\delta`|:math:`\langle\alpha\beta|\gamma\delta\rangle` Racah|:math:`\langle\alpha\beta|\gamma\delta\rangle` Slater| - +=============================+=============+====================================================+=====================================================+ - |:math:`3z^2-r^2, xz, yz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, xz, xy, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, yz, xz, xy` | :math:`-\sqrt{3}B` | :math:`-\sqrt{3}F_2+5\sqrt{3}F_4` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, yz, xy, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, xy, xz, yz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`3z^2-r^2, xy, yz, xz` | :math:`\sqrt{3}B/2` | :math:`\sqrt{3}F_2/2-5\sqrt{3}F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , xz, xy, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , yz, xy, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , xy, xz, yz` | :math:`-3B/2` | :math:`-3F_2/2+15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - |:math:`x^2-y^2 , xy, yz, xz` | :math:`3B/2` | :math:`3F_2/2-15F_4/2` | - +-------------------------------------------+----------------------------------------------------+-----------------------------------------------------+ - - -.. rubric:: Footnotes - -.. [1] MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of - Transition-Metal Ions in Crystals. Academic Press, New York and London. - - -.. rst-class:: sphx-glr-timing - - **Total running time of the script:** (0 minutes 0.368 seconds) - - -.. _sphx_glr_download_auto_examples_example_9_Coulomb.py: - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-example - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download Jupyter notebook: example_9_Coulomb.ipynb ` - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download Python source code: example_9_Coulomb.py ` - - .. container:: sphx-glr-download sphx-glr-download-zip - - :download:`Download zipped: example_9_Coulomb.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/index.rst.txt b/edrixs/_sources/auto_examples/index.rst.txt deleted file mode 100644 index 2878202d35..0000000000 --- a/edrixs/_sources/auto_examples/index.rst.txt +++ /dev/null @@ -1,225 +0,0 @@ -:orphan: - -Pedagogical examples -==================== - -Below are some examples illustrating the concepts behind and usage of EDRIXS. - - - -.. raw:: html - -
- -.. thumbnail-parent-div-open - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/images/thumb/sphx_glr_example_0_ed_calculator_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_example_0_ed_calculator.py` - -.. raw:: html - -
Exact diagonalization
-
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/images/thumb/sphx_glr_example_1_crystal_field_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_example_1_crystal_field.py` - -.. raw:: html - -
Crystal fields
-
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/images/thumb/sphx_glr_example_2_single_atom_RIXS_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_example_2_single_atom_RIXS.py` - -.. raw:: html - -
RIXS calculations for an atomic model
-
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/images/thumb/sphx_glr_example_3_AIM_XAS_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_example_3_AIM_XAS.py` - -.. raw:: html - -
Anderson impurity model for NiO XAS
-
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/images/thumb/sphx_glr_example_4_GS_analysis_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_example_4_GS_analysis.py` - -.. raw:: html - -
Ground state analysis for NiO
-
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/images/thumb/sphx_glr_example_5_charge_transfer_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_example_5_charge_transfer.py` - -.. raw:: html - -
Charge-transfer energy for NiO
-
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/images/thumb/sphx_glr_example_6_Hubbard_dimer_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_example_6_Hubbard_dimer.py` - -.. raw:: html - -
Hubbard Dimer
-
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/images/thumb/sphx_glr_example_7_transitions_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_example_7_transitions.py` - -.. raw:: html - -
X-ray transitions
-
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/images/thumb/sphx_glr_example_8_Hunds_interactions_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_example_8_Hunds_interactions.py` - -.. raw:: html - -
Hund's Interactions in charge transfer insulators
-
- - -.. raw:: html - -
- -.. only:: html - - .. image:: /auto_examples/images/thumb/sphx_glr_example_9_Coulomb_thumb.png - :alt: - - :ref:`sphx_glr_auto_examples_example_9_Coulomb.py` - -.. raw:: html - -
Coulomb interactions
-
- - -.. thumbnail-parent-div-close - -.. raw:: html - -
- - -.. toctree:: - :hidden: - - /auto_examples/example_0_ed_calculator - /auto_examples/example_1_crystal_field - /auto_examples/example_2_single_atom_RIXS - /auto_examples/example_3_AIM_XAS - /auto_examples/example_4_GS_analysis - /auto_examples/example_5_charge_transfer - /auto_examples/example_6_Hubbard_dimer - /auto_examples/example_7_transitions - /auto_examples/example_8_Hunds_interactions - /auto_examples/example_9_Coulomb - - -.. only:: html - - .. container:: sphx-glr-footer sphx-glr-footer-gallery - - .. container:: sphx-glr-download sphx-glr-download-python - - :download:`Download all examples in Python source code: auto_examples_python.zip ` - - .. container:: sphx-glr-download sphx-glr-download-jupyter - - :download:`Download all examples in Jupyter notebooks: auto_examples_jupyter.zip ` - - -.. only:: html - - .. rst-class:: sphx-glr-signature - - `Gallery generated by Sphinx-Gallery `_ diff --git a/edrixs/_sources/auto_examples/sg_execution_times.rst.txt b/edrixs/_sources/auto_examples/sg_execution_times.rst.txt deleted file mode 100644 index 1e468729aa..0000000000 --- a/edrixs/_sources/auto_examples/sg_execution_times.rst.txt +++ /dev/null @@ -1,64 +0,0 @@ - -:orphan: - -.. _sphx_glr_auto_examples_sg_execution_times: - - -Computation times -================= -**00:07.932** total execution time for 10 files **from auto_examples**: - -.. container:: - - .. raw:: html - - - - - - - - .. list-table:: - :header-rows: 1 - :class: table table-striped sg-datatable - - * - Example - - Time - - Mem (MB) - * - :ref:`sphx_glr_auto_examples_example_2_single_atom_RIXS.py` (``example_2_single_atom_RIXS.py``) - - 00:03.985 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_8_Hunds_interactions.py` (``example_8_Hunds_interactions.py``) - - 00:01.236 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_3_AIM_XAS.py` (``example_3_AIM_XAS.py``) - - 00:00.548 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_7_transitions.py` (``example_7_transitions.py``) - - 00:00.514 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_5_charge_transfer.py` (``example_5_charge_transfer.py``) - - 00:00.478 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_4_GS_analysis.py` (``example_4_GS_analysis.py``) - - 00:00.421 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_9_Coulomb.py` (``example_9_Coulomb.py``) - - 00:00.368 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_1_crystal_field.py` (``example_1_crystal_field.py``) - - 00:00.149 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_0_ed_calculator.py` (``example_0_ed_calculator.py``) - - 00:00.138 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_6_Hubbard_dimer.py` (``example_6_Hubbard_dimer.py``) - - 00:00.095 - - 0.0 diff --git a/edrixs/_sources/index.rst.txt b/edrixs/_sources/index.rst.txt deleted file mode 100644 index a1ec052fbc..0000000000 --- a/edrixs/_sources/index.rst.txt +++ /dev/null @@ -1,15 +0,0 @@ -.. Packaging Scientific Python documentation master file, created by - sphinx-quickstart on Thu Jun 28 12:35:56 2018. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -edrixs Documentation -==================== - -.. toctree:: - :maxdepth: 2 - - user/index - auto_examples/index - reference/index - release-history diff --git a/edrixs/_sources/reference/angular_momentum.rst.txt b/edrixs/_sources/reference/angular_momentum.rst.txt deleted file mode 100644 index bfaf9b4144..0000000000 --- a/edrixs/_sources/reference/angular_momentum.rst.txt +++ /dev/null @@ -1,4 +0,0 @@ -angular_momentum -================ -.. automodule:: edrixs.angular_momentum - :members: diff --git a/edrixs/_sources/reference/basis_transform.rst.txt b/edrixs/_sources/reference/basis_transform.rst.txt deleted file mode 100644 index 11a9c20a4c..0000000000 --- a/edrixs/_sources/reference/basis_transform.rst.txt +++ /dev/null @@ -1,4 +0,0 @@ -basis_transform -================ -.. automodule:: edrixs.basis_transform - :members: diff --git a/edrixs/_sources/reference/coulomb_utensor.rst.txt b/edrixs/_sources/reference/coulomb_utensor.rst.txt deleted file mode 100644 index ee5152e6c9..0000000000 --- a/edrixs/_sources/reference/coulomb_utensor.rst.txt +++ /dev/null @@ -1,9 +0,0 @@ -.. EDRIXS documentation master file, created by - sphinx-quickstart on Sun Sep 16 11:58:12 2018. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -coulomb_utensor -=============== -.. automodule:: edrixs.coulomb_utensor - :members: diff --git a/edrixs/_sources/reference/fit_hyb.rst.txt b/edrixs/_sources/reference/fit_hyb.rst.txt deleted file mode 100644 index 474cdf4be0..0000000000 --- a/edrixs/_sources/reference/fit_hyb.rst.txt +++ /dev/null @@ -1,4 +0,0 @@ -fit_hyb -======= -.. automodule:: edrixs.fit_hyb - :members: diff --git a/edrixs/_sources/reference/fock_basis.rst.txt b/edrixs/_sources/reference/fock_basis.rst.txt deleted file mode 100644 index cf5b3b0630..0000000000 --- a/edrixs/_sources/reference/fock_basis.rst.txt +++ /dev/null @@ -1,4 +0,0 @@ -fock_basis -========== -.. automodule:: edrixs.fock_basis - :members: diff --git a/edrixs/_sources/reference/index.rst.txt b/edrixs/_sources/reference/index.rst.txt deleted file mode 100644 index 24e7580eca..0000000000 --- a/edrixs/_sources/reference/index.rst.txt +++ /dev/null @@ -1,39 +0,0 @@ -.. _reference: - -################ -edrixs Reference -################ - -:Release: |version| -:Date: |today| - -.. module:: edrixs - -This reference manual details functions, modules, and objects -included in EDRIXS, describing what they are and what they do. - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - angular_momentum - basis_transform - coulomb_utensor - fit_hyb - fock_basis - iostream - manybody_operator - photon_transition - plot_spectrum - rixs_utils - soc - solvers - utils - wannier_ham - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/edrixs/_sources/reference/iostream.rst.txt b/edrixs/_sources/reference/iostream.rst.txt deleted file mode 100644 index 59daa01a86..0000000000 --- a/edrixs/_sources/reference/iostream.rst.txt +++ /dev/null @@ -1,4 +0,0 @@ -iostream -========== -.. automodule:: edrixs.iostream - :members: diff --git a/edrixs/_sources/reference/manybody_operator.rst.txt b/edrixs/_sources/reference/manybody_operator.rst.txt deleted file mode 100644 index e4beb489f3..0000000000 --- a/edrixs/_sources/reference/manybody_operator.rst.txt +++ /dev/null @@ -1,4 +0,0 @@ -manybody_operator -================= -.. automodule:: edrixs.manybody_operator - :members: diff --git a/edrixs/_sources/reference/photon_transition.rst.txt b/edrixs/_sources/reference/photon_transition.rst.txt deleted file mode 100644 index 5e6417c647..0000000000 --- a/edrixs/_sources/reference/photon_transition.rst.txt +++ /dev/null @@ -1,4 +0,0 @@ -photon_transition -================= -.. automodule:: edrixs.photon_transition - :members: diff --git a/edrixs/_sources/reference/plot_spectrum.rst.txt b/edrixs/_sources/reference/plot_spectrum.rst.txt deleted file mode 100644 index 237d4061ee..0000000000 --- a/edrixs/_sources/reference/plot_spectrum.rst.txt +++ /dev/null @@ -1,4 +0,0 @@ -plot_spectrum -============= -.. automodule:: edrixs.plot_spectrum - :members: diff --git a/edrixs/_sources/reference/rixs_utils.rst.txt b/edrixs/_sources/reference/rixs_utils.rst.txt deleted file mode 100644 index 1471d801f7..0000000000 --- a/edrixs/_sources/reference/rixs_utils.rst.txt +++ /dev/null @@ -1,4 +0,0 @@ -rixs_utils -========== -.. automodule:: edrixs.rixs_utils - :members: diff --git a/edrixs/_sources/reference/soc.rst.txt b/edrixs/_sources/reference/soc.rst.txt deleted file mode 100644 index f65ed14734..0000000000 --- a/edrixs/_sources/reference/soc.rst.txt +++ /dev/null @@ -1,4 +0,0 @@ -soc -=== -.. automodule:: edrixs.soc - :members: diff --git a/edrixs/_sources/reference/solvers.rst.txt b/edrixs/_sources/reference/solvers.rst.txt deleted file mode 100644 index 1141b02701..0000000000 --- a/edrixs/_sources/reference/solvers.rst.txt +++ /dev/null @@ -1,4 +0,0 @@ -solvers -======= -.. automodule:: edrixs.solvers - :members: diff --git a/edrixs/_sources/reference/utils.rst.txt b/edrixs/_sources/reference/utils.rst.txt deleted file mode 100644 index 27a61adb02..0000000000 --- a/edrixs/_sources/reference/utils.rst.txt +++ /dev/null @@ -1,6 +0,0 @@ -.. _utils: - -utils -===== -.. automodule:: edrixs.utils - :members: diff --git a/edrixs/_sources/reference/wannier_ham.rst.txt b/edrixs/_sources/reference/wannier_ham.rst.txt deleted file mode 100644 index 999a5cb220..0000000000 --- a/edrixs/_sources/reference/wannier_ham.rst.txt +++ /dev/null @@ -1,4 +0,0 @@ -wannier_ham -=========== -.. automodule:: edrixs.wannier_ham - :members: diff --git a/edrixs/_sources/release-history.rst.txt b/edrixs/_sources/release-history.rst.txt deleted file mode 100644 index 53707fbb43..0000000000 --- a/edrixs/_sources/release-history.rst.txt +++ /dev/null @@ -1,6 +0,0 @@ -=============== -Release History -=============== - -Initial Release (YYYY-MM-DD) ----------------------------- diff --git a/edrixs/_sources/sg_execution_times.rst.txt b/edrixs/_sources/sg_execution_times.rst.txt deleted file mode 100644 index f2a554f2d3..0000000000 --- a/edrixs/_sources/sg_execution_times.rst.txt +++ /dev/null @@ -1,64 +0,0 @@ - -:orphan: - -.. _sphx_glr_sg_execution_times: - - -Computation times -================= -**00:07.932** total execution time for 10 files **from all galleries**: - -.. container:: - - .. raw:: html - - - - - - - - .. list-table:: - :header-rows: 1 - :class: table table-striped sg-datatable - - * - Example - - Time - - Mem (MB) - * - :ref:`sphx_glr_auto_examples_example_2_single_atom_RIXS.py` (``../../examples/sphinx/example_2_single_atom_RIXS.py``) - - 00:03.985 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_8_Hunds_interactions.py` (``../../examples/sphinx/example_8_Hunds_interactions.py``) - - 00:01.236 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_3_AIM_XAS.py` (``../../examples/sphinx/example_3_AIM_XAS.py``) - - 00:00.548 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_7_transitions.py` (``../../examples/sphinx/example_7_transitions.py``) - - 00:00.514 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_5_charge_transfer.py` (``../../examples/sphinx/example_5_charge_transfer.py``) - - 00:00.478 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_4_GS_analysis.py` (``../../examples/sphinx/example_4_GS_analysis.py``) - - 00:00.421 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_9_Coulomb.py` (``../../examples/sphinx/example_9_Coulomb.py``) - - 00:00.368 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_1_crystal_field.py` (``../../examples/sphinx/example_1_crystal_field.py``) - - 00:00.149 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_0_ed_calculator.py` (``../../examples/sphinx/example_0_ed_calculator.py``) - - 00:00.138 - - 0.0 - * - :ref:`sphx_glr_auto_examples_example_6_Hubbard_dimer.py` (``../../examples/sphinx/example_6_Hubbard_dimer.py``) - - 00:00.095 - - 0.0 diff --git a/edrixs/_sources/user/basics.ed.rst.txt b/edrixs/_sources/user/basics.ed.rst.txt deleted file mode 100644 index 4f1bd0bff1..0000000000 --- a/edrixs/_sources/user/basics.ed.rst.txt +++ /dev/null @@ -1,5 +0,0 @@ -.. _basics.ed: - -******** -ED -******** diff --git a/edrixs/_sources/user/basics.rixs.rst.txt b/edrixs/_sources/user/basics.rixs.rst.txt deleted file mode 100644 index 89a68f8f81..0000000000 --- a/edrixs/_sources/user/basics.rixs.rst.txt +++ /dev/null @@ -1,5 +0,0 @@ -.. _basics.rixs: - -******** -RIXS -******** diff --git a/edrixs/_sources/user/basics.rst.txt b/edrixs/_sources/user/basics.rst.txt deleted file mode 100644 index 417e9beb0c..0000000000 --- a/edrixs/_sources/user/basics.rst.txt +++ /dev/null @@ -1,10 +0,0 @@ -************* -edrixs basics -************* - -.. toctree:: - :maxdepth: 1 - - basics.ed - basics.xas - basics.rixs diff --git a/edrixs/_sources/user/basics.xas.rst.txt b/edrixs/_sources/user/basics.xas.rst.txt deleted file mode 100644 index 99a7b58cf3..0000000000 --- a/edrixs/_sources/user/basics.xas.rst.txt +++ /dev/null @@ -1,5 +0,0 @@ -.. _basics.xas: - -******** -XAS -******** diff --git a/edrixs/_sources/user/examples.rst.txt b/edrixs/_sources/user/examples.rst.txt deleted file mode 100644 index 9104250738..0000000000 --- a/edrixs/_sources/user/examples.rst.txt +++ /dev/null @@ -1,69 +0,0 @@ -.. _examples: - -=================== -Examples -=================== - -Here we outline the examples available. - - -Examples from our CPC paper ---------------------------- - -The original examples from our Computer Physics Communications paper [1]_ are -kept in our -`GitHub repository `_. -These are scripts that compute XAS and RIXS for particular physical -models including: - -* Single atom model for `Ni `_. See Ref. [1]_ section 5.1. -* A two-site `Ir-Ir cluster `_ model. - See Ref. [1]_ section 5.2. This allows the modeling of dimer excitations in RIXS where electrons transition between atoms. - We used this model in our manuscript on Ba5AlIr2O11. [2]_ -* `Anderson impurity model `_. - See Ref. [1]_ section 5.3. This addresses Ba2YOsO6. - - -Extended examples ------------------ - -Additional examples are available -`here `_. -Thus far we have addressed. - -* Single atom and Anderson impurity models for - `Ba2YOsO6 `_. -* Two-site cluster for - `Ba3InIr2O9 `_. -* Single atom model for - `La2NiO4 `_ - taken from Ref. [3]_ extended to show how spin direction can influence XAS and RIXS spectra. -* Single atom model for - `LaNiO3 heterostructures `_ - taken from Ref. [4]_. -* Heavy fermion example for `plutonium O-edge `_ -* Single atom model for - `pyrochlore iridates `_ - taking into account differently oriented octahedra. -* Single atom model for O-edge RIXS on - `URu2Si2 from `_ - including both 5f and 5d orbitals from Ref. [5]_. -* Single atom model for - `L-edge RIXS on URu2Si2 `_ - from Ref. [6]_. - - -.. rubric:: Footnotes - -.. [1] Y. Wang et al., - `Comput. Phys. Commun 243, 151-165 (2019) `_ -.. [2] Y. Wang et al., - `Phys. Rev. Lett. 122, 106401 (2019) `_. -.. [3] G. Fabbris et al., - `Phys. Rev. Lett. 118, 156402 (2017) `_ -.. [4] G. Fabbris et al., - `Phys. Rev. Lett. 117, 147401 (2016) `_ -.. [5] L. Andrew Wray et al., - `Phys. Rev. Lett. 114, 236401 (2015) `_ -.. [6] Y. Wang et al., - `Phys. Rev. B 96, 085146 (2017) `_ diff --git a/edrixs/_sources/user/index.rst.txt b/edrixs/_sources/user/index.rst.txt deleted file mode 100644 index 7c92009988..0000000000 --- a/edrixs/_sources/user/index.rst.txt +++ /dev/null @@ -1,20 +0,0 @@ -.. _user: - -################# -edrixs User Guide -################# - -:Release: |version| -:Date: |today| - -.. toctree:: - :maxdepth: 1 - - whatisedrixs - installation - usedocker - quickstart - basics - pythontips - examples - papers diff --git a/edrixs/_sources/user/installation.rst.txt b/edrixs/_sources/user/installation.rst.txt deleted file mode 100644 index 9ad5bfaec8..0000000000 --- a/edrixs/_sources/user/installation.rst.txt +++ /dev/null @@ -1,366 +0,0 @@ -************ -Installation -************ -For Linux users we suggest :ref:`installing with anaconda `. For Windows and macOS machines, we suggest using the :ref:`docker instructions `, which are relatively straightforward. If desired, you can also compile the code from the source for Linux. - - -.. _AnacondaInstall: - -Install and use edrixs via Anaconda -==================================================== -A conda package has been built for Linux. To use edrixs via Anaconda, you need first to install `Anaconda `_ in your system. -We recommend installing edrixs into a separate environment, for example, called ``edrixs_env``, together with any other packages you might want to use like this:: - - conda create --name edrixs_env -c conda-forge python=3.10 edrixs matplotlib - -We endeavor to keep the conda-forge release up to date, but note that these builds will usually not correspond to the latest version of edrixs, which is available in the `master branch of edrixs `_. - -edrixs will also run on `Google Colaboratory `_, but does not come installed as default. Installing it requires a you to install conda and then edrixs, which can be done by executing a cell:: - - !pip install -q condacolab - import condacolab - condacolab.install() - !conda install -c conda-forge edrixs - -from within a notebook cell. - -Requirements -============ -Several tools and libraries are required to build and install edrixs, - - * Fortran compiler: gfortran and ifort are supported - * MPI environment: openmpi and mpich are tested - * MPI Fortran and C compilers: mpif90, mpicc - * BLAS and LAPACK libraries: `OpenBLAS `_ with gfortran and MKL with ifort - * ARPACK library: `arpack-ng `_ with mpi enabled - * Only Python3 is supported - * numpy, scipy, sympy, matplotlib, sphinx, numpydoc - * mpi4py with the same MPI implementation libraries (``openmpi`` or ``mpich``) as building edrixs - -Build from source -================= -We will show how to build edrixs from source on Ubuntu Linux 20.04 and macOS Mojave (OSX 10.14) as examples. -We will use gcc, gfortran, openmpi and OpenBLAS in these examples. -Building edrixs on other versions of Linux or macOS, or with Intel's ifort+MKL will be similar. - -Ubuntu Linux 20.04 ------------------- -Install compilers and tools:: - - sudo apt-get update - sudo apt-get install build-essential gfortran gcc - sudo apt-get install git wget - sudo apt-get install python3 libpython3-dev python3-pip python3-venv - -Create and activate a python virtual environment for edrixs:: - - python3 -m venv VIRTUAL_ENV - source VIRTUAL_ENV/bin/activate - -where ``VIRTUAL_ENV`` should be replaced by the directory where you wish to install edrixs. - -Alternatively create and activate a conda environment for edrixs:: - - conda create --name edrixs_env python=3.8 - conda activate edrixs_env - -We will assume ``python`` and ``pip`` are pointing to the activated environment from now on. -Check we are using the expected python and pip:: - - which python - which pip - python --version - -Fetch the latest version of ``pip``:: - - pip install --upgrade pip - -openmpi, OpenBLAS, ARPACK can be installed by ``apt-get``, but their versions are old and may not work properly. -However, they can also be compiled from source easily. In the following, we will show both ways, but we always recommend to build newer ones from source. - -openmpi can be installed by:: - - sudo apt-get install libopenmpi-dev - -or from newer version of source, for example v3.1.4:: - - wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.4.tar.bz2 - tar -xjf openmpi-3.1.4.tar.bz2 - cd openmpi-3.1.4 - ./configure CC=gcc CXX=g++ FC=gfortran - make - sudo make install - -the compiling process will take a while. - -OpenBLAS can be installed by:: - - sudo apt-get install libopenblas-dev - -or from a newer version of source:: - - wget https://github.com/xianyi/OpenBLAS/archive/v0.3.6.tar.gz - tar -xzf v0.3.6.tar.gz - cd OpenBLAS-0.3.6 - make CC=gcc FC=gfortran - sudo make PREFIX=/usr/local install - -ARPACK can be installed by:: - - sudo apt-get install libarpack2-dev libparpack2-dev - -or from a newer version of source:: - - wget https://github.com/opencollab/arpack-ng/archive/3.6.3.tar.gz - tar -xzf 3.6.3.tar.gz - cd arpack-ng-3.6.3 - ./bootstrap - ./configure --enable-mpi --with-blas="-L/usr/local/lib/ -lopenblas" FC=gfortran F77=gfortran MPIFC=mpif90 MPIF77=mpif90 - make - sudo make install - -mpi4py can be installed by:: - - export MPICC=/usr/local/bin/mpicc - sudo pip install --no-cache-dir mpi4py - -or from source:: - - wget https://github.com/mpi4py/mpi4py/archive/3.0.1.tar.gz - tar xzf 3.0.1.tar.gz - cd mpi4py-3.0.1 - -edit mpi.cfg to set MPI paths as following:: - - [mpi] - mpi_dir = /usr/local - mpicc = %(mpi_dir)s/bin/mpicc - mpicxx = %(mpi_dir)s/bin/mpicxx - include_dirs = %(mpi_dir)s/include - libraries = mpi - library_dirs = %(mpi_dir)s/lib - runtime_library_dirs = %(mpi_dir)s/lib - -and comment all other contents. Then, build and install by:: - - python setup.py build - sudo pip install . - -Check whether the MPI paths are correct by:: - - python - >>> import mpi4py - >>> mpi4py.get_config() - {'mpicc': '/usr/local/bin/mpicc', - 'mpicxx': '/usr/local/bin/mpicxx', - 'include_dirs': '/usr/local/include', - 'libraries': 'mpi', - 'library_dirs': '/usr/local/lib', - 'runtime_library_dirs': '/usr/local/lib'} - -Now, we are ready to build edrixs:: - - git clone https://github.com/NSLS-II/edrixs.git - cd edrixs - pip install -v . - -Start to play with edrixs by:: - - python - >>> import edrixs - >>> edrixs.some_functions(...) - -or go to ``examples`` directory to run some examples:: - - cd examples/more/ED/14orb - ./get_inputs.py - mpirun -np 2 ed.x - mpirun -np 2 ./run_fedsolver.py - cd ../../RIXS/LaNiO3_thin - mpirun -np 2 ./run_rixs_fsolver.py - -if no errors, the installation is successful. - -macOS Mojave (OSX 10.14) ------------------------- -Install newest Xcode through App store. - -Use MacPorts -~~~~~~~~~~~~ -Download and install `MacPorts `_. -Update MacPorts by:: - - sudo port -v selfupdate - -Install gcc8, arpack, openblas and openmpi:: - - sudo port -v install gcc8 - sudo port select gcc mp-gcc8 - sudo port -v install openmpi-default +gcc8 - sudo port -v install openblas +gcc8 - sudo port -v install arpack +openblas +openmpi - sudo port select --set mpi openmpi-mp-fortran - -Install Python, pip, numpy, scipy, sympy, matplotlib:: - - sudo port -v install python37 py37-pip - sudo port -v install py37-numpy +gcc8 +openblas - sudo port -v install py37-scipy +gcc8 +openblas - sudo port -v install py37-sympy - sudo port -v install py37-matplotlib - -**Notes:** - -* DO NOT use pip to install numpy because it will use ``clang`` as default compiler, which has a strange bug when using ``f2py`` with ``mpif90`` compiler. If you cannot solve this issue by ``sudo port install py37-numpy +gcc8``, you can compile numpy from its source with ``gcc`` compiler. Always use gcc to compile numpy if you want to build it from source. - -* You can also try ``gcc9`` if it is already available, but be sure to change all ``gcc8`` to ``gcc9`` in the above commands. - -We will assume ``python`` pointing to ``python3.7`` and ``pip`` pointing to ``pip3.7`` from now on. If this is not the case, you can make links explicitly. -Check we are using the expected python and pip:: - - which python - python --version - which pip - pip --version - -Add the following two lines into ``~/.bash_profile``:: - - export PATH="/opt/local/bin:/opt/local/sbin:$PATH" - export PATH=/opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin:$PATH - -Close current terminal and open a new one. - -Install mpi4py:: - - export MPICC=/opt/local/bin/mpicc - sudo pip install --no-cache-dir mpi4py - -Please be sure to check whether the MPI paths of mpi4py are correct by:: - - python - >>> import mpi4py - >>> mpi4py.get_config() - {'mpicc': '/opt/local/bin/mpicc'} - -Now, we are ready to build edrixs:: - - git clone https://github.com/NSLS-II/edrixs.git - cd edrixs - make -C src F90=mpif90 LIBS="-L/opt/local/lib -lopenblas -lparpack -larpack" - make -C src install - python setup.py config_fc --f77exec=mpif90 --f90exec=mpif90 build_ext --libraries=openblas,parpack,arpack --library-dirs=/opt/local/lib - sudo pip install . - -You can add ``edrixs/bin`` to the environment variable ``PATH`` in ~/.bash_profile. - -Go to ``examples`` directory to run some examples:: - - cd examples/more/ED/14orb - ./get_inputs.py - mpirun -np 2 ../../../../src/ed.x - mpirun -np 2 ./run_fedsolver.py - cd ../../RIXS/LaNiO3_thin - mpirun -np 2 ./run_rixs_fsolver.py - -if no errors, the installation is successful. - -All done, enjoy! - -Use Homebrew -~~~~~~~~~~~~~ -Install Homebrew:: - - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - -Add following line to ``~/.bash_profile``:: - - export PATH="/usr/local/bin:$PATH" - -Install gcc9:: - - brew install gcc@9 - -Install openblas and arpack:: - - brew install openblas - brew install arpack - -openmpi has been automatically installed when installing arpack. - -Install python3.7:: - - brew install python - -We will assume ``python`` pointing to ``python3.7`` and ``pip`` pointing to ``pip3.7`` from now on. If this is not the case, you can make link explicitly. -Check we are using the expected python and pip:: - - which python - python --version - which pip - pip --version - -Make links if gcc, g++ and gfortran are not pointing to gcc-9, g++-9, gfortran-9, for example:: - - ln -s /usr/local/Cellar/gcc/9.1.0/bin/gcc-9 /usr/local/bin/gcc - ln -s /usr/local/Cellar/gcc/9.1.0/bin/g++-9 /usr/local/bin/g++ - ln -s /usr/local/Cellar/gcc/9.1.0/bin/gfortran-9 /usr/local/bin/gfortran - -DO NOT install numpy through ``pip`` because it uses ``clang`` as default compiler, which will cause problems. -We will build numpy from source with gcc:: - - wget https://github.com/numpy/numpy/archive/v1.16.3.tar.gz - tar xzf v1.16.3.tar.gz - cd numpy-1.16.3 - export CC=gcc CXX=g++ - python setup.py build - pip install . - -You might need to do ``brew install wget`` if it is not already installed. -If you have BLIS or MKL installed, you will need to tell numpy to compile with -openblas. Create a file in the numpy directory called site.cfg and put the -following text in it:: - - [openblas] - libraries = openblas - library_dirs = /usr/local/Cellar/openblas/0.3.9/lib - include_dirs = /usr/local/Cellar/openblas/0.3.9/include - runtime_library_dirs = /usr/local/Cellar/openblas/0.3.9/lib - -Now we are ready to install scipy, sympy, matplotlib:: - - pip install scipy sympy matplotlib - export MPICC=/usr/local/bin/mpicc - pip install --no-cache-dir mpi4py - -Please be sure to check whether the MPI paths of mpi4py are correct by:: - - python - >>> import mpi4py - >>> mpi4py.get_config() - {'mpicc': '/usr/local/bin/mpicc'} - -Now, we are ready to build edrixs:: - - git clone https://github.com/NSLS-II/edrixs.git - cd edrixs - make -C src F90=mpif90 LIBS="-L/usr/local/opt/openblas/lib -lopenblas -L/usr/local/lib -lparpack -larpack" - make -C src install - python setup.py config_fc --f77exec=mpif90 --f90exec=mpif90 build_ext --libraries=openblas,parpack,arpack --library-dirs=/usr/local/lib:/usr/local/opt/openblas/lib - pip install . - -You can add ``edrixs/bin`` to the environment variable ``PATH`` in ``~/.bash_profile``. - -Go to ``examples`` directory to run some examples:: - - cd examples/more/ED/14orb - ./get_inputs.py - mpirun -np 2 ../../../../src/ed.x - mpirun -np 2 ./run_fedsolver.py - cd ../../RIXS/LaNiO3_thin - mpirun -np 2 ./run_rixs_fsolver.py - -if no errors, the installation is successful. - -All done, enjoy! - -.. [#] To change your default pip you need to add a line to your ``~/.bashrc`` on linux or to your ``~/.bash_profile`` on macOS. This should be ``alias pip='/usr/bin/pip3'`` where the path is determined by calling ``which pip3`` from your terminal. diff --git a/edrixs/_sources/user/papers.rst.txt b/edrixs/_sources/user/papers.rst.txt deleted file mode 100644 index 6f91c1eb0f..0000000000 --- a/edrixs/_sources/user/papers.rst.txt +++ /dev/null @@ -1,54 +0,0 @@ -**************** -EDRIXS papers -**************** - -How to cite ------------ -If you are using the EDRIXS code to do some studies and would like to publish your great works, it would be really appreciated if you can cite the following paper: - -* EDRIXS: An open source toolkit for simulating spectra of resonant inelastic x-ray scattering, Y.L. Wang, G. Fabbris, M.P.M. Dean and G. Kotliar, `Computer Physics Communications,243, 151 (2019) `_ - -Papers using EDRIXS -------------------- - -* Strong Orbital Polarization in a Cobaltate-Titanate Oxide Heterostructure, Sangjae Lee, Alex Taekyung Lee, Alexandru B. Georgescu, Gilberto Fabbris, Myung-Geun Han, Yimei Zhu, John W. Freeland, Ankit S. Disa, Yichen Jia, Mark P. M. Dean, Frederick J. Walker, Sohrab Ismail-Beigi, and Charles H. Ahn, `Phys. Rev. Lett. 123, 117201 (2019) `_ - -* Large Polarons as Key Quasiparticles in SrTiO\ :sub:`3` and SrTiO\ :sub:`3`\ -Based Heterostructures, Andrey Geondzhian, Alessia Sambri, Gabriella M. De Luca, Roberto Di Capua, Emiliano Di Gennaro, Davide Betto, Matteo Rossi, Ying Ying Peng, Roberto Fumagalli, Nicholas B. Brookes, Lucio Braicovich, Keith Gilmore, Giacomo Ghiringhelli, and Marco Salluzzo, `Phys. Rev. Lett. 125, 126401 (2020) `_ - -* Enhanced hybridization in the electronic ground state of the intercalated honeycomb iridate Ag\ :sub:`3`\ LiIr\ :sub:`2`\ O\ :sub:`6`\ , A. de la Torre, B. Zager, F. Bahrami, M. DiScala, J. R. Chamorro, M. H. Upton, G. Fabbris, D. Haskel, D. Casa, T. M. McQueen, F. Tafti, and K. W. Plumb, `Phys. Rev. B 104, L100416 (2021) `_ - -* Probing Physical Oxidation State by Resonant X-ray Emission Spectroscopy: Applications to Iron Model Complexes and Nitrogenase, Rebeca G. Castillo, Anselm W. Hahn, Benjamin E. Van Kuiken, Justin T. Henthorn, Jeremy McGale, and Serena DeBeer, `Angew. Chem. Int. Ed. 60, 10112–1012 (2021) `_ - -* Computing Local Multipoint Correlators Using the Numerical Renormalization Group, Seung-Sup B. Lee, Fabian B. Kugler, and Jan von Delft, `Phys. Rev. X 11, 041007 (2021) `_ - -* Role of Oxygen States in the Low Valence Nickelate La\ :sub:`4`\ Ni\ :sub:`3`\ O\ :sub:`8`\ , Y. Shen, J. Sears, G. Fabbris, J. Li, J. Pelliciari, I. Jarrige, Xi He, I. Božović, M. Mitrano, Junjie Zhang, J. F. Mitchell, A. S. Botana, V. Bisogni, M. R. Norman, S. Johnston, and M. P. M. Dean, `Phys. Rev. X 12, 011055 (2022) `_ - -* Role of disorder in electronic and magnetic properties of Ag\ :sub:`3`\ LiIr\ :sub:`2`\ O\ :sub:`6`\ , Ying Li and Roser Valentí, `Phys. Rev. B 105, 115123 (2022) `_ - -* Excited-state exchange interaction in NiO determined by high-resolution resonant inelastic x-ray scattering at the Ni M\ :sub:`2,3`\ edges Chun-Yu Liu, Kari Ruotsalainen, Karl Bauer, Régis Decker, Annette Pietzsch, and Alexander Föhlisch, `Phys. Rev. B 106, 035104 (2022) `_ - -* Electronic ground state of two nonmagnetic pentavalent honeycomb iridates, A. de la Torre, B. Zager, J. R. Chamorro, M. H. Upton, G. Fabbris, D. Haskel, D. Casa, T. M. McQueen, and K. W. Plumb, `Phys. Rev. Materials 6, 084406 (2022) `_ - -* Emergence of Spinons in Layered Trimer Iridate Ba\ :sub:`4`\ Ir\ :sub:`3`\ O\ :sub:`10` , Y. Shen, J. Sears, G. Fabbris, A. Weichselbaum, W. Yin, H. Zhao, D. G. Mazzone, H. Miao, M. H. Upton, D. Casa, R. Acevedo-Esteves, C. Nelson, A. M. Barbour, C. Mazzoli, G. Cao, and M. P. M. Dean, `Phys. Rev. Lett. 129, 207201 (2022) `_ - -* Site-specific electronic and magnetic excitations of the skyrmion material Cu\ :sub:`2`\ OSeO\ :sub:`3`\ , Yanhong Gu, Yilin Wang, Jiaqi Lin, Jonathan Pelliciari, Jiemin Li, Myung-Geun Han, Marcus Schmidt, Gabriel Kotliar, Claudio Mazzoli, Mark P. M. Dean, and Valentina Bisogni, `Communications Physics 5, 156 (2022) `_ - -* Electronic structure of the frustrated diamond lattice magnet NiRh\ :sub:`2`\ O\ :sub:`4`\ , B. Zager, J. R. Chamorro, L. Ge, F. Bahrami, V. Bisogni, J. Pelliciari, J. Li, G. Fabbris, T. M. McQueen, M. Mourigal, and K. W. Plumb, `Phys. Rev. B 106, 045134 (2022) `_ - -* Electronic Character of Charge Order in Square-Planar Low-Valence Nickelates, Y. Shen, J. Sears, G. Fabbris, J. Li, J. Pelliciari, M. Mitrano, W. He, Junjie Zhang, J. F. Mitchell, V. Bisogni, M. R. Norman, S. Johnston, and M. P. M. Dean, `Phys. Rev. X 13, 011021 (2023) `_ - -* Resonant inelastic X-ray scattering in topological semimetal FeSi, Yao Shen, Anirudh Chandrasekaran, Jennifer Sears, Tiantian Zhang, Xin Han, Youguo Shi, Jiemin Li, Jonathan Pelliciari, Valentina Bisogni, Mark P. M. Dean, Stefanos Kourtis, `arXiv:2301.02677 (2023) `_ - -* Momentum-independent magnetic excitation continuum in the honeycomb iridate H\ :sub:`3`\ LiIr\ :sub:`2`\ O\ :sub:`6`\, A. de la Torre, B. Zager, F. Bahrami, M. H. Upton, J. Kim, G. Fabbris, G. -H. Lee, W. Yang, D. Haskel, F. Tafti, K. W. Plumb, `Nature Comm. 14, 5018 (2023) `_ - -* Low-energy electronic interactions in ferrimagnetic Sr\ :sub:`2`\ CrReO\ :sub:`6`\ thin films, Guillaume Marcaud, Alex Taekyung Lee, Adam J. Hauser, F. Y. Yang, Sangjae Lee, Diego Casa, Mary Upton, Thomas Gog, Kayahan Saritas, Yilin Wang, Mark P. M. Dean, Hua Zhou, Zhan Zhang, F. J. Walker, Ignace Jarrige, Sohrab Ismail-Beigi, and Charles Ahn, `Phys. Rev. B 108, 075132 (2023) `_ - -* Softening of dd-excitation in the resonant inelastic x-ray scattering spectra as a signature of Hund's coupling in nickelates, U Kumar, C Melnick, G Kotliar, `arXiv:2310.00983 (2023) `_ - -* Interplay of broken symmetry and delocalized excitations in the insulating state of 1T-TaS\ :sub:`2`\, Xun Jia, Anubhab Haldar, Jungho Kim, Yilin Wang, Gilberto Fabbris, Karl Ludwig, Stefanos Kourtis, Mary Upton, Yu Liu, Wenjian Lu, Xuan Luo, Yu-Ping Sun, Diego Casa, Sahar Sharifzadeh, Pierre T. Darancet, Yue Cao, `Phys. Rev. B 108, 205105 (2023) `_ - -* Local site behavior of the 5d and 4f ions in the frustrated pyrochlore Ho\ :sub:`2`\Os\ :sub:`2`\O\ :sub:`7`\, S. Calder, Z. Y. Zhao, M. H. Upton, and J.-Q. Yan, `Phys. Rev. B 109, 054408 (2024) `_ - -* Elucidating the Role of Dimensionality on the Electronic Structure of the Van der Waals Antiferromagnet NiPS\ :sub:`3`\ , M. F. DiScala, D. Staros, A. de la Torre, A. Lopez, D. Wong, C. Schulz, M. Bartkowiak, B. Rubenstein, K. W. Plumb, `Advanced Physics Research 3, 2300096 (2024) `_ - -* Experimentally Assessing the Electronic Structure and Spin-State Energetics in MnFe Dimers Using 1s3p Resonant Inelastic X-ray Scattering, Rebeca G. Castillo, Benjamin E. Van Kuiken, Thomas Weyhermüller, and Serena DeBeer, `Inorganic Chemistry (2024) `_ \ No newline at end of file diff --git a/edrixs/_sources/user/pythontips.rst.txt b/edrixs/_sources/user/pythontips.rst.txt deleted file mode 100644 index d9d494c2fa..0000000000 --- a/edrixs/_sources/user/pythontips.rst.txt +++ /dev/null @@ -1,66 +0,0 @@ -.. _pythontips: - -************************** -Tips for python and edrixs -************************** - -In the design of edrixs, we made a deliberate choice to use -`python `_ for the application programming interface. This is -because of its readability, easy of use and flexibility to run and combine it -in many different ways. - -The standard way to run a python script ``myscript.py`` is:: - - python myscript.py - -This will generate the outputs of the script such as plots you choose to save -and print statements will be returned into the terminal. You can save the print -output by simply redirecting the output to a file:: - - python myscript.py > myoutput.txt - -Python also includes an excellent plotting package -`matplotlib `_, which one can use to make publication -quality plots. - -While our aim is that the huge majority of tasks can be done without modifying -the underlying code all the python layers of code are easy to modify if you -would like to. If you want to modify, say, solvers.py. we would suggest copying -solvers.py to your working directory under a different name e.g. -:code:`my_solvers.py`. Executing :code:`%run my_solvers.py` -from within your script will then load the functions from the file into your -namespace. Just be sure to tell the script to load functions from edrixs -(and not via a relative file import) i.e. :code:`from .soc import atom_hsoc` -should be :code:`from edrixs.soc import atom_hsoc`. - -For more exploratory usage, `IPython `_ or -`Jupyter `_ -can be very useful. (See :ref:`edrixsanddocker` for invoking jupyter over docker.) -After starting IPython by typing ``ipython`` at the command line -you might find it useful to execute your script via:: - - %run -i myscript.py - -The *interactive* flag ``-i`` means that all the variables and functions you loaded -will be available to you at the command line. These can be straightforwardly printed -or inspected via the ``?`` or ``??`` flags, which show you the object documentation -and the object code respectively.:: - - from edrixs import cd_cubic_d - cd_cubic_d?? - -Including ``%matplotlib widget`` in your script -will facilitate interactive plots. All these interactive options are also available -in the rich outputs possible within the -`juptyer lab `_ interface. - -A brute force option to look at a variable deep within the code is to use a debugger:: - - python3 -m pdb myscript.py - -Use ``import pdb; pdb.set_trace()`` to set the place where you want to enter the -debugger. See `here `_ for more details. - -If you are feeling even braver, you can browse the Fortran code which does the -heavyweight computation. Either in the source edrixs directory or via the online -`edrixs repo `_. diff --git a/edrixs/_sources/user/quickstart.rst.txt b/edrixs/_sources/user/quickstart.rst.txt deleted file mode 100644 index 46f29db1df..0000000000 --- a/edrixs/_sources/user/quickstart.rst.txt +++ /dev/null @@ -1,46 +0,0 @@ -=================== -Quickstart tutorial -=================== - -If you are already familiar with multiplet calculations this page and our -:ref:`examples page ` are a good part to start. Otherwise, checkout -our Pedagogical examples to learn the concepts -behind how edrixs works. The first example explains :ref:`Exact diagonalization -`. - -Use edrixs as an ED calculator ------------------------------- -edrixs can be used as a simple ED calculator to get eigenvalues (eigenvectors) of a many-body Hamiltonian with small size dimension (:math:`< 1,000`). -We will give an example to get eigenvalues for a :math:`t_{2g}`-orbital system (:math:`l_{eff}=1`). There are 6 orbitals including spin. - -Launch your favorite python terminal:: - - >>> import edrixs - >>> import scipy - >>> norb = 6 - >>> noccu = 2 - >>> Ud, JH = edrixs.UJ_to_UdJH(4, 1) - >>> F0, F2, F4 = edrixs.UdJH_to_F0F2F4(Ud, JH) - >>> umat = edrixs.get_umat_slater('t2g', F0, F2, F4) - >>> emat = edrixs.atom_hsoc('t2g', 0.2) - >>> basis = edrixs.get_fock_bin_by_N(norb, noccu) - >>> H = edrixs.build_opers(4, umat, basis) - >>> e1, v1 = scipy.linalg.eigh(H) - >>> H += edrixs.build_opers(2, emat, basis) - >>> e2, v2 = scipy.linalg.eigh(H) - >>> print(e1) - [1. 1. 1. 1. 1. 1. 1. 1. 1. 3. 3. 3. 3. 3. 6.] - >>> print(e2) - [0.890519 0.890519 0.890519 0.890519 0.890519 1.1 1.1 1.1 - 1.183391 3.009481 3.009481 3.009481 3.009481 3.009481 6.016609] - - -Hello RIXS! ------------ - -This is a "Hello World!" example for RIXS simulations at Ni (:math:`3d^8`) :math:`L_{2/3}` edges. -:math:`L_3` means transition from Ni-:math:`2p_{3/2}` to Ni-:math:`3d`, and -:math:`L_2` means transition from Ni-:math:`2p_{1/2}` to Ni-:math:`3d`. - -.. plot:: pyplots/helloworld.py - :include-source: diff --git a/edrixs/_sources/user/usedocker.rst.txt b/edrixs/_sources/user/usedocker.rst.txt deleted file mode 100644 index 9e7ae0568b..0000000000 --- a/edrixs/_sources/user/usedocker.rst.txt +++ /dev/null @@ -1,53 +0,0 @@ -.. _edrixsanddocker: - -********************* -edrixs and docker -********************* - -Run edrixs in a docker container --------------------------------- - -To make life easier, we have built a docker image based on Ubuntu Linux (22.04) for edrixs, so you don't need to struggle with the installation anymore. -The docker image can be used on any OS as long as the `docker `_ application is available. -Follow these steps to use the docker image: - -* Install the `docker `_ application on your system. - -* Once Docker is running, create a directory to store data and create a file called ``docker-compose.yml`` with contents :: - - version: '3' - services: - edrixs-jupyter: - image: edrixs/edrixs - volumes: - - ./:/home/rixs - working_dir: /home/rixs - ports: - - 8888:8888 - command: "jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root" - edrixs-ipython: - image: edrixs/edrixs - volumes: - - ./:/home/rixs - working_dir: /home/rixs - - and execute :: - - docker compose up - - This will return a url, which you can open to connect to the jupyter session. - -* If you would like to access a terminal rather than jupyter run :: - - docker compose run --rm edrixs-ipython - - -Sharing your code ------------------ - -Using Docker is a nice way to straightforwardly share your code with others. The standard way to specify which docker image is needed to run your code is to include a file named ``Dockerfile`` with the following contents :: - - FROM edrixs/edrixs - -You might like to checkout the `jupyter-repo2docker -`_ project, which helps automate the process of building and connecting to docker images. The `mybinder `_ project might also be helpful as this will open a github respository of notebooks in an executable environment, making your code immediately reproducible by anyone, anywhere. diff --git a/edrixs/_sources/user/whatisedrixs.rst.txt b/edrixs/_sources/user/whatisedrixs.rst.txt deleted file mode 100644 index c62d381f35..0000000000 --- a/edrixs/_sources/user/whatisedrixs.rst.txt +++ /dev/null @@ -1,9 +0,0 @@ -**************** -What is edrixs? -**************** - -EDRIXS is an open source toolkit for simulating XAS and RIXS spectra based on exact diagonalization of model Hamiltonians. -It was started as part of `COMSCOPE project `_ in the -Center for Computational Material Spectroscopy and Design, Brookhaven National Laboratory and is now maintained and -developed in collaboration between the `Condensed Matter Physics and Materials Science Division `_ -and the `National Syncrotron Light Source II `_. \ No newline at end of file diff --git a/edrixs/_static/_sphinx_javascript_frameworks_compat.js b/edrixs/_static/_sphinx_javascript_frameworks_compat.js deleted file mode 100644 index 8549469dc2..0000000000 --- a/edrixs/_static/_sphinx_javascript_frameworks_compat.js +++ /dev/null @@ -1,134 +0,0 @@ -/* - * _sphinx_javascript_frameworks_compat.js - * ~~~~~~~~~~ - * - * Compatability shim for jQuery and underscores.js. - * - * WILL BE REMOVED IN Sphinx 6.0 - * xref RemovedInSphinx60Warning - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - - -/** - * small helper function to urldecode strings - * - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL - */ -jQuery.urldecode = function(x) { - if (!x) { - return x - } - return decodeURIComponent(x.replace(/\+/g, ' ')); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s === 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node, addItems) { - if (node.nodeType === 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && - !jQuery(node.parentNode).hasClass(className) && - !jQuery(node.parentNode).hasClass("nohighlight")) { - var span; - var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.className = className; - } - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - if (isInSVG) { - var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - var bbox = node.parentElement.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute('class', className); - addItems.push({ - "parent": node.parentNode, - "target": rect}); - } - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this, addItems); - }); - } - } - var addItems = []; - var result = this.each(function() { - highlight(this, addItems); - }); - for (var i = 0; i < addItems.length; ++i) { - jQuery(addItems[i].parent).before(addItems[i].target); - } - return result; -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} diff --git a/edrixs/_static/basic.css b/edrixs/_static/basic.css deleted file mode 100644 index 7ebbd6d07b..0000000000 --- a/edrixs/_static/basic.css +++ /dev/null @@ -1,914 +0,0 @@ -/* - * Sphinx stylesheet -- basic theme. - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -div.section::after { - display: block; - content: ''; - clear: left; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox form.search { - overflow: hidden; -} - -div.sphinxsidebar #searchbox input[type="text"] { - float: left; - width: 80%; - padding: 0.25em; - box-sizing: border-box; -} - -div.sphinxsidebar #searchbox input[type="submit"] { - float: left; - width: 20%; - border-left: none; - padding: 0.25em; - box-sizing: border-box; -} - - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin-top: 10px; -} - -ul.search li { - padding: 5px 0; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li p.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; - margin-left: auto; - margin-right: auto; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable ul { - margin-top: 0; - margin-bottom: 0; - list-style-type: none; -} - -table.indextable > tbody > tr > td > ul { - padding-left: 0em; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- domain module index --------------------------------------------------- */ - -table.modindextable td { - padding: 2px; - border-collapse: collapse; -} - -/* -- general body styles --------------------------------------------------- */ - -div.body { - min-width: 360px; - max-width: 800px; -} - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -a.headerlink { - visibility: hidden; -} - -a:visited { - color: #551A8B; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, figure.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, figure.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, figure.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -img.align-default, figure.align-default, .figure.align-default { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-default { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar, -aside.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px; - background-color: #ffe; - width: 40%; - float: right; - clear: right; - overflow-x: auto; -} - -p.sidebar-title { - font-weight: bold; -} - -nav.contents, -aside.topic, -div.admonition, div.topic, blockquote { - clear: left; -} - -/* -- topics ---------------------------------------------------------------- */ - -nav.contents, -aside.topic, -div.topic { - border: 1px solid #ccc; - padding: 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- content of sidebars/topics/admonitions -------------------------------- */ - -div.sidebar > :last-child, -aside.sidebar > :last-child, -nav.contents > :last-child, -aside.topic > :last-child, -div.topic > :last-child, -div.admonition > :last-child { - margin-bottom: 0; -} - -div.sidebar::after, -aside.sidebar::after, -nav.contents::after, -aside.topic::after, -div.topic::after, -div.admonition::after, -blockquote::after { - display: block; - content: ''; - clear: both; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - margin-top: 10px; - margin-bottom: 10px; - border: 0; - border-collapse: collapse; -} - -table.align-center { - margin-left: auto; - margin-right: auto; -} - -table.align-default { - margin-left: auto; - margin-right: auto; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -th > :first-child, -td > :first-child { - margin-top: 0px; -} - -th > :last-child, -td > :last-child { - margin-bottom: 0px; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure, figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption, figcaption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number, -figcaption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text, -figcaption span.caption-text { -} - -/* -- field list styles ----------------------------------------------------- */ - -table.field-list td, table.field-list th { - border: 0 !important; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.field-name { - -moz-hyphens: manual; - -ms-hyphens: manual; - -webkit-hyphens: manual; - hyphens: manual; -} - -/* -- hlist styles ---------------------------------------------------------- */ - -table.hlist { - margin: 1em 0; -} - -table.hlist td { - vertical-align: top; -} - -/* -- object description styles --------------------------------------------- */ - -.sig { - font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; -} - -.sig-name, code.descname { - background-color: transparent; - font-weight: bold; -} - -.sig-name { - font-size: 1.1em; -} - -code.descname { - font-size: 1.2em; -} - -.sig-prename, code.descclassname { - background-color: transparent; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.sig-param.n { - font-style: italic; -} - -/* C++ specific styling */ - -.sig-inline.c-texpr, -.sig-inline.cpp-texpr { - font-family: unset; -} - -.sig.c .k, .sig.c .kt, -.sig.cpp .k, .sig.cpp .kt { - color: #0033B3; -} - -.sig.c .m, -.sig.cpp .m { - color: #1750EB; -} - -.sig.c .s, .sig.c .sc, -.sig.cpp .s, .sig.cpp .sc { - color: #067D17; -} - - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -:not(li) > ol > li:first-child > :first-child, -:not(li) > ul > li:first-child > :first-child { - margin-top: 0px; -} - -:not(li) > ol > li:last-child > :last-child, -:not(li) > ul > li:last-child > :last-child { - margin-bottom: 0px; -} - -ol.simple ol p, -ol.simple ul p, -ul.simple ol p, -ul.simple ul p { - margin-top: 0; -} - -ol.simple > li:not(:first-child) > p, -ul.simple > li:not(:first-child) > p { - margin-top: 0; -} - -ol.simple p, -ul.simple p { - margin-bottom: 0; -} - -aside.footnote > span, -div.citation > span { - float: left; -} -aside.footnote > span:last-of-type, -div.citation > span:last-of-type { - padding-right: 0.5em; -} -aside.footnote > p { - margin-left: 2em; -} -div.citation > p { - margin-left: 4em; -} -aside.footnote > p:last-of-type, -div.citation > p:last-of-type { - margin-bottom: 0em; -} -aside.footnote > p:last-of-type:after, -div.citation > p:last-of-type:after { - content: ""; - clear: both; -} - -dl.field-list { - display: grid; - grid-template-columns: fit-content(30%) auto; -} - -dl.field-list > dt { - font-weight: bold; - word-break: break-word; - padding-left: 0.5em; - padding-right: 5px; -} - -dl.field-list > dd { - padding-left: 0.5em; - margin-top: 0em; - margin-left: 0em; - margin-bottom: 0em; -} - -dl { - margin-bottom: 15px; -} - -dd > :first-child { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -.sig dd { - margin-top: 0px; - margin-bottom: 0px; -} - -.sig dl { - margin-top: 0px; - margin-bottom: 0px; -} - -dl > dd:last-child, -dl > dd:last-child > :last-child { - margin-bottom: 0; -} - -dt:target, span.highlighted { - background-color: #fbe54e; -} - -rect.highlighted { - fill: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -.classifier:before { - font-style: normal; - margin: 0 0.5em; - content: ":"; - display: inline-block; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -.translated { - background-color: rgba(207, 255, 207, 0.2) -} - -.untranslated { - background-color: rgba(255, 207, 207, 0.2) -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -pre, div[class*="highlight-"] { - clear: both; -} - -span.pre { - -moz-hyphens: none; - -ms-hyphens: none; - -webkit-hyphens: none; - hyphens: none; - white-space: nowrap; -} - -div[class*="highlight-"] { - margin: 1em 0; -} - -td.linenos pre { - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - display: block; -} - -table.highlighttable tbody { - display: block; -} - -table.highlighttable tr { - display: flex; -} - -table.highlighttable td { - margin: 0; - padding: 0; -} - -table.highlighttable td.linenos { - padding-right: 0.5em; -} - -table.highlighttable td.code { - flex: 1; - overflow: hidden; -} - -.highlight .hll { - display: block; -} - -div.highlight pre, -table.highlighttable pre { - margin: 0; -} - -div.code-block-caption + div { - margin-top: 0; -} - -div.code-block-caption { - margin-top: 1em; - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -table.highlighttable td.linenos, -span.linenos, -div.highlight span.gp { /* gp: Generic.Prompt */ - user-select: none; - -webkit-user-select: text; /* Safari fallback only */ - -webkit-user-select: none; /* Chrome/Safari */ - -moz-user-select: none; /* Firefox */ - -ms-user-select: none; /* IE10+ */ -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - margin: 1em 0; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -span.eqno a.headerlink { - position: absolute; - z-index: 1; -} - -div.math:hover a.headerlink { - visibility: visible; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/edrixs/_static/binder_badge_logo.svg b/edrixs/_static/binder_badge_logo.svg deleted file mode 100644 index 327f6b639a..0000000000 --- a/edrixs/_static/binder_badge_logo.svg +++ /dev/null @@ -1 +0,0 @@ - launchlaunchbinderbinder \ No newline at end of file diff --git a/edrixs/_static/broken_example.png b/edrixs/_static/broken_example.png deleted file mode 100644 index 4fea24e7df..0000000000 Binary files a/edrixs/_static/broken_example.png and /dev/null differ diff --git a/edrixs/_static/calculator.jpg b/edrixs/_static/calculator.jpg deleted file mode 100644 index df59c093d1..0000000000 Binary files a/edrixs/_static/calculator.jpg and /dev/null differ diff --git a/edrixs/_static/check-solid.svg b/edrixs/_static/check-solid.svg deleted file mode 100644 index 92fad4b5c0..0000000000 --- a/edrixs/_static/check-solid.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/edrixs/_static/clipboard.min.js b/edrixs/_static/clipboard.min.js deleted file mode 100644 index 54b3c46381..0000000000 --- a/edrixs/_static/clipboard.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * clipboard.js v2.0.8 - * https://clipboardjs.com/ - * - * Licensed MIT © Zeno Rocha - */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return o}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),c=n.n(e);function a(t){try{return document.execCommand(t)}catch(t){return}}var f=function(t){t=c()(t);return a("cut"),t};var l=function(t){var e,n,o,r=1 - - - - diff --git a/edrixs/_static/copybutton.css b/edrixs/_static/copybutton.css deleted file mode 100644 index f1916ec7d1..0000000000 --- a/edrixs/_static/copybutton.css +++ /dev/null @@ -1,94 +0,0 @@ -/* Copy buttons */ -button.copybtn { - position: absolute; - display: flex; - top: .3em; - right: .3em; - width: 1.7em; - height: 1.7em; - opacity: 0; - transition: opacity 0.3s, border .3s, background-color .3s; - user-select: none; - padding: 0; - border: none; - outline: none; - border-radius: 0.4em; - /* The colors that GitHub uses */ - border: #1b1f2426 1px solid; - background-color: #f6f8fa; - color: #57606a; -} - -button.copybtn.success { - border-color: #22863a; - color: #22863a; -} - -button.copybtn svg { - stroke: currentColor; - width: 1.5em; - height: 1.5em; - padding: 0.1em; -} - -div.highlight { - position: relative; -} - -/* Show the copybutton */ -.highlight:hover button.copybtn, button.copybtn.success { - opacity: 1; -} - -.highlight button.copybtn:hover { - background-color: rgb(235, 235, 235); -} - -.highlight button.copybtn:active { - background-color: rgb(187, 187, 187); -} - -/** - * A minimal CSS-only tooltip copied from: - * https://codepen.io/mildrenben/pen/rVBrpK - * - * To use, write HTML like the following: - * - *

Short

- */ - .o-tooltip--left { - position: relative; - } - - .o-tooltip--left:after { - opacity: 0; - visibility: hidden; - position: absolute; - content: attr(data-tooltip); - padding: .2em; - font-size: .8em; - left: -.2em; - background: grey; - color: white; - white-space: nowrap; - z-index: 2; - border-radius: 2px; - transform: translateX(-102%) translateY(0); - transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); -} - -.o-tooltip--left:hover:after { - display: block; - opacity: 1; - visibility: visible; - transform: translateX(-100%) translateY(0); - transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); - transition-delay: .5s; -} - -/* By default the copy button shouldn't show up when printing a page */ -@media print { - button.copybtn { - display: none; - } -} diff --git a/edrixs/_static/copybutton.js b/edrixs/_static/copybutton.js deleted file mode 100644 index 2ea7ff3e21..0000000000 --- a/edrixs/_static/copybutton.js +++ /dev/null @@ -1,248 +0,0 @@ -// Localization support -const messages = { - 'en': { - 'copy': 'Copy', - 'copy_to_clipboard': 'Copy to clipboard', - 'copy_success': 'Copied!', - 'copy_failure': 'Failed to copy', - }, - 'es' : { - 'copy': 'Copiar', - 'copy_to_clipboard': 'Copiar al portapapeles', - 'copy_success': '¡Copiado!', - 'copy_failure': 'Error al copiar', - }, - 'de' : { - 'copy': 'Kopieren', - 'copy_to_clipboard': 'In die Zwischenablage kopieren', - 'copy_success': 'Kopiert!', - 'copy_failure': 'Fehler beim Kopieren', - }, - 'fr' : { - 'copy': 'Copier', - 'copy_to_clipboard': 'Copier dans le presse-papier', - 'copy_success': 'Copié !', - 'copy_failure': 'Échec de la copie', - }, - 'ru': { - 'copy': 'Скопировать', - 'copy_to_clipboard': 'Скопировать в буфер', - 'copy_success': 'Скопировано!', - 'copy_failure': 'Не удалось скопировать', - }, - 'zh-CN': { - 'copy': '复制', - 'copy_to_clipboard': '复制到剪贴板', - 'copy_success': '复制成功!', - 'copy_failure': '复制失败', - }, - 'it' : { - 'copy': 'Copiare', - 'copy_to_clipboard': 'Copiato negli appunti', - 'copy_success': 'Copiato!', - 'copy_failure': 'Errore durante la copia', - } -} - -let locale = 'en' -if( document.documentElement.lang !== undefined - && messages[document.documentElement.lang] !== undefined ) { - locale = document.documentElement.lang -} - -let doc_url_root = DOCUMENTATION_OPTIONS.URL_ROOT; -if (doc_url_root == '#') { - doc_url_root = ''; -} - -/** - * SVG files for our copy buttons - */ -let iconCheck = ` - ${messages[locale]['copy_success']} - - -` - -// If the user specified their own SVG use that, otherwise use the default -let iconCopy = ``; -if (!iconCopy) { - iconCopy = ` - ${messages[locale]['copy_to_clipboard']} - - - -` -} - -/** - * Set up copy/paste for code blocks - */ - -const runWhenDOMLoaded = cb => { - if (document.readyState != 'loading') { - cb() - } else if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', cb) - } else { - document.attachEvent('onreadystatechange', function() { - if (document.readyState == 'complete') cb() - }) - } -} - -const codeCellId = index => `codecell${index}` - -// Clears selected text since ClipboardJS will select the text when copying -const clearSelection = () => { - if (window.getSelection) { - window.getSelection().removeAllRanges() - } else if (document.selection) { - document.selection.empty() - } -} - -// Changes tooltip text for a moment, then changes it back -// We want the timeout of our `success` class to be a bit shorter than the -// tooltip and icon change, so that we can hide the icon before changing back. -var timeoutIcon = 2000; -var timeoutSuccessClass = 1500; - -const temporarilyChangeTooltip = (el, oldText, newText) => { - el.setAttribute('data-tooltip', newText) - el.classList.add('success') - // Remove success a little bit sooner than we change the tooltip - // So that we can use CSS to hide the copybutton first - setTimeout(() => el.classList.remove('success'), timeoutSuccessClass) - setTimeout(() => el.setAttribute('data-tooltip', oldText), timeoutIcon) -} - -// Changes the copy button icon for two seconds, then changes it back -const temporarilyChangeIcon = (el) => { - el.innerHTML = iconCheck; - setTimeout(() => {el.innerHTML = iconCopy}, timeoutIcon) -} - -const addCopyButtonToCodeCells = () => { - // If ClipboardJS hasn't loaded, wait a bit and try again. This - // happens because we load ClipboardJS asynchronously. - if (window.ClipboardJS === undefined) { - setTimeout(addCopyButtonToCodeCells, 250) - return - } - - // Add copybuttons to all of our code cells - const COPYBUTTON_SELECTOR = 'div.highlight pre'; - const codeCells = document.querySelectorAll(COPYBUTTON_SELECTOR) - codeCells.forEach((codeCell, index) => { - const id = codeCellId(index) - codeCell.setAttribute('id', id) - - const clipboardButton = id => - `` - codeCell.insertAdjacentHTML('afterend', clipboardButton(id)) - }) - -function escapeRegExp(string) { - return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string -} - -/** - * Removes excluded text from a Node. - * - * @param {Node} target Node to filter. - * @param {string} exclude CSS selector of nodes to exclude. - * @returns {DOMString} Text from `target` with text removed. - */ -function filterText(target, exclude) { - const clone = target.cloneNode(true); // clone as to not modify the live DOM - if (exclude) { - // remove excluded nodes - clone.querySelectorAll(exclude).forEach(node => node.remove()); - } - return clone.innerText; -} - -// Callback when a copy button is clicked. Will be passed the node that was clicked -// should then grab the text and replace pieces of text that shouldn't be used in output -function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") { - var regexp; - var match; - - // Do we check for line continuation characters and "HERE-documents"? - var useLineCont = !!lineContinuationChar - var useHereDoc = !!hereDocDelim - - // create regexp to capture prompt and remaining line - if (isRegexp) { - regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)') - } else { - regexp = new RegExp('^(' + escapeRegExp(copybuttonPromptText) + ')(.*)') - } - - const outputLines = []; - var promptFound = false; - var gotLineCont = false; - var gotHereDoc = false; - const lineGotPrompt = []; - for (const line of textContent.split('\n')) { - match = line.match(regexp) - if (match || gotLineCont || gotHereDoc) { - promptFound = regexp.test(line) - lineGotPrompt.push(promptFound) - if (removePrompts && promptFound) { - outputLines.push(match[2]) - } else { - outputLines.push(line) - } - gotLineCont = line.endsWith(lineContinuationChar) & useLineCont - if (line.includes(hereDocDelim) & useHereDoc) - gotHereDoc = !gotHereDoc - } else if (!onlyCopyPromptLines) { - outputLines.push(line) - } else if (copyEmptyLines && line.trim() === '') { - outputLines.push(line) - } - } - - // If no lines with the prompt were found then just use original lines - if (lineGotPrompt.some(v => v === true)) { - textContent = outputLines.join('\n'); - } - - // Remove a trailing newline to avoid auto-running when pasting - if (textContent.endsWith("\n")) { - textContent = textContent.slice(0, -1) - } - return textContent -} - - -var copyTargetText = (trigger) => { - var target = document.querySelector(trigger.attributes['data-clipboard-target'].value); - - // get filtered text - let exclude = '.linenos'; - - let text = filterText(target, exclude); - return formatCopyText(text, '', false, true, true, true, '', '') -} - - // Initialize with a callback so we can modify the text before copy - const clipboard = new ClipboardJS('.copybtn', {text: copyTargetText}) - - // Update UI with error/success messages - clipboard.on('success', event => { - clearSelection() - temporarilyChangeTooltip(event.trigger, messages[locale]['copy'], messages[locale]['copy_success']) - temporarilyChangeIcon(event.trigger) - }) - - clipboard.on('error', event => { - temporarilyChangeTooltip(event.trigger, messages[locale]['copy'], messages[locale]['copy_failure']) - }) -} - -runWhenDOMLoaded(addCopyButtonToCodeCells) \ No newline at end of file diff --git a/edrixs/_static/copybutton_funcs.js b/edrixs/_static/copybutton_funcs.js deleted file mode 100644 index dbe1aaad79..0000000000 --- a/edrixs/_static/copybutton_funcs.js +++ /dev/null @@ -1,73 +0,0 @@ -function escapeRegExp(string) { - return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string -} - -/** - * Removes excluded text from a Node. - * - * @param {Node} target Node to filter. - * @param {string} exclude CSS selector of nodes to exclude. - * @returns {DOMString} Text from `target` with text removed. - */ -export function filterText(target, exclude) { - const clone = target.cloneNode(true); // clone as to not modify the live DOM - if (exclude) { - // remove excluded nodes - clone.querySelectorAll(exclude).forEach(node => node.remove()); - } - return clone.innerText; -} - -// Callback when a copy button is clicked. Will be passed the node that was clicked -// should then grab the text and replace pieces of text that shouldn't be used in output -export function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") { - var regexp; - var match; - - // Do we check for line continuation characters and "HERE-documents"? - var useLineCont = !!lineContinuationChar - var useHereDoc = !!hereDocDelim - - // create regexp to capture prompt and remaining line - if (isRegexp) { - regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)') - } else { - regexp = new RegExp('^(' + escapeRegExp(copybuttonPromptText) + ')(.*)') - } - - const outputLines = []; - var promptFound = false; - var gotLineCont = false; - var gotHereDoc = false; - const lineGotPrompt = []; - for (const line of textContent.split('\n')) { - match = line.match(regexp) - if (match || gotLineCont || gotHereDoc) { - promptFound = regexp.test(line) - lineGotPrompt.push(promptFound) - if (removePrompts && promptFound) { - outputLines.push(match[2]) - } else { - outputLines.push(line) - } - gotLineCont = line.endsWith(lineContinuationChar) & useLineCont - if (line.includes(hereDocDelim) & useHereDoc) - gotHereDoc = !gotHereDoc - } else if (!onlyCopyPromptLines) { - outputLines.push(line) - } else if (copyEmptyLines && line.trim() === '') { - outputLines.push(line) - } - } - - // If no lines with the prompt were found then just use original lines - if (lineGotPrompt.some(v => v === true)) { - textContent = outputLines.join('\n'); - } - - // Remove a trailing newline to avoid auto-running when pasting - if (textContent.endsWith("\n")) { - textContent = textContent.slice(0, -1) - } - return textContent -} diff --git a/edrixs/_static/css/badge_only.css b/edrixs/_static/css/badge_only.css deleted file mode 100644 index 88ba55b965..0000000000 --- a/edrixs/_static/css/badge_only.css +++ /dev/null @@ -1 +0,0 @@ -.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions .rst-other-versions .rtd-current-item{font-weight:700}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}#flyout-search-form{padding:6px} \ No newline at end of file diff --git a/edrixs/_static/css/fonts/Roboto-Slab-Bold.woff b/edrixs/_static/css/fonts/Roboto-Slab-Bold.woff deleted file mode 100644 index 6cb6000018..0000000000 Binary files a/edrixs/_static/css/fonts/Roboto-Slab-Bold.woff and /dev/null differ diff --git a/edrixs/_static/css/fonts/Roboto-Slab-Bold.woff2 b/edrixs/_static/css/fonts/Roboto-Slab-Bold.woff2 deleted file mode 100644 index 7059e23142..0000000000 Binary files a/edrixs/_static/css/fonts/Roboto-Slab-Bold.woff2 and /dev/null differ diff --git a/edrixs/_static/css/fonts/Roboto-Slab-Regular.woff b/edrixs/_static/css/fonts/Roboto-Slab-Regular.woff deleted file mode 100644 index f815f63f99..0000000000 Binary files a/edrixs/_static/css/fonts/Roboto-Slab-Regular.woff and /dev/null differ diff --git a/edrixs/_static/css/fonts/Roboto-Slab-Regular.woff2 b/edrixs/_static/css/fonts/Roboto-Slab-Regular.woff2 deleted file mode 100644 index f2c76e5bda..0000000000 Binary files a/edrixs/_static/css/fonts/Roboto-Slab-Regular.woff2 and /dev/null differ diff --git a/edrixs/_static/css/fonts/fontawesome-webfont.eot b/edrixs/_static/css/fonts/fontawesome-webfont.eot deleted file mode 100644 index e9f60ca953..0000000000 Binary files a/edrixs/_static/css/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/edrixs/_static/css/fonts/fontawesome-webfont.svg b/edrixs/_static/css/fonts/fontawesome-webfont.svg deleted file mode 100644 index 855c845e53..0000000000 --- a/edrixs/_static/css/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,2671 +0,0 @@ - - - - -Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 - By ,,, -Copyright Dave Gandy 2016. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/edrixs/_static/css/fonts/fontawesome-webfont.ttf b/edrixs/_static/css/fonts/fontawesome-webfont.ttf deleted file mode 100644 index 35acda2fa1..0000000000 Binary files a/edrixs/_static/css/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/edrixs/_static/css/fonts/fontawesome-webfont.woff b/edrixs/_static/css/fonts/fontawesome-webfont.woff deleted file mode 100644 index 400014a4b0..0000000000 Binary files a/edrixs/_static/css/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/edrixs/_static/css/fonts/fontawesome-webfont.woff2 b/edrixs/_static/css/fonts/fontawesome-webfont.woff2 deleted file mode 100644 index 4d13fc6040..0000000000 Binary files a/edrixs/_static/css/fonts/fontawesome-webfont.woff2 and /dev/null differ diff --git a/edrixs/_static/css/fonts/lato-bold-italic.woff b/edrixs/_static/css/fonts/lato-bold-italic.woff deleted file mode 100644 index 88ad05b9ff..0000000000 Binary files a/edrixs/_static/css/fonts/lato-bold-italic.woff and /dev/null differ diff --git a/edrixs/_static/css/fonts/lato-bold-italic.woff2 b/edrixs/_static/css/fonts/lato-bold-italic.woff2 deleted file mode 100644 index c4e3d804b5..0000000000 Binary files a/edrixs/_static/css/fonts/lato-bold-italic.woff2 and /dev/null differ diff --git a/edrixs/_static/css/fonts/lato-bold.woff b/edrixs/_static/css/fonts/lato-bold.woff deleted file mode 100644 index c6dff51f06..0000000000 Binary files a/edrixs/_static/css/fonts/lato-bold.woff and /dev/null differ diff --git a/edrixs/_static/css/fonts/lato-bold.woff2 b/edrixs/_static/css/fonts/lato-bold.woff2 deleted file mode 100644 index bb195043cf..0000000000 Binary files a/edrixs/_static/css/fonts/lato-bold.woff2 and /dev/null differ diff --git a/edrixs/_static/css/fonts/lato-normal-italic.woff b/edrixs/_static/css/fonts/lato-normal-italic.woff deleted file mode 100644 index 76114bc033..0000000000 Binary files a/edrixs/_static/css/fonts/lato-normal-italic.woff and /dev/null differ diff --git a/edrixs/_static/css/fonts/lato-normal-italic.woff2 b/edrixs/_static/css/fonts/lato-normal-italic.woff2 deleted file mode 100644 index 3404f37e2e..0000000000 Binary files a/edrixs/_static/css/fonts/lato-normal-italic.woff2 and /dev/null differ diff --git a/edrixs/_static/css/fonts/lato-normal.woff b/edrixs/_static/css/fonts/lato-normal.woff deleted file mode 100644 index ae1307ff5f..0000000000 Binary files a/edrixs/_static/css/fonts/lato-normal.woff and /dev/null differ diff --git a/edrixs/_static/css/fonts/lato-normal.woff2 b/edrixs/_static/css/fonts/lato-normal.woff2 deleted file mode 100644 index 3bf9843328..0000000000 Binary files a/edrixs/_static/css/fonts/lato-normal.woff2 and /dev/null differ diff --git a/edrixs/_static/css/theme.css b/edrixs/_static/css/theme.css deleted file mode 100644 index 0f14f10646..0000000000 --- a/edrixs/_static/css/theme.css +++ /dev/null @@ -1,4 +0,0 @@ -html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}.rst-content .toctree-wrapper>p.caption,h2,h3,p{orphans:3;widows:3}.rst-content .toctree-wrapper>p.caption,h2,h3{page-break-after:avoid}}.btn,.fa:before,.icon:before,.rst-content .admonition,.rst-content .admonition-title:before,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .code-block-caption .headerlink:before,.rst-content .danger,.rst-content .eqno .headerlink:before,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-alert,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}/*! - * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .eqno .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a button.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-left.toctree-expand,.wy-menu-vertical li button.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .eqno .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a button.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-right.toctree-expand,.wy-menu-vertical li button.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .eqno .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a button.pull-left.toctree-expand,.wy-menu-vertical li.on a button.pull-left.toctree-expand,.wy-menu-vertical li button.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .eqno .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a button.pull-right.toctree-expand,.wy-menu-vertical li.on a button.pull-right.toctree-expand,.wy-menu-vertical li button.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li button.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content .eqno .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content .eqno a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content p a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li a button.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content .eqno .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content p .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li button.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content .eqno .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a button.toctree-expand,.btn .wy-menu-vertical li.on a button.toctree-expand,.btn .wy-menu-vertical li button.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content .eqno .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a button.toctree-expand,.nav .wy-menu-vertical li.on a button.toctree-expand,.nav .wy-menu-vertical li button.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .eqno .btn .headerlink,.rst-content .eqno .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p .btn .headerlink,.rst-content p .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn button.toctree-expand,.wy-menu-vertical li.current>a .btn button.toctree-expand,.wy-menu-vertical li.current>a .nav button.toctree-expand,.wy-menu-vertical li .nav button.toctree-expand,.wy-menu-vertical li.on a .btn button.toctree-expand,.wy-menu-vertical li.on a .nav button.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .eqno .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li button.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .eqno .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li button.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .eqno .btn .fa-large.headerlink,.rst-content .eqno .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p .btn .fa-large.headerlink,.rst-content p .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn button.fa-large.toctree-expand,.wy-menu-vertical li .nav button.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .eqno .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li button.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .eqno .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li button.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .eqno .btn .fa-spin.headerlink,.rst-content .eqno .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p .btn .fa-spin.headerlink,.rst-content p .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn button.fa-spin.toctree-expand,.wy-menu-vertical li .nav button.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content .eqno .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li button.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content .eqno .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li button.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content .eqno .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li button.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content .eqno .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini button.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:"";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.rst-content section ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.rst-content section ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.rst-content section ul li p:last-child,.rst-content section ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.rst-content section ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.rst-content section ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.rst-content section ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content .section ol.arabic,.rst-content .toctree-wrapper ol,.rst-content .toctree-wrapper ol.arabic,.rst-content section ol,.rst-content section ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol.arabic li,.rst-content .section ol li,.rst-content .toctree-wrapper ol.arabic li,.rst-content .toctree-wrapper ol li,.rst-content section ol.arabic li,.rst-content section ol li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol.arabic li ul,.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content .toctree-wrapper ol.arabic li ul,.rst-content .toctree-wrapper ol li p:last-child,.rst-content .toctree-wrapper ol li ul,.rst-content section ol.arabic li ul,.rst-content section ol li p:last-child,.rst-content section ol li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol.arabic li ul li,.rst-content .section ol li ul li,.rst-content .toctree-wrapper ol.arabic li ul li,.rst-content .toctree-wrapper ol li ul li,.rst-content section ol.arabic li ul li,.rst-content section ol li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs>li{display:inline-block;padding-top:5px}.wy-breadcrumbs>li.wy-breadcrumbs-aside{float:right}.rst-content .wy-breadcrumbs>li code,.rst-content .wy-breadcrumbs>li tt,.wy-breadcrumbs>li .rst-content tt,.wy-breadcrumbs>li code{all:inherit;color:inherit}.breadcrumb-item:before{content:"/";color:#bbb;font-size:13px;padding:0 6px 0 3px}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li button.toctree-expand{display:block;float:left;margin-left:-1.2em;line-height:18px;color:#4d4d4d;border:none;background:none;padding:0}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover button.toctree-expand,.wy-menu-vertical li.on a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand{display:block;line-height:18px;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{padding:.4045em 1.618em .4045em 4.045em}.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{padding:.4045em 1.618em .4045em 5.663em}.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a{padding:.4045em 1.618em .4045em 7.281em}.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a{padding:.4045em 1.618em .4045em 8.899em}.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a{padding:.4045em 1.618em .4045em 10.517em}.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a{padding:.4045em 1.618em .4045em 12.135em}.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a{padding:.4045em 1.618em .4045em 13.753em}.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a{padding:.4045em 1.618em .4045em 15.371em}.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 1.618em .4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 button.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 button.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover button.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active button.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em;max-width:100%}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search .wy-dropdown>aactive,.wy-side-nav-search .wy-dropdown>afocus,.wy-side-nav-search>a:hover,.wy-side-nav-search>aactive,.wy-side-nav-search>afocus{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon,.wy-side-nav-search>a.icon{display:block}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.switch-menus{position:relative;display:block;margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-side-nav-search>div.switch-menus>div.language-switch,.wy-side-nav-search>div.switch-menus>div.version-switch{display:inline-block;padding:.2em}.wy-side-nav-search>div.switch-menus>div.language-switch select,.wy-side-nav-search>div.switch-menus>div.version-switch select{display:inline-block;margin-right:-2rem;padding-right:2rem;max-width:240px;text-align-last:center;background:none;border:none;border-radius:0;box-shadow:none;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-size:1em;font-weight:400;color:hsla(0,0%,100%,.3);cursor:pointer;appearance:none;-webkit-appearance:none;-moz-appearance:none}.wy-side-nav-search>div.switch-menus>div.language-switch select:active,.wy-side-nav-search>div.switch-menus>div.language-switch select:focus,.wy-side-nav-search>div.switch-menus>div.language-switch select:hover,.wy-side-nav-search>div.switch-menus>div.version-switch select:active,.wy-side-nav-search>div.switch-menus>div.version-switch select:focus,.wy-side-nav-search>div.switch-menus>div.version-switch select:hover{background:hsla(0,0%,100%,.1);color:hsla(0,0%,100%,.5)}.wy-side-nav-search>div.switch-menus>div.language-switch select option,.wy-side-nav-search>div.switch-menus>div.version-switch select option{color:#000}.wy-side-nav-search>div.switch-menus>div.language-switch:has(>select):after,.wy-side-nav-search>div.switch-menus>div.version-switch:has(>select):after{display:inline-block;width:1.5em;height:100%;padding:.1em;content:"\f0d7";font-size:1em;line-height:1.2em;font-family:FontAwesome;text-align:center;pointer-events:none;box-sizing:border-box}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .eqno .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content .eqno .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li button.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version button.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions .rst-other-versions .rtd-current-item{font-weight:700}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}#flyout-search-form{padding:6px}.rst-content .toctree-wrapper>p.caption,.rst-content h1,.rst-content h2,.rst-content h3,.rst-content h4,.rst-content h5,.rst-content h6{margin-bottom:24px}.rst-content img{max-width:100%;height:auto}.rst-content div.figure,.rst-content figure{margin-bottom:24px}.rst-content div.figure .caption-text,.rst-content figure .caption-text{font-style:italic}.rst-content div.figure p:last-child.caption,.rst-content figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center,.rst-content figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img,.rst-content section>a>img,.rst-content section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"\f08e";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp,.rst-content div.highlight span.linenos{user-select:none;pointer-events:none}.rst-content div.highlight span.linenos{display:inline-block;padding-left:0;padding-right:12px;margin-right:12px;border-right:1px solid #e6e9ea}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li,.rst-content .toctree-wrapper ol.loweralpha,.rst-content .toctree-wrapper ol.loweralpha>li,.rst-content section ol.loweralpha,.rst-content section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li,.rst-content .toctree-wrapper ol.upperalpha,.rst-content .toctree-wrapper ol.upperalpha>li,.rst-content section ol.upperalpha,.rst-content section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*,.rst-content .toctree-wrapper ol li>*,.rst-content .toctree-wrapper ul li>*,.rst-content section ol li>*,.rst-content section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child,.rst-content .toctree-wrapper ol li>:first-child,.rst-content .toctree-wrapper ul li>:first-child,.rst-content section ol li>:first-child,.rst-content section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child,.rst-content .toctree-wrapper ol li>p,.rst-content .toctree-wrapper ol li>p:last-child,.rst-content .toctree-wrapper ul li>p,.rst-content .toctree-wrapper ul li>p:last-child,.rst-content section ol li>p,.rst-content section ol li>p:last-child,.rst-content section ul li>p,.rst-content section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child,.rst-content .toctree-wrapper ol li>p:only-child,.rst-content .toctree-wrapper ol li>p:only-child:last-child,.rst-content .toctree-wrapper ul li>p:only-child,.rst-content .toctree-wrapper ul li>p:only-child:last-child,.rst-content section ol li>p:only-child,.rst-content section ol li>p:only-child:last-child,.rst-content section ul li>p:only-child,.rst-content section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul,.rst-content .toctree-wrapper ol li>ol,.rst-content .toctree-wrapper ol li>ul,.rst-content .toctree-wrapper ul li>ol,.rst-content .toctree-wrapper ul li>ul,.rst-content section ol li>ol,.rst-content section ol li>ul,.rst-content section ul li>ol,.rst-content section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul,.rst-content .toctree-wrapper ol.simple li>*,.rst-content .toctree-wrapper ol.simple li ol,.rst-content .toctree-wrapper ol.simple li ul,.rst-content .toctree-wrapper ul.simple li>*,.rst-content .toctree-wrapper ul.simple li ol,.rst-content .toctree-wrapper ul.simple li ul,.rst-content section ol.simple li>*,.rst-content section ol.simple li ol,.rst-content section ol.simple li ul,.rst-content section ul.simple li>*,.rst-content section ul.simple li ol,.rst-content section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink{opacity:0;font-size:14px;font-family:FontAwesome;margin-left:.5em}.rst-content .code-block-caption .headerlink:focus,.rst-content .code-block-caption:hover .headerlink,.rst-content .eqno .headerlink:focus,.rst-content .eqno:hover .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink:focus,.rst-content .toctree-wrapper>p.caption:hover .headerlink,.rst-content dl dt .headerlink:focus,.rst-content dl dt:hover .headerlink,.rst-content h1 .headerlink:focus,.rst-content h1:hover .headerlink,.rst-content h2 .headerlink:focus,.rst-content h2:hover .headerlink,.rst-content h3 .headerlink:focus,.rst-content h3:hover .headerlink,.rst-content h4 .headerlink:focus,.rst-content h4:hover .headerlink,.rst-content h5 .headerlink:focus,.rst-content h5:hover .headerlink,.rst-content h6 .headerlink:focus,.rst-content h6:hover .headerlink,.rst-content p.caption .headerlink:focus,.rst-content p.caption:hover .headerlink,.rst-content p .headerlink:focus,.rst-content p:hover .headerlink,.rst-content table>caption .headerlink:focus,.rst-content table>caption:hover .headerlink{opacity:1}.rst-content p a{overflow-wrap:anywhere}.rst-content .wy-table td p,.rst-content .wy-table td ul,.rst-content .wy-table th p,.rst-content .wy-table th ul,.rst-content table.docutils td p,.rst-content table.docutils td ul,.rst-content table.docutils th p,.rst-content table.docutils th ul,.rst-content table.field-list td p,.rst-content table.field-list td ul,.rst-content table.field-list th p,.rst-content table.field-list th ul{font-size:inherit}.rst-content .btn:focus{outline:2px solid}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .citation-reference>span.fn-bracket,.rst-content .footnote-reference>span.fn-bracket{display:none}.rst-content .hlist{width:100%}.rst-content dl dt span.classifier:before{content:" : "}.rst-content dl dt span.classifier-delimiter{display:none!important}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:auto minmax(80%,95%)}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{display:inline-grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{display:grid;grid-template-columns:auto auto minmax(.65rem,auto) minmax(40%,95%)}html.writer-html5 .rst-content aside.citation>span.label,html.writer-html5 .rst-content aside.footnote>span.label,html.writer-html5 .rst-content div.citation>span.label{grid-column-start:1;grid-column-end:2}html.writer-html5 .rst-content aside.citation>span.backrefs,html.writer-html5 .rst-content aside.footnote>span.backrefs,html.writer-html5 .rst-content div.citation>span.backrefs{grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:3}html.writer-html5 .rst-content aside.citation>p,html.writer-html5 .rst-content aside.footnote>p,html.writer-html5 .rst-content div.citation>p{grid-column-start:4;grid-column-end:5}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{margin-bottom:24px}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.citation>dt>span.brackets:before,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:"["}html.writer-html5 .rst-content dl.citation>dt>span.brackets:after,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:"]"}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a{word-break:keep-all}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a:not(:first-child):before,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.citation>dd p,html.writer-html5 .rst-content dl.footnote>dd p{font-size:.9rem}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{padding-left:1rem;padding-right:1rem;font-size:.9rem;line-height:1.2rem}html.writer-html5 .rst-content aside.citation p,html.writer-html5 .rst-content aside.footnote p,html.writer-html5 .rst-content div.citation p{font-size:.9rem;line-height:1.2rem;margin-bottom:12px}html.writer-html5 .rst-content aside.citation span.backrefs,html.writer-html5 .rst-content aside.footnote span.backrefs,html.writer-html5 .rst-content div.citation span.backrefs{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content aside.citation span.backrefs>a,html.writer-html5 .rst-content aside.footnote span.backrefs>a,html.writer-html5 .rst-content div.citation span.backrefs>a{word-break:keep-all}html.writer-html5 .rst-content aside.citation span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content aside.footnote span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content div.citation span.backrefs>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content aside.citation span.label,html.writer-html5 .rst-content aside.footnote span.label,html.writer-html5 .rst-content div.citation span.label{line-height:1.2rem}html.writer-html5 .rst-content aside.citation-list,html.writer-html5 .rst-content aside.footnote-list,html.writer-html5 .rst-content div.citation-list{margin-bottom:24px}html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content aside.footnote-list aside.footnote,html.writer-html5 .rst-content div.citation-list>div.citation,html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content aside.footnote-list aside.footnote code,html.writer-html5 .rst-content aside.footnote-list aside.footnote tt,html.writer-html5 .rst-content aside.footnote code,html.writer-html5 .rst-content aside.footnote tt,html.writer-html5 .rst-content div.citation-list>div.citation code,html.writer-html5 .rst-content div.citation-list>div.citation tt,html.writer-html5 .rst-content dl.citation code,html.writer-html5 .rst-content dl.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c;white-space:normal}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040;overflow-wrap:normal}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}.rst-content dl dd>ol:last-child,.rst-content dl dd>p:last-child,.rst-content dl dd>table:last-child,.rst-content dl dd>ul:last-child{margin-bottom:0}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px;max-width:100%}html.writer-html4 .rst-content dl:not(.docutils) .k,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .k{font-style:italic}html.writer-html4 .rst-content dl:not(.docutils) .descclassname,html.writer-html4 .rst-content dl:not(.docutils) .descname,html.writer-html4 .rst-content dl:not(.docutils) .sig-name,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .sig-name{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#000}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel,.rst-content .menuselection{font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .guilabel,.rst-content .menuselection{border:1px solid #7fbbe3;background:#e7f2fa}.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>.kbd,.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>kbd{color:inherit;font-size:80%;background-color:#fff;border:1px solid #a6a6a6;border-radius:4px;box-shadow:0 2px grey;padding:2.4px 6px;margin:auto 0}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format("woff2"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format("woff");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format("woff2"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format("woff");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format("woff2"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format("woff");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format("woff2"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format("woff");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format("woff2"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format("woff");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format("woff2"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format("woff");font-display:block} \ No newline at end of file diff --git a/edrixs/_static/doctools.js b/edrixs/_static/doctools.js deleted file mode 100644 index 0398ebb9f0..0000000000 --- a/edrixs/_static/doctools.js +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Base JavaScript utilities for all Sphinx HTML documentation. - */ -"use strict"; - -const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ - "TEXTAREA", - "INPUT", - "SELECT", - "BUTTON", -]); - -const _ready = (callback) => { - if (document.readyState !== "loading") { - callback(); - } else { - document.addEventListener("DOMContentLoaded", callback); - } -}; - -/** - * Small JavaScript module for the documentation. - */ -const Documentation = { - init: () => { - Documentation.initDomainIndexTable(); - Documentation.initOnKeyListeners(); - }, - - /** - * i18n support - */ - TRANSLATIONS: {}, - PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), - LOCALE: "unknown", - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext: (string) => { - const translated = Documentation.TRANSLATIONS[string]; - switch (typeof translated) { - case "undefined": - return string; // no translation - case "string": - return translated; // translation exists - default: - return translated[0]; // (singular, plural) translation tuple exists - } - }, - - ngettext: (singular, plural, n) => { - const translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated !== "undefined") - return translated[Documentation.PLURAL_EXPR(n)]; - return n === 1 ? singular : plural; - }, - - addTranslations: (catalog) => { - Object.assign(Documentation.TRANSLATIONS, catalog.messages); - Documentation.PLURAL_EXPR = new Function( - "n", - `return (${catalog.plural_expr})` - ); - Documentation.LOCALE = catalog.locale; - }, - - /** - * helper function to focus on search bar - */ - focusSearchBar: () => { - document.querySelectorAll("input[name=q]")[0]?.focus(); - }, - - /** - * Initialise the domain index toggle buttons - */ - initDomainIndexTable: () => { - const toggler = (el) => { - const idNumber = el.id.substr(7); - const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); - if (el.src.substr(-9) === "minus.png") { - el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; - toggledRows.forEach((el) => (el.style.display = "none")); - } else { - el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; - toggledRows.forEach((el) => (el.style.display = "")); - } - }; - - const togglerElements = document.querySelectorAll("img.toggler"); - togglerElements.forEach((el) => - el.addEventListener("click", (event) => toggler(event.currentTarget)) - ); - togglerElements.forEach((el) => (el.style.display = "")); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); - }, - - initOnKeyListeners: () => { - // only install a listener if it is really needed - if ( - !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && - !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS - ) - return; - - document.addEventListener("keydown", (event) => { - // bail for input elements - if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; - // bail with special keys - if (event.altKey || event.ctrlKey || event.metaKey) return; - - if (!event.shiftKey) { - switch (event.key) { - case "ArrowLeft": - if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; - - const prevLink = document.querySelector('link[rel="prev"]'); - if (prevLink && prevLink.href) { - window.location.href = prevLink.href; - event.preventDefault(); - } - break; - case "ArrowRight": - if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; - - const nextLink = document.querySelector('link[rel="next"]'); - if (nextLink && nextLink.href) { - window.location.href = nextLink.href; - event.preventDefault(); - } - break; - } - } - - // some keyboard layouts may need Shift to get / - switch (event.key) { - case "/": - if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; - Documentation.focusSearchBar(); - event.preventDefault(); - } - }); - }, -}; - -// quick alias for translations -const _ = Documentation.gettext; - -_ready(Documentation.init); diff --git a/edrixs/_static/documentation_options.js b/edrixs/_static/documentation_options.js deleted file mode 100644 index 7e4c114f21..0000000000 --- a/edrixs/_static/documentation_options.js +++ /dev/null @@ -1,13 +0,0 @@ -const DOCUMENTATION_OPTIONS = { - VERSION: '', - LANGUAGE: 'en', - COLLAPSE_INDEX: false, - BUILDER: 'html', - FILE_SUFFIX: '.html', - LINK_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt', - NAVIGATION_WITH_KEYS: false, - SHOW_SEARCH_SUMMARY: true, - ENABLE_SEARCH_SHORTCUTS: true, -}; \ No newline at end of file diff --git a/edrixs/_static/energy_level.png b/edrixs/_static/energy_level.png deleted file mode 100644 index 9878f7d91d..0000000000 Binary files a/edrixs/_static/energy_level.png and /dev/null differ diff --git a/edrixs/_static/file.png b/edrixs/_static/file.png deleted file mode 100644 index a858a410e4..0000000000 Binary files a/edrixs/_static/file.png and /dev/null differ diff --git a/edrixs/_static/fonts/Inconsolata-Bold.ttf b/edrixs/_static/fonts/Inconsolata-Bold.ttf deleted file mode 100644 index 809c1f5828..0000000000 Binary files a/edrixs/_static/fonts/Inconsolata-Bold.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/Inconsolata-Regular.ttf b/edrixs/_static/fonts/Inconsolata-Regular.ttf deleted file mode 100644 index fc981ce7ad..0000000000 Binary files a/edrixs/_static/fonts/Inconsolata-Regular.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/Inconsolata.ttf b/edrixs/_static/fonts/Inconsolata.ttf deleted file mode 100644 index 4b8a36d249..0000000000 Binary files a/edrixs/_static/fonts/Inconsolata.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/Lato-Bold.ttf b/edrixs/_static/fonts/Lato-Bold.ttf deleted file mode 100644 index 1d23c7066e..0000000000 Binary files a/edrixs/_static/fonts/Lato-Bold.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/Lato-Regular.ttf b/edrixs/_static/fonts/Lato-Regular.ttf deleted file mode 100644 index 0f3d0f837d..0000000000 Binary files a/edrixs/_static/fonts/Lato-Regular.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-bold.eot b/edrixs/_static/fonts/Lato/lato-bold.eot deleted file mode 100644 index 3361183a41..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-bold.eot and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-bold.ttf b/edrixs/_static/fonts/Lato/lato-bold.ttf deleted file mode 100644 index 29f691d5ed..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-bold.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-bold.woff b/edrixs/_static/fonts/Lato/lato-bold.woff deleted file mode 100644 index c6dff51f06..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-bold.woff and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-bold.woff2 b/edrixs/_static/fonts/Lato/lato-bold.woff2 deleted file mode 100644 index bb195043cf..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-bold.woff2 and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-bolditalic.eot b/edrixs/_static/fonts/Lato/lato-bolditalic.eot deleted file mode 100644 index 3d4154936b..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-bolditalic.eot and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-bolditalic.ttf b/edrixs/_static/fonts/Lato/lato-bolditalic.ttf deleted file mode 100644 index f402040b3e..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-bolditalic.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-bolditalic.woff b/edrixs/_static/fonts/Lato/lato-bolditalic.woff deleted file mode 100644 index 88ad05b9ff..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-bolditalic.woff and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-bolditalic.woff2 b/edrixs/_static/fonts/Lato/lato-bolditalic.woff2 deleted file mode 100644 index c4e3d804b5..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-bolditalic.woff2 and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-italic.eot b/edrixs/_static/fonts/Lato/lato-italic.eot deleted file mode 100644 index 3f826421a1..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-italic.eot and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-italic.ttf b/edrixs/_static/fonts/Lato/lato-italic.ttf deleted file mode 100644 index b4bfc9b24a..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-italic.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-italic.woff b/edrixs/_static/fonts/Lato/lato-italic.woff deleted file mode 100644 index 76114bc033..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-italic.woff and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-italic.woff2 b/edrixs/_static/fonts/Lato/lato-italic.woff2 deleted file mode 100644 index 3404f37e2e..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-italic.woff2 and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-regular.eot b/edrixs/_static/fonts/Lato/lato-regular.eot deleted file mode 100644 index 11e3f2a5f0..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-regular.eot and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-regular.ttf b/edrixs/_static/fonts/Lato/lato-regular.ttf deleted file mode 100644 index 74decd9ebb..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-regular.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-regular.woff b/edrixs/_static/fonts/Lato/lato-regular.woff deleted file mode 100644 index ae1307ff5f..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-regular.woff and /dev/null differ diff --git a/edrixs/_static/fonts/Lato/lato-regular.woff2 b/edrixs/_static/fonts/Lato/lato-regular.woff2 deleted file mode 100644 index 3bf9843328..0000000000 Binary files a/edrixs/_static/fonts/Lato/lato-regular.woff2 and /dev/null differ diff --git a/edrixs/_static/fonts/RobotoSlab-Bold.ttf b/edrixs/_static/fonts/RobotoSlab-Bold.ttf deleted file mode 100644 index df5d1df273..0000000000 Binary files a/edrixs/_static/fonts/RobotoSlab-Bold.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/RobotoSlab-Regular.ttf b/edrixs/_static/fonts/RobotoSlab-Regular.ttf deleted file mode 100644 index eb52a79073..0000000000 Binary files a/edrixs/_static/fonts/RobotoSlab-Regular.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot b/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot deleted file mode 100644 index 79dc8efed3..0000000000 Binary files a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot and /dev/null differ diff --git a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf b/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf deleted file mode 100644 index df5d1df273..0000000000 Binary files a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff b/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff deleted file mode 100644 index 6cb6000018..0000000000 Binary files a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff and /dev/null differ diff --git a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 b/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 deleted file mode 100644 index 7059e23142..0000000000 Binary files a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 and /dev/null differ diff --git a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot b/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot deleted file mode 100644 index 2f7ca78a1e..0000000000 Binary files a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot and /dev/null differ diff --git a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf b/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf deleted file mode 100644 index eb52a79073..0000000000 Binary files a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff b/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff deleted file mode 100644 index f815f63f99..0000000000 Binary files a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff and /dev/null differ diff --git a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 b/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 deleted file mode 100644 index f2c76e5bda..0000000000 Binary files a/edrixs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 and /dev/null differ diff --git a/edrixs/_static/fonts/fontawesome-webfont.eot b/edrixs/_static/fonts/fontawesome-webfont.eot deleted file mode 100644 index e9f60ca953..0000000000 Binary files a/edrixs/_static/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/edrixs/_static/fonts/fontawesome-webfont.svg b/edrixs/_static/fonts/fontawesome-webfont.svg deleted file mode 100644 index 855c845e53..0000000000 --- a/edrixs/_static/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,2671 +0,0 @@ - - - - -Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 - By ,,, -Copyright Dave Gandy 2016. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/edrixs/_static/fonts/fontawesome-webfont.ttf b/edrixs/_static/fonts/fontawesome-webfont.ttf deleted file mode 100644 index 35acda2fa1..0000000000 Binary files a/edrixs/_static/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/edrixs/_static/fonts/fontawesome-webfont.woff b/edrixs/_static/fonts/fontawesome-webfont.woff deleted file mode 100644 index 400014a4b0..0000000000 Binary files a/edrixs/_static/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/edrixs/_static/fonts/fontawesome-webfont.woff2 b/edrixs/_static/fonts/fontawesome-webfont.woff2 deleted file mode 100644 index 4d13fc6040..0000000000 Binary files a/edrixs/_static/fonts/fontawesome-webfont.woff2 and /dev/null differ diff --git a/edrixs/_static/gallery-binder.css b/edrixs/_static/gallery-binder.css deleted file mode 100644 index a33aa4204a..0000000000 --- a/edrixs/_static/gallery-binder.css +++ /dev/null @@ -1,6 +0,0 @@ -/* CSS for binder integration */ - -div.binder-badge { - margin: 1em auto; - vertical-align: middle; -} diff --git a/edrixs/_static/gallery-dataframe.css b/edrixs/_static/gallery-dataframe.css deleted file mode 100644 index f01e6b3280..0000000000 --- a/edrixs/_static/gallery-dataframe.css +++ /dev/null @@ -1,36 +0,0 @@ -/* Pandas dataframe css */ -/* Taken from: https://github.com/spatialaudio/nbsphinx/blob/fb3ba670fc1ba5f54d4c487573dbc1b4ecf7e9ff/src/nbsphinx.py#L587-L619 */ - -table.dataframe { - border: none !important; - border-collapse: collapse; - border-spacing: 0; - border-color: transparent; - color: black; - font-size: 12px; - table-layout: fixed; -} -table.dataframe thead { - border-bottom: 1px solid black; - vertical-align: bottom; -} -table.dataframe tr, -table.dataframe th, -table.dataframe td { - text-align: right; - vertical-align: middle; - padding: 0.5em 0.5em; - line-height: normal; - white-space: normal; - max-width: none; - border: none; -} -table.dataframe th { - font-weight: bold; -} -table.dataframe tbody tr:nth-child(odd) { - background: #f5f5f5; -} -table.dataframe tbody tr:hover { - background: rgba(66, 165, 245, 0.2); -} diff --git a/edrixs/_static/gallery-rendered-html.css b/edrixs/_static/gallery-rendered-html.css deleted file mode 100644 index cea21975c4..0000000000 --- a/edrixs/_static/gallery-rendered-html.css +++ /dev/null @@ -1,209 +0,0 @@ -/* Adapted from notebook/static/style/style.min.css */ - -.rendered_html { - color: #000; - /* any extras will just be numbers: */ -} -.rendered_html em { - font-style: italic; -} -.rendered_html strong { - font-weight: bold; -} -.rendered_html u { - text-decoration: underline; -} -.rendered_html :link { - text-decoration: underline; -} -.rendered_html :visited { - text-decoration: underline; -} -.rendered_html h1 { - font-size: 185.7%; - margin: 1.08em 0 0 0; - font-weight: bold; - line-height: 1.0; -} -.rendered_html h2 { - font-size: 157.1%; - margin: 1.27em 0 0 0; - font-weight: bold; - line-height: 1.0; -} -.rendered_html h3 { - font-size: 128.6%; - margin: 1.55em 0 0 0; - font-weight: bold; - line-height: 1.0; -} -.rendered_html h4 { - font-size: 100%; - margin: 2em 0 0 0; - font-weight: bold; - line-height: 1.0; -} -.rendered_html h5 { - font-size: 100%; - margin: 2em 0 0 0; - font-weight: bold; - line-height: 1.0; - font-style: italic; -} -.rendered_html h6 { - font-size: 100%; - margin: 2em 0 0 0; - font-weight: bold; - line-height: 1.0; - font-style: italic; -} -.rendered_html h1:first-child { - margin-top: 0.538em; -} -.rendered_html h2:first-child { - margin-top: 0.636em; -} -.rendered_html h3:first-child { - margin-top: 0.777em; -} -.rendered_html h4:first-child { - margin-top: 1em; -} -.rendered_html h5:first-child { - margin-top: 1em; -} -.rendered_html h6:first-child { - margin-top: 1em; -} -.rendered_html ul:not(.list-inline), -.rendered_html ol:not(.list-inline) { - padding-left: 2em; -} -.rendered_html ul { - list-style: disc; -} -.rendered_html ul ul { - list-style: square; - margin-top: 0; -} -.rendered_html ul ul ul { - list-style: circle; -} -.rendered_html ol { - list-style: decimal; -} -.rendered_html ol ol { - list-style: upper-alpha; - margin-top: 0; -} -.rendered_html ol ol ol { - list-style: lower-alpha; -} -.rendered_html ol ol ol ol { - list-style: lower-roman; -} -.rendered_html ol ol ol ol ol { - list-style: decimal; -} -.rendered_html * + ul { - margin-top: 1em; -} -.rendered_html * + ol { - margin-top: 1em; -} -.rendered_html hr { - color: black; - background-color: black; -} -.rendered_html pre { - margin: 1em 2em; - padding: 0px; - background-color: #fff; -} -.rendered_html code { - background-color: #eff0f1; -} -.rendered_html p code { - padding: 1px 5px; -} -.rendered_html pre code { - background-color: #fff; -} -.rendered_html pre, -.rendered_html code { - border: 0; - color: #000; - font-size: 100%; -} -.rendered_html blockquote { - margin: 1em 2em; -} -.rendered_html table { - margin-left: auto; - margin-right: auto; - border: none; - border-collapse: collapse; - border-spacing: 0; - color: black; - font-size: 12px; - table-layout: fixed; -} -.rendered_html thead { - border-bottom: 1px solid black; - vertical-align: bottom; -} -.rendered_html tr, -.rendered_html th, -.rendered_html td { - text-align: right; - vertical-align: middle; - padding: 0.5em 0.5em; - line-height: normal; - white-space: normal; - max-width: none; - border: none; -} -.rendered_html th { - font-weight: bold; -} -.rendered_html tbody tr:nth-child(odd) { - background: #f5f5f5; -} -.rendered_html tbody tr:hover { - background: rgba(66, 165, 245, 0.2); -} -.rendered_html * + table { - margin-top: 1em; -} -.rendered_html p { - text-align: left; -} -.rendered_html * + p { - margin-top: 1em; -} -.rendered_html img { - display: block; - margin-left: auto; - margin-right: auto; -} -.rendered_html * + img { - margin-top: 1em; -} -.rendered_html img, -.rendered_html svg { - max-width: 100%; - height: auto; -} -.rendered_html img.unconfined, -.rendered_html svg.unconfined { - max-width: none; -} -.rendered_html .alert { - margin-bottom: initial; -} -.rendered_html * + .alert { - margin-top: 1em; -} -[dir="rtl"] .rendered_html p { - text-align: right; -} diff --git a/edrixs/_static/gallery.css b/edrixs/_static/gallery.css deleted file mode 100644 index 5fdf7f2498..0000000000 --- a/edrixs/_static/gallery.css +++ /dev/null @@ -1,204 +0,0 @@ -/* -Sphinx-Gallery has compatible CSS to fix default sphinx themes -Tested for Sphinx 1.3.1 for all themes: default, alabaster, sphinxdoc, -scrolls, agogo, traditional, nature, haiku, pyramid -Tested for Read the Docs theme 0.1.7 */ -.sphx-glr-thumbcontainer { - background: #fff; - border: solid #fff 1px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - box-shadow: none; - float: left; - margin: 5px; - min-height: 230px; - padding-top: 5px; - position: relative; -} -.sphx-glr-thumbcontainer:hover { - border: solid #b4ddfc 1px; - box-shadow: 0 0 15px rgba(142, 176, 202, 0.5); -} -.sphx-glr-thumbcontainer a.internal { - bottom: 0; - display: block; - left: 0; - padding: 150px 10px 0; - position: absolute; - right: 0; - top: 0; -} -/* Next one is to avoid Sphinx traditional theme to cover all the -thumbnail with its default link Background color */ -.sphx-glr-thumbcontainer a.internal:hover { - background-color: transparent; -} - -.sphx-glr-thumbcontainer p { - margin: 0 0 .1em 0; -} -.sphx-glr-thumbcontainer .figure { - margin: 10px; - width: 160px; -} -.sphx-glr-thumbcontainer img { - display: inline; - max-height: 112px; - max-width: 160px; -} -.sphx-glr-thumbcontainer[tooltip]:hover:after { - background: rgba(0, 0, 0, 0.8); - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - color: #fff; - content: attr(tooltip); - left: 95%; - padding: 5px 15px; - position: absolute; - z-index: 98; - width: 220px; - bottom: 52%; -} -.sphx-glr-thumbcontainer[tooltip]:hover:before { - border: solid; - border-color: #333 transparent; - border-width: 18px 0 0 20px; - bottom: 58%; - content: ''; - left: 85%; - position: absolute; - z-index: 99; -} - -.sphx-glr-script-out { - color: #888; - margin: 0; -} -p.sphx-glr-script-out { - padding-top: 0.7em; -} -.sphx-glr-script-out .highlight { - background-color: transparent; - margin-left: 2.5em; - margin-top: -2.1em; -} -.sphx-glr-script-out .highlight pre { - background-color: #fafae2; - border: 0; - max-height: 30em; - overflow: auto; - padding-left: 1ex; - margin: 0px; - word-break: break-word; -} -.sphx-glr-script-out + p { - margin-top: 1.8em; -} -blockquote.sphx-glr-script-out { - margin-left: 0pt; -} -.sphx-glr-script-out.highlight-pytb .highlight pre { - color: #000; - background-color: #ffe4e4; - border: 1px solid #f66; - margin-top: 10px; - padding: 7px; -} - -div.sphx-glr-footer { - text-align: center; -} - -div.sphx-glr-download { - margin: 1em auto; - vertical-align: middle; -} - -div.sphx-glr-download a { - background-color: #ffc; - background-image: linear-gradient(to bottom, #FFC, #d5d57e); - border-radius: 4px; - border: 1px solid #c2c22d; - color: #000; - display: inline-block; - font-weight: bold; - padding: 1ex; - text-align: center; -} - -div.sphx-glr-download code.download { - display: inline-block; - white-space: normal; - word-break: normal; - overflow-wrap: break-word; - /* border and background are given by the enclosing 'a' */ - border: none; - background: none; -} - -div.sphx-glr-download a:hover { - box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); - text-decoration: none; - background-image: none; - background-color: #d5d57e; -} - -.sphx-glr-example-title:target::before { - display: block; - content: ""; - margin-top: -50px; - height: 50px; - visibility: hidden; -} - -ul.sphx-glr-horizontal { - list-style: none; - padding: 0; -} -ul.sphx-glr-horizontal li { - display: inline; -} -ul.sphx-glr-horizontal img { - height: auto !important; -} - -.sphx-glr-single-img { - margin: auto; - display: block; - max-width: 100%; -} - -.sphx-glr-multi-img { - max-width: 42%; - height: auto; -} - -div.sphx-glr-animation { - margin: auto; - display: block; - max-width: 100%; -} -div.sphx-glr-animation .animation{ - display: block; -} - -p.sphx-glr-signature a.reference.external { - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - padding: 3px; - font-size: 75%; - text-align: right; - margin-left: auto; - display: table; -} - -.sphx-glr-clear{ - clear: both; -} - -a.sphx-glr-backref-instance { - text-decoration: none; -} diff --git a/edrixs/_static/jquery-3.5.1.js b/edrixs/_static/jquery-3.5.1.js deleted file mode 100644 index 50937333b9..0000000000 --- a/edrixs/_static/jquery-3.5.1.js +++ /dev/null @@ -1,10872 +0,0 @@ -/*! - * jQuery JavaScript Library v3.5.1 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2020-05-04T22:49Z - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var flat = arr.flat ? function( array ) { - return arr.flat.call( array ); -} : function( array ) { - return arr.concat.apply( [], array ); -}; - - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - -var isFunction = function isFunction( obj ) { - - // Support: Chrome <=57, Firefox <=52 - // In some browsers, typeof returns "function" for HTML elements - // (i.e., `typeof document.createElement( "object" ) === "function"`). - // We don't want to classify *any* DOM node as a function. - return typeof obj === "function" && typeof obj.nodeType !== "number"; - }; - - -var isWindow = function isWindow( obj ) { - return obj != null && obj === obj.window; - }; - - -var document = window.document; - - - - var preservedScriptAttributes = { - type: true, - src: true, - nonce: true, - noModule: true - }; - - function DOMEval( code, node, doc ) { - doc = doc || document; - - var i, val, - script = doc.createElement( "script" ); - - script.text = code; - if ( node ) { - for ( i in preservedScriptAttributes ) { - - // Support: Firefox 64+, Edge 18+ - // Some browsers don't support the "nonce" property on scripts. - // On the other hand, just using `getAttribute` is not enough as - // the `nonce` attribute is reset to an empty string whenever it - // becomes browsing-context connected. - // See https://github.com/whatwg/html/issues/2369 - // See https://html.spec.whatwg.org/#nonce-attributes - // The `node.getAttribute` check was added for the sake of - // `jQuery.globalEval` so that it can fake a nonce-containing node - // via an object. - val = node[ i ] || node.getAttribute && node.getAttribute( i ); - if ( val ) { - script.setAttribute( i, val ); - } - } - } - doc.head.appendChild( script ).parentNode.removeChild( script ); - } - - -function toType( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; -} -/* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.5.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - even: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return ( i + 1 ) % 2; - } ) ); - }, - - odd: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return i % 2; - } ) ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - copy = options[ name ]; - - // Prevent Object.prototype pollution - // Prevent never-ending loop - if ( name === "__proto__" || target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - src = target[ name ]; - - // Ensure proper type for the source value - if ( copyIsArray && !Array.isArray( src ) ) { - clone = []; - } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { - clone = {}; - } else { - clone = src; - } - copyIsArray = false; - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - // Evaluates a script in a provided context; falls back to the global one - // if not specified. - globalEval: function( code, options, doc ) { - DOMEval( code, { nonce: options && options.nonce }, doc ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return flat( ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), -function( _i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -} ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = toType( obj ); - - if ( isFunction( obj ) || isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.5 - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://js.foundation/ - * - * Date: 2020-03-14 - */ -( function( window ) { -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - nonnativeSelectorCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ( {} ).hasOwnProperty, - arr = [], - pop = arr.pop, - pushNative = arr.push, - push = arr.push, - slice = arr.slice, - - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[ i ] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + - "ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram - identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + - "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - - // "Attribute values must be CSS identifiers [capture 5] - // or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + - whitespace + "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + - whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + - "*" ), - rdescend = new RegExp( whitespace + "|>" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + - whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + - whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + - "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + - "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rhtml = /HTML$/i, - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), - funescape = function( escape, nonHex ) { - var high = "0x" + escape.slice( 1 ) - 0x10000; - - return nonHex ? - - // Strip the backslash prefix from a non-hex escape sequence - nonHex : - - // Replace a hexadecimal escape sequence with the encoded Unicode code point - // Support: IE <=11+ - // For values outside the Basic Multilingual Plane (BMP), manually construct a - // surrogate pair - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + - ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - inDisabledFieldset = addCombinator( - function( elem ) { - return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - ( arr = slice.call( preferredDoc.childNodes ) ), - preferredDoc.childNodes - ); - - // Support: Android<4.0 - // Detect silently failing push.apply - // eslint-disable-next-line no-unused-expressions - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - pushNative.apply( target, slice.call( els ) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - - // Can't trust NodeList.length - while ( ( target[ j++ ] = els[ i++ ] ) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - setDocument( context ); - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { - - // ID selector - if ( ( m = match[ 1 ] ) ) { - - // Document context - if ( nodeType === 9 ) { - if ( ( elem = context.getElementById( m ) ) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && ( elem = newContext.getElementById( m ) ) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[ 2 ] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !nonnativeSelectorCache[ selector + " " ] && - ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && - - // Support: IE 8 only - // Exclude object elements - ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { - - newSelector = selector; - newContext = context; - - // qSA considers elements outside a scoping root when evaluating child or - // descendant combinators, which is not what we want. - // In such cases, we work around the behavior by prefixing every selector in the - // list with an ID selector referencing the scope context. - // The technique has to be used as well when a leading combinator is used - // as such selectors are not recognized by querySelectorAll. - // Thanks to Andrew Dupont for this technique. - if ( nodeType === 1 && - ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - - // We can use :scope instead of the ID hack if the browser - // supports it & if we're not changing the context. - if ( newContext !== context || !support.scope ) { - - // Capture the context ID, setting it first if necessary - if ( ( nid = context.getAttribute( "id" ) ) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", ( nid = expando ) ); - } - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + - toSelector( groups[ i ] ); - } - newSelector = groups.join( "," ); - } - - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - nonnativeSelectorCache( selector, true ); - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return ( cache[ key + " " ] = value ); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement( "fieldset" ); - - try { - return !!fn( el ); - } catch ( e ) { - return false; - } finally { - - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split( "|" ), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[ i ] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( ( cur = cur.nextSibling ) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return ( name === "input" || name === "button" ) && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - inDisabledFieldset( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction( function( argument ) { - argument = +argument; - return markFunction( function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ ( j = matchIndexes[ i ] ) ] ) { - seed[ j ] = !( matches[ j ] = seed[ j ] ); - } - } - } ); - } ); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - var namespace = elem.namespaceURI, - docElem = ( elem.ownerDocument || elem ).documentElement; - - // Support: IE <=8 - // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes - // https://bugs.jquery.com/ticket/4833 - return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9 - 11+, Edge 12 - 18+ - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( preferredDoc != document && - ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, - // Safari 4 - 5 only, Opera <=11.6 - 12.x only - // IE/Edge & older browsers don't support the :scope pseudo-class. - // Support: Safari 6.0 only - // Safari 6.0 supports :scope but it's an alias of :root there. - support.scope = assert( function( el ) { - docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); - return typeof el.querySelectorAll !== "undefined" && - !el.querySelectorAll( ":scope fieldset div" ).length; - } ); - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert( function( el ) { - el.className = "i"; - return !el.getAttribute( "className" ); - } ); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert( function( el ) { - el.appendChild( document.createComment( "" ) ); - return !el.getElementsByTagName( "*" ).length; - } ); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert( function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - } ); - - // ID filter and find - if ( support.getById ) { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute( "id" ) === attrId; - }; - }; - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode( "id" ); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( ( elem = elems[ i++ ] ) ) { - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find[ "TAG" ] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { - - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert( function( el ) { - - var input; - - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "" + - ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll( "[selected]" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push( "~=" ); - } - - // Support: IE 11+, Edge 15 - 18+ - // IE 11/Edge don't find elements on a `[name='']` query in some cases. - // Adding a temporary attribute to the document before the selection works - // around the issue. - // Interestingly, IE 10 & older don't seem to have the issue. - input = document.createElement( "input" ); - input.setAttribute( "name", "" ); - el.appendChild( input ); - if ( !el.querySelectorAll( "[name='']" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + - whitespace + "*(?:''|\"\")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll( ":checked" ).length ) { - rbuggyQSA.push( ":checked" ); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push( ".#.+[+~]" ); - } - - // Support: Firefox <=3.6 - 5 only - // Old Firefox doesn't throw on a badly-escaped identifier. - el.querySelectorAll( "\\\f" ); - rbuggyQSA.push( "[\\r\\n\\f]" ); - } ); - - assert( function( el ) { - el.innerHTML = "" + - ""; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement( "input" ); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll( "[name=d]" ).length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: Opera 10 - 11 only - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll( "*,:x" ); - rbuggyQSA.push( ",.*:" ); - } ); - } - - if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector ) ) ) ) { - - assert( function( el ) { - - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - } ); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - ) ); - } : - function( a, b ) { - if ( b ) { - while ( ( b = b.parentNode ) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { - - // Choose the first element that is related to our preferred document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( a == document || a.ownerDocument == preferredDoc && - contains( preferredDoc, a ) ) { - return -1; - } - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( b == document || b.ownerDocument == preferredDoc && - contains( preferredDoc, b ) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - return a == document ? -1 : - b == document ? 1 : - /* eslint-enable eqeqeq */ - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( ( cur = cur.parentNode ) ) { - ap.unshift( cur ); - } - cur = b; - while ( ( cur = cur.parentNode ) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[ i ] === bp[ i ] ) { - i++; - } - - return i ? - - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[ i ], bp[ i ] ) : - - // Otherwise nodes in our document sort first - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - ap[ i ] == preferredDoc ? -1 : - bp[ i ] == preferredDoc ? 1 : - /* eslint-enable eqeqeq */ - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - setDocument( elem ); - - if ( support.matchesSelector && documentIsHTML && - !nonnativeSelectorCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch ( e ) { - nonnativeSelectorCache( expr, true ); - } - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( context.ownerDocument || context ) != document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( elem.ownerDocument || elem ) != document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; -}; - -Sizzle.escape = function( sel ) { - return ( sel + "" ).replace( rcssescape, fcssescape ); -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - - // If no nodeType, this is expected to be an array - while ( ( node = elem[ i++ ] ) ) { - - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[ 1 ] = match[ 1 ].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[ 3 ] = ( match[ 3 ] || match[ 4 ] || - match[ 5 ] || "" ).replace( runescape, funescape ); - - if ( match[ 2 ] === "~=" ) { - match[ 3 ] = " " + match[ 3 ] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[ 1 ] = match[ 1 ].toLowerCase(); - - if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { - - // nth-* requires argument - if ( !match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[ 4 ] = +( match[ 4 ] ? - match[ 5 ] + ( match[ 6 ] || 1 ) : - 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); - match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); - - // other types prohibit arguments - } else if ( match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[ 6 ] && match[ 2 ]; - - if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[ 3 ] ) { - match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - - // Get excess from tokenize (recursively) - ( excess = tokenize( unquoted, true ) ) && - - // advance to the next closing parenthesis - ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { - - // excess is a negative index - match[ 0 ] = match[ 0 ].slice( 0, excess ); - match[ 2 ] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { - return true; - } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - ( pattern = new RegExp( "(^|" + whitespace + - ")" + className + "(" + whitespace + "|$)" ) ) && classCache( - className, function( elem ) { - return pattern.test( - typeof elem.className === "string" && elem.className || - typeof elem.getAttribute !== "undefined" && - elem.getAttribute( "class" ) || - "" - ); - } ); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - /* eslint-disable max-len */ - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - /* eslint-enable max-len */ - - }; - }, - - "CHILD": function( type, what, _argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, _context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( ( node = node[ dir ] ) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( ( node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - - // Use previously-cached element index if available - if ( useCache ) { - - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - - // Use the same loop as above to seek `elem` from the start - while ( ( node = ++nodeIndex && node && node[ dir ] || - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - if ( ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || - ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction( function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[ i ] ); - seed[ idx ] = !( matches[ idx ] = matched[ i ] ); - } - } ) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - - // Potentially complex pseudos - "not": markFunction( function( selector ) { - - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction( function( seed, matches, _context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( ( elem = unmatched[ i ] ) ) { - seed[ i ] = !( matches[ i ] = elem ); - } - } - } ) : - function( elem, _context, xml ) { - input[ 0 ] = elem; - matcher( input, null, xml, results ); - - // Don't keep the element (issue #299) - input[ 0 ] = null; - return !results.pop(); - }; - } ), - - "has": markFunction( function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - } ), - - "contains": markFunction( function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; - }; - } ), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - - // lang value must be a valid identifier - if ( !ridentifier.test( lang || "" ) ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( ( elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); - return false; - }; - } ), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && - ( !document.hasFocus || document.hasFocus() ) && - !!( elem.type || elem.href || ~elem.tabIndex ); - }, - - // Boolean properties - "enabled": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( true ), - - "checked": function( elem ) { - - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return ( nodeName === "input" && !!elem.checked ) || - ( nodeName === "option" && !!elem.selected ); - }, - - "selected": function( elem ) { - - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - // eslint-disable-next-line no-unused-expressions - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos[ "empty" ]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( ( attr = elem.getAttribute( "type" ) ) == null || - attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo( function() { - return [ 0 ]; - } ), - - "last": createPositionalPseudo( function( _matchIndexes, length ) { - return [ length - 1 ]; - } ), - - "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - } ), - - "even": createPositionalPseudo( function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "odd": createPositionalPseudo( function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? - argument + length : - argument > length ? - length : - argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ) - } -}; - -Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || ( match = rcomma.exec( soFar ) ) ) { - if ( match ) { - - // Don't consume trailing commas as valid - soFar = soFar.slice( match[ 0 ].length ) || soFar; - } - groups.push( ( tokens = [] ) ); - } - - matched = false; - - // Combinators - if ( ( match = rcombinators.exec( soFar ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - - // Cast descendant combinators to space - type: match[ 0 ].replace( rtrim, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || - ( match = preFilters[ type ]( match ) ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[ i ].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - return false; - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || ( elem[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || - ( outerCache[ elem.uniqueID ] = {} ); - - if ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( ( oldCache = uniqueCache[ key ] ) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return ( newCache[ 2 ] = oldCache[ 2 ] ); - } else { - - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { - return true; - } - } - } - } - } - return false; - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[ i ]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[ 0 ]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[ i ], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( ( elem = unmatched[ i ] ) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction( function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( - selector || "*", - context.nodeType ? [ context ] : context, - [] - ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( ( elem = temp[ i ] ) ) { - matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) ) { - - // Restore matcherIn since elem is not yet a final match - temp.push( ( matcherIn[ i ] = elem ) ); - } - } - postFinder( null, ( matcherOut = [] ), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) && - ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { - - seed[ temp ] = !( results[ temp ] = elem ); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - } ); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[ 0 ].type ], - implicitRelative = leadingRelative || Expr.relative[ " " ], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - ( checkContext = context ).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { - matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; - } else { - matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[ j ].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens - .slice( 0, i - 1 ) - .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), - - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), - len = elems.length; - - if ( outermost ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - outermostContext = context == document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( !context && elem.ownerDocument != document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( ( matcher = elementMatchers[ j++ ] ) ) { - if ( matcher( elem, context || document, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - - // They will have gone through all possible matchers - if ( ( elem = !matcher && elem ) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( ( matcher = setMatchers[ j++ ] ) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !( unmatched[ i ] || setMatched[ i ] ) ) { - setMatched[ i ] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[ i ] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( - selector, - matcherFromGroupMatchers( elementMatchers, setMatchers ) - ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( ( selector = compiled.selector || selector ) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[ 0 ] = match[ 0 ].slice( 0 ); - if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { - - context = ( Expr.find[ "ID" ]( token.matches[ 0 ] - .replace( runescape, funescape ), context ) || [] )[ 0 ]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[ i ]; - - // Abort if we hit a combinator - if ( Expr.relative[ ( type = token.type ) ] ) { - break; - } - if ( ( find = Expr.find[ type ] ) ) { - - // Search, expanding context for leading sibling combinators - if ( ( seed = find( - token.matches[ 0 ].replace( runescape, funescape ), - rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || - context - ) ) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert( function( el ) { - - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; -} ); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert( function( el ) { - el.innerHTML = ""; - return el.firstChild.getAttribute( "href" ) === "#"; -} ) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - } ); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert( function( el ) { - el.innerHTML = ""; - el.firstChild.setAttribute( "value", "" ); - return el.firstChild.getAttribute( "value" ) === ""; -} ) ) { - addHandle( "value", function( elem, _name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - } ); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert( function( el ) { - return el.getAttribute( "disabled" ) == null; -} ) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; - } - } ); -} - -return Sizzle; - -} )( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; - -// Deprecated -jQuery.expr[ ":" ] = jQuery.expr.pseudos; -jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; -jQuery.escapeSelector = Sizzle.escape; - - - - -var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - - - -function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - -}; -var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Filtered directly for both simple and complex selectors - return jQuery.filter( qualifier, elements, not ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, _i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, _i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, _i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - if ( elem.contentDocument != null && - - // Support: IE 11+ - // elements with no `data` attribute has an object - // `contentDocument` with a `null` prototype. - getProto( elem.contentDocument ) ) { - - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -} ); -var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = locked || options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && toType( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -function Identity( v ) { - return v; -} -function Thrower( ex ) { - throw ex; -} - -function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } -} - -jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( _i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // rejected_handlers.disable - // fulfilled_handlers.disable - tuples[ 3 - i ][ 3 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock, - - // progress_handlers.lock - tuples[ 0 ][ 3 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the master Deferred - master = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - master.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( master.state() === "pending" || - isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return master.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); - } - - return master.promise(); - } -} ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. -var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - -jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } -}; - - - - -jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); -}; - - - - -// The deferred used on DOM ready -var readyList = jQuery.Deferred(); - -jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; -}; - -jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } -} ); - -jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method -function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); -} - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - -} else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); -} - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( toType( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, _key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; -}; - - -// Matches dashed string for camelizing -var rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g; - -// Used by camelCase as callback to replace() -function fcamelCase( _all, letter ) { - return letter.toUpperCase(); -} - -// Convert dashed to camelCase; used by the css and data modules -// Support: IE <=9 - 11, Edge 12 - 15 -// Microsoft forgot to hump their vendor prefix (#9572) -function camelCase( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); -} -var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - - - -function Data() { - this.expando = jQuery.expando + Data.uid++; -} - -Data.uid = 1; - -Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( camelCase ); - } else { - key = camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } -}; -var dataPriv = new Data(); - -var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - -function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; -} - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); -var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - -var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var documentElement = document.documentElement; - - - - var isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ); - }, - composed = { composed: true }; - - // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only - // Check attachment across shadow DOM boundaries when possible (gh-3504) - // Support: iOS 10.0-10.2 only - // Early iOS 10 versions support `attachShadow` but not `getRootNode`, - // leading to errors. We need to check for `getRootNode`. - if ( documentElement.getRootNode ) { - isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ) || - elem.getRootNode( composed ) === elem.ownerDocument; - }; - } -var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - isAttached( elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, scale, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = elem.nodeType && - ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Support: Firefox <=54 - // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) - initial = initial / 2; - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - while ( maxIterations-- ) { - - // Evaluate and update our best guess (doubling guesses that zero out). - // Finish if the scale equals or crosses 1 (making the old*new product non-positive). - jQuery.style( elem, prop, initialInUnit + unit ); - if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { - maxIterations = 0; - } - initialInUnit = initialInUnit / scale; - - } - - initialInUnit = initialInUnit * 2; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; -} - - -var defaultDisplayMap = {}; - -function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; -} - -function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; -} - -jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } -} ); -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); - -var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); - - - -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // Support: IE <=9 only - // IE <=9 replaces "; - support.option = !!div.lastChild; -} )(); - - -// We have to close these tags to support XHTML (#13200) -var wrapMap = { - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting or other required elements. - thead: [ 1, "", "
" ], - col: [ 2, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - _default: [ 0, "", "" ] -}; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// Support: IE <=9 only -if ( !support.option ) { - wrapMap.optgroup = wrapMap.option = [ 1, "" ]; -} - - -function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/; - -function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, attached, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( toType( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - attached = isAttached( elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( attached ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; -} - - -var - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -// Support: IE <=9 - 11+ -// focus() and blur() are asynchronous, except when they are no-op. -// So expect focus to be synchronous when the element is already active, -// and blur to be synchronous when the element is not already active. -// (focus and blur are always synchronous in other supported browsers, -// this just defines when we can count on it). -function expectSync( elem, type ) { - return ( elem === safeActiveElement() ) === ( type === "focus" ); -} - -// Support: IE <=9 only -// Accessing document.activeElement can throw unexpectedly -// https://bugs.jquery.com/ticket/13393 -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Only attach events to objects that accept data - if ( !acceptData( elem ) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = Object.create( null ); - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( nativeEvent ), - - handlers = ( - dataPriv.get( this, "events" ) || Object.create( null ) - )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // If the event is namespaced, then each handler is only invoked if it is - // specially universal or its namespaces are a superset of the event's. - if ( !event.rnamespace || handleObj.namespace === false || - event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - click: { - - // Utilize native event to ensure correct state for checkable inputs - setup: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Claim the first handler - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - // dataPriv.set( el, "click", ... ) - leverageNative( el, "click", returnTrue ); - } - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Force setup before triggering a click - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - leverageNative( el, "click" ); - } - - // Return non-false to allow normal event-path propagation - return true; - }, - - // For cross-browser consistency, suppress native .click() on links - // Also prevent it if we're currently inside a leveraged native-event stack - _default: function( event ) { - var target = event.target; - return rcheckableType.test( target.type ) && - target.click && nodeName( target, "input" ) && - dataPriv.get( target, "click" ) || - nodeName( target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } -}; - -// Ensure the presence of an event listener that handles manually-triggered -// synthetic events by interrupting progress until reinvoked in response to -// *native* events that it fires directly, ensuring that state changes have -// already occurred before other listeners are invoked. -function leverageNative( el, type, expectSync ) { - - // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add - if ( !expectSync ) { - if ( dataPriv.get( el, type ) === undefined ) { - jQuery.event.add( el, type, returnTrue ); - } - return; - } - - // Register the controller as a special universal handler for all event namespaces - dataPriv.set( el, type, false ); - jQuery.event.add( el, type, { - namespace: false, - handler: function( event ) { - var notAsync, result, - saved = dataPriv.get( this, type ); - - if ( ( event.isTrigger & 1 ) && this[ type ] ) { - - // Interrupt processing of the outer synthetic .trigger()ed event - // Saved data should be false in such cases, but might be a leftover capture object - // from an async native handler (gh-4350) - if ( !saved.length ) { - - // Store arguments for use when handling the inner native event - // There will always be at least one argument (an event object), so this array - // will not be confused with a leftover capture object. - saved = slice.call( arguments ); - dataPriv.set( this, type, saved ); - - // Trigger the native event and capture its result - // Support: IE <=9 - 11+ - // focus() and blur() are asynchronous - notAsync = expectSync( this, type ); - this[ type ](); - result = dataPriv.get( this, type ); - if ( saved !== result || notAsync ) { - dataPriv.set( this, type, false ); - } else { - result = {}; - } - if ( saved !== result ) { - - // Cancel the outer synthetic event - event.stopImmediatePropagation(); - event.preventDefault(); - return result.value; - } - - // If this is an inner synthetic event for an event with a bubbling surrogate - // (focus or blur), assume that the surrogate already propagated from triggering the - // native event and prevent that from happening again here. - // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the - // bubbling surrogate propagates *after* the non-bubbling base), but that seems - // less bad than duplication. - } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { - event.stopPropagation(); - } - - // If this is a native event triggered above, everything is now in order - // Fire an inner synthetic event with the original arguments - } else if ( saved.length ) { - - // ...and capture the result - dataPriv.set( this, type, { - value: jQuery.event.trigger( - - // Support: IE <=9 - 11+ - // Extend with the prototype to reset the above stopImmediatePropagation() - jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), - saved.slice( 1 ), - this - ) - } ); - - // Abort handling of the native event - event.stopImmediatePropagation(); - } - } - } ); -} - -jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } -}; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || Date.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Includes all common event props including KeyEvent and MouseEvent specific props -jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - code: true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - - which: function( event ) { - var button = event.button; - - // Add which for key events - if ( event.which == null && rkeyEvent.test( event.type ) ) { - return event.charCode != null ? event.charCode : event.keyCode; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { - if ( button & 1 ) { - return 1; - } - - if ( button & 2 ) { - return 3; - } - - if ( button & 4 ) { - return 2; - } - - return 0; - } - - return event.which; - } -}, jQuery.event.addProp ); - -jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { - jQuery.event.special[ type ] = { - - // Utilize native event if possible so blur/focus sequence is correct - setup: function() { - - // Claim the first handler - // dataPriv.set( this, "focus", ... ) - // dataPriv.set( this, "blur", ... ) - leverageNative( this, type, expectSync ); - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function() { - - // Force setup before trigger - leverageNative( this, type ); - - // Return non-false to allow normal event-path propagation - return true; - }, - - delegateType: delegateType - }; -} ); - -// Create mouseenter/leave events using mouseover/out and event-time checks -// so that event delegation works in jQuery. -// Do the same for pointerenter/pointerleave and pointerover/pointerout -// -// Support: Safari 7 only -// Safari sends mouseenter too often; see: -// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 -// for the description of the bug (it existed in older Chrome versions as well). -jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } -} ); - - -var - - // Support: IE <=10 - 11, Edge 12 - 13 only - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g; - -// Prefer a tbody over its parent table for containing new rows -function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( elem ).children( "tbody" )[ 0 ] || elem; - } - - return elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { - elem.type = elem.type.slice( 5 ); - } else { - elem.removeAttribute( "type" ); - } - - return elem; -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.get( src ); - events = pdataOld.events; - - if ( events ) { - dataPriv.remove( dest, "handle events" ); - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } -} - -// Fix IE bugs, see support tests -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = flat( args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - valueIsFunction = isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( valueIsFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( valueIsFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl && !node.noModule ) { - jQuery._evalUrl( node.src, { - nonce: node.nonce || node.getAttribute( "nonce" ) - }, doc ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); - } - } - } - } - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && isAttached( node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html; - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = isAttached( elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } -} ); - -jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); -var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - -var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - -var swap = function( elem, options, callback ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.call( elem ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - -var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); - - - -( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - container.style.cssText = "position:absolute;left:-11111px;width:60px;" + - "margin-top:1px;padding:0;border:0"; - div.style.cssText = - "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + - "margin:auto;border:1px;padding:1px;" + - "width:60%;top:1%"; - documentElement.appendChild( container ).appendChild( div ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; - - // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 - // Some styles come back with percentage values, even though they shouldn't - div.style.right = "60%"; - pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; - - // Support: IE 9 - 11 only - // Detect misreporting of content dimensions for box-sizing:border-box elements - boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; - - // Support: IE 9 only - // Detect overflow:scroll screwiness (gh-3699) - // Support: Chrome <=64 - // Don't get tricked when zoom affects offsetWidth (gh-4029) - div.style.position = "absolute"; - scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - function roundPixelMeasures( measure ) { - return Math.round( parseFloat( measure ) ); - } - - var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, - reliableTrDimensionsVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - jQuery.extend( support, { - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelBoxStyles: function() { - computeStyleTests(); - return pixelBoxStylesVal; - }, - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - }, - scrollboxSize: function() { - computeStyleTests(); - return scrollboxSizeVal; - }, - - // Support: IE 9 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Behavior in IE 9 is more subtle than in newer versions & it passes - // some versions of this test; make sure not to make it pass there! - reliableTrDimensions: function() { - var table, tr, trChild, trStyle; - if ( reliableTrDimensionsVal == null ) { - table = document.createElement( "table" ); - tr = document.createElement( "tr" ); - trChild = document.createElement( "div" ); - - table.style.cssText = "position:absolute;left:-11111px"; - tr.style.height = "1px"; - trChild.style.height = "9px"; - - documentElement - .appendChild( table ) - .appendChild( tr ) - .appendChild( trChild ); - - trStyle = window.getComputedStyle( tr ); - reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; - - documentElement.removeChild( table ); - } - return reliableTrDimensionsVal; - } - } ); -} )(); - - -function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !isAttached( elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; -} - - -function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; -} - - -var cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style, - vendorProps = {}; - -// Return a vendor-prefixed property or undefined -function vendorPropName( name ) { - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } -} - -// Return a potentially-mapped jQuery.cssProps or vendor prefixed property -function finalPropName( name ) { - var final = jQuery.cssProps[ name ] || vendorProps[ name ]; - - if ( final ) { - return final; - } - if ( name in emptyStyle ) { - return name; - } - return vendorProps[ name ] = vendorPropName( name ) || name; -} - - -var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }; - -function setPositiveNumber( _elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; -} - -function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { - var i = dimension === "width" ? 1 : 0, - extra = 0, - delta = 0; - - // Adjustment may not be necessary - if ( box === ( isBorderBox ? "border" : "content" ) ) { - return 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin - if ( box === "margin" ) { - delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); - } - - // If we get here with a content-box, we're seeking "padding" or "border" or "margin" - if ( !isBorderBox ) { - - // Add padding - delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // For "border" or "margin", add border - if ( box !== "padding" ) { - delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - - // But still keep track of it otherwise - } else { - extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - - // If we get here with a border-box (content + padding + border), we're seeking "content" or - // "padding" or "margin" - } else { - - // For "content", subtract padding - if ( box === "content" ) { - delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // For "content" or "padding", subtract border - if ( box !== "margin" ) { - delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - // Account for positive content-box scroll gutter when requested by providing computedVal - if ( !isBorderBox && computedVal >= 0 ) { - - // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border - // Assuming integer scroll gutter, subtract the rest and round down - delta += Math.max( 0, Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - computedVal - - delta - - extra - - 0.5 - - // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter - // Use an explicit zero to avoid NaN (gh-3964) - ) ) || 0; - } - - return delta; -} - -function getWidthOrHeight( elem, dimension, extra ) { - - // Start with computed style - var styles = getStyles( elem ), - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). - // Fake content-box until we know it's needed to know the true value. - boxSizingNeeded = !support.boxSizingReliable() || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - valueIsBorderBox = isBorderBox, - - val = curCSS( elem, dimension, styles ), - offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); - - // Support: Firefox <=54 - // Return a confounding non-pixel value or feign ignorance, as appropriate. - if ( rnumnonpx.test( val ) ) { - if ( !extra ) { - return val; - } - val = "auto"; - } - - - // Support: IE 9 - 11 only - // Use offsetWidth/offsetHeight for when box sizing is unreliable. - // In those cases, the computed value can be trusted to be border-box. - if ( ( !support.boxSizingReliable() && isBorderBox || - - // Support: IE 10 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Interestingly, in some cases IE 9 doesn't suffer from this issue. - !support.reliableTrDimensions() && nodeName( elem, "tr" ) || - - // Fall back to offsetWidth/offsetHeight when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - val === "auto" || - - // Support: Android <=4.1 - 4.3 only - // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) - !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && - - // Make sure the element is visible & connected - elem.getClientRects().length ) { - - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Where available, offsetWidth/offsetHeight approximate border box dimensions. - // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the - // retrieved value as a content box dimension. - valueIsBorderBox = offsetProp in elem; - if ( valueIsBorderBox ) { - val = elem[ offsetProp ]; - } - } - - // Normalize "" and auto - val = parseFloat( val ) || 0; - - // Adjust for the element's box model - return ( val + - boxModelAdjustment( - elem, - dimension, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles, - - // Provide the current computed size to request scroll gutter calculation (gh-3589) - val - ) - ) + "px"; -} - -jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "gridArea": true, - "gridColumn": true, - "gridColumnEnd": true, - "gridColumnStart": true, - "gridRow": true, - "gridRowEnd": true, - "gridRowStart": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: {}, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append - // "px" to a few hardcoded values. - if ( type === "number" && !isCustomProp ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } -} ); - -jQuery.each( [ "height", "width" ], function( _i, dimension ) { - jQuery.cssHooks[ dimension ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, dimension, extra ); - } ) : - getWidthOrHeight( elem, dimension, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = getStyles( elem ), - - // Only read styles.position if the test has a chance to fail - // to avoid forcing a reflow. - scrollboxSizeBuggy = !support.scrollboxSize() && - styles.position === "absolute", - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) - boxSizingNeeded = scrollboxSizeBuggy || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - subtract = extra ? - boxModelAdjustment( - elem, - dimension, - extra, - isBorderBox, - styles - ) : - 0; - - // Account for unreliable border-box dimensions by comparing offset* to computed and - // faking a content-box to get border and padding (gh-3699) - if ( isBorderBox && scrollboxSizeBuggy ) { - subtract -= Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - parseFloat( styles[ dimension ] ) - - boxModelAdjustment( elem, dimension, "border", false, styles ) - - 0.5 - ); - } - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ dimension ] = value; - value = jQuery.css( elem, dimension ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; -} ); - -jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } -); - -// These hooks are used by animate to expand properties -jQuery.each( { - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( prefix !== "margin" ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -} ); - -jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } -} ); - - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && ( - jQuery.cssHooks[ tween.prop ] || - tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" -}; - -jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point -jQuery.fx.step = {}; - - - - -var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - -function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } -} - -// Animations created synchronously will run synchronously -function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = Date.now() ); -} - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } -} - -function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 15 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY and Edge just mirrors - // the overflowX value there. - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - result.stop.bind( result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } -} ); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } -} ); - -jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -} ); - -// Generate shortcuts for custom animations -jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -} ); - -jQuery.timers = []; -jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = Date.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); -}; - -jQuery.fx.interval = 13; -jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); -}; - -jQuery.fx.stop = function() { - inProgress = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 -}; - - -// Based off of the plugin by Clint Helfers, with permission. -// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ -jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); -}; - - -( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; -} )(); - - -var boolHook, - attrHandle = jQuery.expr.attrHandle; - -jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } -} ); - -jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } -} ); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } -}; - -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; -} ); - - - - -var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - -jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } -} ); - -jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } -} ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -// eslint rule "no-unused-expressions" is disabled for this code -// since it considers such accessions noop -if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; -} - -jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -} ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - -function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; -} - -function classesToArray( value ) { - if ( Array.isArray( value ) ) { - return value; - } - if ( typeof value === "string" ) { - return value.match( rnothtmlwhite ) || []; - } - return []; -} - -jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isValidValue = type === "string" || Array.isArray( value ); - - if ( typeof stateVal === "boolean" && isValidValue ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( isValidValue ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = classesToArray( value ); - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } -} ); - - - - -var rreturn = /\r/g; - -jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, valueIsFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - valueIsFunction = isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( valueIsFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } -} ); - -jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } -} ); - -// Radios and checkboxes getter/setter -jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } -} ); - - - - -// Return jQuery for attributes-only inclusion - - -support.focusin = "onfocusin" in window; - - -var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - stopPropagationCallback = function( e ) { - e.stopPropagation(); - }; - -jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = lastElement = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - lastElement = cur; - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( - dataPriv.get( cur, "events" ) || Object.create( null ) - )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - - if ( event.isPropagationStopped() ) { - lastElement.addEventListener( type, stopPropagationCallback ); - } - - elem[ type ](); - - if ( event.isPropagationStopped() ) { - lastElement.removeEventListener( type, stopPropagationCallback ); - } - - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - -} ); - -jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -} ); - - -// Support: Firefox <=44 -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 -// focus(in | out) events fire after focus & blur events, -// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order -// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 -if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - - // Handle: regular nodes (via `this.ownerDocument`), window - // (via `this.document`) & document (via `this`). - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); -} -var location = window.location; - -var nonce = { guid: Date.now() }; - -var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) { - xml = undefined; - } - - if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; -}; - - -var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && toType( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } -} - -// Serialize an array of form elements or a set of -// key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - if ( a == null ) { - return ""; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); -}; - -jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ) - .filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ) - .map( function( _i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } -} ); - - -var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; -} - -/* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -/* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ -function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; -} - -jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() + " " ] = - ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) - .concat( match[ 2 ] ); - } - } - match = responseHeaders[ key.toLowerCase() + " " ]; - } - return match == null ? null : match.join( ", " ); - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 15 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available and should be processed, append data to url - if ( s.data && ( s.processData || typeof s.data === "string" ) ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + - uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Use a noop converter for missing script - if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { - s.converters[ "text script" ] = function() {}; - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } -} ); - -jQuery.each( [ "get", "post" ], function( _i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; -} ); - -jQuery.ajaxPrefilter( function( s ) { - var i; - for ( i in s.headers ) { - if ( i.toLowerCase() === "content-type" ) { - s.contentType = s.headers[ i ] || ""; - } - } -} ); - - -jQuery._evalUrl = function( url, options, doc ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - - // Only evaluate the response if it is successful (gh-4126) - // dataFilter is not invoked for failure responses, so using it instead - // of the default converter is kludgy but it works. - converters: { - "text script": function() {} - }, - dataFilter: function( response ) { - jQuery.globalEval( response, options, doc ); - } - } ); -}; - - -jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var htmlIsFunction = isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } -} ); - - -jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); -}; -jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); -}; - - - - -jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} -}; - -var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); -support.ajax = xhrSupported = !!xhrSupported; - -jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.ontimeout = - xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) -jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } -} ); - -// Install script dataType -jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -} ); - -// Handle cache's special case and crossDomain -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } -} ); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain or forced-by-attrs requests - if ( s.crossDomain || s.scriptAttrs ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( " - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Exact diagonalization

-

Here we show how to find the eigenvalues and eigenvectors of a many-body -Hamiltonian of fermions with Coulomb interactions. We then determine their spin -and orbital angular momentum and how this changes when we switch on spin-orbit -coupling.

-

Import the necessary modules.

-
import numpy as np
-import matplotlib.pyplot as plt
-import scipy
-import edrixs
-
-
-
-

Parameters

-

Define the orbital angular momentum number \(l=1\) (i.e. a p shell), -the number of spin-orbitals, the occupancy and the Slater integrals. -\(F^{k}\) with \(k=0,2\):

-
l = 1
-norb = 6
-noccu = 2
-F0, F2 = 4.0, 1.0
-
-
-
-
-

Coulomb interactions

-

The Coulomb interactions in EDRIXS are described by a tensor. Understanding this -in full is complicated and requires careful consideration of the symmetry of the -interactions. See example 6 for more discussion if desired. -EDRIXS can construct the matrix via

-
umat = edrixs.get_umat_slater('p', F0, F2)
-
-
-
-
-

Create basis

-

Now we build the binary form of the Fock basis \(|F>\) (we consider it -preferable to use the standard \(F\) and trust the reader to avoid -confusing it with the interaction parameters.) -The Fock basis is the simplest legitimate form for the basis and it consists -of a series of 1s and 0s where 1 means occupied and -0 means empty. These are in order up, down, up, down, up, down.

-
basis = edrixs.get_fock_bin_by_N(norb, noccu)
-print(np.array(basis))
-
-
-
[[1 1 0 0 0 0]
- [1 0 1 0 0 0]
- [1 0 0 1 0 0]
- [1 0 0 0 1 0]
- [1 0 0 0 0 1]
- [0 1 1 0 0 0]
- [0 1 0 1 0 0]
- [0 1 0 0 1 0]
- [0 1 0 0 0 1]
- [0 0 1 1 0 0]
- [0 0 1 0 1 0]
- [0 0 1 0 0 1]
- [0 0 0 1 1 0]
- [0 0 0 1 0 1]
- [0 0 0 0 1 1]]
-
-
-

We expect the number of these states to be given by the mathematical -combination of two electrons distributed among six states (three spin-orbitals -with two spins per orbital).

-
message = ("We predict C(norb={}, noccu={})={:.0f} states and we got {:d}, "
-           "which is reassuring!")
-print(message.format(norb, noccu, edrixs.combination(norb, noccu), len(basis)))
-
-
-
We predict C(norb=6, noccu=2)=15 states and we got 15, which is reassuring!
-
-
-

Note that in more complicated problems with both valence and core -electrons, the edrixs convention is to list the valence electrons first.

-
-
-

Transform interactions into Fock basis

-

edrixs works by initiailly creating a Hamiltonian matrix -\(\hat{H}\) in the single particle basis and then transforming into -our chosen Fock basis. In the single particle basis, we have four fermion -interactions with this form

-
-
-\[\hat{H} = <F_l|\sum_{ij}U_{ijkl}\hat{f}_{i}^{\dagger} - \hat{f}_{j}^{\dagger} - \hat{f}_{k}\hat{f}_{l}|F_r>\]
-
-

generated as

-
n_fermion = 4
-H = edrixs.build_opers(n_fermion, umat, basis)
-
-
-

We needed to specify n_fermion = 4 because the -edrixs.build_opers function can also make two fermion terms.

-
-
-

Diagonalize the matrix

-

For a small problem such as this it is convenient to use the native -scipy diagonalization routine. This returns eigenvalues -e and eignvectors v where eigenvalue e[i] corresponds -to eigenvector v[:,i].

-
e, v = scipy.linalg.eigh(H)
-print("{} eignvalues and {} eigvenvectors {} elements long.".format(len(e),
-                                                                    v.shape[1],
-                                                                    v.shape[0]))
-
-
-
15 eignvalues and 15 eigvenvectors 15 elements long.
-
-
-
-
-

Computing expectation values

-

To interpret the results, it is informative to compute the expectations values -related to the spin \(\mathbf{S}\), orbital \(\mathbf{L}\), -and total \(\mathbf{J}\), angular momentum. We first load the relevant -matrices for these quantities for a p atomic shell. We need to specify -that we would like to include spin when loading the orbital operator.

-
orb_mom = edrixs.get_orb_momentum(l, ispin=True)
-spin_mom = edrixs.get_spin_momentum(l)
-tot_mom = orb_mom + spin_mom
-
-
-

We again transform these matrices to our Fock basis to build the operators

-
n_fermion = 2
-opL, opS, opJ = edrixs.build_opers(n_fermion, [orb_mom, spin_mom, tot_mom],
-                                   basis)
-
-
-

Recall that quantum mechanics forbids us from knowing all three Cartesian -components of angular momentum at once, so we want to compute the squares of -these operators i.e.

-
-
-\[\begin{split}\mathbf{S}^2 = S^2_x + S^2_y + S^2_z\\ -\mathbf{L}^2 = L^2_x + L^2_y + L^2_z\\ -\mathbf{J}^2 = J^2_x + J^2_y + J^2_z\end{split}\]
-
-
L2 = np.dot(opL[0], opL[0]) + np.dot(opL[1], opL[1]) + np.dot(opL[2], opL[2])
-S2 = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2])
-J2 = np.dot(opJ[0], opJ[0]) + np.dot(opJ[1], opJ[1]) + np.dot(opJ[2], opJ[2])
-
-
-

Remember that the eigenvalues of \(\mathbf{S}^2\) are in the form -\(S(S+1)\) etc. and that they can be obtained by calculating the -projection of the operators onto our eigenvectors.

-
L2_val = edrixs.cb_op(L2, v).diagonal().real
-S2_val = edrixs.cb_op(S2, v).diagonal().real
-J2_val = edrixs.cb_op(J2, v).diagonal().real
-
-
-

We can determine the degeneracy of the eigenvalues numerically and print out -the values as follows

-
e = np.round(e, decimals=6)
-degeneracy = [sum(eval == e) for eval in e]
-header = "{:<3s}\t{:>8s}\t{:>8s}\t{:>8s}\t{:>8s}"
-print(header.format("#  ", "E  ", "S(S+1)", "L(L+1)", "Degen."))
-for i, eigenvalue in enumerate(e):
-    values_list = [i, eigenvalue, S2_val[i], L2_val[i], degeneracy[i]]
-    print("{:<3d}\t{:8.3f}\t{:8.3f}\t{:8.3f}\t{:>3d}".format(*values_list))
-
-
-
#            E            S(S+1)          L(L+1)          Degen.
-0          3.800           2.000           2.000          9
-1          3.800           2.000           2.000          9
-2          3.800           2.000           2.000          9
-3          3.800           2.000           2.000          9
-4          3.800           2.000           2.000          9
-5          3.800           2.000           2.000          9
-6          3.800           2.000           2.000          9
-7          3.800           2.000           2.000          9
-8          3.800           2.000           2.000          9
-9          4.040           0.000           6.000          5
-10         4.040           0.000           6.000          5
-11         4.040           0.000           6.000          5
-12         4.040           0.000           6.000          5
-13         4.040           0.000           6.000          5
-14         4.400           0.000          -0.000          1
-
-
-

We see \(S=0\) and \(S=1\) states coming from the -two combinations of the spin 1/2 particles. \(L\) can take values of -0, 1, 2. Remember that spin states have degeneracy of \(2S+1\) and the -same is true for orbital states. -We must multiply these \(S\) and -\(L\) degeneracies to get the total degeneracy. -Since these particles are fermions, the -overall state must be antisymmetric, which dictates the allowed combinations -of \(S\) and \(L\).

-
-
-

Energy level diagram

-

Let us show our findings graphically

-
fig, ax = plt.subplots()
-for i, eigenvalue in enumerate(np.unique(e)):
-    art = ax.plot([0, 1], [eigenvalue, eigenvalue], '-',  color='C{}'.format(i))
-    ind = np.where(eigenvalue == e)[0][0]
-    L = (-1 + np.sqrt(1 + 4*L2_val[ind]))/2
-    S = (-1 + np.sqrt(1 + 4*S2_val[ind]))/2
-    message = "L={:.0f}, S={:.0f} ({:.0f})"
-    ax.text(1, eigenvalue, message.format(L, S, degeneracy[ind]),
-            horizontalalignment='right',
-            verticalalignment='bottom',
-            color='C{}'.format(i))
-
-ax.set_ylabel('Energy')
-for loc in ['right', 'top', 'bottom']:
-    ax.spines[loc].set_visible(False)
-
-ax.yaxis.set_ticks_position('left')
-ax.set_xticks([])
-plt.show()
-
-
-example 0 ed calculator

We see Hund’s rules in action! Rule 1 says that the highest spin \(S=1\) -state has the lowest energy. Of the two \(S=0\) states, the state with -larger \(L=1\) is lower energy following rule 2.

-
-
-

Spin orbit coupling

-

For fun, we can see how this changes when we add spin orbit coupling (SOC). -This is a two-fermion operator that we create, transform into the Fock basis -and add to the prior Hamiltonian. To make things easy, let us make the SOC -small so that the LS coupling approximation is valid and we can -still track the states.

-
soc = edrixs.atom_hsoc('p', 0.1)
-n_fermion = 2
-H2 = H + edrixs.build_opers(n_fermion, soc, basis)
-
-
-

Then, we redo the diagonalization and print the results.

-
e2, v2 = scipy.linalg.eigh(H2)
-e2 = np.round(e2, decimals=6)
-degeneracy2 = [sum(eval == e2) for eval in e2]
-print()
-message = "With SOC\n {:<3s}\t{:>8s}\t{:>8s}\t{:>8s}\t{:>8s}\t{:>8s}"
-print(message.format("#", "E", "S(S+1)", "L(L+1)", "J(J+1)", "degen."))
-J2_val_soc = edrixs.cb_op(J2, v2).diagonal().real
-L2_val_soc = edrixs.cb_op(L2, v2).diagonal().real
-S2_val_soc = edrixs.cb_op(S2, v2).diagonal().real
-for i, eigenvalue in enumerate(e2):
-    values_list = [i, eigenvalue, S2_val_soc[i], L2_val_soc[i], J2_val_soc[i],
-                   degeneracy2[i]]
-    print("{:<3d}\t{:8.3f}\t{:8.3f}\t{:8.3f}\t{:8.3f}\t{:8.3f}".format(*values_list))
-
-
-
With SOC
- #             E          S(S+1)          L(L+1)          J(J+1)          degen.
-0          3.673           1.927           1.927          -0.000           1.000
-1          3.750           2.000           2.000           2.000           3.000
-2          3.750           2.000           2.000           2.000           3.000
-3          3.750           2.000           2.000           2.000           3.000
-4          3.827           1.802           2.396           6.000           5.000
-5          3.827           1.802           2.396           6.000           5.000
-6          3.827           1.802           2.396           6.000           5.000
-7          3.827           1.802           2.396           6.000           5.000
-8          3.827           1.802           2.396           6.000           5.000
-9          4.063           0.198           5.604           6.000           5.000
-10         4.063           0.198           5.604           6.000           5.000
-11         4.063           0.198           5.604           6.000           5.000
-12         4.063           0.198           5.604           6.000           5.000
-13         4.063           0.198           5.604           6.000           5.000
-14         4.427           0.073           0.073          -0.000           1.000
-
-
-

and we make an equivalent energy level diagram.

-
fig, ax = plt.subplots()
-for i, eigenvalue in enumerate(np.unique(e2)):
-    art = ax.plot([0, 1], [eigenvalue, eigenvalue], '-',  color='C{}'.format(i))
-    ind = np.where(eigenvalue == e2)[0][0]
-    J = (-1 + np.sqrt(1+4*J2_val_soc[ind]))/2
-    message = "J={:.0f} ({:.0f})"
-    ax.text(1, eigenvalue, message.format(J, degeneracy2[ind]),
-            horizontalalignment='right',
-            verticalalignment='bottom',
-            color='C{}'.format(i))
-
-ax.set_ylabel('Energy')
-for loc in ['right', 'top', 'bottom']:
-    ax.spines[loc].set_visible(False)
-
-ax.yaxis.set_ticks_position('left')
-ax.set_xticks([])
-plt.show()
-
-
-example 0 ed calculator

It is clear that we have split the \(S=1\) state, which branches into -three states from \(J=|L-S|, |L-S|+1, ..., |L+S|\). Since the shell is -less than half full, Hund’s third rule dictates that the smaller \(J\) -states have the lower energies.

-

Total running time of the script: (0 minutes 0.138 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_1_crystal_field.html b/edrixs/auto_examples/example_1_crystal_field.html deleted file mode 100644 index 246c5c7cf1..0000000000 --- a/edrixs/auto_examples/example_1_crystal_field.html +++ /dev/null @@ -1,496 +0,0 @@ - - - - - - - - - Crystal fields — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Crystal fields

-

This example explains how to implement crystal fields in edrixs.

-

We need to import these modules.

-
import edrixs
-import numpy as np
-import scipy
-
-np.set_printoptions(precision=2, suppress=True, linewidth=90)
-
-
-
-

Crystal field matrices

-

Let us start by considering the common case of a \(d\) atomic shell in a -cubic crystal field. This is controlled by parameter \(10D_q\) and is -described in terms of a matrix which we will assign to cfmat. edrixs -can make this matrix via.

-
ten_dq = 10
-cfmat = edrixs.angular_momentum.cf_cubic_d(ten_dq)
-
-
-

Note this matrix is in a complex harmonic basis \(Y^m_l\) where \(m\) -goes from \(-l,-l+1,...,l-1, l\). There is an up spin and a down -spin for each \(Y^m_l\). This matrix is not diagonal in the complex -harmonic basis, but it would be diagonal in the real harmonic basis -\(d_{3z^2-r^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}\). -Let us diagonalize this matrix as a check and print out the energies -and their degeneracies.

-
e, v = scipy.linalg.eigh(cfmat)
-e = e.round(decimals=6)
-unique_e = np.unique(e)
-degeneracies = [sum(evalue == e) for evalue in unique_e]
-
-print("E  \tDegeneracy")
-for evalue, degenvalue in zip(unique_e, degeneracies):
-    print("{:.1f}\t{:.0f}".format(evalue, degenvalue))
-print("{} distinct energies".format(len(unique_e)))
-
-
-
E       Degeneracy
--4.0    6
-6.0     4
-2 distinct energies
-
-
-

This makes sense! We see two different energies split by \(10D_q=10\). Let -us look at the six columns corresponding to the lower energy eigenvalues.

-
print(v[:, :6].real)
-
-
-
[[ 0.    0.    0.    0.    0.71  0.  ]
- [ 0.    0.    0.    0.    0.    0.71]
- [ 0.    0.   -1.    0.    0.    0.  ]
- [ 0.    0.    0.   -1.    0.    0.  ]
- [ 0.    0.    0.    0.    0.    0.  ]
- [ 0.    0.    0.    0.    0.    0.  ]
- [ 1.    0.    0.    0.    0.    0.  ]
- [ 0.    1.    0.    0.    0.    0.  ]
- [ 0.    0.    0.    0.   -0.71  0.  ]
- [ 0.    0.    0.    0.    0.   -0.71]]
-
-
-

These are the set of so-called \(t_{2g}\) orbitals, composed of -\(Y^2_2, Y^{-2}_2, Y^{1}_2, Y^{-1}_2\). The rest of the eigenvectors -(the last four) are

-
print(v[:, 6:].real)
-
-
-
[[-0.71  0.    0.    0.  ]
- [ 0.   -0.71  0.    0.  ]
- [ 0.    0.    0.    0.  ]
- [ 0.    0.    0.    0.  ]
- [ 0.    0.    0.    1.  ]
- [ 0.    0.    1.    0.  ]
- [ 0.    0.    0.    0.  ]
- [ 0.    0.    0.    0.  ]
- [-0.71  0.    0.    0.  ]
- [ 0.   -0.71  0.    0.  ]]
-
-
-

These are the set of so-called \(e_{g}\) orbitals, composed of -\(Y^2_2, Y^{-2}_2, Y^{0}_2\). We can use edrixs to prove that -cfmat would be diagonal in the real -harmonic basis. An operator \(\hat{O}\) can be transformed into an -operator in another basis \(\hat{O}^{\prime}\) using a unitary -transformation matrix \(T\) as

-
-
-\[\hat{O}^{\prime} = (T)^{\dagger} \hat{O} (T).\]
-
-

This is computed as follows

-
cfmat_rhb = edrixs.cb_op(cfmat, edrixs.tmat_c2r('d', ispin=True))
-print(cfmat_rhb.real)
-
-
-
[[ 6.  0.  0.  0.  0.  0.  0.  0.  0.  0.]
- [ 0.  6.  0.  0.  0.  0.  0.  0.  0.  0.]
- [ 0.  0. -4.  0.  0.  0.  0.  0.  0.  0.]
- [ 0.  0.  0. -4.  0.  0.  0.  0.  0.  0.]
- [ 0.  0.  0.  0. -4.  0.  0.  0.  0.  0.]
- [ 0.  0.  0.  0.  0. -4.  0.  0.  0.  0.]
- [ 0.  0.  0.  0.  0.  0.  6.  0.  0.  0.]
- [ 0.  0.  0.  0.  0.  0.  0.  6.  0.  0.]
- [ 0.  0.  0.  0.  0.  0.  0.  0. -4.  0.]
- [ 0.  0.  0.  0.  0.  0.  0.  0.  0. -4.]]
-
-
-

where edrixs.tmat_c2r('d', ispin=True) is the transformation matrix. -We needed to tell edrixs that we are working with a \(d\)-shell and that it -should include spin. We could also have transformed v to see how these -eignevectors are composed of the real harmonic basis. We will see an example -of this later.

-
-
-

Crystal field on an atom

-

To simulate the solid state, we need to combine the crystal field with Coulomb -interactions. Let us choose an atomic model for Ni.

-
l = 2
-norb = 10
-noccu = 8
-basis = edrixs.get_fock_bin_by_N(norb, noccu)
-slater = edrixs.get_atom_data('Ni', '3d', noccu, edge='L3')['slater_i']
-
-
-

Let us implement a tetragonal crystal field, for which we need to pass -d1 the splitting of \(d_{yz}/d_{zx}\) and \(d_{xy}\) and -d3 the splitting of \(d_{3z^2-r^2}\) and \(d_{x^2-y^2}\).

-
ten_dq, d1, d3 = 2.5, 0.9, .2
-
-
-

To determine the eigenvalues and eigenvectors we need to transform both our -Coulomb matrix and our crystal field matrix into the same basis. See the -example on exact diagonalization if needed. In this case, we put this -procedure into a function, with the option to scale the Coulomb interactions.

-
def diagonlize(scaleU=1):
-    umat = edrixs.get_umat_slater('d',
-                                  slater[0][1]*scaleU,
-                                  slater[1][1]*scaleU,
-                                  slater[2][1]*scaleU)
-    cfmat = edrixs.angular_momentum.cf_tetragonal_d(ten_dq=ten_dq, d1=d1, d3=d3)
-    H = edrixs.build_opers(2, cfmat, basis) + edrixs.build_opers(4, umat, basis)
-    e, v = scipy.linalg.eigh(H)
-    e = e - np.min(e)  # define ground state as zero energy
-    return e, v
-
-
-

Let us look what happens when we run the function with the Coulomb -interactions switched off and check the degeneracy of the output. Look at this -python -string formatting tutorial -if the code is confusing.

-
e, v = diagonlize(scaleU=0)
-e = e.round(decimals=6)
-unique_e = np.unique(e)
-degeneracies = [sum(evalue == e) for evalue in unique_e]
-
-print("E  \tDegeneracy")
-for evalue, degenvalue in zip(unique_e, degeneracies):
-    print("{:.1f}\t{:.0f}".format(evalue, degenvalue))
-print("{} distinct energies".format(len(unique_e)))
-
-
-
E       Degeneracy
-0.0     1
-0.2     4
-0.4     1
-2.5     4
-2.7     4
-3.4     8
-3.6     8
-5.0     1
-5.9     8
-6.8     6
-10 distinct energies
-
-
-

We see 10 distinct energies, which is the number of ways one can arrange -two holes among 4 energy levels – which makes sense as the tetragonal field -involves four levels \(zx/zy, xy, 3z^2-r^2, x^2-y^2\). To see what is going -on in more detail, we can also calculate the expectation -values of the occupancy number of the orbitals -\(3z^2-r^2, zx, zy, x^2-y^2, xy\). -To create the operator, first write the matrix in the real harmonics basis -\(|3z^2-r^2,\uparrow>\), \(|3z^2-r^2,\downarrow>\), -\(|zx,\uparrow>\), \(|zx,\downarrow>\), etc. -In this basis, they take a simple form: only the diagonal terms have element -1. We therefore make a 3D empty array and assign the diagonal as 1. Check -out the -numpy indexing notes -if needed.

- -

Recalling the necessity to put everything in the same basis, we transform -into the complex harmonic basis and then transform into our Fock basis

-
nd_complex_harmoic_basis = edrixs.cb_op(nd_real_harmoic_basis,
-                                        edrixs.tmat_r2c('d', True))
-nd_op = edrixs.build_opers(2, nd_complex_harmoic_basis, basis)
-
-
-

We apply the operator and print out as follows. Check the -numpy docs -if the details of how the spin pairs have been added up is not immediately -transparent.

-
nd_expt = np.array([edrixs.cb_op(nd_vec, v).diagonal().real for nd_vec in nd_op])
-
-message = "{:>3s}" + "\t{:>6s}"*5
-print(message.format(*"E 3z2-r2 zx zy x2-y2 xy".split(" ")))
-
-message = "{:>3.1f}" + "\t{:>6.1f}"*5
-for evalue, row in zip(e, nd_expt.T):
-    spin_pairs = row.reshape(-1, 2).sum(1)
-    print(message.format(evalue, *spin_pairs))
-
-
-
  E     3z2-r2      zx      zy   x2-y2      xy
-0.0        2.0     2.0     2.0     0.0     2.0
-0.2        1.0     2.0     2.0     1.0     2.0
-0.2        1.0     2.0     2.0     1.0     2.0
-0.2        1.0     2.0     2.0     1.0     2.0
-0.2        1.0     2.0     2.0     1.0     2.0
-0.4        0.0     2.0     2.0     2.0     2.0
-2.5        2.0     2.0     2.0     1.0     1.0
-2.5        2.0     2.0     2.0     1.0     1.0
-2.5        2.0     2.0     2.0     1.0     1.0
-2.5        2.0     2.0     2.0     1.0     1.0
-2.7        1.0     2.0     2.0     2.0     1.0
-2.7        1.0     2.0     2.0     2.0     1.0
-2.7        1.0     2.0     2.0     2.0     1.0
-2.7        1.0     2.0     2.0     2.0     1.0
-3.4        2.0     1.5     1.5     1.0     2.0
-3.4        2.0     1.5     1.5     1.0     2.0
-3.4        2.0     1.5     1.5     1.0     2.0
-3.4        2.0     1.5     1.5     1.0     2.0
-3.4        2.0     1.5     1.5     1.0     2.0
-3.4        2.0     1.5     1.5     1.0     2.0
-3.4        2.0     1.5     1.5     1.0     2.0
-3.4        2.0     1.5     1.5     1.0     2.0
-3.6        1.0     1.6     1.4     2.0     2.0
-3.6        1.0     1.5     1.5     2.0     2.0
-3.6        1.0     1.5     1.5     2.0     2.0
-3.6        1.0     1.6     1.4     2.0     2.0
-3.6        1.0     1.3     1.7     2.0     2.0
-3.6        1.0     1.5     1.5     2.0     2.0
-3.6        1.0     1.4     1.6     2.0     2.0
-3.6        1.0     1.6     1.4     2.0     2.0
-5.0        2.0     2.0     2.0     2.0     0.0
-5.9        2.0     1.5     1.5     2.0     1.0
-5.9        2.0     1.5     1.5     2.0     1.0
-5.9        2.0     1.5     1.5     2.0     1.0
-5.9        2.0     1.5     1.5     2.0     1.0
-5.9        2.0     1.5     1.5     2.0     1.0
-5.9        2.0     1.5     1.5     2.0     1.0
-5.9        2.0     1.5     1.5     2.0     1.0
-5.9        2.0     1.5     1.5     2.0     1.0
-6.8        2.0     0.4     1.6     2.0     2.0
-6.8        2.0     1.3     0.7     2.0     2.0
-6.8        2.0     1.0     1.0     2.0     2.0
-6.8        2.0     1.0     1.0     2.0     2.0
-6.8        2.0     1.0     1.0     2.0     2.0
-6.8        2.0     1.2     0.8     2.0     2.0
-
-
-

The lowest energy state involves putting both holes in the \(x^2-y^2\) -orbital, which makes sense. Now, let us redo the proceedure including Coulomb -repulsion, which imposes an energy cost to putting multiple electrons in the -same orbital.

-
e, v = diagonlize(scaleU=1)
-
-nd_expt = np.array([edrixs.cb_op(nd_vec, v).diagonal().real for nd_vec in nd_op])
-
-message = "{:>3s}" + "\t{:>6s}"*5
-print(message.format(*"E 3z2-r2 zx zy x2-y2 xy".split(" ")))
-
-message = "{:>3.1f}" + "\t{:>6.1f}"*5
-for evalue, row in zip(e, nd_expt.T):
-    spin_pairs = row.reshape(-1, 2).sum(1)
-    print(message.format(evalue, *spin_pairs))
-
-
-
  E     3z2-r2      zx      zy   x2-y2      xy
-0.0        1.0     2.0     2.0     1.0     2.0
-0.0        1.0     2.0     2.0     1.0     2.0
-0.0        1.0     2.0     2.0     1.0     2.0
-2.4        1.2     2.0     2.0     0.8     2.0
-2.5        1.0     2.0     2.0     1.0     2.0
-2.5        1.0     2.0     2.0     2.0     1.0
-2.5        1.0     2.0     2.0     2.0     1.0
-2.5        1.0     2.0     2.0     2.0     1.0
-3.2        1.8     1.2     1.8     1.2     2.0
-3.2        1.8     1.7     1.3     1.2     2.0
-3.2        1.8     1.5     1.5     1.2     2.0
-3.2        1.8     1.7     1.3     1.2     2.0
-3.2        1.8     1.4     1.6     1.2     2.0
-3.2        1.8     1.5     1.5     1.2     2.0
-4.0        2.0     1.9     1.9     1.1     1.1
-4.0        2.0     1.9     1.9     1.1     1.1
-4.0        2.0     1.9     1.9     1.1     1.1
-4.3        0.9     2.0     2.0     1.2     1.9
-4.7        1.4     1.4     1.6     1.9     1.7
-4.7        1.4     1.5     1.5     1.9     1.7
-4.7        1.4     1.6     1.4     1.9     1.7
-4.7        1.4     1.4     1.6     1.9     1.7
-4.7        1.4     1.4     1.6     1.9     1.7
-4.7        1.4     1.6     1.4     1.9     1.7
-4.9        1.0     2.0     2.0     2.0     1.0
-5.5        2.0     2.0     2.0     1.0     1.0
-5.6        1.8     1.6     1.4     1.2     2.0
-5.6        1.8     1.4     1.6     1.2     2.0
-6.5        1.2     1.6     1.4     1.8     2.0
-6.5        1.2     1.4     1.6     1.8     2.0
-6.8        1.8     1.4     1.6     1.9     1.3
-6.8        1.8     1.5     1.5     1.9     1.3
-6.8        1.8     1.5     1.5     1.9     1.3
-6.8        1.8     1.6     1.4     1.9     1.3
-6.8        1.8     1.4     1.6     1.9     1.3
-6.8        1.8     1.6     1.4     1.9     1.3
-7.4        2.0     1.1     1.1     1.9     1.9
-7.4        2.0     1.1     1.1     1.9     1.9
-7.4        2.0     1.1     1.1     1.9     1.9
-8.0        2.0     1.8     1.8     2.0     0.4
-8.5        2.0     1.5     1.5     2.0     1.0
-8.5        2.0     1.5     1.5     2.0     1.0
-9.3        2.0     1.0     1.0     2.0     2.0
-9.4        2.0     1.0     1.0     2.0     2.0
-12.8       1.9     1.2     1.2     1.9     1.7
-
-
-

Now the lowest energy state involves splitting the holes between the two -highest energy \(x^2-y^2\) and \(3z^2-r^2\) orbitals. i.e. we have -gone from low-spin to high spin. Working out the balance between these two -states is often one of the first things one wants to determine upon the -discovery of an interesting new material [1].

-

Footnotes

- -

Total running time of the script: (0 minutes 0.149 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_2_single_atom_RIXS.html b/edrixs/auto_examples/example_2_single_atom_RIXS.html deleted file mode 100644 index af57c35d24..0000000000 --- a/edrixs/auto_examples/example_2_single_atom_RIXS.html +++ /dev/null @@ -1,459 +0,0 @@ - - - - - - - - - RIXS calculations for an atomic model — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

RIXS calculations for an atomic model

-

Here we show how to compute RIXS for a single site atomic model with crystal -field and electron-electron interactions. We take the case of -Sr2YIrO6 -from Ref. [1] as the material in question. The aim of this example is to -illustrate the proceedure and to provide what we hope is useful advice. What is -written is not meant to be a replacement for reading the docstrings of the -functions, which can always be accessed on the -edrixs website or -by executing functions with ?? in IPython.

-
import edrixs
-import numpy as np
-import matplotlib.pyplot as plt
-
-
-
-

Specify active core and valence orbitals

-

Sr2YIrO6 has a \(5d^4\) electronic configuration and -we want to calculate the \(L_3\) edge spectrum i.e. resonating with a -\(2p_{3/2}\) core hole. We will start by including only the -\(t_{2g}\) valance orbitals.

-
shell_name = ('t2g', 'p32')
-v_noccu = 4
-
-
-
-
-

Slater parameters

-

Here we want to use Hund’s interaction -\(J_H\) and spin orbit coupling \(\lambda\) as adjustable parameters -to match experiment. We will take -the core hole interaction parameter from the Hartree Fock numbers EDRIXS has -in its database. These need to be converted and arranged into the order -required by EDRIXS.

-
Ud = 2
-JH = 0.25
-lam = 0.42
-F0_d, F2_d, F4_d = edrixs.UdJH_to_F0F2F4(Ud, JH)
-info = edrixs.utils.get_atom_data('Ir', '5d', v_noccu, edge='L3')
-G1_dp = info['slater_n'][5][1]
-G3_dp = info['slater_n'][6][1]
-F0_dp = edrixs.get_F0('dp', G1_dp, G3_dp)
-F2_dp = info['slater_n'][4][1]
-
-slater_i = [F0_d, F2_d, F4_d]   # Fk for d
-slater_n = [
-    F0_d, F2_d, F4_d,   # Fk for d
-    F0_dp, F2_dp,        # Fk for dp
-    G1_dp, G3_dp,        # Gk for dp
-    0.0, 0.0           # Fk for p
-]
-slater = [slater_i, slater_n]
-v_soc = (lam, lam)
-
-
-
-
-

Diagonalization

-

We obtain the ground and intermediate state eigenenergies and the transition -operators via matrix diagonalization. Note that the calculation does not know -the core hole energy, so we need to adjust the energy that the resonance will -appear at by hand. We know empirically that the resonance is at 11215 eV -and that putting four electrons into the valance band costs about -\(4 F^0_d\approx6\) eV. In this case -we are assuming a perfectly cubic crystal field, which we have already -implemented when we specified the use of the \(t_{2g}\) subshell only -so we do not need to pass an additional v_cfmat matrix.

-
off = 11215 - 6
-out = edrixs.ed_1v1c_py(shell_name, shell_level=(0, -off), v_soc=v_soc,
-                        c_soc=info['c_soc'], v_noccu=v_noccu, slater=slater)
-eval_i, eval_n, trans_op = out
-
-
-
edrixs >>> Running ED ...
-
-    Summary of Slater integrals:
-    ------------------------------
-    Terms,   Initial Hamiltonian,  Intermediate Hamiltonian
-     F0_vv :          2.0000000000        2.0000000000
-     F2_vv :          2.1538461538        2.1538461538
-     F4_vv :          1.3461538462        1.3461538462
-     F0_vc :          0.0000000000        0.0881857143
-     F2_vc :          0.0000000000        1.0700000000
-     G1_vc :          0.0000000000        0.9570000000
-     G3_vc :          0.0000000000        0.5690000000
-     F0_cc :          0.0000000000        0.0000000000
-     F2_cc :          0.0000000000        0.0000000000
-
-edrixs >>> Dimension of the initial Hamiltonian:  15
-edrixs >>> Dimension of the intermediate Hamiltonian:  24
-edrixs >>> Building Many-body Hamiltonians ...
-edrixs >>> Done !
-edrixs >>> Exact Diagonalization of Hamiltonians ...
-edrixs >>> Done !
-edrixs >>> ED Done !
-
-
-
-
-

Compute XAS

-

To calculate XAS we need to correctly specify the orientation of the x-rays -with respect to the sample. By default, the \(x, y, z\) coordinates -of the sample’s crystal field, will be aligned with our lab frame, passing -loc_axis to ed_1v1c_py can be used to specify a different -convention. The experimental geometry is specified following the angles -shown in Figure 1 of Y. Wang et al., -Computer Physics Communications 243, 151-165 (2019). The default -setting has x-rays along \(z\) for \(\theta=\pi/2\) rad -and the x-ray beam along \(-x\) for -\(\theta=\phi=0\). Parameter scatter_axis can be passed to -xas_1v1c_py to specify a different geometry if desired.

-

Variable pol_type specifies a list of different x-ray -polarizations to calculate. Here we will use so-called \(\pi\)-polarization -where the x-rays are parallel to the plane spanned by the incident -beam and the sample \(z\)-axis.

-

EDRIXS represents the system’s ground state using a set of -low energy eigenstates weighted by Boltzmann thermal factors. -These eigenstates are specified by gs_list, -which is of the form \([0, 1, 2, 3, \dots]\). In this example, we -calculate these states as those that have non-negligible thermal -population. The function xas_1v1c_py assumes that the spectral -broadening is dominated by the inverse core hole lifetime gamma_c, -which is the Lorentzian half width at half maximum.

-
ominc = np.linspace(11200, 11230, 50)
-temperature = 300  # in K
-prob = edrixs.boltz_dist(eval_i, temperature)
-gs_list = [n for n, prob in enumerate(prob) if prob > 1e-6]
-
-thin = 30*np.pi/180
-phi = 0
-pol_type = [('linear', 0)]
-
-xas = edrixs.xas_1v1c_py(
-    eval_i, eval_n, trans_op, ominc, gamma_c=info['gamma_c'],
-    thin=thin, phi=phi, pol_type=pol_type,
-    gs_list=gs_list)
-
-
-
edrixs >>> Running XAS ...
-edrixs >>> XAS Done !
-
-
-
-
-

Compute RIXS

-

Calculating RIXS is overall similar to XAS, but with a few additional -considerations. The spectral width in the energy loss axis of RIXS it -not set by the core hole lifetime, but by either the final state lifetime -or the experimental resolution and is parameterized by gamma_f -– the Lorentzian half width at half maximum.

-

The angle and polarization of the emitted beam must also be specified, so -we pass pol_type_rixs to the function, which specifies the -includes the incoming and outgoing x-ray states. If, as is common in -experiments, the emitted polarization is not resolved -one needs to add both emitted polarization channels, which is what we will -do later on in this example.

-
eloss = np.linspace(-.5, 6, 400)
-pol_type_rixs = [('linear', 0, 'linear', 0), ('linear', 0, 'linear', np.pi/2)]
-
-thout = 60*np.pi/180
-gamma_f = 0.02
-
-rixs = edrixs.rixs_1v1c_py(
-    eval_i, eval_n, trans_op, ominc, eloss,
-    gamma_c=info['gamma_c'], gamma_f=gamma_f,
-    thin=thin, thout=thout, phi=phi,
-    pol_type=pol_type_rixs, gs_list=gs_list,
-    temperature=temperature
-)
-
-
-
edrixs >>> Running RIXS ...
-edrixs >>> RIXS Done !
-
-
-

The array xas will have shape -(len(ominc_xas), len(pol_type))

-
-
-

Plot XAS and RIXS

-

Let’s plot everything. We will use a function so we can reuse the code later. -Note that the rixs array rixs has shape -(len(ominc_xas), len(ominc_xas), len(pol_type)). We will use some numpy -tricks to sum over the two different emitted polarizations.

-
fig, axs = plt.subplots(2, 2, figsize=(10, 10))
-
-
-def plot_it(axs, ominc, xas, eloss, rixscut, rixsmap=None, label=None):
-    axs[0].plot(ominc, xas[:, 0], label=label)
-    axs[0].set_xlabel('Energy (eV)')
-    axs[0].set_ylabel('Intensity')
-    axs[0].set_title('XAS')
-
-    axs[1].plot(eloss, rixscut, label=f"{label}")
-    axs[1].set_xlabel('Energy loss (eV)')
-    axs[1].set_ylabel('Intensity')
-    axs[1].set_title(f'RIXS at resonance')
-
-    if rixsmap is not None:
-        art = axs[2].pcolormesh(ominc, eloss, rixsmap.T, shading='auto')
-        plt.colorbar(art, ax=axs[2], label='Intensity')
-        axs[2].set_xlabel('Incident energy (eV)')
-        axs[2].set_ylabel('Energy loss')
-        axs[2].set_title('RIXS map')
-
-
-rixs_pol_sum = rixs.sum(-1)
-cut_index = np.argmax(rixs_pol_sum[:, eloss < 2].sum(1))
-rixscut = rixs_pol_sum[cut_index]
-
-plot_it(axs.ravel(), ominc, xas, eloss, rixscut, rixsmap=rixs_pol_sum)
-axs[0, 1].set_xlim(right=3)
-axs[1, 0].set_ylim(top=3)
-axs[1, 1].remove()
-
-plt.show()
-
-
-XAS, RIXS at resonance, RIXS map
-
-

Full d shell calculation

-

Some researchers have questioned the appropriateness of only including the -\(t_{2g}\) subshell for iridates [2]. Let’s test this. We specify that -the full \(d\) shell should be used and apply cubic crystal field matrix -v_cfmat. We shift the energy offset by \(\frac{2}{5}10D_q\), which -is the amount the crystal field moves the \(t_{2g}\) subshell.

-
ten_dq = 3.5
-v_cfmat = edrixs.cf_cubic_d(ten_dq)
-off = 11215 - 6 + ten_dq*2/5
-out = edrixs.ed_1v1c_py(('d', 'p32'), shell_level=(0, -off), v_soc=v_soc,
-                        v_cfmat=v_cfmat,
-                        c_soc=info['c_soc'], v_noccu=v_noccu, slater=slater)
-eval_i, eval_n, trans_op = out
-
-xas_full_d_shell = edrixs.xas_1v1c_py(
-    eval_i, eval_n, trans_op, ominc, gamma_c=info['gamma_c'],
-    thin=thin, phi=phi, pol_type=pol_type,
-    gs_list=gs_list)
-
-rixs_full_d_shell = edrixs.rixs_1v1c_py(
-    eval_i, eval_n, trans_op, np.array([11215]), eloss,
-    gamma_c=info['gamma_c'], gamma_f=gamma_f,
-    thin=thin, thout=thout, phi=phi,
-    pol_type=pol_type_rixs, gs_list=gs_list,
-    temperature=temperature)
-
-fig, axs = plt.subplots(1, 2, figsize=(10, 4))
-plot_it(axs, ominc, xas, eloss, rixscut, label='$t_{2g}$ subshell')
-rixscut = rixs_full_d_shell.sum((0, -1))
-plot_it(axs, ominc, xas_full_d_shell, eloss, rixscut, label='$d$ shell')
-
-axs[0].legend()
-axs[1].legend()
-plt.show()
-
-
-XAS, RIXS at resonance
edrixs >>> Running ED ...
-
-    Summary of Slater integrals:
-    ------------------------------
-    Terms,   Initial Hamiltonian,  Intermediate Hamiltonian
-     F0_vv :          2.0000000000        2.0000000000
-     F2_vv :          2.1538461538        2.1538461538
-     F4_vv :          1.3461538462        1.3461538462
-     F0_vc :          0.0000000000        0.0881857143
-     F2_vc :          0.0000000000        1.0700000000
-     G1_vc :          0.0000000000        0.9570000000
-     G3_vc :          0.0000000000        0.5690000000
-     F0_cc :          0.0000000000        0.0000000000
-     F2_cc :          0.0000000000        0.0000000000
-
-edrixs >>> Dimension of the initial Hamiltonian:  210
-edrixs >>> Dimension of the intermediate Hamiltonian:  1008
-edrixs >>> Building Many-body Hamiltonians ...
-edrixs >>> Done !
-edrixs >>> Exact Diagonalization of Hamiltonians ...
-edrixs >>> Done !
-edrixs >>> ED Done !
-edrixs >>> Running XAS ...
-edrixs >>> XAS Done !
-edrixs >>> Running RIXS ...
-edrixs >>> RIXS Done !
-
-
-

As expected, we see the appearance of excitations on the energy scale of -\(10D_q\) in the XAS and RIXS. The low energy manifold is qualitatively, -but not quantiatively similar. This makes it clear that the parameterization -of Sr2YIrO6 is dependent on the model.

-

Footnotes

- -

Total running time of the script: (0 minutes 3.985 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_3_AIM_XAS.html b/edrixs/auto_examples/example_3_AIM_XAS.html deleted file mode 100644 index 6670b1e0fa..0000000000 --- a/edrixs/auto_examples/example_3_AIM_XAS.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - - - - - - Anderson impurity model for NiO XAS — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Anderson impurity model for NiO XAS

-

Here we calculate the \(L\)-edge XAS spectrum of an Anderson impurity model, -which is sometimes also called a charge-transfer multiplet model. This model -considers a set of correlated orbitals, often called the impurity or metal -states, that hybridize with a set of uncorrelated orbitals, often called the -ligands or bath states. Everyone’s favorite test case for x-ray spectroscopic -calculations of the Anderson impurity model is NiO and we won’t risk being -original! This means that our correlated states will -be the Ni \(3d\) orbitals and the uncorrelated states come from O -\(2p\) orbitals. The fact that we include these interactions means that our -spectrum can include processes where electrons transition from the bath to the -impurity, as such the Anderson Impurity Model is often more accurate than atomic -models, especially if the material has strong covalency.

-

When defining the bath states, it is useful to use the so-called -symmetry adapted linear combinations of orbitals as the basis. These states -take into account the symmetry relationships between the different bath atom -orbitals and the fact that there are bath orbital combinations that do not -interact with the impurity by symmetry. By doing this the problem can be -represented with fewer orbitals, which makes the calculation far more efficient. -The standard EDRIXS solver that we will use assumes that the bath states are -represented by an integer number of bath sites set by nbath, each of -which hosts the same number of spin-orbits as the impurity e.g. 10 for a -\(d\)-electron material.

-

NiO has a rocksalt structure in which all Ni atoms are surrounded by six O -atoms. This NiO cluster used to simulate the -crystal would then contain 10 Ni \(3d\) spin-orbitals and \(6\) -spin-orbitals per O \(\times 6\) O atoms \(=36\) oxygen -spin-orbitals. As explained by, for example, Maurits Haverkort -et al. in [1] symmetry allows us to represent the bath with 10 symmetry -adapted linear combinations of the different O \(p_x, p_y, p_z\) states. -The crystal field and hopping parameters for -such a calculation can be obtained by post-processing DFT calculations. We will -use values for NiO from [1]. If you use values from a paper the relevant -references should, of course, be cited.

-
import edrixs
-import numpy as np
-import matplotlib.pyplot as plt
-
-
-
-

Number of electrons

-

When formulating problems of this type, one usually thinks of a nominal -valence for the impurity atom in this case nd = 8 and assume that the -bath is full. The solver that we will -use can simulate multiple bath sites. In our case we specify -nbath  = 1 sites. Electrons will be able to transition from O to Ni -during our calculation, but the total number of valance electrons -v_noccu will be conserved.

-
nd = 8
-norb_d = 10
-norb_bath = 10
-nbath = 1
-v_noccu  = nd + nbath*norb_d
-shell_name = ('d', 'p') # valence and core shells for XAS calculation
-
-
-
-
-

Coulomb interactions

-

The atomic Coulomb interactions are usually initialized based on Hartree-Fock -calculations from, for example, -Cowan’s code. -edrixs has a database of these.

-
info  = edrixs.utils.get_atom_data('Ni', '3d', nd, edge='L3')
-
-
-

The atomic values are typically scaled to account for screening in the solid. -Here we use 80% scaling. Let’s write these out in full, so that nothing is -hidden. Values for \(U_{dd}\) and \(U_{dp}\) are those of Ref. [1] -obtained by comparing theory and experiment [2] [3].

-
scale_dd = 0.8
-F2_dd = info['slater_i'][1][1] * scale_dd
-F4_dd = info['slater_i'][2][1] * scale_dd
-U_dd = 7.3
-F0_dd = U_dd + edrixs.get_F0('d', F2_dd, F4_dd)
-
-scale_dp = 0.8
-F2_dp = info['slater_n'][4][1] * scale_dp
-G1_dp = info['slater_n'][5][1] * scale_dp
-G3_dp = info['slater_n'][6][1] * scale_dp
-U_dp = 8.5
-F0_dp = U_dp + edrixs.get_F0('dp', G1_dp, G3_dp)
-
-slater = ([F0_dd, F2_dd, F4_dd],  # initial
-          [F0_dd, F2_dd, F4_dd, F0_dp, F2_dp, G1_dp, G3_dp])  # with core hole
-
-
-
-
-

Energy of the bath states

-

In the notation used in EDRIXS, \(\Delta\) sets the energy difference -between the bath and impurity states. \(\Delta\) is defined in the atomic -limit without crystal field (i.e. in terms of the centers of the impurity and -bath states before hybridization is considered) as the energy for a -\(d^{n_d} \rightarrow d^{n_d + 1} \underline{L}\) transition. -Note that as electrons are moved one has to pay energy -costs associated with the Coulomb interactions. The -energy splitting between the bath and impurity is consequently not simply -\(\Delta\). One must therefore determine the energies by solving -a set of linear equations. See the edrixs.utils functions -for details. We can call these functions to get the impurity energy -\(E_d\), bath energy \(E_L\), impurity energy with a core hole -\(E_{dc}\), bath energy with a core hole \(E_{Lc}\) and the -core hole energy \(E_p\). The -if __name__ == '__main__' code specifies that this command -should only be executed if the file is explicitly run.

-
Delta = 4.7
-E_d, E_L = edrixs.CT_imp_bath(U_dd, Delta, nd)
-E_dc, E_Lc, E_p = edrixs.CT_imp_bath_core_hole(U_dd, U_dp, Delta, nd)
-message = ("E_d = {:.3f} eV\n"
-           "E_L = {:.3f} eV\n"
-           "E_dc = {:.3f} eV\n"
-           "E_Lc = {:.3f} eV\n"
-           "E_p = {:.3f} eV\n")
-if __name__ == '__main__':
-    print(message.format(E_d, E_L, E_dc, E_Lc, E_p))
-
-
-
E_d = -41.189 eV
-E_L = 12.511 eV
-E_dc = -77.367 eV
-E_Lc = 27.333 eV
-E_p = -44.467 eV
-
-
-

The spin-orbit coupling for the valence electrons in the ground state, the -valence electrons with the core hole present, and for the core hole itself -are initialized using the atomic values.

-
zeta_d_i = info['v_soc_i'][0]
-zeta_d_n = info['v_soc_n'][0]
-c_soc = info['c_soc']
-
-
-
-
-

Build matrices describing interactions

-

edrixs uses complex spherical harmonics as its default basis set. If we want to -use another basis set, we need to pass a matrix to the solver, which transforms -from complex spherical harmonics into the basis we use. -The solver will use this matrix when implementing the Coulomb interactions -using the slater list of Coulomb parameters. -Here it is easiest to -use real harmonics. We make the complex harmonics to real harmonics transformation -matrix via

-
trans_c2n = edrixs.tmat_c2r('d',True)
-
-
-

The crystal field and SOC needs to be passed to the solver by constructing -the impurity matrix in the real harmonic basis. For cubic symmetry, we need -to set the energies of the orbitals along the -diagonal of the matrix. These need to be in pairs as there are two -spin-orbitals for each orbital energy. Python -list comprehension -and -numpy indexing -are used here. See Crystal fields -for more details if needed.

-
ten_dq = 0.56
-CF = np.zeros((norb_d, norb_d), dtype=complex)
-diagonal_indices = np.arange(norb_d)
-
-orbital_energies = np.array([e for orbital_energy in
-                             [+0.6 * ten_dq, # dz2
-                              -0.4 * ten_dq, # dzx
-                              -0.4 * ten_dq, # dzy
-                              +0.6 * ten_dq, # dx2-y2
-                              -0.4 * ten_dq] # dxy)
-                             for e in [orbital_energy]*2])
-
-
-CF[diagonal_indices, diagonal_indices] = orbital_energies
-
-
-

The valence band SOC is constructed in the normal way and transformed into the -real harmonic basis.

-
soc = edrixs.cb_op(edrixs.atom_hsoc('d', zeta_d_i), edrixs.tmat_c2r('d', True))
-
-
-

The total impurity matrices for the ground and core-hole states are then -the sum of crystal field and spin-orbit coupling. We further needed to apply -an energy shift along the matrix diagonal, which we do using the -np.eye function which creates a diagonal matrix of ones.

- -

The energy level of the bath(s) is described by a matrix where the row index -denotes which bath and the column index denotes which orbital. Here we have -only one bath, with 10 spin-orbitals. We initialize the matrix to -norb_d and then split the energies according to ten_dq_bath.

-
ten_dq_bath = 1.44
-bath_level = np.full((nbath, norb_d), E_L, dtype=complex)
-bath_level[0, :2] += ten_dq_bath*.6  # 3z2-r2
-bath_level[0, 2:6] -= ten_dq_bath*.4  # zx/yz
-bath_level[0, 6:8] += ten_dq_bath*.6  # x2-y2
-bath_level[0, 8:] -= ten_dq_bath*.4  # xy
-bath_level_n = np.full((nbath, norb_d), E_Lc, dtype=complex)
-bath_level_n[0, :2] += ten_dq_bath*.6  # 3z2-r2
-bath_level_n[0, 2:6] -= ten_dq_bath*.4  # zx/yz
-bath_level_n[0, 6:8] += ten_dq_bath*.6  # x2-y2
-bath_level_n[0, 8:] -= ten_dq_bath*.4  # xy
-
-
-

The hybridization matrix describes the hopping between the bath -and the impurity. This is called either \(V\) or \(T\) in the -literature and matrix sign can either be positive or negative based. -This is the same shape as the bath matrix. We take our -values from Maurits Haverkort et al.’s DFT calculations [1].

-
Veg = 2.06
-Vt2g = 1.21
-
-hyb = np.zeros((nbath, norb_d), dtype=complex)
-hyb[0, :2] = Veg  # 3z2-r2
-hyb[0, 2:6] = Vt2g  # zx/yz
-hyb[0, 6:8] = Veg  # x2-y2
-hyb[0, 8:] = Vt2g  # xy
-
-
-

We now need to define the parameters describing the XAS. X-ray polarization -can be linear, circular or isotropic (appropriate for a powder).

-
poltype_xas = [('isotropic', 0)]
-
-
-

edrixs uses the temperature in Kelvin to work out the population of the low-lying -states via a Boltzmann distribution.

-
temperature = 300
-
-
-

The x-ray beam is specified by the incident angle and azimuthal angle in radians

-
thin = 0 / 180.0 * np.pi
-phi = 0.0
-
-
-

these are with respect to the crystal field \(z\) and \(x\) axes -written above. (That is, unless you specify the loc_axis parameter -described in the edrixs.xas_siam_fort function documentation.)

-

The spectrum in the raw calculation is offset by the energy involved with the -core hole state, which is roughly \(5 E_p\), so we offset the spectrum by -this and use om_shift as an adjustable parameters for comparing -theory to experiment. We also use this to specify ominc_xas -the range we want to compute the spectrum over. The core hole lifetime -broadening also needs to be set via gamma_c_stat.

-
om_shift = 857.6
-c_level = -om_shift - 5*E_p
-ominc_xas = om_shift + np.linspace(-15, 25, 1000)
-
-
-

The final state broadening is specified in terms of half-width at half-maximum -You can either pass a constant value or an array the same size as -om_shift with varying values to simulate, for example, different state -lifetimes for higher energy states.

- -

Magnetic field is a three-component vector in eV specified with respect to the -same local axis as the x-ray beam. Since we are considering a powder here -we create an isotropic normalized vector. on_which = 'both' specifies to -apply the operator to the total spin plus orbital angular momentum as is -appropriate for a physical external magnetic field. You can use -on_which = 'spin' to apply the operator to spin in order to simulate -magnetic order in the sample. The value of the Bohr Magneton can -be useful for converting here \(\mu_B = 5.7883818012\times 10^{−5}\). -For this example, we will account for magnetic order in the sample by

-
ext_B = np.array([0.00, 0.00, 0.12])
-on_which = 'spin'
-
-
-

The number crunching uses -mpi4py. You can safely ignore -this for most purposes, but see -Y. L. Wang et al., Computer Physics Communications 243, 151-165 (2019) -if you would like more details. -The main thing to remember is that you should call this script via:

-
mpirun -n <number of processors> python example_AIM_XAS.py
-
-
-

where <number of processors> is the number of processors -you’d like to us. Running it as normal will work, it will just be slower.

-
if __name__ == '__main__':
-    from mpi4py import MPI
-    comm = MPI.COMM_WORLD
-    rank = comm.Get_rank()
-    size = comm.Get_size()
-
-
-

Calling the edrixs.ed_siam_fort solver will find the ground state and -write input files, hopping_i.in, hopping_n.in, coulomb_i.in, coulomb_n.in -for following XAS (or RIXS) calculation. We need to specify siam_type=0 -which says that we will pass imp_mat, bath_level and hyb. -We need to specify do_ed = 1. For this example, we cannot use -do_ed = 0 for a ground state search as we have set the impurity and -bath energy levels artificially, which means edrixs will have trouble to know -which subspace to search to find the ground state.

-
if __name__ == '__main__':
-    do_ed = 1
-    eval_i, denmat, noccu_gs = edrixs.ed_siam_fort(
-        comm, shell_name, nbath, siam_type=0, imp_mat=imp_mat, imp_mat_n=imp_mat_n,
-        bath_level=bath_level, bath_level_n=bath_level_n, hyb=hyb, c_level=c_level,
-        c_soc=c_soc, slater=slater, ext_B=ext_B,
-        on_which=on_which, trans_c2n=trans_c2n, v_noccu=v_noccu, do_ed=do_ed,
-        ed_solver=2, neval=50, nvector=3, ncv=100, idump=True)
-
-
-
edrixs >>> Running ED ...
-
-    Summary of Slater integrals:
-    ------------------------------
-    Terms,  Initial Hamiltonian,  Intermediate Hamiltonian
-     F0_vv :          7.8036698413        7.8036698413
-     F2_vv :          9.7872000000        9.7872000000
-     F4_vv :          6.0784000000        6.0784000000
-     F0_vc :          0.0000000000        8.9214742857
-     F2_vc :          0.0000000000        6.1768000000
-     G1_vc :          0.0000000000        4.6296000000
-     G3_vc :          0.0000000000        2.6328000000
-     F0_cc :          0.0000000000        0.0000000000
-     F2_cc :          0.0000000000        0.0000000000
-
-edrixs >>> do_ed=1, perform ED at noccu:  18
-
-
-

Let’s check that we have all the electrons we think we have and print how -the electron are distributed between the Ni (impurity) and O (bath).

-
if __name__ == '__main__':
-    assert np.abs(noccu_gs - v_noccu) < 1e-6
-    impurity_occupation = np.sum(denmat[0].diagonal()[0:norb_d]).real
-    bath_occupation = np.sum(denmat[0].diagonal()[norb_d:]).real
-    print('Impurity occupation = {:.6f}\n'.format(impurity_occupation))
-    print('Bath occupation = {:.6f}\n'.format(bath_occupation))
-
-
-
Impurity occupation = 8.179506
-
-Bath occupation = 9.820494
-
-
-

We see that 0.18 electrons move from the O to the Ni in the ground state.

-

We can now construct the XAS spectrum edrixs by applying a transition -operator to create the excited state. We need to be careful to specify how -many of the low energy states are thermally populated. In this case -num_gs=3. This can be determined by inspecting the function output.

-
if __name__ == '__main__':
-    xas, xas_poles = edrixs.xas_siam_fort(
-        comm, shell_name, nbath, ominc_xas, gamma_c=gamma_c, v_noccu=v_noccu, thin=thin,
-        phi=phi, num_gs=3, nkryl=200, pol_type=poltype_xas, temperature=temperature
-    )
-
-
-
edrixs >>> Running XAS ...
-edrixs >>> Loop over for polarization:  0 isotropic
-edrixs >>> Isotropic, component:  0
-edrixs >>> Loop over for polarization:  0 isotropic
-edrixs >>> Isotropic, component:  1
-edrixs >>> Loop over for polarization:  0 isotropic
-edrixs >>> Isotropic, component:  2
-
-
-

Let’s plot the data and save it just in case

-
if __name__ == '__main__':
-    fig, ax = plt.subplots()
-
-    ax.plot(ominc_xas, xas)
-    ax.set_xlabel('Energy (eV)')
-    ax.set_ylabel('XAS intensity')
-    ax.set_title('Anderson impurity model for NiO')
-    plt.show()
-
-    np.savetxt('xas.dat', np.concatenate((np.array([ominc_xas]).T, xas), axis=1))
-
-
-Anderson impurity model for NiO

Footnotes

- -

Total running time of the script: (0 minutes 0.548 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_4_GS_analysis.html b/edrixs/auto_examples/example_4_GS_analysis.html deleted file mode 100644 index 26f405070e..0000000000 --- a/edrixs/auto_examples/example_4_GS_analysis.html +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - - - - Ground state analysis for NiO — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Ground state analysis for NiO

-

This example follows the Anderson impurity model for NiO XAS -example and considers the same model. This time we show how to analyze -the wavevectors in terms of a -\(\alpha |d^8L^{10}> + \beta |d^9L^9> \gamma |d^{10}L^8>\) -representation.

-

In doing this we will go through the exercise of building and diagonalizing -the Hamiltonian in a way that hopefully clarifies how to analyze other -properties of the model.

-
import edrixs
-import numpy as np
-import matplotlib.pyplot as plt
-import scipy
-import example_3_AIM_XAS
-import importlib
-_ = importlib.reload(example_3_AIM_XAS)
-
-
-
-

Hamiltonian

-

edrixs builds model Hamiltonians based on two fermion and four fermion terms. -The four fermion terms come from Coulomb interactions and will be -assigned to umat. All other interactions contribute to two fermion -terms in emat.

-
-
-\[\begin{equation} -\hat{H}_{i} = \sum_{\alpha,\beta} t_{\alpha,\beta} -\hat{f}^{\dagger}_{\alpha} \hat{f}_{\beta} -+ \sum_{\alpha,\beta,\gamma,\delta} U_{\alpha,\beta,\gamma,\delta} -\hat{f}^{\dagger}_{\alpha}\hat{f}^{\dagger}_{\beta} -\hat{f}_{\gamma}\hat{f}_{\delta}, -\end{equation}\]
-
-
-
-

Import parameters

-

Let’s get the parammeters we need from the -Anderson impurity model for NiO XAS example. We need to -consider ntot=20 spin-orbitals -for this problem.

-
from example_3_AIM_XAS import (F0_dd, F2_dd, F4_dd,
-                               nd, norb_d, norb_bath, v_noccu,
-                               imp_mat, bath_level,
-                               hyb, ext_B, trans_c2n)
-ntot = 20
-
-
-
-
-

Four fermion matrix

-

The Coulomb interactions in the \(d\) shell of this problem are described -by a \(10\times10\times10\times10\) matrix. We -need to specify a \(20\times20\times20\times 20\) matrix since we need to -include the full problem with ntot=20 spin-orbitals. The edrixs -convention is to put the \(d\) orbitals first, so we assign them to the -first \(10\times10\times10\times 10\) indices of the matrix. edrixs -creates this matrix in the complex harmmonic basis by default.

-
umat_delectrons = edrixs.get_umat_slater('d', F0_dd, F2_dd, F4_dd)
-umat = np.zeros((ntot, ntot, ntot, ntot), dtype=complex)
-umat[:norb_d, :norb_d, :norb_d, :norb_d] += umat_delectrons
-
-
-
-
-

Two fermion matrix

-

Previously we made a \(10\times10\) two-fermion matrix describing the -\(d\)-shell interactions. Keep in mind we did this in the real harmonic -basis. We need to specify the two-fermion matrix for -the full problem \(20\times20\) spin-orbitals in size.

-
emat_rhb = np.zeros((ntot, ntot), dtype='complex')
-emat_rhb[0:norb_d, 0:norb_d] += imp_mat
-
-
-

The bath_level energies need to be applied to the diagonal of the -last \(10\times10\) region of the matrix.

- -

The hyb terms mix the impurity and bath states and are therefore -applied to the off-diagonal terms of emat.

- -

We now need to transform into the complex harmonic basis. We assign -the two diagonal blocks of a \(20\times20\) matrix to the -conjugate transpose of the transition matrix.

-
tmat = np.eye(ntot, dtype=complex)
-for i in range(2):
-    off = i * norb_d
-    tmat[off:off+norb_d, off:off+norb_d] = np.conj(np.transpose(trans_c2n))
-
-emat_chb = edrixs.cb_op(emat_rhb, tmat)
-
-
-

The spin exchange is built from the spin operators and the effective field -is applied to the \(d\)-shell region of the matrix.

-
v_orbl = 2
-sx = edrixs.get_sx(v_orbl)
-sy = edrixs.get_sy(v_orbl)
-sz = edrixs.get_sz(v_orbl)
-zeeman = ext_B[0] * (2 * sx) + ext_B[1] * (2 * sy) + ext_B[2] * (2 * sz)
-emat_chb[0:norb_d, 0:norb_d] += zeeman
-
-
-
-
-

Build the Fock basis and Hamiltonain and Diagonalize

-

We create the fock basis and build the Hamiltonian using the full set of -\(20\) spin orbitals, specifying that they are occuplied by \(18\) -electrons. See the Exact diagonalization -example for more details if needed. We also set the ground state to zero -energy.

-
basis = np.array(edrixs.get_fock_bin_by_N(ntot, v_noccu))
-H = (edrixs.build_opers(2, emat_chb, basis)
-  + edrixs.build_opers(4, umat, basis))
-
-e, v = scipy.linalg.eigh(H)
-e -= e[0]
-
-
-
-
-

State analysis

-

Now we have all the eigenvectors in the Fock basis, we need to pick out the -states that have 8, 9 and 10 \(d\)-electrons, respectively. -The modulus squared of these coeffcients need to be added up to get -\(\alpha\), \(\beta\), and \(\gamma\).

-
num_d_electrons = basis[:, :norb_d].sum(1)
-
-alphas = np.sum(np.abs(v[num_d_electrons==8, :])**2, axis=0)
-betas = np.sum(np.abs(v[num_d_electrons==9, :])**2, axis=0)
-gammas = np.sum(np.abs(v[num_d_electrons==10, :])**2, axis=0)
-
-
-

The ground state is the first entry.

-
message = "Ground state\nalpha={:.3f}\tbeta={:.3f}\tgamma={:.3f}"
-print(message.format(alphas[0], betas[0], gammas[0]))
-
-
-
Ground state
-alpha=0.825     beta=0.171      gamma=0.004
-
-
-
-
-

Plot

-

Let’s look how \(\alpha\), \(\beta\), and \(\gamma\) vary with -energy.

-
fig, ax = plt.subplots()
-
-ax.plot(e, alphas, label=r'$\alpha$ $d^8L^{10}$')
-ax.plot(e, betas, label=r'$\beta$ $d^9L^{9}$')
-ax.plot(e, gammas, label=r'$\gamma$ $d^{10}L^{8}$')
-
-ax.set_xlabel('Energy (eV)')
-ax.set_ylabel('Population')
-ax.set_title('NiO')
-ax.legend()
-plt.show()
-
-
-NiO

We see that the ligand states are mixed into the ground state, but the -majority of the weight for the \(L^9\) and \(L^8\) states -live at \(\Delta\) and \(2\Delta\). With a lot of additional -structure from the other interactions.

-

Total running time of the script: (0 minutes 0.421 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_5_Hubbard_dimer.html b/edrixs/auto_examples/example_5_Hubbard_dimer.html deleted file mode 100644 index 0b8672ad58..0000000000 --- a/edrixs/auto_examples/example_5_Hubbard_dimer.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - Hubbard Dimer — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Hubbard Dimer

-

This exercise will demonstrate how to handle hopping and multi-site problems within -edrixs using the example of a Hubbard dimer. We want to solve the equation

-
-
-\[\begin{equation} -\hat{H} = \sum_{i,j} \sum_{\sigma} t_{i,j} \hat{f}^{\dagger}_{i,\sigma} \hat{f}_{j, \sigma} -+ U \sum_{i} \hat{n}_{i,\uparrow}\hat{n}_{i,\downarrow}, -\end{equation}\]
-
-

which involves two sites labeled with indices \(i\) or \(j\) with two -electrons of spin \(\sigma\in{\uparrow,\downarrow}\). \(t_{i,j}\) -is the hopping between sites, \(\hat{f}^{\dagger}_{i,\sigma}\) is the -creation operators, and -\(\hat{n}^{\dagger}_{i,\sigma}=\hat{f}^{\dagger}_{i,\sigma}\hat{f}_{i,\sigma}\) -is the number operator. The main task is to represent this Hamiltonian and -the related spin operator using the EDRIXS two-fermion and four-fermion form -where \(\alpha,\beta,\delta,\gamma\) are the indices of the single -particle basis.

-
-
-\[\begin{equation} -\hat{H} = \sum_{\alpha,\beta} t_{\alpha,\beta} \hat{f}^{\dagger}_{\alpha} \hat{f}_{\beta} -+ \sum_{\alpha,\beta,\gamma,\delta} U_{\alpha,\beta,\gamma,\delta} -\hat{f}^{\dagger}_{\alpha}\hat{f}^{\dagger}_{\beta}\hat{f}_{\gamma}\hat{f}_{\delta}. -\end{equation}\]
-
-
-

Initialize matrices

-

We start by noting that each of the two sites is like an \(l=0\) -\(s\)-orbital with two spin-orbitals each. We will include -two electron occupation and build the Fock basis.

-
import numpy as np
-import matplotlib.pyplot as plt
-import scipy
-import edrixs
-np.set_printoptions(precision=4)
-
-
-ll = 0
-case = 's'
-norb = 4
-noccu = 2
-basis = edrixs.get_fock_bin_by_N(norb, noccu)
-
-
-
-
-

Create function to populate and diagonalize matrices

-

The Coulomb and hopping matrices umat and emat will be -represented by \(4\times4\times4\times4\) and \(4\times4\) matrices, -respectively. Note that we needed to specify -that these are, in general, complex, although -they happen to contain only real numbers in this case. We follow the convention -that these are ordered first by site and then by spin: -\(|0\uparrow>, |0\downarrow>, |1\uparrow>, |1\downarrow>\). -Consequently the \(2\times2\) and \(2\times2\times2\times2\) block -diagonal structures of the matrices will contain the on-site interactions. -The converse is true for the hopping between the sites. -From here let us generate a function to build and diagonalize the Hamiltonian. -We need to generate the Coulomb matrix for the on-site interactions and -apply it to the block diagonal. The hopping connects off-site indices with -the same spin.

-
def diagonalize(U, t, extra_emat=None):
-    """Diagonalize 2 site Hubbard Hamiltonian"""
-    umat = np.zeros((norb, norb, norb, norb), dtype=np.complex128)
-    emat = np.zeros((norb, norb), dtype=np.complex128)
-    U_mat_1site = edrixs.get_umat_slater('s', U)
-    umat[:2, :2, :2, :2,] = umat[2:, 2:, 2:, 2:] = U_mat_1site
-    emat[2, 0] = emat[3, 1] = emat[0, 2] = emat[1, 3] = t
-
-    if extra_emat is not None:
-        emat = emat + extra_emat
-
-    H = (edrixs.build_opers(2, emat, basis)
-         + edrixs.build_opers(4, umat, basis))
-
-    e, v = scipy.linalg.eigh(H)
-    return e, v
-
-
-
-
-

The large \(U\) limit

-

Let us see what happens with \(U \gg t\).

-
e, v = diagonalize(1000, 1)
-print("Energies are")
-print(e)
-
-
-

Out:

-
Energies are
-[  -0.004    0.       0.       0.    1000.    1000.004]
-
-
-

To analyze what is going on we can determine the spin expectation values -of the cluster. Building the operators follows the same form as the -Hamiltonian and the previous example.

-
spin_mom_one_site = edrixs.get_spin_momentum(ll)
-spin_mom = np.zeros((3, norb, norb), dtype=np.complex128)
-spin_mom[:, :2, :2] = spin_mom[:, 2:, 2:] = spin_mom_one_site
-
-opS = edrixs.build_opers(2, spin_mom, basis)
-opS_squared = (np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1])
-               + np.dot(opS[2], opS[2]))
-
-
-

This time let us include a tiny magnetic field along the \(z\)-axis, so -that we have a well-defined measurement axis and print out the expectation -values.

-
zeeman = np.zeros((norb, norb), dtype=np.complex128)
-zeeman[:2, :2] = zeeman[2:, 2:] = 1e-8*spin_mom_one_site[2]
-e, v = diagonalize(1000, 1, extra_emat=zeeman)
-
-Ssq_exp = edrixs.cb_op(opS_squared, v).diagonal().real
-Sz_exp = edrixs.cb_op(opS[2], v).diagonal().real
-
-header = "{:<10s}\t{:<6s}\t{:<6s}"
-print(header.format("E", "S(S+1)", "<Sz>"))
-for i in range(len(e)):
-    print("{:<2f}\t{:.1f}\t{:.1f}".format(e[i], Ssq_exp[i], Sz_exp[i]))
-
-
-

Out:

-
E               S(S+1)  <Sz>
--0.004000       0.0     0.0
--0.000000       2.0     -1.0
--0.000000       2.0     0.0
-0.000000        2.0     1.0
-1000.000000     0.0     0.0
-1000.004000     0.0     0.0
-
-
-

For \(U \gg t\) the two states with double occupancy acquire an energy of -approximately \(U\). The low energy states are a \(S=0\) singlet and -and \(S=1\) triplet, which are split by \(4t^2/U\), which is the -magnetic exchange term.

-
-
-

\(U\) dependence

-

Let us plot the changes in energy with \(U\).

-
plt.figure()
-
-t = 1
-Us = np.linspace(0.01, 10, 50)
-Es = np.array([diagonalize(U, t, extra_emat=zeeman)[0] for U in Us])
-
-plt.plot(Us/t, Es/t)
-plt.xlabel('U/t')
-plt.ylabel('Eigenstate energies/t')
-plt.show()
-
-
-example 5 Hubbard dimer

To help interpret this, we can represent the eigenvectors in terms of a sum -of the single particle states.

-
def get_single_particle_repesentations(v):
-    reps = []
-    for i in range(6):
-        rep = sum([vec*weight for weight, vec
-                        in zip(v[:, i], np.array(basis))])
-        reps.append(rep)
-
-    return np.array(reps)
-
-t = 1
-for U in [10000, 0.0001]:
-    e, v = diagonalize(U, t, extra_emat=zeeman)
-    repesentations = get_single_particle_repesentations(v)
-    print("For U={} t={} states  are".format(U,  t))
-    print(repesentations.round(3).real)
-    print("\n")
-
-
-

Out:

-
For U=10000 t=1 states  are
-[[-0.707  0.707  0.707 -0.707]
- [ 0.     1.     0.     1.   ]
- [ 0.707  0.707  0.707  0.707]
- [-1.     0.    -1.     0.   ]
- [-0.707 -0.707  0.707  0.707]
- [ 0.707  0.707  0.707  0.707]]
-
-
-For U=0.0001 t=1 states  are
-[[-0.     1.     1.    -0.   ]
- [ 0.     1.     0.     1.   ]
- [ 0.707  0.707  0.707  0.707]
- [-1.     0.    -1.     0.   ]
- [-0.707 -0.707  0.707  0.707]
- [-1.    -0.    -0.    -1.   ]]
-
-
-

For \(U \gg t\) the ground state maximizes its magnetic exchange -energy saving. In the \(U \ll t\) condition the ground state maximizes -its kinetic energy saving. Since both states share the same parity, the -cross-over between them is smooth. This type of physics is at play in current -research on quantum materials 1 2.

-

Footnotes

-
-
1
-
    -
  1. Wang et al., Phys. Rev. Lett. 122, 106401 (2019).

  2. -
-
-
2
-
    -
  1. Revelli et al., Science Advances 5, eaav4020 (2019).

  2. -
-
-
-

Total running time of the script: ( 0 minutes 0.191 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_5_charge_transfer.html b/edrixs/auto_examples/example_5_charge_transfer.html deleted file mode 100644 index 85e0a85057..0000000000 --- a/edrixs/auto_examples/example_5_charge_transfer.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - - - - Charge-transfer energy for NiO — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Charge-transfer energy for NiO

-

This example follows the Anderson impurity model for NiO XAS -example and considers the same model. This time we outline how to determine -the charge transfer energy in the sense defined by Zaanen, Sawatzky, and Allen -[1]. That is, a \(d^{n_d} \rightarrow d^{n_d + 1} \underline{L}\) transition -in the atomic limit, after considering Coulomb interactions and crystal field. Although -this can be determined analytically in some cases, the easiest way is often just to -calculate it, as we will do here.

-
import edrixs
-import numpy as np
-import matplotlib.pyplot as plt
-import scipy
-import example_3_AIM_XAS
-import importlib
-_ = importlib.reload(example_3_AIM_XAS)
-
-
-
-

Determine eigenvectors and occupations

-

The first step repeats what was done in -Ground state analysis for NiO but it does not apply -the hybridization between the impurity and both states.

-
from example_3_AIM_XAS import (F0_dd, F2_dd, F4_dd,
-                               nd, norb_d, norb_bath, v_noccu,
-                               imp_mat, bath_level,
-                               hyb, ext_B, trans_c2n)
-ntot = 20
-umat_delectrons = edrixs.get_umat_slater('d', F0_dd, F2_dd, F4_dd)
-umat = np.zeros((ntot, ntot, ntot, ntot), dtype=complex)
-umat[:norb_d, :norb_d, :norb_d, :norb_d] += umat_delectrons
-emat_rhb = np.zeros((ntot, ntot), dtype='complex')
-emat_rhb[0:norb_d, 0:norb_d] += imp_mat
-indx = np.arange(norb_d, norb_d*2)
-emat_rhb[indx, indx] += bath_level[0]
-tmat = np.eye(ntot, dtype=complex)
-for i in range(2):
-    off = i * norb_d
-    tmat[off:off+norb_d, off:off+norb_d] = np.conj(np.transpose(trans_c2n))
-
-emat_chb = edrixs.cb_op(emat_rhb, tmat)
-v_orbl = 2
-sx = edrixs.get_sx(v_orbl)
-sy = edrixs.get_sy(v_orbl)
-sz = edrixs.get_sz(v_orbl)
-zeeman = ext_B[0] * (2 * sx) + ext_B[1] * (2 * sy) + ext_B[2] * (2 * sz)
-emat_chb[0:norb_d, 0:norb_d] += zeeman
-basis = np.array(edrixs.get_fock_bin_by_N(ntot, v_noccu))
-H = (edrixs.build_opers(2, emat_chb, basis)
-     + edrixs.build_opers(4, umat, basis))
-
-e, v = scipy.linalg.eigh(H)
-e -= e[0]
-
-num_d_electrons = basis[:, :norb_d].sum(1)
-alphas = np.sum(np.abs(v[num_d_electrons == 8, :])**2, axis=0)
-betas = np.sum(np.abs(v[num_d_electrons == 9, :])**2, axis=0)
-
-
-
-
-

Energy to lowest energy ligand orbital

-

Let’s vizualize \(\alpha\) and \(\beta\).

-
fig, ax = plt.subplots()
-
-ax.plot(e, alphas, '.-', label=r'$\alpha$ $d^8L^{10}$')
-ax.plot(e, betas, '.-', label=r'$\beta$ $d^9L^{9}$')
-
-ax.set_xlabel('Energy (eV)')
-ax.set_ylabel('Population')
-ax.set_title('NiO')
-ax.legend()
-plt.show()
-
-
-NiO

One can see that the mixing between impurity and bath states has disappered -because we have turned off the hybridization. The energy required to

-
GS_energy = min(e[np.isclose(alphas, 1)])
-lowest_energy_to_transfer_electron = min(e[np.isclose(betas, 1)])
-E_to_ligand = lowest_energy_to_transfer_electron - GS_energy
-print(f"Energy to lowest energy ligand state is {E_to_ligand:.3f} eV")
-
-
-
Energy to lowest energy ligand state is 5.517 eV
-
-
-

where we have used np.isclose to avoid errors from finite numerical -precision.

-
-
-

Diagonalizing by blocks

-

When working on a problem with a large basis, one can take advantage of the -lack of hybridization and separately diagonalize the impurity and bath -states

-
energies = []
-
-for n_ligand_holes in [0, 1]:
-    basis_d = edrixs.get_fock_bin_by_N(10, nd + n_ligand_holes)
-    Hd = (edrixs.build_opers(2, emat_chb[:10, :10], basis_d)
-          + edrixs.build_opers(4, umat[:10, :10, :10, :10], basis_d))
-    ed = scipy.linalg.eigh(Hd, eigvals_only=True, subset_by_index=[0, 0])[0]
-
-    basis_L = edrixs.get_fock_bin_by_N(10, 10 - n_ligand_holes)
-    HL = (edrixs.build_opers(2, emat_chb[10:, 10:], basis_L)
-          + edrixs.build_opers(4, umat[10:, 10:, 10:, 10:], basis_L))
-    eL = scipy.linalg.eigh(HL, eigvals_only=True, subset_by_index=[0, 0])[0]
-
-    energies.append(ed + eL)
-
-print(f"Energy to lowest energy ligand state is {energies[1] - energies[0]:.3f} eV")
-
-
-
Energy to lowest energy ligand state is 5.517 eV
-
-
-

which yields the same result.

-
-
-

Energy splitting in ligand states

-

The last thing to consider is that our definition of the charge transfer -energy refers to the atomic limit with all hopping terms switched off, whereas -the ligand states in the model are already split by the oxygen-oxygen hopping -term \(T_{pp}\) as illustrated below. So the final charge transer energy -needs to account for this.

-
-
../_images/energy_level.png -
-
T_pp = 1
-print(f"Charge transfer is {energies[1] - energies[0] + T_pp:.3f} eV")
-
-
-
Charge transfer is 6.517 eV
-
-
-

Footnotes

- -

Total running time of the script: (0 minutes 0.478 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_5_transitions.html b/edrixs/auto_examples/example_5_transitions.html deleted file mode 100644 index 3220c57247..0000000000 --- a/edrixs/auto_examples/example_5_transitions.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - X-ray transitions — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

X-ray transitions

-

This example explains how to calculate x-ray transition amplitudes between -specific orbital and spin states. We take the case of a cuprate which has one -hole in the \(d_{x^2-y^2}\) orbital and a spin ordering direction along the -in-plane diagaonal direction and compute the angular dependence of spin-flip -and non-spin-flip processes.

-

This case was chosen because the eigenvectors in question are simple enough -for us to write them out more-or-less by hand, so this example helps the reader -to understand what happens under the hood in more complex cases.

-

Some of the code here is credited to Yao Shen who used this approach for the -analysis of a low valence nickelate material [1]. The task performed repeats -analysis done by many researchers e.g. Luuk Ament et al [2] as well as -several other groups.

-
import edrixs
-import numpy as np
-import matplotlib.pyplot as plt
-import scipy
-
-
-
-

Eigenvectors

-

Let us start by determining the eigenvectors involved in the transitions. -The spin direction can be set using a vector -\(\vec{B}\) to represent a magnetic field in terms of generalized spin -operator \(\tilde{\sigma}=\vec{B}\cdot\sigma\) based on the Pauli matrices -\(\sigma\). Let’s put the spin along the \([1, 1, 0]\) direction -and formuate the problem in the hole basis. -For one particle, we know that the Hamiltonian will be diagonal in the real -harmonic basis. -We can generate the required eigenvectors by making a diagonal -matrix, transforming it to the required -complex harmonic basis (as is standard for EDRIXS) and diagonalizing it. -As long as the crystal field splitting is much larger than the magnetic -field, the eigenvectors will be independent of the exact values of both -these parameters.

-
B = 1e-3*np.array([1, 1, 0])
-cf_splitting = 1e3
-zeeman = sum(s*b for s, b in zip(edrixs.get_spin_momentum(2), B))
-dd_levels = np.array([energy for dd_level in cf_splitting*np.arange(5)
-                      for energy in [dd_level]*2], dtype=complex)
-emat_rhb = np.diag(dd_levels)
-emat = edrixs.cb_op(emat_rhb, edrixs.tmat_r2c('d', ispin=True)) + zeeman
-_, eigenvectors = np.linalg.eigh(emat)
-
-def get_eigenvector(orbital_index, spin_index):
-    return eigenvectors[:, 2*orbital_index + spin_index]
-
-
-

Let’s examine the \(d_{x^2-y^2}\) orbital first. Recall from the -Crystal fields -example that edrixs uses the standard orbital order of -\(d_{3z^2-r^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}\). So we want -orbital_index = 3 element. Using this, we can build spin-up and -down -eigenvectors.

-
orbital_index = 3
-
-groundstate_vector = get_eigenvector(orbital_index, 0)
-excitedstate_vector = get_eigenvector(orbital_index, 1)
-
-
-
-
-

Transition operators and scattering matrix

-

Here we are considering the \(L_3\)-edge. This means -a \(2p_{3/2} \rightarrow 3d\) -absoprtion transition and a \(2p_{3/2} \rightarrow 3d\) -emission transition. We can read the relevant matrix from the edrixs database, -keeping in mind that there are in fact three operations for -\(x, y,\) & \(z\) directions. Note that edrixs provides operators -in electron notation. If we define \(D\) as the transition operator in -electron language, \(D^\dagger\) is the operator in the hole language -we are using for this example. -The angular dependence of a RIXS transition can be conveniently described -using the scattering matrix, which is a \(3\times3\) element object that -specifies the transition amplitude for each incoming and outgoing x-ray -polarization. Correspondingly, we have

-
-
-\[\begin{equation} -\mathcal{F}=\sum_n\langle f|D|n\rangle\langle n|D^{\dagger}|g\rangle -\end{equation}.\]
-
-

In matrix form this is

-
-
-\[\begin{equation} -\mathcal{F}(m,n)=\{f^{\dagger} \cdot D(m)\} \cdot \{D^{\dagger}(n) \cdot g\} -\end{equation}.\]
-
-
D_Tmat = edrixs.get_trans_oper('dp32')
-
-def get_F(vector_i, vector_f):
-    F = np.zeros((3, 3), dtype=complex)
-    for i in range(3):
-        for j in range(3):
-            F[i, j] = np.dot(np.dot(np.conj(vector_f.T), D_Tmat[i]),
-                             np.dot(np.conj(D_Tmat[j].T), vector_i))
-    return F
-
-
-

Using this function, we can obtain non-spin-flip (NSF) and spin-flip (SF) -scattering matrices by choosing whether we return to the ground state or -whether we access the excited state with the spin flipped.

- -
-
-

Angular dependence

-

Let’s consider the common case of fixing the total scattering angle at -two_theta = 90 and choosing a series of incident angles thins. -Since the detector does not resolve polarization, we need to add both outgoing -polarizations. It is then convenient to use function dipole_polvec_rixs() -to obtain the incoming and outgoing polarization vectors.

-
thins = np.linspace(0, 90)
-two_theta = 90
-phi = 0
-
-
-def get_I(thin, alpha, F):
-    intensity = 0
-    for beta in [0, np.pi/2]:
-        thout = two_theta - thin
-        ei, ef = edrixs.dipole_polvec_rixs(thin*np.pi/180, thout*np.pi/180,
-                                           phi*np.pi/180, alpha, beta)
-        intensity += np.abs(np.dot(ef, np.dot(F, ei)))**2
-    return intensity
-
-
-
-
-

Plot

-

We now run through a few configurations specified in terms of incoming -polarization angle \(\alpha\) (defined in radians w.r.t. the scattering -plane), \(F\), plotting label, and plotting color.

-
fig, ax = plt.subplots()
-
-config = [[0, F_NSF, r'$\pi$ NSF', 'C0'],
-          [np.pi/2, F_NSF, r'$\sigma$ NSF', 'C1'],
-          [0, F_SF, r'$\pi$ SF', 'C2'],
-          [np.pi/2, F_SF, r'$\sigma$ SF', 'C3']]
-
-for alpha, F, label, color in config:
-    Is = np.array([get_I(thin, alpha, F) for thin in thins])
-    ax.plot(thins, Is, label=label, color=color)
-
-ax.legend()
-ax.set_xlabel(r'Theta ($^\circ$)')
-ax.set_ylabel('Relative intensity')
-plt.show()
-
-
-example 5 transitions
-
-

Run through orbitals

-

For completeness, let’s look at transitions from \(x^2-y^2\) to all other -orbitals.

-
fig, axs = plt.subplots(5, 1, figsize=(7, 7),
-                        sharex=True, sharey=True)
-
-orbitals = ['$d_{3z^2-r^2}$', '$d_{xz}$', '$d_{yz}$',
-            '$d_{x^2-y^2}$', '$d_{xy}$']
-orbital_order = [4, 1, 2, 0, 3]
-
-plot_index = 0
-for ax, orbital_index in zip(axs, orbital_order):
-    for spin_index, spin_label in zip([0, 1], ['NSF', 'SF']):
-        excitedstate_vector = get_eigenvector(orbital_index, spin_index)
-        F = get_F(groundstate_vector, excitedstate_vector)
-        for alpha, pol_label in zip([0, np.pi/2], [r'$\pi$', r'$\sigma$']):
-            Is = np.array([get_I(thin, alpha, F) for thin in thins])
-            ax.plot(thins, Is*10, label=f'{pol_label} {spin_label}',
-                    color=f'C{plot_index%4}')
-            plot_index += 1
-    ax.legend(title=orbitals[orbital_index], bbox_to_anchor=(1.1, 1),
-              loc="upper left", fontsize=8)
-
-
-axs[-1].set_xlabel(r'$\theta$ ($^\circ$)')
-axs[2].set_ylabel('Scattering intensity')
-
-fig.subplots_adjust(hspace=0, left=.3, right=.6)
-plt.show()
-
-
-example 5 transitions

Footnotes

- -

Total running time of the script: (0 minutes 0.559 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_6_Coulomb.html b/edrixs/auto_examples/example_6_Coulomb.html deleted file mode 100644 index 8a34c9b174..0000000000 --- a/edrixs/auto_examples/example_6_Coulomb.html +++ /dev/null @@ -1,706 +0,0 @@ - - - - - - - Coulomb interactions — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Coulomb interactions

-

In this example we provide more details on how Coulomb interactions are -implemented in multiplet calculations and EDRIXS in particular. We aim -to clarify the form of the matrices, how they are parametrized, -and how the breaking of spherical symmetry can switch on additional elements -that one might not anticipate. Our example is based on a \(d\) atomic shell.

-
-

Create matrix

-

The Coulomb interaction between two particles can be written as

-
-
-\[\begin{equation} -\hat{H} = \frac{1}{2} -\int d\mathbf{r} \int d\mathbf{r}^\prime -\Sigma_{\sigma, \sigma^\prime} -|\hat{\psi}^\sigma(\mathbf{r})|^2 \frac{e^2}{R} -|\hat{\psi}^{\sigma^\prime}(\mathbf{r})|^2, -\end{equation}\]
-
-

where \(\hat{\psi}^\sigma(\mathbf{r})\) is the electron wavefunction, with -spin \(\sigma\), and \(R=|r-r^\prime|\) is the electron separation. -Solving our problem in this form is difficult due to the need to symmeterize -the wavefunction to follow fermionic statistics. -Using second quantization, we can use operators to impose the required -particle exchange statistics and write the equation in terms of -a tensor \(U\)

-
-
-\[\begin{equation} -\hat{H} = \sum_{\alpha,\beta,\gamma,\delta,\sigma,\sigma^\prime} -U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} -\hat{f}^{\dagger}_{\alpha\sigma} -\hat{f}^{\dagger}_{\beta\sigma^\prime} -\hat{f}_{t\sigma^\prime}\hat{f}_{\delta\sigma}, -\end{equation}\]
-
-

where \(\alpha\), \(\beta\), \(\gamma\), \(\delta\) are -orbital indices and \(\hat{f}^{\dagger}\) -(\(\hat{f}\)) are the creation (anihilation) operators. -For a \(d\)-electron system, we have \(10\) distinct spin-orbitals -(\(5\) orbitals each with \(2\) spins), which makes matrix the -\(10\times10\times10\times10\) in total size. -In EDRIXS the matrix can be created as follows:

-
import edrixs
-import numpy as np
-import scipy
-import matplotlib.pyplot as plt
-import itertools
-
-F0, F2, F4 = 6.94, 14.7, 4.41
-umat_chb = edrixs.get_umat_slater('d', F0, F2, F4)
-
-
-

We stored this under variable umat_chb where “cbh” stands for -complex harmonic basis, which is the default basis in EDRIXS.

-
-
-

Parameterizing interactions

-

EDRIXS parameterizes the interactions in \(U\) via Slater integral -parameters \(F^{k}\). These relate to integrals of various spherical -Harmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients, -and Wigner 3J symbols. Textbooks such as 1 can be used for further -reference. If you are interested in the details of how -EDRIXS does this (and you probably aren’t) function umat_slater(), -constructs the required matrix via Gaunt coeficents from -get_gaunt(). Two alternative parameterizations are common. -The first are the Racah parameters, which are

-
-
-\[\begin{split}\begin{eqnarray} -A &=& F^0 - \frac{49}{441} F^4 \\ -B &=& \frac{1}{49}F^2 - \frac{5}{441}F^4 \\ -C &=& \frac{35}{441}F^4. -\end{eqnarray}\end{split}\]
-
-

or an alternative form for the Slater integrals

-
-
-\[\begin{split}\begin{eqnarray} -F_0 &=& F^0 \\ -F_2 &=& \frac{1}{49}F^2 \\ -F_4 &=& \frac{1}{441}F^4, -\end{eqnarray}\end{split}\]
-
-

which involves different normalization parameters.

-
-
-

Basis transform

-

If we want to use the real harmonic basis, we can use a tensor -transformation, which imposes the following orbital order -\(3z^2-r^2, xz, yz, x^2-y^2, xy\), each of which involves -\(\uparrow, \downarrow\) spin pairs. Let’s perform this transformation and -store a list of these orbitals.

-
umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True))
-orbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy']
-
-
-
-
-

Interactions

-

Tensor \(U\) is a series of matrix -elements

-
-
-\[\begin{equation} -\langle\psi_{\gamma,\delta}^{\bar{\sigma},\bar{\sigma}^\prime} -|\hat{H}| -\psi_{\alpha,\beta}^{\sigma,\sigma^\prime}\rangle -\end{equation}\]
-
-

the combination of which defines the energetic cost of pairwise -electron-electron interactions between states \(\alpha,\sigma\) -and \(\beta,\sigma^\prime\). In EDRIXS we follow the convention of -summing over all orbital pairs. Some other texts count each pair of -indices only once. The matrix elements here will consequently -be half the magnitude of those in other references. -We can express the interactions in terms of -the orbitals involved. It is common to distinguish “direct Coulomb” and -“exchange” interactions. The former come from electrons in the same orbital -and the later involve swapping orbital labels for electrons. We will use -\(U_0\) and \(J\) as a shorthand for distinguishing these.

-

Before we describe the different types of interactions, we note that since -the Coulomb interaction is real, and due to the spin symmmetry properties -of the process \(U\) always obeys

-
-
-\[\begin{equation} -U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} = -U_{\beta\sigma,\alpha\sigma^\prime,\delta\sigma^\prime,\gamma\sigma} = -U_{\delta\sigma,\gamma\sigma^\prime,\beta\sigma^\prime,\alpha\sigma} = -U_{\gamma\sigma,\delta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}. -\end{equation}\]
-
-
-

1. Intra orbital

-

The direct Coulomb energy cost to double-occupy an orbital comes from terms -like \(U_{\alpha\sigma,\alpha\bar\sigma,\alpha\bar\sigma,\alpha\sigma}\). -In this notation, we use \(\sigma^\prime\) to denote that the matrix -element is summed over all pairs and \(\bar{\sigma}\) to denote sums -over all opposite spin pairs. Due to rotational symmetry, all these -elements are the same and equal to

-
-
-\[\begin{split}\begin{eqnarray} -U_0 &=& \frac{A}{2} + 2B + \frac{3C}{2}\\ - &=& \frac{F_0}{2} + 2F_2 + 18F_4 -\end{eqnarray}\end{split}\]
-
-

Let’s print these to demonstrate where these live in the array

-
for i in range(0, 5):
-    val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real
-    print(f"{orbitals[i]:<8} \t {val:.3f}")
-
-
-

Out:

-
3z^2-r^2         4.250
-xz               4.250
-yz               4.250
-x^2-y^2          4.250
-xy               4.250
-
-
-
-
-

2. Inter orbital Coulomb interactions

-

Direct Coulomb repulsion between different orbitals depends on terms like -\(U_{\alpha\sigma,\beta\sigma^\prime,\beta\sigma^\prime,\alpha\sigma}\). -Expresions for these parameters are provided in column \(U\) in -Table of 2 orbital interactions. We can print the values from umat -like this:

-
for i, j in itertools.combinations(range(5), 2):
-    val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}")
-
-
-

Out:

-
3z^2-r^2         xz              3.650
-3z^2-r^2         yz              3.650
-3z^2-r^2         x^2-y^2         2.900
-3z^2-r^2         xy              2.900
-xz               yz              3.150
-xz               x^2-y^2         3.150
-xz               xy              3.150
-yz               x^2-y^2         3.150
-yz               xy              3.150
-x^2-y^2          xy              3.900
-
-
-
-
-

3. Inter-orbital exchange interactions

-

Exchange terms exist with the form -\(U_{\alpha\sigma,\beta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}\). -Expresions for these parameters are provided in column \(J\) of -Table of 2 orbital interactions. These come from terms like this in the matrix:

-
for i, j in itertools.combinations(range(5), 2):
-    val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}")
-
-
-

Out:

-
3z^2-r^2         xz              0.300
-3z^2-r^2         yz              0.300
-3z^2-r^2         x^2-y^2         0.675
-3z^2-r^2         xy              0.675
-xz               yz              0.550
-xz               x^2-y^2         0.550
-xz               xy              0.550
-yz               x^2-y^2         0.550
-yz               xy              0.550
-x^2-y^2          xy              0.175
-
-
-
-
-

4. Pair hopping term

-

Terms that swap pairs of electrons exist as -\((1-\delta_{\sigma\sigma'})U_{\alpha\sigma,\alpha\bar\sigma,\beta\bar\sigma,\beta\sigma}\) -and depend on exchange interactions column \(J\) from -Table of 2 orbital interactions -and here in the matrix.

-
for i, j in itertools.combinations(range(5), 2):
-    val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}")
-
-
-

Out:

-
3z^2-r^2         xz              0.300
-3z^2-r^2         yz              0.300
-3z^2-r^2         x^2-y^2         0.675
-3z^2-r^2         xy              0.675
-xz               yz              0.550
-xz               x^2-y^2         0.550
-xz               xy              0.550
-yz               x^2-y^2         0.550
-yz               xy              0.550
-x^2-y^2          xy              0.175
-
-
-
-
-

5. Three orbital

-

Another set of terms that one might not immediately anticipate involve three -orbitals like

-
-
-\[\begin{split}\begin{equation} -U_{\alpha\sigma, \gamma\sigma', \beta\sigma', \gamma\sigma} \\ -U_{\alpha\sigma, \gamma\sigma', \gamma\sigma', \beta\sigma} \\ -(1-\delta_{\sigma\sigma'}) -U_{\alpha\sigma, \beta\sigma', \gamma\sigma', \gamma\sigma} -\end{equation}\end{split}\]
-
-

for \(\alpha=3z^2-r^2, \beta=x^2-y^2, \gamma=xz/yz\). -These are needed to maintain the rotational symmetry of the interations. -See Table of 3 orbital interactions for the expressions. We can print some of -these via:

-
ijkl = [[0, 1, 3, 1],
-        [0, 2, 3, 2],
-        [1, 0, 3, 1],
-        [1, 1, 3, 0],
-        [2, 0, 3, 2],
-        [2, 2, 3, 0]]
-
-for i, j, k, l in ijkl:
-    val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t"
-          f"{orbitals[k]:<8} \t {orbitals[l]:<8} \t {val:.3f}")
-
-
-

Out:

-
3z^2-r^2         xz             x^2-y^2          xz              0.217
-3z^2-r^2         yz             x^2-y^2          yz              -0.217
-xz               3z^2-r^2       x^2-y^2          xz              -0.433
-xz               xz             x^2-y^2          3z^2-r^2        0.217
-yz               3z^2-r^2       x^2-y^2          yz              0.433
-yz               yz             x^2-y^2          3z^2-r^2        -0.217
-
-
-
-
-

6. Four orbital

-

Futher multi-orbital terms include -\(U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma}\). -We can find these here in the matrix:

-
ijkl = [[0, 1, 2, 4],
-        [0, 1, 4, 2],
-        [0, 2, 1, 4],
-        [0, 2, 4, 1],
-        [0, 4, 1, 2],
-        [0, 4, 2, 1],
-        [3, 1, 4, 2],
-        [3, 2, 4, 1],
-        [3, 4, 1, 2],
-        [3, 4, 2, 1]]
-
-for i, j, k, l in ijkl:
-    val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {orbitals[k]:<8}"
-          f"\t {orbitals[l]:<8} \t {val:.3f}")
-
-
-

Out:

-
3z^2-r^2         xz              yz              xy              -0.433
-3z^2-r^2         xz              xy              yz              0.217
-3z^2-r^2         yz              xz              xy              -0.433
-3z^2-r^2         yz              xy              xz              0.217
-3z^2-r^2         xy              xz              yz              0.217
-3z^2-r^2         xy              yz              xz              0.217
-x^2-y^2          xz              xy              yz              -0.375
-x^2-y^2          yz              xy              xz              0.375
-x^2-y^2          xy              xz              yz              -0.375
-x^2-y^2          xy              yz              xz              0.375
-
-
-
-
-
-

Effects of multi-orbital terms

-

To test the effects of the multi-orbital terms, let’s plot the eigenenergy -spectra with and without multi-orbital terms switched on for system with and -without a cubic crystal field. We will use a \(d\)-shell with two -electrons.

-
ten_dqs = [0, 2, 4, 12]
-
-def diagonalize(ten_dq, umat):
-    emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq),
-                        edrixs.tmat_c2r('d', ispin=True))
-    H = (edrixs.build_opers(4, umat, basis)
-         + edrixs.build_opers(2, emat, basis))
-    e, v = scipy.linalg.eigh(H)
-    return e - e.min()
-
-basis = edrixs.get_fock_bin_by_N(10, 2)
-umat_no_multiorbital = np.copy(umat)
-B = F2/49 - 5*F4/441
-for val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]:
-    umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0
-
-fig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3))
-
-for cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)):
-    ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1,
-              label='on', color=f'C{cind}')
-    ax.hlines(diagonalize(ten_dq, umat_no_multiorbital),
-              xmin=1.5, xmax=2.5,
-              label='off',
-              linestyle=':', color=f'C{cind}')
-    ax.set_title(f"$10D_q={ten_dq}$")
-    ax.set_ylim([-.5, 20])
-    ax.set_xticks([])
-    ax.legend()
-
-fig.suptitle("Eigenvalues with 3&4-orbital effects on/off")
-fig.subplots_adjust(wspace=.3)
-axs[0].set_ylabel('Eigenvalues (eV)')
-fig.subplots_adjust(top=.8)
-plt.show()
-
-
-Eigenvalues with 3&4-orbital effects on/off, $10D_q=0$, $10D_q=2$, $10D_q=4$, $10D_q=12$

On the left of the plot Coulomb interactions in spherical symmetry cause -substantial mxing between \(t_{2g}\) and \(e_{g}\) orbitals in the -eigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the -the right eigenenergies. As \(10D_q\) get large, this mixing is switched -off and the spectra start to become independent of whether the 3 & 4 orbital -orbital terms are included or not.

- - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of 2 orbital interactions

Orbitals \(\alpha,\beta\)

\(U_0\) Racah

\(U_0\) Slater

\(J\) Racah

\(J\) Slater

\(3z^2-r^2, xz\)

\(A/2+B+C/2\)

\(F_0/2+F_2-12F_4\)

\(B/2+C/2\)

\(F_2/2+15F_4\)

\(3z^2-r^2, yz\)

\(A/2+B+C/2\)

\(F_0/2+F_2-12F_4\)

\(B/2+C/2\)

\(F_2/2+15F_4\)

\(3z^2-r^2, x^2-y^2\)

\(A/2-2B+C/2\)

\(F_0/2-2F_2+3F_4\)

\(2B+C/2\)

\(2F_2+15F_4/2\)

\(3z^2-r^2, xy\)

\(A/2-2B+C/2\)

\(F_0/2-2F_2+3F_4\)

\(2B+C/2\)

\(2F_2+15F_4/2\)

\(xz, yz\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(xz, x^2-y^2\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(xz, xy\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(yz, x^2-y^2\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(yz, xy\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(x^2-y^2, xy\)

\(A/2+2B+C/2\)

\(F_0+4F_2-34F_4\)

\(C/2\)

\(35F_4/2\)

- - ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of 3 orbital interactions

Orbitals \(\alpha,\beta,\gamma,\delta\)

\(\langle\alpha\beta|\gamma\delta\rangle\) Racah

\(\langle\alpha\beta|\gamma\delta\rangle\) Slater

\(3z^2-r^2, xz, x^2-y^2, xz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, yz, x^2-y^2, yz\)

\(-\sqrt{3}B/2\)

\(-\sqrt{3}F_2/2+5\sqrt{3}F_4/2\)

\(xz, 3z^2-r^2, x^2-y^2, xz\)

\(-\sqrt{3}B\)

\(-\sqrt{3}F_2+5\sqrt{3}F_4\)

\(xz, xz, x^2-y^2, 3z^2-r^2\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(yz, 3z^2-r^2, x^2-y^2, yz\)

\(\sqrt{3}B\)

\(\sqrt{3}F_2-5\sqrt{3}F_4\)

\(yz, yz, x^2-y^2, 3z^2-r^2\)

\(-\sqrt{3}B/2\)

\(-\sqrt{3}F_2/2+5\sqrt{3}F_4/2\)

- - ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of 4 orbital interactions

Orbitals \(\alpha,\beta,\gamma,\delta\)

\(\langle\alpha\beta|\gamma\delta\rangle\) Racah

\(\langle\alpha\beta|\gamma\delta\rangle\) Slater

\(3z^2-r^2, xz, yz, xy\)

\(-\sqrt{3}B\)

\(-\sqrt{3}F_2+5\sqrt{3}F_4\)

\(3z^2-r^2, xz, xy, yz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, yz, xz, xy\)

\(-\sqrt{3}B\)

\(-\sqrt{3}F_2+5\sqrt{3}F_4\)

\(3z^2-r^2, yz, xy, xz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, xy, xz, yz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, xy, yz, xz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(x^2-y^2 , xz, xy, yz\)

\(-3B/2\)

\(-3F_2/2+15F_4/2\)

\(x^2-y^2 , yz, xy, xz\)

\(3B/2\)

\(3F_2/2-15F_4/2\)

\(x^2-y^2 , xy, xz, yz\)

\(-3B/2\)

\(-3F_2/2+15F_4/2\)

\(x^2-y^2 , xy, yz, xz\)

\(3B/2\)

\(3F_2/2-15F_4/2\)

-

Footnotes

-
-
1
-

MSugano S, Tanabe Y and Kamimura H. 1970. Multiplets of -Transition-Metal Ions in Crystals. Academic Press, New York and London.

-
-
-

Total running time of the script: ( 0 minutes 0.694 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_6_Hubbard_dimer.html b/edrixs/auto_examples/example_6_Hubbard_dimer.html deleted file mode 100644 index c0a4b8985d..0000000000 --- a/edrixs/auto_examples/example_6_Hubbard_dimer.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - Hubbard Dimer — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Hubbard Dimer

-

This exercise will demonstrate how to handle hopping and multi-site problems within -edrixs using the example of a Hubbard dimer. We want to solve the equation

-
-
-\[\begin{equation} -\hat{H} = \sum_{i,j} \sum_{\sigma} t_{i,j} \hat{f}^{\dagger}_{i,\sigma} \hat{f}_{j, \sigma} -+ U \sum_{i} \hat{n}_{i,\uparrow}\hat{n}_{i,\downarrow}, -\end{equation}\]
-
-

which involves two sites labeled with indices \(i\) or \(j\) with two -electrons of spin \(\sigma\in{\uparrow,\downarrow}\). \(t_{i,j}\) -is the hopping between sites, \(\hat{f}^{\dagger}_{i,\sigma}\) is the -creation operators, and -\(\hat{n}^{\dagger}_{i,\sigma}=\hat{f}^{\dagger}_{i,\sigma}\hat{f}_{i,\sigma}\) -is the number operator. The main task is to represent this Hamiltonian and -the related spin operator using the EDRIXS two-fermion and four-fermion form -where \(\alpha,\beta,\delta,\gamma\) are the indices of the single -particle basis.

-
-
-\[\begin{equation} -\hat{H} = \sum_{\alpha,\beta} t_{\alpha,\beta} \hat{f}^{\dagger}_{\alpha} \hat{f}_{\beta} -+ \sum_{\alpha,\beta,\gamma,\delta} U_{\alpha,\beta,\gamma,\delta} -\hat{f}^{\dagger}_{\alpha}\hat{f}^{\dagger}_{\beta}\hat{f}_{\gamma}\hat{f}_{\delta}. -\end{equation}\]
-
-
-

Initialize matrices

-

We start by noting that each of the two sites is like an \(l=0\) -\(s\)-orbital with two spin-orbitals each. We will include -two electron occupation and build the Fock basis.

-
import numpy as np
-import matplotlib.pyplot as plt
-import scipy
-import edrixs
-np.set_printoptions(precision=4)
-
-
-ll = 0
-case = 's'
-norb = 4
-noccu = 2
-basis = edrixs.get_fock_bin_by_N(norb, noccu)
-
-
-
-
-

Create function to populate and diagonalize matrices

-

The Coulomb and hopping matrices umat and emat will be -represented by \(4\times4\times4\times4\) and \(4\times4\) matrices, -respectively. Note that we needed to specify -that these are, in general, complex, although -they happen to contain only real numbers in this case. We follow the convention -that these are ordered first by site and then by spin: -\(|0\uparrow>, |0\downarrow>, |1\uparrow>, |1\downarrow>\). -Consequently the \(2\times2\) and \(2\times2\times2\times2\) block -diagonal structures of the matrices will contain the on-site interactions. -The converse is true for the hopping between the sites. -From here let us generate a function to build and diagonalize the Hamiltonian. -We need to generate the Coulomb matrix for the on-site interactions and -apply it to the block diagonal. The hopping connects off-site indices with -the same spin.

-
def diagonalize(U, t, extra_emat=None):
-    """Diagonalize 2 site Hubbard Hamiltonian"""
-    umat = np.zeros((norb, norb, norb, norb), dtype=np.complex128)
-    emat = np.zeros((norb, norb), dtype=np.complex128)
-    U_mat_1site = edrixs.get_umat_slater('s', U)
-    umat[:2, :2, :2, :2,] = umat[2:, 2:, 2:, 2:] = U_mat_1site
-    emat[2, 0] = emat[3, 1] = emat[0, 2] = emat[1, 3] = t
-
-    if extra_emat is not None:
-        emat = emat + extra_emat
-
-    H = (edrixs.build_opers(2, emat, basis)
-         + edrixs.build_opers(4, umat, basis))
-
-    e, v = scipy.linalg.eigh(H)
-    return e, v
-
-
-
-
-

The large \(U\) limit

-

Let us see what happens with \(U \gg t\).

-
e, v = diagonalize(1000, 1)
-print("Energies are")
-print(e)
-
-
-
Energies are
-[  -0.004    0.       0.       0.    1000.    1000.004]
-
-
-

To analyze what is going on we can determine the spin expectation values -of the cluster. Building the operators follows the same form as the -Hamiltonian and the previous example.

-
spin_mom_one_site = edrixs.get_spin_momentum(ll)
-spin_mom = np.zeros((3, norb, norb), dtype=np.complex128)
-spin_mom[:, :2, :2] = spin_mom[:, 2:, 2:] = spin_mom_one_site
-
-opS = edrixs.build_opers(2, spin_mom, basis)
-opS_squared = (np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1])
-               + np.dot(opS[2], opS[2]))
-
-
-

This time let us include a tiny magnetic field along the \(z\)-axis, so -that we have a well-defined measurement axis and print out the expectation -values.

-
zeeman = np.zeros((norb, norb), dtype=np.complex128)
-zeeman[:2, :2] = zeeman[2:, 2:] = 1e-8*spin_mom_one_site[2]
-e, v = diagonalize(1000, 1, extra_emat=zeeman)
-
-Ssq_exp = edrixs.cb_op(opS_squared, v).diagonal().real
-Sz_exp = edrixs.cb_op(opS[2], v).diagonal().real
-
-header = "{:<10s}\t{:<6s}\t{:<6s}"
-print(header.format("E", "S(S+1)", "<Sz>"))
-for i in range(len(e)):
-    print("{:<2f}\t{:.1f}\t{:.1f}".format(e[i], Ssq_exp[i], Sz_exp[i]))
-
-
-
E               S(S+1)  <Sz>
--0.004000       0.0     0.0
--0.000000       2.0     -1.0
--0.000000       2.0     0.0
-0.000000        2.0     1.0
-1000.000000     0.0     0.0
-1000.004000     0.0     0.0
-
-
-

For \(U \gg t\) the two states with double occupancy acquire an energy of -approximately \(U\). The low energy states are a \(S=0\) singlet and -and \(S=1\) triplet, which are split by \(4t^2/U\), which is the -magnetic exchange term.

-
-
-

\(U\) dependence

-

Let us plot the changes in energy with \(U\).

-
plt.figure()
-
-t = 1
-Us = np.linspace(0.01, 10, 50)
-Es = np.array([diagonalize(U, t, extra_emat=zeeman)[0] for U in Us])
-
-plt.plot(Us/t, Es/t)
-plt.xlabel('U/t')
-plt.ylabel('Eigenstate energies/t')
-plt.show()
-
-
-example 6 Hubbard dimer

To help interpret this, we can represent the eigenvectors in terms of a sum -of the single particle states.

-
def get_single_particle_repesentations(v):
-    reps = []
-    for i in range(6):
-        rep = sum([vec*weight for weight, vec
-                        in zip(v[:, i], np.array(basis))])
-        reps.append(rep)
-
-    return np.array(reps)
-
-t = 1
-for U in [10000, 0.0001]:
-    e, v = diagonalize(U, t, extra_emat=zeeman)
-    repesentations = get_single_particle_repesentations(v)
-    print("For U={} t={} states  are".format(U,  t))
-    print(repesentations.round(3).real)
-    print("\n")
-
-
-
For U=10000 t=1 states  are
-[[-0.707  0.707  0.707 -0.707]
- [ 0.     1.     0.     1.   ]
- [ 0.707  0.707  0.707  0.707]
- [-1.     0.    -1.     0.   ]
- [-0.707 -0.707  0.707  0.707]
- [ 0.707  0.707  0.707  0.707]]
-
-
-For U=0.0001 t=1 states  are
-[[-0.     1.     1.    -0.   ]
- [ 0.     1.     0.     1.   ]
- [ 0.707  0.707  0.707  0.707]
- [-1.     0.    -1.     0.   ]
- [-0.707 -0.707  0.707  0.707]
- [-1.    -0.    -0.    -1.   ]]
-
-
-

For \(U \gg t\) the ground state maximizes its magnetic exchange -energy saving. In the \(U \ll t\) condition the ground state maximizes -its kinetic energy saving. Since both states share the same parity, the -cross-over between them is smooth. This type of physics is at play in current -research on quantum materials [1] [2].

-

Footnotes

- -

Total running time of the script: (0 minutes 0.095 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_7_Coulomb.html b/edrixs/auto_examples/example_7_Coulomb.html deleted file mode 100644 index e2b662fb31..0000000000 --- a/edrixs/auto_examples/example_7_Coulomb.html +++ /dev/null @@ -1,686 +0,0 @@ - - - - - - - Coulomb interactions — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Coulomb interactions

-

In this example we provide more details on how Coulomb interactions are -implemented in multiplet calculations and EDRIXS in particular. We aim -to clarify the form of the matrices, how they are parametrized, -and how the breaking of spherical symmetry can switch on additional elements -that one might not anticipate. Our example is based on a \(d\) atomic shell.

-
-

Create matrix

-

The Coulomb interaction between two particles can be written as

-
-
-\[\begin{equation} -\hat{H} = \frac{1}{2} -\int d\mathbf{r} \int d\mathbf{r}^\prime -\Sigma_{\sigma, \sigma^\prime} -|\hat{\psi}^\sigma(\mathbf{r})|^2 \frac{e^2}{R} -|\hat{\psi}^{\sigma^\prime}(\mathbf{r})|^2, -\end{equation}\]
-
-

where \(\hat{\psi}^\sigma(\mathbf{r})\) is the electron wavefunction, with -spin \(\sigma\), and \(R=|r-r^\prime|\) is the electron separation. -Solving our problem in this form is difficult due to the need to symmeterize -the wavefunction to follow fermionic statistics. -Using second quantization, we can use operators to impose the required -particle exchange statistics and write the equation in terms of -a tensor \(U\)

-
-
-\[\begin{equation} -\hat{H} = \sum_{\alpha,\beta,\gamma,\delta,\sigma,\sigma^\prime} -U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} -\hat{f}^{\dagger}_{\alpha\sigma} -\hat{f}^{\dagger}_{\beta\sigma^\prime} -\hat{f}_{t\sigma^\prime}\hat{f}_{\delta\sigma}, -\end{equation}\]
-
-

where \(\alpha\), \(\beta\), \(\gamma\), \(\delta\) are -orbital indices and \(\hat{f}^{\dagger}\) -(\(\hat{f}\)) are the creation (anihilation) operators. -For a \(d\)-electron system, we have \(10\) distinct spin-orbitals -(\(5\) orbitals each with \(2\) spins), which makes matrix the -\(10\times10\times10\times10\) in total size. -In EDRIXS the matrix can be created as follows:

-
import edrixs
-import numpy as np
-import scipy
-import matplotlib.pyplot as plt
-import itertools
-
-F0, F2, F4 = 6.94, 14.7, 4.41
-umat_chb = edrixs.get_umat_slater('d', F0, F2, F4)
-
-
-

We stored this under variable umat_chb where “cbh” stands for -complex harmonic basis, which is the default basis in EDRIXS.

-
-
-

Parameterizing interactions

-

EDRIXS parameterizes the interactions in \(U\) via Slater integral -parameters \(F^{k}\). These relate to integrals of various spherical -Harmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients, -and Wigner 3J symbols. Textbooks such as [1] can be used for further -reference. If you are interested in the details of how -EDRIXS does this (and you probably aren’t) function umat_slater(), -constructs the required matrix via Gaunt coeficents from -get_gaunt(). Two alternative parameterizations are common. -The first are the Racah parameters, which are

-
-
-\[\begin{split}\begin{eqnarray} -A &=& F^0 - \frac{49}{441} F^4 \\ -B &=& \frac{1}{49}F^2 - \frac{5}{441}F^4 \\ -C &=& \frac{35}{441}F^4. -\end{eqnarray}\end{split}\]
-
-

or an alternative form for the Slater integrals

-
-
-\[\begin{split}\begin{eqnarray} -F_0 &=& F^0 \\ -F_2 &=& \frac{1}{49}F^2 \\ -F_4 &=& \frac{1}{441}F^4, -\end{eqnarray}\end{split}\]
-
-

which involves different normalization parameters.

-
-
-

Basis transform

-

If we want to use the real harmonic basis, we can use a tensor -transformation, which imposes the following orbital order -\(3z^2-r^2, xz, yz, x^2-y^2, xy\), each of which involves -\(\uparrow, \downarrow\) spin pairs. Let’s perform this transformation and -store a list of these orbitals.

-
umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True))
-orbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy']
-
-
-
-
-

Interactions

-

Tensor \(U\) is a series of matrix -elements

-
-
-\[\begin{equation} -\langle\psi_{\gamma,\delta}^{\bar{\sigma},\bar{\sigma}^\prime} -|\hat{H}| -\psi_{\alpha,\beta}^{\sigma,\sigma^\prime}\rangle -\end{equation}\]
-
-

the combination of which defines the energetic cost of pairwise -electron-electron interactions between states \(\alpha,\sigma\) -and \(\beta,\sigma^\prime\). In EDRIXS we follow the convention of -summing over all orbital pairs. Some other texts count each pair of -indices only once. The matrix elements here will consequently -be half the magnitude of those in other references. -We can express the interactions in terms of -the orbitals involved. It is common to distinguish “direct Coulomb” and -“exchange” interactions. The former come from electrons in the same orbital -and the later involve swapping orbital labels for electrons. We will use -\(U_0\) and \(J\) as a shorthand for distinguishing these.

-

Before we describe the different types of interactions, we note that since -the Coulomb interaction is real, and due to the spin symmmetry properties -of the process \(U\) always obeys

-
-
-\[\begin{equation} -U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} = -U_{\beta\sigma,\alpha\sigma^\prime,\delta\sigma^\prime,\gamma\sigma} = -U_{\delta\sigma,\gamma\sigma^\prime,\beta\sigma^\prime,\alpha\sigma} = -U_{\gamma\sigma,\delta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}. -\end{equation}\]
-
-
-

1. Intra orbital

-

The direct Coulomb energy cost to double-occupy an orbital comes from terms -like \(U_{\alpha\sigma,\alpha\bar\sigma,\alpha\bar\sigma,\alpha\sigma}\). -In this notation, we use \(\sigma^\prime\) to denote that the matrix -element is summed over all pairs and \(\bar{\sigma}\) to denote sums -over all opposite spin pairs. Due to rotational symmetry, all these -elements are the same and equal to

-
-
-\[\begin{split}\begin{eqnarray} -U_0 &=& \frac{A}{2} + 2B + \frac{3C}{2}\\ - &=& \frac{F_0}{2} + 2F_2 + 18F_4 -\end{eqnarray}\end{split}\]
-
-

Let’s print these to demonstrate where these live in the array

-
for i in range(0, 5):
-    val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real
-    print(f"{orbitals[i]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         4.250
-xz               4.250
-yz               4.250
-x^2-y^2          4.250
-xy               4.250
-
-
-
-
-

2. Inter orbital Coulomb interactions

-

Direct Coulomb repulsion between different orbitals depends on terms like -\(U_{\alpha\sigma,\beta\sigma^\prime,\beta\sigma^\prime,\alpha\sigma}\). -Expresions for these parameters are provided in column \(U\) in -Table of 2 orbital interactions. We can print the values from umat -like this:

-
for i, j in itertools.combinations(range(5), 2):
-    val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz              3.650
-3z^2-r^2         yz              3.650
-3z^2-r^2         x^2-y^2         2.900
-3z^2-r^2         xy              2.900
-xz               yz              3.150
-xz               x^2-y^2         3.150
-xz               xy              3.150
-yz               x^2-y^2         3.150
-yz               xy              3.150
-x^2-y^2          xy              3.900
-
-
-
-
-

3. Inter-orbital exchange interactions

-

Exchange terms exist with the form -\(U_{\alpha\sigma,\beta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}\). -Expresions for these parameters are provided in column \(J\) of -Table of 2 orbital interactions. These come from terms like this in the matrix:

-
for i, j in itertools.combinations(range(5), 2):
-    val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz              0.300
-3z^2-r^2         yz              0.300
-3z^2-r^2         x^2-y^2         0.675
-3z^2-r^2         xy              0.675
-xz               yz              0.550
-xz               x^2-y^2         0.550
-xz               xy              0.550
-yz               x^2-y^2         0.550
-yz               xy              0.550
-x^2-y^2          xy              0.175
-
-
-
-
-

4. Pair hopping term

-

Terms that swap pairs of electrons exist as -\((1-\delta_{\sigma\sigma'})U_{\alpha\sigma,\alpha\bar\sigma,\beta\bar\sigma,\beta\sigma}\) -and depend on exchange interactions column \(J\) from -Table of 2 orbital interactions -and here in the matrix.

-
for i, j in itertools.combinations(range(5), 2):
-    val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz              0.300
-3z^2-r^2         yz              0.300
-3z^2-r^2         x^2-y^2         0.675
-3z^2-r^2         xy              0.675
-xz               yz              0.550
-xz               x^2-y^2         0.550
-xz               xy              0.550
-yz               x^2-y^2         0.550
-yz               xy              0.550
-x^2-y^2          xy              0.175
-
-
-
-
-

5. Three orbital

-

Another set of terms that one might not immediately anticipate involve three -orbitals like

-
-
-\[\begin{split}\begin{equation} -U_{\alpha\sigma, \gamma\sigma', \beta\sigma', \gamma\sigma} \\ -U_{\alpha\sigma, \gamma\sigma', \gamma\sigma', \beta\sigma} \\ -(1-\delta_{\sigma\sigma'}) -U_{\alpha\sigma, \beta\sigma', \gamma\sigma', \gamma\sigma} -\end{equation}\end{split}\]
-
-

for \(\alpha=3z^2-r^2, \beta=x^2-y^2, \gamma=xz/yz\). -These are needed to maintain the rotational symmetry of the interations. -See Table of 3 orbital interactions for the expressions. We can print some of -these via:

-
ijkl = [[0, 1, 3, 1],
-        [0, 2, 3, 2],
-        [1, 0, 3, 1],
-        [1, 1, 3, 0],
-        [2, 0, 3, 2],
-        [2, 2, 3, 0]]
-
-for i, j, k, l in ijkl:
-    val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t"
-          f"{orbitals[k]:<8} \t {orbitals[l]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz             x^2-y^2          xz              0.217
-3z^2-r^2         yz             x^2-y^2          yz              -0.217
-xz               3z^2-r^2       x^2-y^2          xz              -0.433
-xz               xz             x^2-y^2          3z^2-r^2        0.217
-yz               3z^2-r^2       x^2-y^2          yz              0.433
-yz               yz             x^2-y^2          3z^2-r^2        -0.217
-
-
-
-
-

6. Four orbital

-

Futher multi-orbital terms include -\(U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma}\). -We can find these here in the matrix:

-
ijkl = [[0, 1, 2, 4],
-        [0, 1, 4, 2],
-        [0, 2, 1, 4],
-        [0, 2, 4, 1],
-        [0, 4, 1, 2],
-        [0, 4, 2, 1],
-        [3, 1, 4, 2],
-        [3, 2, 4, 1],
-        [3, 4, 1, 2],
-        [3, 4, 2, 1]]
-
-for i, j, k, l in ijkl:
-    val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {orbitals[k]:<8}"
-          f"\t {orbitals[l]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz              yz              xy              -0.433
-3z^2-r^2         xz              xy              yz              0.217
-3z^2-r^2         yz              xz              xy              -0.433
-3z^2-r^2         yz              xy              xz              0.217
-3z^2-r^2         xy              xz              yz              0.217
-3z^2-r^2         xy              yz              xz              0.217
-x^2-y^2          xz              xy              yz              -0.375
-x^2-y^2          yz              xy              xz              0.375
-x^2-y^2          xy              xz              yz              -0.375
-x^2-y^2          xy              yz              xz              0.375
-
-
-
-
-
-

Effects of multi-orbital terms

-

To test the effects of the multi-orbital terms, let’s plot the eigenenergy -spectra with and without multi-orbital terms switched on for system with and -without a cubic crystal field. We will use a \(d\)-shell with two -electrons.

-
ten_dqs = [0, 2, 4, 12]
-
-def diagonalize(ten_dq, umat):
-    emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq),
-                        edrixs.tmat_c2r('d', ispin=True))
-    H = (edrixs.build_opers(4, umat, basis)
-         + edrixs.build_opers(2, emat, basis))
-    e, v = scipy.linalg.eigh(H)
-    return e - e.min()
-
-basis = edrixs.get_fock_bin_by_N(10, 2)
-umat_no_multiorbital = np.copy(umat)
-B = F2/49 - 5*F4/441
-for val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]:
-    umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0
-
-fig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3))
-
-for cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)):
-    ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1,
-              label='on', color=f'C{cind}')
-    ax.hlines(diagonalize(ten_dq, umat_no_multiorbital),
-              xmin=1.5, xmax=2.5,
-              label='off',
-              linestyle=':', color=f'C{cind}')
-    ax.set_title(f"$10D_q={ten_dq}$")
-    ax.set_ylim([-.5, 20])
-    ax.set_xticks([])
-    ax.legend()
-
-fig.suptitle("Eigenvalues with 3&4-orbital effects on/off")
-fig.subplots_adjust(wspace=.3)
-axs[0].set_ylabel('Eigenvalues (eV)')
-fig.subplots_adjust(top=.8)
-plt.show()
-
-
-Eigenvalues with 3&4-orbital effects on/off, $10D_q=0$, $10D_q=2$, $10D_q=4$, $10D_q=12$

On the left of the plot Coulomb interactions in spherical symmetry cause -substantial mxing between \(t_{2g}\) and \(e_{g}\) orbitals in the -eigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the -the right eigenenergies. As \(10D_q\) get large, this mixing is switched -off and the spectra start to become independent of whether the 3 & 4 orbital -orbital terms are included or not.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of 2 orbital interactions

Orbitals \(\alpha,\beta\)

\(U_0\) Racah

\(U_0\) Slater

\(J\) Racah

\(J\) Slater

\(3z^2-r^2, xz\)

\(A/2+B+C/2\)

\(F_0/2+F_2-12F_4\)

\(B/2+C/2\)

\(F_2/2+15F_4\)

\(3z^2-r^2, yz\)

\(A/2+B+C/2\)

\(F_0/2+F_2-12F_4\)

\(B/2+C/2\)

\(F_2/2+15F_4\)

\(3z^2-r^2, x^2-y^2\)

\(A/2-2B+C/2\)

\(F_0/2-2F_2+3F_4\)

\(2B+C/2\)

\(2F_2+15F_4/2\)

\(3z^2-r^2, xy\)

\(A/2-2B+C/2\)

\(F_0/2-2F_2+3F_4\)

\(2B+C/2\)

\(2F_2+15F_4/2\)

\(xz, yz\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(xz, x^2-y^2\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(xz, xy\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(yz, x^2-y^2\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(yz, xy\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(x^2-y^2, xy\)

\(A/2+2B+C/2\)

\(F_0+4F_2-34F_4\)

\(C/2\)

\(35F_4/2\)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of 3 orbital interactions

Orbitals \(\alpha,\beta,\gamma,\delta\)

\(\langle\alpha\beta|\gamma\delta\rangle\) Racah

\(\langle\alpha\beta|\gamma\delta\rangle\) Slater

\(3z^2-r^2, xz, x^2-y^2, xz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, yz, x^2-y^2, yz\)

\(-\sqrt{3}B/2\)

\(-\sqrt{3}F_2/2+5\sqrt{3}F_4/2\)

\(xz, 3z^2-r^2, x^2-y^2, xz\)

\(-\sqrt{3}B\)

\(-\sqrt{3}F_2+5\sqrt{3}F_4\)

\(xz, xz, x^2-y^2, 3z^2-r^2\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(yz, 3z^2-r^2, x^2-y^2, yz\)

\(\sqrt{3}B\)

\(\sqrt{3}F_2-5\sqrt{3}F_4\)

\(yz, yz, x^2-y^2, 3z^2-r^2\)

\(-\sqrt{3}B/2\)

\(-\sqrt{3}F_2/2+5\sqrt{3}F_4/2\)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of 4 orbital interactions

Orbitals \(\alpha,\beta,\gamma,\delta\)

\(\langle\alpha\beta|\gamma\delta\rangle\) Racah

\(\langle\alpha\beta|\gamma\delta\rangle\) Slater

\(3z^2-r^2, xz, yz, xy\)

\(-\sqrt{3}B\)

\(-\sqrt{3}F_2+5\sqrt{3}F_4\)

\(3z^2-r^2, xz, xy, yz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, yz, xz, xy\)

\(-\sqrt{3}B\)

\(-\sqrt{3}F_2+5\sqrt{3}F_4\)

\(3z^2-r^2, yz, xy, xz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, xy, xz, yz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, xy, yz, xz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(x^2-y^2 , xz, xy, yz\)

\(-3B/2\)

\(-3F_2/2+15F_4/2\)

\(x^2-y^2 , yz, xy, xz\)

\(3B/2\)

\(3F_2/2-15F_4/2\)

\(x^2-y^2 , xy, xz, yz\)

\(-3B/2\)

\(-3F_2/2+15F_4/2\)

\(x^2-y^2 , xy, yz, xz\)

\(3B/2\)

\(3F_2/2-15F_4/2\)

-

Footnotes

- -

Total running time of the script: ( 0 minutes 0.579 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_7_Hunds_interactions.html b/edrixs/auto_examples/example_7_Hunds_interactions.html deleted file mode 100644 index 4d020a9398..0000000000 --- a/edrixs/auto_examples/example_7_Hunds_interactions.html +++ /dev/null @@ -1,463 +0,0 @@ - - - - - - - Hund’s Interactions in charge transfer insulators — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Hund’s Interactions in charge transfer insulators

-

In this exercise we will solve a toy model relevant to cubic \(d^8\) charge transfer insulators -such as NiO or NiPS3. We are interested in better understanding the interplay between the -Hund’s interactions and the charge transfer energy in terms of the energy of the triplet-singlet -excitations of this model. These seem to act against each other in that the Hund’s interactions -impose a energy cost for the triplet-singlet excitations whenever there are two holes on -the Ni \(d\) orbitals. The charge transfer physics, on the other hand, will promote a -\(d^9\underline{L}\) ground state in which the Hund’s interactions are not active.

-

The simplest model that captures this physics requires four Ni spin-orbitals, representing the Ni -\(e_g\) manifold. We will represent the ligand states in the same way as the Anderson impurity -model in terms of one effective ligand spin-orbital per Ni spin-orbital. We assume these effective -orbitals have been constructed so that each Ni orbital only bonds to one sister orbital. For -simplicity, we will treat all Ni and all ligand orbitals as equivalent, even though a more -realistic model would account for the different Coulomb and hopping of the \(d_{3z^2-r^2}\) -and \(d_{x^2-y^2}\) orbitals. We therefore simply connect Ni and ligand orbitals via a constant -hopping \(t\). We also include the ligand energy parameter \(e_L\).

-

The easiest way to implement the requried Coulomb interactions is to use the so-called Kanamori -Hamiltonian, which is a simplfied form for the interactions, which treats all orbitals as -equivalent. Daniel Khomskii’s book provides a great explanation of this physics [1]. We -parameterize the interactions via Coulomb repulsion parameter \(U\) and Hund’s exchange -\(J_H\). EDRIXS provides this functionality via the more general -get_umat_kanamori() function.

-

It’s also easiest to consider this problem in hole langauge, which means our eight spin-orbitals -are populated by two fermions.

-
-

Setup

-

We start by loading the necessary modules, and defining the total number of -orbitals and electrons.

-
import edrixs
-import scipy
-import numpy as np
-import matplotlib.pyplot as plt
-
-norb = 8
-noccu = 2
-
-
-
-
-

Diagonalization

-

Let’s write a function to diagonalize our model in a similar way to -the Hubbard Dimer example. -Within this function, we also create operators to count the number of -\(d\) holes and operators to calculate expectation values for -\(S^2\) and \(S_z\). For the latter to make sense, we also include a -small effective spin interaction along \(z\).

-
def diagonalize(U, JH, t, eL, n=1):
-    # Setup Coulomb matrix
-    umat = np.zeros((norb, norb, norb, norb), dtype=complex)
-    uNi = edrixs.get_umat_kanamori(norb//2, U, JH)
-    umat[:norb//2, :norb//2, :norb//2, :norb//2] = uNi
-
-    # Setup hopping matrix
-    emat = np.zeros((norb, norb), dtype=complex)
-    ind = np.arange(norb//2)
-    emat[ind, ind + norb//2] = t
-    emat[ind+norb//2, ind] = np.conj(t)  # conj is not needed, but is good practise.
-    ind = np.arange(norb//2, norb)
-    emat[ind, ind] += eL
-
-    # Spin operator
-    spin_mom = np.zeros((3, norb, norb), dtype=complex)
-    spin_mom[:, :2, :2] = edrixs.get_spin_momentum(0)
-    spin_mom[:, 2:4, 2:4] = edrixs.get_spin_momentum(0)
-    spin_mom[:, 4:6, 4:6] = edrixs.get_spin_momentum(0)
-    spin_mom[:, 6:8, 6:8] = edrixs.get_spin_momentum(0)
-
-    # add small effective field along z
-    emat += 1e-6*spin_mom[2]
-
-    # Diagonalize
-    basis = edrixs.get_fock_bin_by_N(norb, noccu)
-    H = edrixs.build_opers(2, emat, basis) + edrixs.build_opers(4, umat, basis)
-    e, v = scipy.linalg.eigh(H)
-    e -= e[0]  # Define ground state as zero energy
-
-    # Operator for holes on Ni
-    basis = np.array(basis)
-    num_d_electrons = basis[:, :4].sum(1)
-    d0 = np.sum(np.abs(v[num_d_electrons == 0, :])**2, axis=0)
-    d1 = np.sum(np.abs(v[num_d_electrons == 1, :])**2, axis=0)
-    d2 = np.sum(np.abs(v[num_d_electrons == 2, :])**2, axis=0)
-
-    # S^2 and Sz operators
-    opS = edrixs.build_opers(2, spin_mom, basis)
-    S_squared_op = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2])
-    S_squared_exp = edrixs.cb_op(S_squared_op, v).diagonal().real
-    S_z_exp = edrixs.cb_op(opS[2], v).diagonal().real
-
-    return e[:n], d0[:n], d1[:n], d2[:n], S_squared_exp[:n], S_z_exp[:n]
-
-
-
-
-

The atomic limit

-

For simplicity, let’s start in the atomic limit with \(e_L \gg t \gg U\) -where all holes are on nickel. In this case, there are six ways to distribute -two holes on the four Ni spin-orbitals. Let’s examine the expectation values -of the \(S^2\) and \(S_z\) operators.

-
U = 10
-JH = 2
-t = 100
-eL = 1e10
-
-e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6)
-
-print("Ground state\nE\t<S(S+1)\tSz>")
-for i in range(3):
-    print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}")
-
-print("\nExcited state\nE\t<S(S+1)\tSz>")
-for i in range(3, 6):
-    print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}")
-
-
-
Ground state
-E       <S(S+1) Sz>
-0.00    2.00    1.00
-0.00    2.00    0.00
-0.00    2.00    -1.00
-
-Excited state
-E       <S(S+1) Sz>
-4.00    0.00    0.00
-4.00    0.00    0.00
-8.00    0.00    0.00
-
-
-

The ground state is a high-spin triplet. The fourth and fifth -states (the first excited state) are low-spin singlet excitons at -\(2 J_H\). These have one hole on each orbital in the antisymmetric -combination of \(|\uparrow\downarrow>-|\downarrow\uparrow>\). -The state at \(3 J_H\) also has one hole on each orbital in the symmetric -\(|\uparrow\downarrow>+|\downarrow\uparrow>\) configuration.

-
-
-

Where are the holes for large hopping

-

As discussed at the start, we are interested to see interplay between Hund’s -and charge-transfer physics, which will obviously depend strongly on whether -the holes are on Ni or the ligand. Let’s see what happens as \(e_L\) is -reduced while observing the location of the ground state and exciton holes.

-
U = 10
-JH = 2
-t = 100
-
-eLs = np.linspace(0, 1000, 30)
-
-fig, axs = plt.subplots(1, 2, figsize=(8, 4))
-
-for ax, ind in zip(axs.ravel(), [0, 3]):
-    ds = np.array([diagonalize(U, JH, t, eL, n=6)
-                   for eL in eLs])
-
-    ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$')
-    ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$')
-    ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$')
-    ax.set_xlabel("Energy of ligands $e_L$")
-    ax.set_ylabel("Number of electrons")
-    ax.legend()
-
-axs[0].set_title("Location of ground state holes")
-axs[1].set_title("Location of exciton holes")
-
-plt.tight_layout()
-plt.show()
-
-
-Location of ground state holes, Location of exciton holes

For large \(e_L\), we see that both holes are on nickel as expected. In -the opposite limit of \(|e_L| \ll t\) and \(U \ll t\) the holes are -shared in the ratio 0.25:0.5:0.25 as there are two ways to have one hole on -Ni. In the limit of large \(e_L\), all holes move onto Ni. Since -\(t\) is large, this applies equally to both the ground state and the -exciton.

-
-
-

Connecton between atomic and charge transfer limits

-

We now examine the quantum numbers during cross over between the two limits -with \(e_L\). Let’s first look at the how \(<S^2>\) changes for the -ground state and exciton and then examine how the exciton energy changes.

-
U = 10
-JH = 2
-t = 100
-
-eLs = np.linspace(0, 1000, 30)
-
-info = np.array([diagonalize(U, JH, t, eL, n=6)
-                 for eL in eLs])
-
-fig, axs = plt.subplots(1, 2, figsize=(8, 4))
-
-
-axs[0].plot(eLs, info[:, 4, 0], label='Ground state')
-axs[0].plot(eLs, info[:, 4, 3], label='Exciton')
-axs[0].set_xlabel("Energy of ligands $e_L$")
-axs[0].set_ylabel('$<S^2>$')
-axs[0].set_title('Quantum numbers')
-axs[0].legend()
-
-axs[1].plot(eLs, info[:, 0, 3], '+', color='C0')
-axs[1].set_xlabel("Energy of ligands $e_L$")
-axs[1].set_ylabel('Exciton energy', color='C0')
-axr = axs[1].twinx()
-axr.plot(eLs, info[:, 3, 5], 'x', color='C1')
-axr.set_ylabel('$d^2$ fraction', color='C1')
-
-for ax, color in zip([axs[1], axr], ['C0', 'C1']):
-    for tick in ax.get_yticklabels():
-        tick.set_color(color)
-
-axs[1].set_ylim(0, 2*JH)
-axr.set_ylim(0, 1)
-
-axs[1].set_title('Exciton energy vs. $d^2$ character')
-plt.tight_layout()
-plt.show()
-
-
-Quantum numbers, Exciton energy vs. $d^2$ character

In the left panel, we see that the two limits are adiabatically connected -as they preseve the same quantum numbers. This is because there is always -an appreciable double occupancy under conditions where the -\(d^9\underline{L}\) character is maximized and this continues to favor -the high spin ground state. Other interactions such as strong tetragonal -crystal field would be needed to overcome the Hund’s interactions and break -this paradigm. In the right panel, we see that the exciton energy simply -scales with the double occupancy. Overall, even though -Hund’s interactions are irrelevant for the \(d^9\underline{L}\) -electronic configuration, whenever \(t\) is appreciable there is a -strong mixing with the \(d^8\) component is always present, which -dominates the energy of the exciton.

-
-
-

Charge transfer excitons

-

Another limiting case of the model is where \(t\) is smaller than the -Coulomb interactions. This, however, tends to produce -ground state and exciton configurations that correspond to those of distinct -atomic models. Let’s look at the \(e_L\) dependence in this case.

-
U = 10
-JH = 2
-t = .5
-eL = 7
-
-eLs = np.linspace(0, 20, 30)
-
-fig, axs = plt.subplots(1, 2, figsize=(8, 4))
-
-for ax, ind in zip(axs.ravel(), [0, 3]):
-    ds = np.array([diagonalize(U, JH, t, eL, n=6)
-                   for eL in eLs])
-
-    ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$')
-    ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$')
-    ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$')
-    ax.set_xlabel("Energy of ligands $e_L$")
-    ax.set_ylabel("Number of electrons")
-    ax.legend()
-
-axs[0].axvline(x=eL, linestyle=':', color='k')
-axs[1].axvline(x=eL, linestyle=':', color='k')
-
-axs[0].set_title("Location of ground state holes")
-axs[1].set_title("Location of exciton holes")
-
-plt.tight_layout()
-plt.show()
-
-
-Location of ground state holes, Location of exciton holes

Around \(e_L = 7\) the plot shows that the excition is primairly a -\(d^2 \rightarrow d^1\) transition or a -\(d^8 \rightarrow d^{9}\underline{L}\) transition in electron language. -Let’s examine the energy and quantum numbers.

-
e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6)
-
-print("Ground state\nE\t<S(S+1)\tSz>")
-for i in range(3):
-    print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}")
-
-print("\nExcited state\nE\t<S(S+1)\tSz>")
-for i in range(3, 6):
-    print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}")
-
-
-
Ground state
-E       <S(S+1) Sz>
-0.00    2.00    -1.00
-0.00    2.00    -0.00
-0.00    2.00    1.00
-
-Excited state
-E       <S(S+1) Sz>
-2.74    0.00    0.00
-2.74    0.00    0.00
-2.99    0.00    0.00
-
-
-

We once again see the same quantum numbers, despite the differences in mixing -in the ground state and exciton.

-

Footnotes

- -

Total running time of the script: (0 minutes 1.206 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_7_transitions.html b/edrixs/auto_examples/example_7_transitions.html deleted file mode 100644 index 442e218ebe..0000000000 --- a/edrixs/auto_examples/example_7_transitions.html +++ /dev/null @@ -1,355 +0,0 @@ - - - - - - - - - X-ray transitions — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

X-ray transitions

-

This example explains how to calculate x-ray transition amplitudes between -specific orbital and spin states. We take the case of a cuprate which has one -hole in the \(d_{x^2-y^2}\) orbital and a spin ordering direction along the -in-plane diagaonal direction and compute the angular dependence of spin-flip -and non-spin-flip processes.

-

This case was chosen because the eigenvectors in question are simple enough -for us to write them out more-or-less by hand, so this example helps the reader -to understand what happens under the hood in more complex cases.

-

Some of the code here is credited to Yao Shen who used this approach for the -analysis of a low valence nickelate material [1]. The task performed repeats -analysis done by many researchers e.g. Luuk Ament et al [2] as well as -several other groups.

-
import edrixs
-import numpy as np
-import matplotlib.pyplot as plt
-import scipy
-
-
-
-

Eigenvectors

-

Let us start by determining the eigenvectors involved in the transitions. -The spin direction can be set using a vector -\(\vec{B}\) to represent a magnetic field in terms of generalized spin -operator \(\tilde{\sigma}=\vec{B}\cdot\sigma\) based on the Pauli matrices -\(\sigma\). Let’s put the spin along the \([1, 1, 0]\) direction -and formuate the problem in the hole basis. -For one particle, we know that the Hamiltonian will be diagonal in the real -harmonic basis. -We can generate the required eigenvectors by making a diagonal -matrix, transforming it to the required -complex harmonic basis (as is standard for EDRIXS) and diagonalizing it. -As long as the crystal field splitting is much larger than the magnetic -field, the eigenvectors will be independent of the exact values of both -these parameters.

-
B = 1e-3*np.array([1, 1, 0])
-cf_splitting = 1e3
-zeeman = sum(s*b for s, b in zip(edrixs.get_spin_momentum(2), B))
-dd_levels = np.array([energy for dd_level in cf_splitting*np.arange(5)
-                      for energy in [dd_level]*2], dtype=complex)
-emat_rhb = np.diag(dd_levels)
-emat = edrixs.cb_op(emat_rhb, edrixs.tmat_r2c('d', ispin=True)) + zeeman
-_, eigenvectors = np.linalg.eigh(emat)
-
-def get_eigenvector(orbital_index, spin_index):
-    return eigenvectors[:, 2*orbital_index + spin_index]
-
-
-

Let’s examine the \(d_{x^2-y^2}\) orbital first. Recall from the -Crystal fields -example that edrixs uses the standard orbital order of -\(d_{3z^2-r^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}\). So we want -orbital_index = 3 element. Using this, we can build spin-up and -down -eigenvectors.

-
orbital_index = 3
-
-groundstate_vector = get_eigenvector(orbital_index, 0)
-excitedstate_vector = get_eigenvector(orbital_index, 1)
-
-
-
-
-

Transition operators and scattering matrix

-

Here we are considering the \(L_3\)-edge. This means -a \(2p_{3/2} \rightarrow 3d\) -absoprtion transition and a \(2p_{3/2} \rightarrow 3d\) -emission transition. We can read the relevant matrix from the edrixs database, -keeping in mind that there are in fact three operations for -\(x, y,\) & \(z\) directions. Note that edrixs provides operators -in electron notation. If we define \(D\) as the transition operator in -electron language, \(D^\dagger\) is the operator in the hole language -we are using for this example. -The angular dependence of a RIXS transition can be conveniently described -using the scattering matrix, which is a \(3\times3\) element object that -specifies the transition amplitude for each incoming and outgoing x-ray -polarization. Correspondingly, we have

-
-
-\[\begin{equation} -\mathcal{F}=\sum_n\langle f|D|n\rangle\langle n|D^{\dagger}|g\rangle -\end{equation}.\]
-
-

In matrix form this is

-
-
-\[\begin{equation} -\mathcal{F}(m,n)=\{f^{\dagger} \cdot D(m)\} \cdot \{D^{\dagger}(n) \cdot g\} -\end{equation}.\]
-
-
D_Tmat = edrixs.get_trans_oper('dp32')
-
-def get_F(vector_i, vector_f):
-    F = np.zeros((3, 3), dtype=complex)
-    for i in range(3):
-        for j in range(3):
-            F[i, j] = np.dot(np.dot(np.conj(vector_f.T), D_Tmat[i]),
-                             np.dot(np.conj(D_Tmat[j].T), vector_i))
-    return F
-
-
-

Using this function, we can obtain non-spin-flip (NSF) and spin-flip (SF) -scattering matrices by choosing whether we return to the ground state or -whether we access the excited state with the spin flipped.

- -
-
-

Angular dependence

-

Let’s consider the common case of fixing the total scattering angle at -two_theta = 90 and choosing a series of incident angles thins. -Since the detector does not resolve polarization, we need to add both outgoing -polarizations. It is then convenient to use function dipole_polvec_rixs() -to obtain the incoming and outgoing polarization vectors.

-
thins = np.linspace(0, 90)
-two_theta = 90
-phi = 0
-
-
-def get_I(thin, alpha, F):
-    intensity = 0
-    for beta in [0, np.pi/2]:
-        thout = two_theta - thin
-        ei, ef = edrixs.dipole_polvec_rixs(thin*np.pi/180, thout*np.pi/180,
-                                           phi*np.pi/180, alpha, beta)
-        intensity += np.abs(np.dot(ef, np.dot(F, ei)))**2
-    return intensity
-
-
-
-
-

Plot

-

We now run through a few configurations specified in terms of incoming -polarization angle \(\alpha\) (defined in radians w.r.t. the scattering -plane), \(F\), plotting label, and plotting color.

-
fig, ax = plt.subplots()
-
-config = [[0, F_NSF, r'$\pi$ NSF', 'C0'],
-          [np.pi/2, F_NSF, r'$\sigma$ NSF', 'C1'],
-          [0, F_SF, r'$\pi$ SF', 'C2'],
-          [np.pi/2, F_SF, r'$\sigma$ SF', 'C3']]
-
-for alpha, F, label, color in config:
-    Is = np.array([get_I(thin, alpha, F) for thin in thins])
-    ax.plot(thins, Is, label=label, color=color)
-
-ax.legend()
-ax.set_xlabel(r'Theta ($^\circ$)')
-ax.set_ylabel('Relative intensity')
-plt.show()
-
-
-example 7 transitions
-
-

Run through orbitals

-

For completeness, let’s look at transitions from \(x^2-y^2\) to all other -orbitals.

-
fig, axs = plt.subplots(5, 1, figsize=(7, 7),
-                        sharex=True, sharey=True)
-
-orbitals = ['$d_{3z^2-r^2}$', '$d_{xz}$', '$d_{yz}$',
-            '$d_{x^2-y^2}$', '$d_{xy}$']
-orbital_order = [4, 1, 2, 0, 3]
-
-plot_index = 0
-for ax, orbital_index in zip(axs, orbital_order):
-    for spin_index, spin_label in zip([0, 1], ['NSF', 'SF']):
-        excitedstate_vector = get_eigenvector(orbital_index, spin_index)
-        F = get_F(groundstate_vector, excitedstate_vector)
-        for alpha, pol_label in zip([0, np.pi/2], [r'$\pi$', r'$\sigma$']):
-            Is = np.array([get_I(thin, alpha, F) for thin in thins])
-            ax.plot(thins, Is*10, label=f'{pol_label} {spin_label}',
-                    color=f'C{plot_index%4}')
-            plot_index += 1
-    ax.legend(title=orbitals[orbital_index], bbox_to_anchor=(1.1, 1),
-              loc="upper left", fontsize=8)
-
-
-axs[-1].set_xlabel(r'$\theta$ ($^\circ$)')
-axs[2].set_ylabel('Scattering intensity')
-
-fig.subplots_adjust(hspace=0, left=.3, right=.6)
-plt.show()
-
-
-example 7 transitions

Footnotes

- -

Total running time of the script: (0 minutes 0.514 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_8_Coulomb.html b/edrixs/auto_examples/example_8_Coulomb.html deleted file mode 100644 index 55083425ed..0000000000 --- a/edrixs/auto_examples/example_8_Coulomb.html +++ /dev/null @@ -1,692 +0,0 @@ - - - - - - - Coulomb interactions — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Coulomb interactions

-

In this example we provide more details on how Coulomb interactions are -implemented in multiplet calculations and EDRIXS in particular. We aim -to clarify the form of the matrices, how they are parametrized, -and how the breaking of spherical symmetry can switch on additional elements -that one might not anticipate. Our example is based on a \(d\) atomic shell.

-
-

Create matrix

-

The Coulomb interaction between two particles can be written as

-
-
-\[\begin{equation} -\hat{H} = \frac{1}{2} -\int d\mathbf{r} \int d\mathbf{r}^\prime -\Sigma_{\sigma, \sigma^\prime} -|\hat{\psi}^\sigma(\mathbf{r})|^2 \frac{e^2}{R} -|\hat{\psi}^{\sigma^\prime}(\mathbf{r^\prime})|^2, -\end{equation}\]
-
-

where \(\hat{\psi}^\sigma(\mathbf{r})\) is the electron wavefunction, with -spin \(\sigma\), and \(R=|r-r^\prime|\) is the electron separation. -Solving our problem in this form is difficult due to the need to symmeterize -the wavefunction to follow fermionic statistics. -Using second quantization, we can use operators to impose the required -particle exchange statistics and write the equation in terms of -a tensor \(U\)

-
-
-\[\begin{equation} -\hat{H} = \sum_{\alpha,\beta,\gamma,\delta,\sigma,\sigma^\prime} -U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} -\hat{f}^{\dagger}_{\alpha\sigma} -\hat{f}^{\dagger}_{\beta\sigma^\prime} -\hat{f}_{\gamma\sigma^\prime}\hat{f}_{\delta\sigma}, -\end{equation}\]
-
-

where \(\alpha\), \(\beta\), \(\gamma\), \(\delta\) are -orbital indices and \(\hat{f}^{\dagger}\) -(\(\hat{f}\)) are the creation (anihilation) operators. -For a \(d\)-electron system, we have \(10\) distinct spin-orbitals -(\(5\) orbitals each with \(2\) spins), which makes matrix the -\(10\times10\times10\times10\) in total size. -In EDRIXS the matrix can be created as follows:

-
import edrixs
-import numpy as np
-import scipy
-import matplotlib.pyplot as plt
-import itertools
-
-F0, F2, F4 = 6.94, 14.7, 4.41
-umat_chb = edrixs.get_umat_slater('d', F0, F2, F4)
-
-
-

We stored this under variable umat_chb where “cbh” stands for -complex harmonic basis, which is the default basis in EDRIXS.

-
-
-

Parameterizing interactions

-

EDRIXS parameterizes the interactions in \(U\) via Slater integral -parameters \(F^{k}\). These relate to integrals of various spherical -Harmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients, -and Wigner 3J symbols. Textbooks such as [1] can be used for further -reference. If you are interested in the details of how -EDRIXS does this (and you probably aren’t) function umat_slater(), -constructs the required matrix via Gaunt coeficents from -get_gaunt(). Two alternative parameterizations are common. -The first are the Racah parameters, which are

-
-
-\[\begin{split}\begin{eqnarray} -A &=& F^0 - \frac{49}{441} F^4 \\ -B &=& \frac{1}{49}F^2 - \frac{5}{441}F^4 \\ -C &=& \frac{35}{441}F^4. -\end{eqnarray}\end{split}\]
-
-

or an alternative form for the Slater integrals

-
-
-\[\begin{split}\begin{eqnarray} -F_0 &=& F^0 \\ -F_2 &=& \frac{1}{49}F^2 \\ -F_4 &=& \frac{1}{441}F^4, -\end{eqnarray}\end{split}\]
-
-

which involves different normalization parameters.

-
-
-

Basis transform

-

If we want to use the real harmonic basis, we can use a tensor -transformation, which imposes the following orbital order -\(3z^2-r^2, xz, yz, x^2-y^2, xy\), each of which involves -\(\uparrow, \downarrow\) spin pairs. Let’s perform this transformation and -store a list of these orbitals.

-
umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True))
-orbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy']
-
-
-
-
-

Interactions

-

Tensor \(U\) is a series of matrix -elements

-
-
-\[\begin{equation} -\langle\psi_{\gamma,\delta}^{\bar{\sigma},\bar{\sigma}^\prime} -|\hat{H}| -\psi_{\alpha,\beta}^{\sigma,\sigma^\prime}\rangle -\end{equation}\]
-
-

the combination of which defines the energetic cost of pairwise -electron-electron interactions between states \(\alpha,\sigma\) -and \(\beta,\sigma^\prime\). In EDRIXS we follow the convention of -summing over all orbital pairs. Some other texts count each pair of -indices only once. The matrix elements here will consequently -be half the magnitude of those in other references. -We can express the interactions in terms of -the orbitals involved. It is common to distinguish “direct Coulomb” and -“exchange” interactions. The former come from electrons in the same orbital -and the later involve swapping orbital labels for electrons. We will use -\(U_0\) and \(J\) as a shorthand for distinguishing these.

-

Before we describe the different types of interactions, we note that since -the Coulomb interaction is real, and due to the spin symmmetry properties -of the process \(U\) always obeys

-
-
-\[\begin{equation} -U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} = -U_{\beta\sigma,\alpha\sigma^\prime,\delta\sigma^\prime,\gamma\sigma} = -U_{\delta\sigma,\gamma\sigma^\prime,\beta\sigma^\prime,\alpha\sigma} = -U_{\gamma\sigma,\delta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}. -\end{equation}\]
-
-
-

1. Intra orbital

-

The direct Coulomb energy cost to double-occupy an orbital comes from terms -like \(U_{\alpha\sigma,\alpha\bar\sigma,\alpha\bar\sigma,\alpha\sigma}\). -In this notation, we use \(\sigma^\prime\) to denote that the matrix -element is summed over all pairs and \(\bar{\sigma}\) to denote sums -over all opposite spin pairs. Due to rotational symmetry, all these -elements are the same and equal to

-
-
-\[\begin{split}\begin{eqnarray} -U_0 &=& \frac{A}{2} + 2B + \frac{3C}{2}\\ - &=& \frac{F_0}{2} + 2F_2 + 18F_4 -\end{eqnarray}\end{split}\]
-
-

Let’s print these to demonstrate where these live in the array

-
for i in range(0, 5):
-    val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real
-    print(f"{orbitals[i]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         4.250
-xz               4.250
-yz               4.250
-x^2-y^2          4.250
-xy               4.250
-
-
-
-
-

2. Inter orbital Coulomb interactions

-

Direct Coulomb repulsion between different orbitals depends on terms like -\(U_{\alpha\sigma,\beta\sigma^\prime,\beta\sigma^\prime,\alpha\sigma}\). -Expresions for these parameters are provided in column \(U\) in -Table of 2 orbital interactions. We can print the values from umat -like this:

-
for i, j in itertools.combinations(range(5), 2):
-    val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz              3.650
-3z^2-r^2         yz              3.650
-3z^2-r^2         x^2-y^2         2.900
-3z^2-r^2         xy              2.900
-xz               yz              3.150
-xz               x^2-y^2         3.150
-xz               xy              3.150
-yz               x^2-y^2         3.150
-yz               xy              3.150
-x^2-y^2          xy              3.900
-
-
-
-
-

3. Inter-orbital exchange interactions

-

Exchange terms exist with the form -\(U_{\alpha\sigma,\beta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}\). -Expresions for these parameters are provided in column \(J\) of -Table of 2 orbital interactions. These come from terms like this in the matrix:

-
for i, j in itertools.combinations(range(5), 2):
-    val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz              0.300
-3z^2-r^2         yz              0.300
-3z^2-r^2         x^2-y^2         0.675
-3z^2-r^2         xy              0.675
-xz               yz              0.550
-xz               x^2-y^2         0.550
-xz               xy              0.550
-yz               x^2-y^2         0.550
-yz               xy              0.550
-x^2-y^2          xy              0.175
-
-
-
-
-

4. Pair hopping term

-

Terms that swap pairs of electrons exist as -\((1-\delta_{\sigma\sigma'})U_{\alpha\sigma,\alpha\bar\sigma,\beta\bar\sigma,\beta\sigma}\) -and depend on exchange interactions column \(J\) from -Table of 2 orbital interactions -and here in the matrix.

-
for i, j in itertools.combinations(range(5), 2):
-    val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz              0.300
-3z^2-r^2         yz              0.300
-3z^2-r^2         x^2-y^2         0.675
-3z^2-r^2         xy              0.675
-xz               yz              0.550
-xz               x^2-y^2         0.550
-xz               xy              0.550
-yz               x^2-y^2         0.550
-yz               xy              0.550
-x^2-y^2          xy              0.175
-
-
-
-
-

5. Three orbital

-

Another set of terms that one might not immediately anticipate involve three -orbitals like

-
-
-\[\begin{split}\begin{equation} -U_{\alpha\sigma, \gamma\sigma', \beta\sigma', \gamma\sigma} \\ -U_{\alpha\sigma, \gamma\sigma', \gamma\sigma', \beta\sigma} \\ -(1-\delta_{\sigma\sigma'}) -U_{\alpha\sigma, \beta\sigma', \gamma\sigma', \gamma\sigma} -\end{equation}\end{split}\]
-
-

for \(\alpha=3z^2-r^2, \beta=x^2-y^2, \gamma=xz/yz\). -These are needed to maintain the rotational symmetry of the interations. -See Table of 3 orbital interactions for the expressions. We can print some of -these via:

-
ijkl = [[0, 1, 3, 1],
-        [0, 2, 3, 2],
-        [1, 0, 3, 1],
-        [1, 1, 3, 0],
-        [2, 0, 3, 2],
-        [2, 2, 3, 0]]
-
-for i, j, k, l in ijkl:
-    val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t"
-          f"{orbitals[k]:<8} \t {orbitals[l]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz             x^2-y^2          xz              0.217
-3z^2-r^2         yz             x^2-y^2          yz              -0.217
-xz               3z^2-r^2       x^2-y^2          xz              -0.433
-xz               xz             x^2-y^2          3z^2-r^2        0.217
-yz               3z^2-r^2       x^2-y^2          yz              0.433
-yz               yz             x^2-y^2          3z^2-r^2        -0.217
-
-
-
-
-

6. Four orbital

-

Futher multi-orbital terms include -\(U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma}\). -We can find these here in the matrix:

-
ijkl = [[0, 1, 2, 4],
-        [0, 1, 4, 2],
-        [0, 2, 1, 4],
-        [0, 2, 4, 1],
-        [0, 4, 1, 2],
-        [0, 4, 2, 1],
-        [3, 1, 4, 2],
-        [3, 2, 4, 1],
-        [3, 4, 1, 2],
-        [3, 4, 2, 1]]
-
-for i, j, k, l in ijkl:
-    val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {orbitals[k]:<8}"
-          f"\t {orbitals[l]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz              yz              xy              -0.433
-3z^2-r^2         xz              xy              yz              0.217
-3z^2-r^2         yz              xz              xy              -0.433
-3z^2-r^2         yz              xy              xz              0.217
-3z^2-r^2         xy              xz              yz              0.217
-3z^2-r^2         xy              yz              xz              0.217
-x^2-y^2          xz              xy              yz              -0.375
-x^2-y^2          yz              xy              xz              0.375
-x^2-y^2          xy              xz              yz              -0.375
-x^2-y^2          xy              yz              xz              0.375
-
-
-
-
-
-

Effects of multi-orbital terms

-

To test the effects of the multi-orbital terms, let’s plot the eigenenergy -spectra with and without multi-orbital terms switched on for system with and -without a cubic crystal field. We will use a \(d\)-shell with two -electrons.

-
ten_dqs = [0, 2, 4, 12]
-
-def diagonalize(ten_dq, umat):
-    emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq),
-                        edrixs.tmat_c2r('d', ispin=True))
-    H = (edrixs.build_opers(4, umat, basis)
-         + edrixs.build_opers(2, emat, basis))
-    e, v = scipy.linalg.eigh(H)
-    return e - e.min()
-
-basis = edrixs.get_fock_bin_by_N(10, 2)
-umat_no_multiorbital = np.copy(umat)
-B = F2/49 - 5*F4/441
-for val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]:
-    umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0
-
-fig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3))
-
-for cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)):
-    ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1,
-              label='on', color=f'C{cind}')
-    ax.hlines(diagonalize(ten_dq, umat_no_multiorbital),
-              xmin=1.5, xmax=2.5,
-              label='off',
-              linestyle=':', color=f'C{cind}')
-    ax.set_title(f"$10D_q={ten_dq}$")
-    ax.set_ylim([-.5, 20])
-    ax.set_xticks([])
-    ax.legend()
-
-fig.suptitle("Eigenvalues with 3&4-orbital effects on/off")
-fig.subplots_adjust(wspace=.3)
-axs[0].set_ylabel('Eigenvalues (eV)')
-fig.subplots_adjust(top=.8)
-plt.show()
-
-
-Eigenvalues with 3&4-orbital effects on/off, $10D_q=0$, $10D_q=2$, $10D_q=4$, $10D_q=12$

On the left of the plot Coulomb interactions in spherical symmetry cause -substantial mxing between \(t_{2g}\) and \(e_{g}\) orbitals in the -eigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the -the right eigenenergies. As \(10D_q\) get large, this mixing is switched -off and the spectra start to become independent of whether the 3 & 4 orbital -orbital terms are included or not.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of 2 orbital interactions

Orbitals \(\alpha,\beta\)

\(U_0\) Racah

\(U_0\) Slater

\(J\) Racah

\(J\) Slater

\(3z^2-r^2, xz\)

\(A/2+B+C/2\)

\(F_0/2+F_2-12F_4\)

\(B/2+C/2\)

\(F_2/2+15F_4\)

\(3z^2-r^2, yz\)

\(A/2+B+C/2\)

\(F_0/2+F_2-12F_4\)

\(B/2+C/2\)

\(F_2/2+15F_4\)

\(3z^2-r^2, x^2-y^2\)

\(A/2-2B+C/2\)

\(F_0/2-2F_2+3F_4\)

\(2B+C/2\)

\(2F_2+15F_4/2\)

\(3z^2-r^2, xy\)

\(A/2-2B+C/2\)

\(F_0/2-2F_2+3F_4\)

\(2B+C/2\)

\(2F_2+15F_4/2\)

\(xz, yz\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(xz, x^2-y^2\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(xz, xy\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(yz, x^2-y^2\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(yz, xy\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(x^2-y^2, xy\)

\(A/2+2B+C/2\)

\(F_0+4F_2-34F_4\)

\(C/2\)

\(35F_4/2\)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of 3 orbital interactions

Orbitals \(\alpha,\beta,\gamma,\delta\)

\(\langle\alpha\beta|\gamma\delta\rangle\) Racah

\(\langle\alpha\beta|\gamma\delta\rangle\) Slater

\(3z^2-r^2, xz, x^2-y^2, xz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, yz, x^2-y^2, yz\)

\(-\sqrt{3}B/2\)

\(-\sqrt{3}F_2/2+5\sqrt{3}F_4/2\)

\(xz, 3z^2-r^2, x^2-y^2, xz\)

\(-\sqrt{3}B\)

\(-\sqrt{3}F_2+5\sqrt{3}F_4\)

\(xz, xz, x^2-y^2, 3z^2-r^2\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(yz, 3z^2-r^2, x^2-y^2, yz\)

\(\sqrt{3}B\)

\(\sqrt{3}F_2-5\sqrt{3}F_4\)

\(yz, yz, x^2-y^2, 3z^2-r^2\)

\(-\sqrt{3}B/2\)

\(-\sqrt{3}F_2/2+5\sqrt{3}F_4/2\)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of 4 orbital interactions

Orbitals \(\alpha,\beta,\gamma,\delta\)

\(\langle\alpha\beta|\gamma\delta\rangle\) Racah

\(\langle\alpha\beta|\gamma\delta\rangle\) Slater

\(3z^2-r^2, xz, yz, xy\)

\(-\sqrt{3}B\)

\(-\sqrt{3}F_2+5\sqrt{3}F_4\)

\(3z^2-r^2, xz, xy, yz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, yz, xz, xy\)

\(-\sqrt{3}B\)

\(-\sqrt{3}F_2+5\sqrt{3}F_4\)

\(3z^2-r^2, yz, xy, xz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, xy, xz, yz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, xy, yz, xz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(x^2-y^2 , xz, xy, yz\)

\(-3B/2\)

\(-3F_2/2+15F_4/2\)

\(x^2-y^2 , yz, xy, xz\)

\(3B/2\)

\(3F_2/2-15F_4/2\)

\(x^2-y^2 , xy, xz, yz\)

\(-3B/2\)

\(-3F_2/2+15F_4/2\)

\(x^2-y^2 , xy, yz, xz\)

\(3B/2\)

\(3F_2/2-15F_4/2\)

-

Footnotes

- -

Total running time of the script: (0 minutes 0.360 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_8_Hunds_interactions.html b/edrixs/auto_examples/example_8_Hunds_interactions.html deleted file mode 100644 index bc209af094..0000000000 --- a/edrixs/auto_examples/example_8_Hunds_interactions.html +++ /dev/null @@ -1,462 +0,0 @@ - - - - - - - - - Hund’s Interactions in charge transfer insulators — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Hund’s Interactions in charge transfer insulators

-

In this exercise we will solve a toy model relevant to cubic \(d^8\) charge transfer insulators -such as NiO or NiPS3. We are interested in better understanding the interplay between the -Hund’s interactions and the charge transfer energy in terms of the energy of the triplet-singlet -excitations of this model. These seem to act against each other in that the Hund’s interactions -impose a energy cost for the triplet-singlet excitations whenever there are two holes on -the Ni \(d\) orbitals. The charge transfer physics, on the other hand, will promote a -\(d^9\underline{L}\) ground state in which the Hund’s interactions are not active.

-

The simplest model that captures this physics requires four Ni spin-orbitals, representing the Ni -\(e_g\) manifold. We will represent the ligand states in the same way as the Anderson impurity -model in terms of one effective ligand spin-orbital per Ni spin-orbital. We assume these effective -orbitals have been constructed so that each Ni orbital only bonds to one sister orbital. For -simplicity, we will treat all Ni and all ligand orbitals as equivalent, even though a more -realistic model would account for the different Coulomb and hopping of the \(d_{3z^2-r^2}\) -and \(d_{x^2-y^2}\) orbitals. We therefore simply connect Ni and ligand orbitals via a constant -hopping \(t\). We also include the ligand energy parameter \(e_L\).

-

The easiest way to implement the requried Coulomb interactions is to use the so-called Kanamori -Hamiltonian, which is a simplfied form for the interactions, which treats all orbitals as -equivalent. Daniel Khomskii’s book provides a great explanation of this physics [1]. We -parameterize the interactions via Coulomb repulsion parameter \(U\) and Hund’s exchange -\(J_H\). EDRIXS provides this functionality via the more general -get_umat_kanamori() function.

-

It’s also easiest to consider this problem in hole langauge, which means our eight spin-orbitals -are populated by two fermions.

-
-

Setup

-

We start by loading the necessary modules, and defining the total number of -orbitals and electrons.

-
import edrixs
-import scipy
-import numpy as np
-import matplotlib.pyplot as plt
-
-norb = 8
-noccu = 2
-
-
-
-
-

Diagonalization

-

Let’s write a function to diagonalize our model in a similar way to -the Hubbard Dimer example. -Within this function, we also create operators to count the number of -\(d\) holes and operators to calculate expectation values for -\(S^2\) and \(S_z\). For the latter to make sense, we also include a -small effective spin interaction along \(z\).

-
def diagonalize(U, JH, t, eL, n=1):
-    # Setup Coulomb matrix
-    umat = np.zeros((norb, norb, norb, norb), dtype=complex)
-    uNi = edrixs.get_umat_kanamori(norb//2, U, JH)
-    umat[:norb//2, :norb//2, :norb//2, :norb//2] = uNi
-
-    # Setup hopping matrix
-    emat = np.zeros((norb, norb), dtype=complex)
-    ind = np.arange(norb//2)
-    emat[ind, ind + norb//2] = t
-    emat[ind+norb//2, ind] = np.conj(t)  # conj is not needed, but is good practise.
-    ind = np.arange(norb//2, norb)
-    emat[ind, ind] += eL
-
-    # Spin operator
-    spin_mom = np.zeros((3, norb, norb), dtype=complex)
-    spin_mom[:, :2, :2] = edrixs.get_spin_momentum(0)
-    spin_mom[:, 2:4, 2:4] = edrixs.get_spin_momentum(0)
-    spin_mom[:, 4:6, 4:6] = edrixs.get_spin_momentum(0)
-    spin_mom[:, 6:8, 6:8] = edrixs.get_spin_momentum(0)
-
-    # add small effective field along z
-    emat += 1e-6*spin_mom[2]
-
-    # Diagonalize
-    basis = edrixs.get_fock_bin_by_N(norb, noccu)
-    H = edrixs.build_opers(2, emat, basis) + edrixs.build_opers(4, umat, basis)
-    e, v = scipy.linalg.eigh(H)
-    e -= e[0]  # Define ground state as zero energy
-
-    # Operator for holes on Ni
-    basis = np.array(basis)
-    num_d_electrons = basis[:, :4].sum(1)
-    d0 = np.sum(np.abs(v[num_d_electrons == 0, :])**2, axis=0)
-    d1 = np.sum(np.abs(v[num_d_electrons == 1, :])**2, axis=0)
-    d2 = np.sum(np.abs(v[num_d_electrons == 2, :])**2, axis=0)
-
-    # S^2 and Sz operators
-    opS = edrixs.build_opers(2, spin_mom, basis)
-    S_squared_op = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2])
-    S_squared_exp = edrixs.cb_op(S_squared_op, v).diagonal().real
-    S_z_exp = edrixs.cb_op(opS[2], v).diagonal().real
-
-    return e[:n], d0[:n], d1[:n], d2[:n], S_squared_exp[:n], S_z_exp[:n]
-
-
-
-
-

The atomic limit

-

For simplicity, let’s start in the atomic limit with \(e_L \gg t \gg U\) -where all holes are on nickel. In this case, there are six ways to distribute -two holes on the four Ni spin-orbitals. Let’s examine the expectation values -of the \(S^2\) and \(S_z\) operators.

-
U = 10
-JH = 2
-t = 100
-eL = 1e10
-
-e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6)
-
-print("Ground state\nE\t<S(S+1)\tSz>")
-for i in range(3):
-    print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}")
-
-print("\nExcited state\nE\t<S(S+1)\tSz>")
-for i in range(3, 6):
-    print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}")
-
-
-
Ground state
-E       <S(S+1) Sz>
-0.00    2.00    1.00
-0.00    2.00    0.00
-0.00    2.00    -1.00
-
-Excited state
-E       <S(S+1) Sz>
-4.00    0.00    0.00
-4.00    0.00    0.00
-8.00    0.00    0.00
-
-
-

The ground state is a high-spin triplet. The fourth and fifth -states (the first excited state) are low-spin singlet excitons at -\(2 J_H\). These have one hole on each orbital in the antisymmetric -combination of \(|\uparrow\downarrow>-|\downarrow\uparrow>\). -The state at \(3 J_H\) also has one hole on each orbital in the symmetric -\(|\uparrow\downarrow>+|\downarrow\uparrow>\) configuration.

-
-
-

Where are the holes for large hopping

-

As discussed at the start, we are interested to see interplay between Hund’s -and charge-transfer physics, which will obviously depend strongly on whether -the holes are on Ni or the ligand. Let’s see what happens as \(e_L\) is -reduced while observing the location of the ground state and exciton holes.

-
U = 10
-JH = 2
-t = 100
-
-eLs = np.linspace(0, 1000, 30)
-
-fig, axs = plt.subplots(1, 2, figsize=(8, 4))
-
-for ax, ind in zip(axs.ravel(), [0, 3]):
-    ds = np.array([diagonalize(U, JH, t, eL, n=6)
-                   for eL in eLs])
-
-    ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$')
-    ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$')
-    ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$')
-    ax.set_xlabel("Energy of ligands $e_L$")
-    ax.set_ylabel("Number of electrons")
-    ax.legend()
-
-axs[0].set_title("Location of ground state holes")
-axs[1].set_title("Location of exciton holes")
-
-plt.tight_layout()
-plt.show()
-
-
-Location of ground state holes, Location of exciton holes

For large \(e_L\), we see that both holes are on nickel as expected. In -the opposite limit of \(|e_L| \ll t\) and \(U \ll t\) the holes are -shared in the ratio 0.25:0.5:0.25 as there are two ways to have one hole on -Ni. In the limit of large \(e_L\), all holes move onto Ni. Since -\(t\) is large, this applies equally to both the ground state and the -exciton.

-
-
-

Connecton between atomic and charge transfer limits

-

We now examine the quantum numbers during cross over between the two limits -with \(e_L\). Let’s first look at the how \(<S^2>\) changes for the -ground state and exciton and then examine how the exciton energy changes.

-
U = 10
-JH = 2
-t = 100
-
-eLs = np.linspace(0, 1000, 30)
-
-info = np.array([diagonalize(U, JH, t, eL, n=6)
-                 for eL in eLs])
-
-fig, axs = plt.subplots(1, 2, figsize=(8, 4))
-
-
-axs[0].plot(eLs, info[:, 4, 0], label='Ground state')
-axs[0].plot(eLs, info[:, 4, 3], label='Exciton')
-axs[0].set_xlabel("Energy of ligands $e_L$")
-axs[0].set_ylabel('$<S^2>$')
-axs[0].set_title('Quantum numbers')
-axs[0].legend()
-
-axs[1].plot(eLs, info[:, 0, 3], '+', color='C0')
-axs[1].set_xlabel("Energy of ligands $e_L$")
-axs[1].set_ylabel('Exciton energy', color='C0')
-axr = axs[1].twinx()
-axr.plot(eLs, info[:, 3, 5], 'x', color='C1')
-axr.set_ylabel('$d^2$ fraction', color='C1')
-
-for ax, color in zip([axs[1], axr], ['C0', 'C1']):
-    for tick in ax.get_yticklabels():
-        tick.set_color(color)
-
-axs[1].set_ylim(0, 2*JH)
-axr.set_ylim(0, 1)
-
-axs[1].set_title('Exciton energy vs. $d^2$ character')
-plt.tight_layout()
-plt.show()
-
-
-Quantum numbers, Exciton energy vs. $d^2$ character

In the left panel, we see that the two limits are adiabatically connected -as they preseve the same quantum numbers. This is because there is always -an appreciable double occupancy under conditions where the -\(d^9\underline{L}\) character is maximized and this continues to favor -the high spin ground state. Other interactions such as strong tetragonal -crystal field would be needed to overcome the Hund’s interactions and break -this paradigm. In the right panel, we see that the exciton energy simply -scales with the double occupancy. Overall, even though -Hund’s interactions are irrelevant for the \(d^9\underline{L}\) -electronic configuration, whenever \(t\) is appreciable there is a -strong mixing with the \(d^8\) component is always present, which -dominates the energy of the exciton.

-
-
-

Charge transfer excitons

-

Another limiting case of the model is where \(t\) is smaller than the -Coulomb interactions. This, however, tends to produce -ground state and exciton configurations that correspond to those of distinct -atomic models. Let’s look at the \(e_L\) dependence in this case.

-
U = 10
-JH = 2
-t = .5
-eL = 7
-
-eLs = np.linspace(0, 20, 30)
-
-fig, axs = plt.subplots(1, 2, figsize=(8, 4))
-
-for ax, ind in zip(axs.ravel(), [0, 3]):
-    ds = np.array([diagonalize(U, JH, t, eL, n=6)
-                   for eL in eLs])
-
-    ax.plot(eLs, ds[:, 1, ind], 'o', label='$d^0$')
-    ax.plot(eLs, ds[:, 2, ind], 's', label='$d^1$')
-    ax.plot(eLs, ds[:, 3, ind], '^', label='$d^2$')
-    ax.set_xlabel("Energy of ligands $e_L$")
-    ax.set_ylabel("Number of electrons")
-    ax.legend()
-
-axs[0].axvline(x=eL, linestyle=':', color='k')
-axs[1].axvline(x=eL, linestyle=':', color='k')
-
-axs[0].set_title("Location of ground state holes")
-axs[1].set_title("Location of exciton holes")
-
-plt.tight_layout()
-plt.show()
-
-
-Location of ground state holes, Location of exciton holes

Around \(e_L = 7\) the plot shows that the excition is primairly a -\(d^2 \rightarrow d^1\) transition or a -\(d^8 \rightarrow d^{9}\underline{L}\) transition in electron language. -Let’s examine the energy and quantum numbers.

-
e, d0, d1, d2, S_squared_exp, S_z_exp = diagonalize(U, JH, t, eL, n=6)
-
-print("Ground state\nE\t<S(S+1)\tSz>")
-for i in range(3):
-    print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}")
-
-print("\nExcited state\nE\t<S(S+1)\tSz>")
-for i in range(3, 6):
-    print(f"{e[i]:.2f}\t{S_squared_exp[i]:.2f}\t{S_z_exp[i]:.2f}")
-
-
-
Ground state
-E       <S(S+1) Sz>
-0.00    2.00    -1.00
-0.00    2.00    -0.00
-0.00    2.00    1.00
-
-Excited state
-E       <S(S+1) Sz>
-2.74    0.00    0.00
-2.74    0.00    0.00
-2.99    0.00    0.00
-
-
-

We once again see the same quantum numbers, despite the differences in mixing -in the ground state and exciton.

-

Footnotes

- -

Total running time of the script: (0 minutes 1.236 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/example_9_Coulomb.html b/edrixs/auto_examples/example_9_Coulomb.html deleted file mode 100644 index e4e9ebc158..0000000000 --- a/edrixs/auto_examples/example_9_Coulomb.html +++ /dev/null @@ -1,691 +0,0 @@ - - - - - - - - - Coulomb interactions — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- - -
-

Coulomb interactions

-

In this example we provide more details on how Coulomb interactions are -implemented in multiplet calculations and EDRIXS in particular. We aim -to clarify the form of the matrices, how they are parametrized, -and how the breaking of spherical symmetry can switch on additional elements -that one might not anticipate. Our example is based on a \(d\) atomic shell.

-
-

Create matrix

-

The Coulomb interaction between two particles can be written as

-
-
-\[\begin{equation} -\hat{H} = \frac{1}{2} -\int d\mathbf{r} \int d\mathbf{r}^\prime -\Sigma_{\sigma, \sigma^\prime} -|\hat{\psi}^\sigma(\mathbf{r})|^2 \frac{e^2}{R} -|\hat{\psi}^{\sigma^\prime}(\mathbf{r^\prime})|^2, -\end{equation}\]
-
-

where \(\hat{\psi}^\sigma(\mathbf{r})\) is the electron wavefunction, with -spin \(\sigma\), and \(R=|r-r^\prime|\) is the electron separation. -Solving our problem in this form is difficult due to the need to symmeterize -the wavefunction to follow fermionic statistics. -Using second quantization, we can use operators to impose the required -particle exchange statistics and write the equation in terms of -a tensor \(U\)

-
-
-\[\begin{equation} -\hat{H} = \sum_{\alpha,\beta,\gamma,\delta,\sigma,\sigma^\prime} -U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} -\hat{f}^{\dagger}_{\alpha\sigma} -\hat{f}^{\dagger}_{\beta\sigma^\prime} -\hat{f}_{\gamma\sigma^\prime}\hat{f}_{\delta\sigma}, -\end{equation}\]
-
-

where \(\alpha\), \(\beta\), \(\gamma\), \(\delta\) are -orbital indices and \(\hat{f}^{\dagger}\) -(\(\hat{f}\)) are the creation (anihilation) operators. -For a \(d\)-electron system, we have \(10\) distinct spin-orbitals -(\(5\) orbitals each with \(2\) spins), which makes matrix the -\(10\times10\times10\times10\) in total size. -In EDRIXS the matrix can be created as follows:

-
import edrixs
-import numpy as np
-import scipy
-import matplotlib.pyplot as plt
-import itertools
-
-F0, F2, F4 = 6.94, 14.7, 4.41
-umat_chb = edrixs.get_umat_slater('d', F0, F2, F4)
-
-
-

We stored this under variable umat_chb where “cbh” stands for -complex harmonic basis, which is the default basis in EDRIXS.

-
-
-

Parameterizing interactions

-

EDRIXS parameterizes the interactions in \(U\) via Slater integral -parameters \(F^{k}\). These relate to integrals of various spherical -Harmonics as well as Clebsch-Gordon coefficients, Gaunt coefficients, -and Wigner 3J symbols. Textbooks such as [1] can be used for further -reference. If you are interested in the details of how -EDRIXS does this (and you probably aren’t) function umat_slater(), -constructs the required matrix via Gaunt coeficents from -get_gaunt(). Two alternative parameterizations are common. -The first are the Racah parameters, which are

-
-
-\[\begin{split}\begin{eqnarray} -A &=& F^0 - \frac{49}{441} F^4 \\ -B &=& \frac{1}{49}F^2 - \frac{5}{441}F^4 \\ -C &=& \frac{35}{441}F^4. -\end{eqnarray}\end{split}\]
-
-

or an alternative form for the Slater integrals

-
-
-\[\begin{split}\begin{eqnarray} -F_0 &=& F^0 \\ -F_2 &=& \frac{1}{49}F^2 \\ -F_4 &=& \frac{1}{441}F^4, -\end{eqnarray}\end{split}\]
-
-

which involves different normalization parameters.

-
-
-

Basis transform

-

If we want to use the real harmonic basis, we can use a tensor -transformation, which imposes the following orbital order -\(3z^2-r^2, xz, yz, x^2-y^2, xy\), each of which involves -\(\uparrow, \downarrow\) spin pairs. Let’s perform this transformation and -store a list of these orbitals.

-
umat = edrixs.transform_utensor(umat_chb, edrixs.tmat_c2r('d', True))
-orbitals = ['3z^2-r^2', 'xz', 'yz', 'x^2-y^2', 'xy']
-
-
-
-
-

Interactions

-

Tensor \(U\) is a series of matrix -elements

-
-
-\[\begin{equation} -\langle\psi_{\gamma,\delta}^{\bar{\sigma},\bar{\sigma}^\prime} -|\hat{H}| -\psi_{\alpha,\beta}^{\sigma,\sigma^\prime}\rangle -\end{equation}\]
-
-

the combination of which defines the energetic cost of pairwise -electron-electron interactions between states \(\alpha,\sigma\) -and \(\beta,\sigma^\prime\). In EDRIXS we follow the convention of -summing over all orbital pairs. Some other texts count each pair of -indices only once. The matrix elements here will consequently -be half the magnitude of those in other references. -We can express the interactions in terms of -the orbitals involved. It is common to distinguish “direct Coulomb” and -“exchange” interactions. The former come from electrons in the same orbital -and the later involve swapping orbital labels for electrons. We will use -\(U_0\) and \(J\) as a shorthand for distinguishing these.

-

Before we describe the different types of interactions, we note that since -the Coulomb interaction is real, and due to the spin symmmetry properties -of the process \(U\) always obeys

-
-
-\[\begin{equation} -U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma} = -U_{\beta\sigma,\alpha\sigma^\prime,\delta\sigma^\prime,\gamma\sigma} = -U_{\delta\sigma,\gamma\sigma^\prime,\beta\sigma^\prime,\alpha\sigma} = -U_{\gamma\sigma,\delta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}. -\end{equation}\]
-
-
-

1. Intra orbital

-

The direct Coulomb energy cost to double-occupy an orbital comes from terms -like \(U_{\alpha\sigma,\alpha\bar\sigma,\alpha\bar\sigma,\alpha\sigma}\). -In this notation, we use \(\sigma^\prime\) to denote that the matrix -element is summed over all pairs and \(\bar{\sigma}\) to denote sums -over all opposite spin pairs. Due to rotational symmetry, all these -elements are the same and equal to

-
-
-\[\begin{split}\begin{eqnarray} -U_0 &=& \frac{A}{2} + 2B + \frac{3C}{2}\\ - &=& \frac{F_0}{2} + 2F_2 + 18F_4 -\end{eqnarray}\end{split}\]
-
-

Let’s print these to demonstrate where these live in the array

-
for i in range(0, 5):
-    val = umat[i*2, i*2 + 1, i*2 + 1, i*2].real
-    print(f"{orbitals[i]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         4.250
-xz               4.250
-yz               4.250
-x^2-y^2          4.250
-xy               4.250
-
-
-
-
-

2. Inter orbital Coulomb interactions

-

Direct Coulomb repulsion between different orbitals depends on terms like -\(U_{\alpha\sigma,\beta\sigma^\prime,\beta\sigma^\prime,\alpha\sigma}\). -Expresions for these parameters are provided in column \(U\) in -Table of 2 orbital interactions. We can print the values from umat -like this:

-
for i, j in itertools.combinations(range(5), 2):
-    val = umat[i*2, j*2 + 1, j*2 + 1, i*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz              3.650
-3z^2-r^2         yz              3.650
-3z^2-r^2         x^2-y^2         2.900
-3z^2-r^2         xy              2.900
-xz               yz              3.150
-xz               x^2-y^2         3.150
-xz               xy              3.150
-yz               x^2-y^2         3.150
-yz               xy              3.150
-x^2-y^2          xy              3.900
-
-
-
-
-

3. Inter-orbital exchange interactions

-

Exchange terms exist with the form -\(U_{\alpha\sigma,\beta\sigma^\prime,\alpha\sigma^\prime,\beta\sigma}\). -Expresions for these parameters are provided in column \(J\) of -Table of 2 orbital interactions. These come from terms like this in the matrix:

-
for i, j in itertools.combinations(range(5), 2):
-    val = umat[i*2, j*2 + 1, i*2 + 1, j*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz              0.300
-3z^2-r^2         yz              0.300
-3z^2-r^2         x^2-y^2         0.675
-3z^2-r^2         xy              0.675
-xz               yz              0.550
-xz               x^2-y^2         0.550
-xz               xy              0.550
-yz               x^2-y^2         0.550
-yz               xy              0.550
-x^2-y^2          xy              0.175
-
-
-
-
-

4. Pair hopping term

-

Terms that swap pairs of electrons exist as -\((1-\delta_{\sigma\sigma'})U_{\alpha\sigma,\alpha\bar\sigma,\beta\bar\sigma,\beta\sigma}\) -and depend on exchange interactions column \(J\) from -Table of 2 orbital interactions -and here in the matrix.

-
for i, j in itertools.combinations(range(5), 2):
-    val = umat[i*2, i*2 + 1, j*2 + 1, j*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz              0.300
-3z^2-r^2         yz              0.300
-3z^2-r^2         x^2-y^2         0.675
-3z^2-r^2         xy              0.675
-xz               yz              0.550
-xz               x^2-y^2         0.550
-xz               xy              0.550
-yz               x^2-y^2         0.550
-yz               xy              0.550
-x^2-y^2          xy              0.175
-
-
-
-
-

5. Three orbital

-

Another set of terms that one might not immediately anticipate involve three -orbitals like

-
-
-\[\begin{split}\begin{equation} -U_{\alpha\sigma, \gamma\sigma', \beta\sigma', \gamma\sigma} \\ -U_{\alpha\sigma, \gamma\sigma', \gamma\sigma', \beta\sigma} \\ -(1-\delta_{\sigma\sigma'}) -U_{\alpha\sigma, \beta\sigma', \gamma\sigma', \gamma\sigma} -\end{equation}\end{split}\]
-
-

for \(\alpha=3z^2-r^2, \beta=x^2-y^2, \gamma=xz/yz\). -These are needed to maintain the rotational symmetry of the interations. -See Table of 3 orbital interactions for the expressions. We can print some of -these via:

-
ijkl = [[0, 1, 3, 1],
-        [0, 2, 3, 2],
-        [1, 0, 3, 1],
-        [1, 1, 3, 0],
-        [2, 0, 3, 2],
-        [2, 2, 3, 0]]
-
-for i, j, k, l in ijkl:
-    val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t"
-          f"{orbitals[k]:<8} \t {orbitals[l]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz             x^2-y^2          xz              0.217
-3z^2-r^2         yz             x^2-y^2          yz              -0.217
-xz               3z^2-r^2       x^2-y^2          xz              -0.433
-xz               xz             x^2-y^2          3z^2-r^2        0.217
-yz               3z^2-r^2       x^2-y^2          yz              0.433
-yz               yz             x^2-y^2          3z^2-r^2        -0.217
-
-
-
-
-

6. Four orbital

-

Futher multi-orbital terms include -\(U_{\alpha\sigma,\beta\sigma^\prime,\gamma\sigma^\prime,\delta\sigma}\). -We can find these here in the matrix:

-
ijkl = [[0, 1, 2, 4],
-        [0, 1, 4, 2],
-        [0, 2, 1, 4],
-        [0, 2, 4, 1],
-        [0, 4, 1, 2],
-        [0, 4, 2, 1],
-        [3, 1, 4, 2],
-        [3, 2, 4, 1],
-        [3, 4, 1, 2],
-        [3, 4, 2, 1]]
-
-for i, j, k, l in ijkl:
-    val = umat[i*2, j*2 + 1, k*2 + 1, l*2].real
-    print(f"{orbitals[i]:<8} \t {orbitals[j]:<8} \t {orbitals[k]:<8}"
-          f"\t {orbitals[l]:<8} \t {val:.3f}")
-
-
-
3z^2-r^2         xz              yz              xy              -0.433
-3z^2-r^2         xz              xy              yz              0.217
-3z^2-r^2         yz              xz              xy              -0.433
-3z^2-r^2         yz              xy              xz              0.217
-3z^2-r^2         xy              xz              yz              0.217
-3z^2-r^2         xy              yz              xz              0.217
-x^2-y^2          xz              xy              yz              -0.375
-x^2-y^2          yz              xy              xz              0.375
-x^2-y^2          xy              xz              yz              -0.375
-x^2-y^2          xy              yz              xz              0.375
-
-
-
-
-
-

Effects of multi-orbital terms

-

To test the effects of the multi-orbital terms, let’s plot the eigenenergy -spectra with and without multi-orbital terms switched on for system with and -without a cubic crystal field. We will use a \(d\)-shell with two -electrons.

-
ten_dqs = [0, 2, 4, 12]
-
-def diagonalize(ten_dq, umat):
-    emat = edrixs.cb_op(edrixs.cf_cubic_d(ten_dq),
-                        edrixs.tmat_c2r('d', ispin=True))
-    H = (edrixs.build_opers(4, umat, basis)
-         + edrixs.build_opers(2, emat, basis))
-    e, v = scipy.linalg.eigh(H)
-    return e - e.min()
-
-basis = edrixs.get_fock_bin_by_N(10, 2)
-umat_no_multiorbital = np.copy(umat)
-B = F2/49 - 5*F4/441
-for val in [np.sqrt(3)*B/2, np.sqrt(3)*B, 3*B/2]:
-    umat_no_multiorbital[(np.abs(umat)- val) < 1e-6] = 0
-
-fig, axs = plt.subplots(1, len(ten_dqs), figsize=(8, 3))
-
-for cind, (ax, ten_dq) in enumerate(zip(axs, ten_dqs)):
-    ax.hlines(diagonalize(ten_dq, umat), xmin=0, xmax=1,
-              label='on', color=f'C{cind}')
-    ax.hlines(diagonalize(ten_dq, umat_no_multiorbital),
-              xmin=1.5, xmax=2.5,
-              label='off',
-              linestyle=':', color=f'C{cind}')
-    ax.set_title(f"$10D_q={ten_dq}$")
-    ax.set_ylim([-.5, 20])
-    ax.set_xticks([])
-    ax.legend()
-
-fig.suptitle("Eigenvalues with 3&4-orbital effects on/off")
-fig.subplots_adjust(wspace=.3)
-axs[0].set_ylabel('Eigenvalues (eV)')
-fig.subplots_adjust(top=.8)
-plt.show()
-
-
-Eigenvalues with 3&4-orbital effects on/off, $10D_q=0$, $10D_q=2$, $10D_q=4$, $10D_q=12$

On the left of the plot Coulomb interactions in spherical symmetry cause -substantial mxing between \(t_{2g}\) and \(e_{g}\) orbitals in the -eigenstates and 3 & 4 orbital orbital terms are crucial for obtaining the -the right eigenenergies. As \(10D_q\) get large, this mixing is switched -off and the spectra start to become independent of whether the 3 & 4 orbital -orbital terms are included or not.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of 2 orbital interactions

Orbitals \(\alpha,\beta\)

\(U_0\) Racah

\(U_0\) Slater

\(J\) Racah

\(J\) Slater

\(3z^2-r^2, xz\)

\(A/2+B+C/2\)

\(F_0/2+F_2-12F_4\)

\(B/2+C/2\)

\(F_2/2+15F_4\)

\(3z^2-r^2, yz\)

\(A/2+B+C/2\)

\(F_0/2+F_2-12F_4\)

\(B/2+C/2\)

\(F_2/2+15F_4\)

\(3z^2-r^2, x^2-y^2\)

\(A/2-2B+C/2\)

\(F_0/2-2F_2+3F_4\)

\(2B+C/2\)

\(2F_2+15F_4/2\)

\(3z^2-r^2, xy\)

\(A/2-2B+C/2\)

\(F_0/2-2F_2+3F_4\)

\(2B+C/2\)

\(2F_2+15F_4/2\)

\(xz, yz\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(xz, x^2-y^2\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(xz, xy\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(yz, x^2-y^2\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(yz, xy\)

\(A/2-B+C/2\)

\(F_0/2-F_2-12F_4\)

\(3B/2+C/2\)

\(3F_2/2+10F_4\)

\(x^2-y^2, xy\)

\(A/2+2B+C/2\)

\(F_0+4F_2-34F_4\)

\(C/2\)

\(35F_4/2\)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of 3 orbital interactions

Orbitals \(\alpha,\beta,\gamma,\delta\)

\(\langle\alpha\beta|\gamma\delta\rangle\) Racah

\(\langle\alpha\beta|\gamma\delta\rangle\) Slater

\(3z^2-r^2, xz, x^2-y^2, xz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, yz, x^2-y^2, yz\)

\(-\sqrt{3}B/2\)

\(-\sqrt{3}F_2/2+5\sqrt{3}F_4/2\)

\(xz, 3z^2-r^2, x^2-y^2, xz\)

\(-\sqrt{3}B\)

\(-\sqrt{3}F_2+5\sqrt{3}F_4\)

\(xz, xz, x^2-y^2, 3z^2-r^2\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(yz, 3z^2-r^2, x^2-y^2, yz\)

\(\sqrt{3}B\)

\(\sqrt{3}F_2-5\sqrt{3}F_4\)

\(yz, yz, x^2-y^2, 3z^2-r^2\)

\(-\sqrt{3}B/2\)

\(-\sqrt{3}F_2/2+5\sqrt{3}F_4/2\)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of 4 orbital interactions

Orbitals \(\alpha,\beta,\gamma,\delta\)

\(\langle\alpha\beta|\gamma\delta\rangle\) Racah

\(\langle\alpha\beta|\gamma\delta\rangle\) Slater

\(3z^2-r^2, xz, yz, xy\)

\(-\sqrt{3}B\)

\(-\sqrt{3}F_2+5\sqrt{3}F_4\)

\(3z^2-r^2, xz, xy, yz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, yz, xz, xy\)

\(-\sqrt{3}B\)

\(-\sqrt{3}F_2+5\sqrt{3}F_4\)

\(3z^2-r^2, yz, xy, xz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, xy, xz, yz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(3z^2-r^2, xy, yz, xz\)

\(\sqrt{3}B/2\)

\(\sqrt{3}F_2/2-5\sqrt{3}F_4/2\)

\(x^2-y^2 , xz, xy, yz\)

\(-3B/2\)

\(-3F_2/2+15F_4/2\)

\(x^2-y^2 , yz, xy, xz\)

\(3B/2\)

\(3F_2/2-15F_4/2\)

\(x^2-y^2 , xy, xz, yz\)

\(-3B/2\)

\(-3F_2/2+15F_4/2\)

\(x^2-y^2 , xy, yz, xz\)

\(3B/2\)

\(3F_2/2-15F_4/2\)

-

Footnotes

- -

Total running time of the script: (0 minutes 0.368 seconds)

- -

Gallery generated by Sphinx-Gallery

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/index.html b/edrixs/auto_examples/index.html deleted file mode 100644 index 1ba451939e..0000000000 --- a/edrixs/auto_examples/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - Pedagogical examples — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Pedagogical examples

-

Below are some examples illustrating the concepts behind and usage of EDRIXS.

-
-

Exact diagonalization

-
Exact diagonalization
-
-

Crystal fields

-
Crystal fields
-
-

RIXS calculations for an atomic model

-
RIXS calculations for an atomic model
-
-

Anderson impurity model for NiO XAS

-
Anderson impurity model for NiO XAS
-
-

Ground state analysis for NiO

-
Ground state analysis for NiO
-
-

Charge-transfer energy for NiO

-
Charge-transfer energy for NiO
-
-

Hubbard Dimer

-
Hubbard Dimer
-
-

X-ray transitions

-
X-ray transitions
-
-

Hund’s Interactions in charge transfer insulators

-
Hund's Interactions in charge transfer insulators
-
-

Coulomb interactions

-
Coulomb interactions
-
-
- -

Gallery generated by Sphinx-Gallery

-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/auto_examples/sg_execution_times.html b/edrixs/auto_examples/sg_execution_times.html deleted file mode 100644 index 2a7859fa0c..0000000000 --- a/edrixs/auto_examples/sg_execution_times.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - Computation times — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Computation times

-

00:07.932 total execution time for 10 files from auto_examples:

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Example

Time

Mem (MB)

RIXS calculations for an atomic model (example_2_single_atom_RIXS.py)

00:03.985

0.0

Hund’s Interactions in charge transfer insulators (example_8_Hunds_interactions.py)

00:01.236

0.0

Anderson impurity model for NiO XAS (example_3_AIM_XAS.py)

00:00.548

0.0

X-ray transitions (example_7_transitions.py)

00:00.514

0.0

Charge-transfer energy for NiO (example_5_charge_transfer.py)

00:00.478

0.0

Ground state analysis for NiO (example_4_GS_analysis.py)

00:00.421

0.0

Coulomb interactions (example_9_Coulomb.py)

00:00.368

0.0

Crystal fields (example_1_crystal_field.py)

00:00.149

0.0

Exact diagonalization (example_0_ed_calculator.py)

00:00.138

0.0

Hubbard Dimer (example_6_Hubbard_dimer.py)

00:00.095

0.0

-
-
- - -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/genindex.html b/edrixs/genindex.html deleted file mode 100644 index cb5a7ddf4c..0000000000 --- a/edrixs/genindex.html +++ /dev/null @@ -1,675 +0,0 @@ - - - - - - - - Index — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
-
    -
  • - -
  • -
  • -
-
-
-
-
- - -

Index

- -
- A - | B - | C - | D - | E - | F - | G - | H - | I - | K - | L - | M - | O - | P - | Q - | R - | S - | T - | U - | W - | X - | Z - -
-

A

- - -
- -

B

- - - -
- -

C

- - - -
- -

D

- - - -
- -

E

- - - -
- -

F

- - - -
- -

G

- - - -
- -

H

- - -
- -

I

- - -
- -

K

- - - -
- -

L

- - - -
- -

M

- - -
- -

O

- - -
- -

P

- - - -
- -

Q

- - -
- -

R

- - - -
- -

S

- - - -
- -

T

- - - -
- -

U

- - - -
- -

W

- - - -
- -

X

- - - -
- -

Z

- - -
- - - -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/index.html b/edrixs/index.html deleted file mode 100644 index 35008a138b..0000000000 --- a/edrixs/index.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - edrixs Documentation — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/edrixs/objects.inv b/edrixs/objects.inv deleted file mode 100644 index cc1ddd1ed8..0000000000 Binary files a/edrixs/objects.inv and /dev/null differ diff --git a/edrixs/py-modindex.html b/edrixs/py-modindex.html deleted file mode 100644 index d95ae94062..0000000000 --- a/edrixs/py-modindex.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - Python Module Index — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
-
    -
  • - -
  • -
  • -
-
-
-
-
- - -

Python Module Index

- -
- e -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- e
- edrixs -
    - edrixs.angular_momentum -
    - edrixs.basis_transform -
    - edrixs.coulomb_utensor -
    - edrixs.fit_hyb -
    - edrixs.fock_basis -
    - edrixs.iostream -
    - edrixs.manybody_operator -
    - edrixs.photon_transition -
    - edrixs.plot_spectrum -
    - edrixs.rixs_utils -
    - edrixs.soc -
    - edrixs.solvers -
    - edrixs.utils -
    - edrixs.wannier_ham -
- - -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/pyplots/helloworld.hires.png b/edrixs/pyplots/helloworld.hires.png deleted file mode 100644 index 5d0b99906b..0000000000 Binary files a/edrixs/pyplots/helloworld.hires.png and /dev/null differ diff --git a/edrixs/pyplots/helloworld.pdf b/edrixs/pyplots/helloworld.pdf deleted file mode 100644 index 7a3685d864..0000000000 Binary files a/edrixs/pyplots/helloworld.pdf and /dev/null differ diff --git a/edrixs/pyplots/helloworld.png b/edrixs/pyplots/helloworld.png deleted file mode 100644 index 851537f7d8..0000000000 Binary files a/edrixs/pyplots/helloworld.png and /dev/null differ diff --git a/edrixs/pyplots/helloworld.py b/edrixs/pyplots/helloworld.py deleted file mode 100644 index 7eb3ecd6b9..0000000000 --- a/edrixs/pyplots/helloworld.py +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env python - -import numpy as np -import matplotlib.pyplot as plt -import matplotlib as mpl -import edrixs - -# Setup parameters -# ---------------- -# Number of occupancy of 3d shell -noccu = 8 - -res = edrixs.get_atom_data('Ni', v_name='3d', v_noccu=noccu, edge='L23') -name_i, slat_i = [list(i) for i in zip(*res['slater_i'])] -name_n, slat_n = [list(i) for i in zip(*res['slater_n'])] - -# Slater integrals for initial Hamiltonian without core-hole -si = edrixs.rescale(slat_i, ([1, 2], [0.65]*2)) -si[0] = edrixs.get_F0('d', si[1], si[2]) # F0_dd - -# Slater integrals for intermediate Hamiltonian with core-hole -sn = edrixs.rescale(slat_n, ([1, 2, 4, 5, 6], [0.65, 0.65, 0.95, 0.7, 0.7])) -sn[0] = edrixs.get_F0('d', sn[1], sn[2]) # F0_dd -sn[3] = edrixs.get_F0('dp', sn[5], sn[6]) # F0_dp - -slater = (si, sn) - -# Spin-orbit coupling strengths -zeta_d_i = res['v_soc_i'][0] # valence 3d electron without core-hole -zeta_d_n = res['v_soc_n'][0] # valence 3d electron with core-hole -# E_{L2} - E_{L3} = 1.5 * zeta_p -zeta_p_n = (res['edge_ene'][0] - res['edge_ene'][1]) / 1.5 # core 2p electron - -# Tetragonal crystal field -cf = edrixs.cf_tetragonal_d(ten_dq=1.3, d1=0.05, d3=0.2) - -# Level shift of the core shell -off = 857.4 - -# Life time broadening -gamma_c = res['gamma_c'][1] # core hole -gamma_f = 0.1 # final states - -# Incident, scattered, azimuthal angles -# See Figure 1 of Y. Wang et al., -# `Computer Physics Communications 243, 151-165 (2019) -# `_ -# for the defintion of the scattering angles. -thin, thout, phi = 15 / 180.0 * np.pi, 75 / 180.0 * np.pi, 0.0 - -# Polarization types -poltype_xas = [('isotropic', 0.0)] # for XAS -poltype_rixs = [('linear', 0, 'linear', 0), ('linear', 0, 'linear', np.pi/2.0)] # for RIXS - -# Energy grid -ominc_xas = np.linspace(off - 10, off + 20, 1000) # for XAS -ominc_rixs_L3 = np.linspace(-5.9 + off, -0.9 + off, 100) # incident energy at L3 edge -ominc_rixs_L2 = np.linspace(10.4 + off, 14.9 + off, 100) # incident energy at L3 edge -eloss = np.linspace(-0.5, 5.0, 1000) # energy loss for RIXS - -# Run ED -eval_i, eval_n, trans_op = edrixs.ed_1v1c_py( - ('d', 'p'), shell_level=(0.0, -off), v_soc=(zeta_d_i, zeta_d_n), - c_soc=zeta_p_n, v_noccu=noccu, slater=slater, v_cfmat=cf -) - -# Run XAS -xas = edrixs.xas_1v1c_py( - eval_i, eval_n, trans_op, ominc_xas, gamma_c=gamma_c, thin=thin, phi=phi, - pol_type=poltype_xas, gs_list=[0, 1, 2], temperature=300 -) - -# Run RIXS at L3 edge -rixs_L3 = edrixs.rixs_1v1c_py( - eval_i, eval_n, trans_op, ominc_rixs_L3, eloss, gamma_c=gamma_c, gamma_f=gamma_f, - thin=thin, thout=thout, phi=phi, pol_type=poltype_rixs, gs_list=[0, 1, 2], - temperature=300 -) - -# Run RIXS at L2 edge -rixs_L2 = edrixs.rixs_1v1c_py( - eval_i, eval_n, trans_op, ominc_rixs_L2, eloss, gamma_c=gamma_c, gamma_f=gamma_f, - thin=thin, thout=thout, phi=phi, pol_type=poltype_rixs, gs_list=[0, 1, 2], - temperature=300 -) - -# Plot -fig = plt.figure(figsize=(16, 14)) -mpl.rcParams['font.size'] = 20 - -ax1 = plt.subplot(2, 2, 1) -plt.grid() -plt.plot(range(len(eval_i)), eval_i - min(eval_i), '-o') -plt.xlabel(r'Multiplets') -plt.ylabel(r'Energy (eV)') -plt.title(r'(a) Energy of multiplets') - -ax2 = plt.subplot(2, 2, 2) -plt.grid() -plt.plot(ominc_xas, xas[:, 0], '-') -plt.xlabel(r'Incident Energy (eV)') -plt.ylabel(r'XAS Intensity (a.u.)') -plt.title(r'(b) Isotropic XAS') - -ax3 = plt.subplot(2, 2, 3) -plt.imshow(np.sum(rixs_L3, axis=2), - extent=[min(eloss), max(eloss), min(ominc_rixs_L3), max(ominc_rixs_L3)], - origin='lower', aspect='auto', cmap='rainbow', interpolation='gaussian') -plt.xlabel(r'Energy loss (eV)') -plt.ylabel(r'Incident Energy (eV)') -plt.title(r'(c) RIXS map at $L_3$ edge (LH)') - -ax4 = plt.subplot(2, 2, 4) -plt.imshow(np.sum(rixs_L2, axis=2), - extent=[min(eloss), max(eloss), min(ominc_rixs_L2), max(ominc_rixs_L2)], - origin='lower', aspect='auto', cmap='rainbow', interpolation='gaussian') -plt.xlabel(r'Energy loss (eV)') -plt.ylabel(r'Incident Energy (eV)') -plt.title(r'(d) RIXS map at $L_2$ edge (LH)') - -plt.subplots_adjust(left=0.1, right=0.9, bottom=0.1, top=0.9, wspace=0.2, hspace=0.3) -plt.show() diff --git a/edrixs/reference/angular_momentum.html b/edrixs/reference/angular_momentum.html deleted file mode 100644 index 335f775395..0000000000 --- a/edrixs/reference/angular_momentum.html +++ /dev/null @@ -1,702 +0,0 @@ - - - - - - - - - angular_momentum — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

angular_momentum

-
-
-edrixs.angular_momentum.cf_cubic_d(ten_dq)[source]
-

Given 10Dq, return cubic crystal field matrix for d orbitals -in the complex harmonics basis.

-
-
Parameters:
-
-
ten_dq: float scalar

The splitting between \(eg\) and \(t2g\) orbitals.

-
-
-
-
Returns:
-
-
cf: 2d complex array, shape=(10, 10)

The matrix form of crystal field Hamiltonian in complex harmonics basis.

-
-
-
-
-
- -
-
-edrixs.angular_momentum.cf_square_planar_d(ten_dq, ds)[source]
-

Given 10Dq, ds, return square planar crystal field matrix for d orbitals -in the complex harmonics basis. This is the limit of strong tetragonal -distortion with two axial ligands at infinity. Note that in this case the -three parameters, ten_dq, ds, and dt, are no longer independent: -dt = 2/35*ten_dq and the levels depend on only two parameters -ten_dq and ds.

-
-
Parameters:
-
-
ten_dq: float scalar

Parameter associated with eg-t2g splitting.

-
-
ds: float scalar

Paramter associated with splitting orbitals with -z-components.

-
-
-
-
Returns:
-
-
cf: 2d complex array, shape=(10, 10)

The matrix form of crystal field Hamiltonian in complex harmonics basis.

-
-
-
-
-
- -
-
-edrixs.angular_momentum.cf_tetragonal_d(ten_dq, d1, d3)[source]
-

Given 10Dq, d1, d3, return tetragonal crystal field matrix for d orbitals -in the complex harmonics basis.

-
-
Parameters:
-
-
ten_dq: float scalar

Parameter used to label cubic crystal splitting.

-
-
d1: float scalar

Paramter used to label tetragonal splitting.

-
-
d3: float scalar

Paramter used to label tetragonal splitting.

-
-
-
-
Returns:
-
-
cf: 2d complex array, shape=(10, 10)

The matrix form of crystal field Hamiltonian in complex harmonics basis.

-
-
-
-
-
- -
-
-edrixs.angular_momentum.cf_trigonal_t2g(delta)[source]
-

Given delta, return trigonal crystal field matrix for t2g orbitals -in the complex harmonics basis.

-
-
Parameters:
-
-
delta: float scalar

Parameter used to label trigonal crystal splitting.

-
-
-
-
Returns:
-
-
cf: 2d complex array, shape=(6, 6)

The matrix form of crystal field Hamiltonian in complex harmonics basis.

-
-
-
-
-
- -
-
-edrixs.angular_momentum.dmat_spinor(alpha, beta, gamma)[source]
-

Given three Euler angle: \(\alpha, \beta, \gamma\), -return the transformation -matrix for \(\frac{1}{2}\)-spinor.

-
-
Parameters:
-
-
alpha: float

Euler angle \(\alpha\) in radian [0, \(2\pi\)].

-
-
beta: float

Euler angle \(\beta\) in radian [0, \(\pi\)].

-
-
gamma: float

Euler angle \(\gamma\) in radian [0, \(2\pi\)].

-
-
-
-
Returns:
-
-
dmat: 2d complex array

The \(2 \times 2\) transformation matrix.

-
-
-
-
-
- -
-
-edrixs.angular_momentum.euler_to_rmat(alpha, beta, gamma)[source]
-

Given Euler angle: \(\alpha, \beta, \gamma\), -generate the \(3 \times 3\) rotational matrix \(R\).

-
-
Parameters:
-
-
alpha: float

Euler angle, in radian, [0, \(2\pi\)]

-
-
beta: float

Euler angle, in radian, [0, \(\pi\)]

-
-
gamma: float

Euler angle, in radian, [0, \(2\pi\)]

-
-
-
-
Returns:
-
-
rmat: 2d float array

The \(3 \times 3\) rotational matrix.

-
-
-
-
-
- -
-
-edrixs.angular_momentum.get_ladd(ll, ispin=False)[source]
-

Get the matrix form of the raising operator \(l^+\) in the -complex spherical harmonics basis

-
-\[l^+|ll,m> = \sqrt{(ll-m)(ll+m+1)} |ll,m+1>\]
-
-
Parameters:
-
-
ll: int

Orbital angular momentum number.

-
-
ispin: logical

Whether including spin or not (default: False).

-
-
-
-
Returns:
-
-
ladd: 2d complex array

The matrix form of \(l^+\).

-

If ispin=True, the dimension will be \(2(2ll+1) \times 2(2ll+1)\),

-

otherwise, it will be \((2ll+1) \times (2ll+1)\).

-
-
-
-
-
- -
-
-edrixs.angular_momentum.get_lminus(ll, ispin=False)[source]
-

Get the matrix form of the lowering operator \(l^-\) in the -complex spherical harmonics basis

-
-\[l^-|ll,m> = \sqrt{(ll+m)(ll-m+1)} |ll,m-1>\]
-
-
Parameters:
-
-
ll: int

Orbital angular momentum number.

-
-
ispin: logical

Whether including spin or not (default: False).

-
-
-
-
Returns:
-
-
lminus: 2d complex array

The matrix form of \(l^-\).

-

If ispin=True, the dimension will be \(2(2ll+1) \times 2(2ll+1)\),

-

otherwise, it will be \((2ll+1) \times (2ll+1)\).

-
-
-
-
-
- -
-
-edrixs.angular_momentum.get_lx(ll, ispin=False)[source]
-

Get the matrix form of the orbital angular momentum -operator \(l_x\) in the complex spherical harmonics basis,

-
-\[l_x = \frac{1}{2} (l^+ + l^-)\]
-
-
Parameters:
-
-
ll: int

Orbital angular momentum number.

-
-
ispin: logical

Whether including spin or not (default: False).

-
-
-
-
Returns:
-
-
lx: 2d complex array

The matrix form of \(l_x\).

-

If ispin=True, the dimension will be \(2(2ll+1) \times 2(2ll+1)\),

-

otherwise, it will be \((2ll+1) \times (2ll+1)\).

-
-
-
-
-
- -
-
-edrixs.angular_momentum.get_ly(ll, ispin=False)[source]
-

Get the matrix form of the orbital angular momentum -operator \(l_y\) in the complex spherical harmonics basis,

-
-\[l_y = \frac{-i}{2} (l^+ - l^-)\]
-
-
Parameters:
-
-
ll: int

Orbital angular momentum number.

-
-
ispin: logical

Whether including spin or not (default: False).

-
-
-
-
Returns:
-
-
ly: 2d complex array

The matrix form of \(l_y\).

-

If ispin=True, the dimension will be \(2(2ll+1) \times 2(2ll+1)\),

-

otherwise, it will be \((2ll+1) \times (2ll+1)\).

-
-
-
-
-
- -
-
-edrixs.angular_momentum.get_lz(ll, ispin=False)[source]
-

Get the matrix form of the orbital angular momentum -operator \(l_z\) in the complex spherical harmonics basis.

-
-
Parameters:
-
-
ll: int

Orbital angular momentum number.

-
-
ispin: logical

Whether including spin or not (default: False).

-
-
-
-
Returns:
-
-
lz: 2d complex array

The matrix form of \(l_z\).

-

If ispin=True, the dimension will be \(2(2ll+1) \times 2(2ll+1)\),

-

otherwise, it will be \((2ll+1) \times (2ll+1)\).

-
-
-
-
-
- -
-
-edrixs.angular_momentum.get_orb_momentum(ll, ispin=False)[source]
-

Get the matrix form of the orbital angular momentum -operator \(l_x, l_y, l_z\) in the complex spherical harmonics basis.

-
-
Parameters:
-
-
ll: int

Orbital angular momentum number.

-
-
ispin: logical

Whether including spin or not (default: False).

-
-
-
-
Returns:
-
-
res: 3d complex array

The matrix form of

-
    -
  • res[0]: \(l_x\)

  • -
  • res[1]: \(l_y\)

  • -
  • res[2]: \(l_z\)

  • -
-

If ispin=True, the dimension will be \(3 \times 2(2ll+1) \times 2(2ll+1)\),

-

otherwise, it will be \(3 \times (2ll+1) \times (2ll+1)\).

-
-
-
-
-
- -
-
-edrixs.angular_momentum.get_pauli()[source]
-

Get the Pauli matrix

-
-
Returns:
-
-
sigma: 3d complex array, shape=(3, 2, 2)
    -
  • sigma[0] is \(\sigma_x\),

  • -
  • sigma[1] is \(\sigma_y\),

  • -
  • sigma[2] is \(\sigma_z\),

  • -
-
-
-
-
-
- -
-
-edrixs.angular_momentum.get_spin_momentum(ll)[source]
-

Get the matrix form of the spin angular momentum -operator \(s_x, s_y, s_z\) in the complex spherical harmonics basis.

-
-
Parameters:
-
-
ll: int

Orbital angular momentum number.

-
-
-
-
Returns:
-
-
res: 3d complex array

The matrix form of

-
    -
  • res[0]: \(s_x\)

  • -
  • res[1]: \(s_y\)

  • -
  • res[2]: \(s_z\)

  • -
-

the dimension is \(3 \times 2(2ll+1) \times 2(2ll+1)\),

-

Orbital order is: |-ll,up>, |-ll,down>, …, -|+ll, up>, |+ll,down>

-
-
-
-
-
- -
-
-edrixs.angular_momentum.get_sx(ll)[source]
-

Get the matrix form of spin angular momentum operator \(s_x\) in the -complex spherical harmonics basis.

-
-
Parameters:
-
-
ll: int

Quantum number of orbital angular momentum.

-
-
-
-
Returns:
-
-
sx: 2d complex array.

Matrix form of \(s_x\), the dimension -is \(2(2ll+1) \times 2(2ll+1)\),

-

Orbital order is: |-ll,up>, |-ll,down>, …, -|+ll, up>, |+ll,down>.

-
-
-
-
-
- -
-
-edrixs.angular_momentum.get_sy(ll)[source]
-

Get the matrix form of spin angular momentum operator \(s_y\) in the -complex spherical harmonics basis.

-
-
Parameters:
-
-
ll: int

Quantum number of orbital angular momentum.

-
-
-
-
Returns:
-
-
sy: 2d complex array.

Matrix form of \(s_y\), the dimension -is \(2(2ll+1) \times 2(2ll+1)\), spin order is:

-

Orbital order is: |-ll,up>, |-ll,down>, …, -|+ll, up>, |+ll,down>

-
-
-
-
-
- -
-
-edrixs.angular_momentum.get_sz(ll)[source]
-

Get the matrix form of spin angular momentum operator \(s_z\) in the -complex spherical harmonics basis.

-
-
Parameters:
-
-
ll: int

Quantum number of orbital angular momentum.

-
-
-
-
Returns:
-
-
sz: 2d complex array.

Matrix form of \(s_z\), the dimension -is \(2(2ll+1) \times 2(2ll+1)\).

-

Orbital order is: |-ll,up>, |-ll,down>, …, -|+ll, up>, |+ll,down>

-
-
-
-
-
- -
-
-edrixs.angular_momentum.get_wigner_dmat(quant_2j, alpha, beta, gamma)[source]
-

Given quantum number and Euler angles, return the Wigner-D matrix.

-
-
Parameters:
-
-
quant_2j: int

Twice of the quantum number j: 2j, for example, quant_2j=1 means j=1/2, -quant_2j=2 means j=1

-
-
alpha: float number

The first Euler angle \(\alpha\) in radian [0, \(2\pi\)].

-
-
beta: float number

The second Euler angle \(\beta\) in radian [0, \(\pi\)].

-
-
gamma: float number

The third Euler angle \(\gamma\) in radian [0, \(2\pi\)].

-
-
-
-
Returns:
-
-
result: 2d complex array, shape(quant_2j+1, quant_2j+1)

The Wigner D-matrix. -For \(j=1/2\), the orbital order is: +1/2 (spin up), -1/2 (spin down). -For \(j>1/2\), the orbital order is: \(-j, -j+1, ..., +j\)

-
-
-
-
-

Examples

-
>>> import edrixs
-spin-1/2 D-matrix
->>> edrixs.get_wigner_dmat(1, 1, 2, 3)
-array([[-0.224845-0.491295j, -0.454649-0.708073j],
-       [ 0.454649-0.708073j, -0.224845+0.491295j]])
-j=1 D-matrix
->>> edrixs.get_wigner_dmat(2, 1, 2, 3)
-array([[-0.190816-0.220931j,  0.347398+0.541041j, -0.294663-0.643849j],
-       [ 0.636536-0.090736j, -0.416147+0.j      , -0.636536-0.090736j],
-       [-0.294663+0.643849j, -0.347398+0.541041j, -0.190816+0.220931j]])
-
-
-
- -
-
-edrixs.angular_momentum.rmat_to_euler(rmat)[source]
-

Given the \(3 \times 3\) rotational matrix \(R\), return the Euler -angles: \(\alpha, \beta, \gamma\).

-
-
Parameters:
-
-
rmat: 2d float array

The \(3 \times 3\) rotational matrix \(R\).

-
-
-
-
Returns:
-
-
alpha: float

Euler angle \(\alpha\) in radian, [0, \(2\pi\)].

-
-
beta: float

Euler angle \(\beta\) in radian, [0, \(\pi\)].

-
-
gamma: float

Euler angle \(\gamma\) in radian, [0, \(2\pi\)]

-
-
-
-
-
- -
-
-edrixs.angular_momentum.where_is_angle(sina, cosa)[source]
-

Given sine and cosine of an angle \(\alpha\), return the -angle \(\alpha\) range from [0, \(2\pi\)].

-
-
Parameters:
-
-
sina: float

\(\sin(\alpha)\).

-
-
cosa: float

\(\cos(\alpha)\).

-
-
-
-
Returns:
-
-
alpha: float

The angle \(\alpha\) in radian [0, \(2\pi\)].

-
-
-
-
-
- -
-
-edrixs.angular_momentum.zx_to_rmat(z, x)[source]
-

Given \(z\) vector and \(x\) vector, calculate \(y\) vector -which satisfies the right-hand Cartesian coordinate and normalize them to -unit if needed, and then return the \(3 \times 3\) -rotational matrix \(R\).

-
-
Parameters:
-
-
z: 1d float array

The \(z\) vector.

-
-
x: 1d float array

The \(x\) vector.

-
-
-
-
Returns:
-
-
rmat: 2d float array

The \(3 \times 3\) rotational matrix \(R\).

-
-
-
-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/basis_transform.html b/edrixs/reference/basis_transform.html deleted file mode 100644 index 45a7edcd49..0000000000 --- a/edrixs/reference/basis_transform.html +++ /dev/null @@ -1,400 +0,0 @@ - - - - - - - - - basis_transform — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

basis_transform

-
-
-edrixs.basis_transform.cb_op(oper_O, TL, TR=None)[source]
-

Change the basis of an operator \(\hat{O}\).

-
-\[O^{\prime} = (T_L)^{\dagger} O (T_R),\]
-
-
Parameters:
-
-
oper_O: array-like

At least 2-dimension, the last 2-dimension is the dimension of the -matrix form of operator \(\hat{O}\) in basis \(A\). -For example:

-
    -
  • oper_O.shape = (3, 10, 10), means 3 operators with dimension \(10 \times 10\)

  • -
  • oper_O.shape = (2, 3, 10, 10), means \(2 \times 3=6\) operators with -dimension \(10 \times 10\)

  • -
-
-
TL: 2d array

The unitary transformation matrix from basis \(A\) to -basis \(B\), namely,

-

\(TL_{ij} = <\psi^{A}_{i}|\phi^{B}_{j}>\).

-
-
TR: 2d array

The unitary transformation matrix from basis \(A\) to -basis \(B\), namely,

-

\(TR_{ij} = <\psi^{A}_{i}|\phi^{B}_{j}>\).

-

if TR = None, TR = TL

-
-
-
-
Returns:
-
-
res: same shape as oper_O

The matrices form of operators \(\hat{O}\) in new basis.

-
-
-
-
-
- -
-
-edrixs.basis_transform.cb_op2(oper_O, TL, TR)[source]
-

Change the basis of an operator \(\hat{O}\).

-
-\[O^{\prime} = (T_L)^{\dagger} O (T_R),\]
-
-
Parameters:
-
-
oper_O: array-like

At least 2-dimension, the last 2-dimension is the dimension of the -matrix form of operator \(\hat{O}\) in basis \(A\). -For example:

-
    -
  • oper_O.shape = (3, 10, 10), means 3 operatos with dimension \(10 \times 10\)

  • -
  • oper_O.shape = (2, 3, 10, 10), means \(2 \times 3=6\) operators with -dimension \(10 \times 10\)

  • -
-
-
TL: 2d array

The unitary transformation matrix applied on the left.

-
-
TR: 2d array

The unitary transformation matrix applied on the right.

-
-
-
-
Returns:
-
-
res: same shape as oper_O

The matrices form of operators \(\hat{O}\) in new basis.

-
-
-
-
-
- -
-
-edrixs.basis_transform.fourier_hr2hk(norbs, nkpt, kvec, nrpt, rvec, deg_rpt, hr)[source]
-

Fourier transform a tight-binding Hamiltonian \(H(r)\) from -real space to \(k\) space \(H(k)\), -for Wannier90.

-
-
Parameters:
-
-
norbs: int

Number of orbitals.

-
-
nkpt: int

Number of \(k\)-points.

-
-
kvec: 2d float array

Fractional coordinate for k-points.

-
-
nrpt: int

Number of r-points.

-
-
rvec: 2d float array

Fractional coordinate for r-points.

-
-
deg_rpt: int

The degenerancy for each r-point.

-
-
hr: 3d complex array

Hamiltonian in r-space.

-
-
-
-
Returns:
-
-
hk: 3d complex array

Hamiltonian in k-space.

-
-
-
-
-
- -
-
-edrixs.basis_transform.tmat_c2j(orb_l)[source]
-

Get the transformation matrix from the complex spherical harmonics to -the \(|j^2,j_z>\) basis in which the spin-oribt coupling Hamiltonian -is diagonal. The orbital order is:

-

\(|j=l-1/2, -j>, |j=l-1/2, -j+1>, ... |j=l-1/2, +j>,\)

-

\(|j=l+1/2, -j>, |j=l+1/2, -j+1>, ..., |j=l+1/2, +j>\).

-
-
Parameters:
-
-
orb_l: int

Quantum number of orbital angular momentum.

-
-
-
-
Returns:
-
-
t_c2j: 2d complex array

The transformation matrix.

-
-
-
-
-
- -
-
-edrixs.basis_transform.tmat_c2r(case, ispin=False)[source]
-

Get the unitary transformation matrix from the basis of complex -spherical harmonics to real spherical harmonics.

-
-
Parameters:
-
-
case: string

Label for different systems.

-
    -
  • ‘p’: for \(p\)-shell

  • -
  • ‘t2g’: for \(t_{2g}\)-shell

  • -
  • ‘d’: for \(d\)-shell

  • -
  • ‘f’: for \(f\)-shell

  • -
-
-
ispin: logical

Whether including spin degree of freedom or not (default: False).

-
-
-
-
Returns:
-
-
t_c2r: 2d complex array

The transformation matrix.

-
-
-
-
-
- -
-
-edrixs.basis_transform.tmat_cub2r_f(ispin=False)[source]
-

Get the transformation matrix from the cubic spherical harmonics to -real spherical harmonics, only for \(f\) system.

-
-
Parameters:
-
-
ispin: logical

Whether including spin degree of freedom or not (default: False).

-
-
-
-
Returns:
-
-
t_cub2r: 2d complex array

The transformation matrix.

-
-
-
-
-
- -
-
-edrixs.basis_transform.tmat_r2c(case, ispin=False)[source]
-

Get the unitary transformation matrix from the basis of real -spherical harmonics to complex spherical harmonics.

-
-
Parameters:
-
-
case: string

Label for different systems.

-
    -
  • ‘p’: for \(p\)-shell

  • -
  • ‘t2g’: for \(t_{2g}\)-shell

  • -
  • ‘d’: for \(d\)-shell

  • -
  • ‘f’: for \(f\)-shell

  • -
-
-
ispin: logical

Whether including spin degree of freedom or not (default: False).

-
-
-
-
Returns:
-
-
t_r2c: 2d complex array

The transformation matrix.

-
-
-
-
-
- -
-
-edrixs.basis_transform.tmat_r2cub_f(ispin=False)[source]
-

Get the transformation matrix from real spherical harmonics to the -cubic spherical harmonics that is the representation of the cubic -point group, only for \(f\) system.

-
-
Parameters:
-
-
ispin: logical

Whether including spin degree of freedom or not (default: False).

-
-
-
-
Returns:
-
-
t_r2cub: 2d complex array

The transformation matrix.

-
-
-
-
-
- -
-
-edrixs.basis_transform.transform_utensor(umat, tmat)[source]
-

Transform the rank-4 Coulomb interaction tensor from one basis to -another basis.

-
-
Parameters:
-
-
umat: 4d array

Coulomb interaction tensor (rank-4).

-
-
tmat: 2d array

The transformation matrix.

-
-
-
-
Returns:
-
-
umat_new: 4d complex array

The Coulomb interaction tensor in the new basis.

-
-
-
-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/coulomb_utensor.html b/edrixs/reference/coulomb_utensor.html deleted file mode 100644 index 63f0559199..0000000000 --- a/edrixs/reference/coulomb_utensor.html +++ /dev/null @@ -1,554 +0,0 @@ - - - - - - - - - coulomb_utensor — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

coulomb_utensor

-
-
-edrixs.coulomb_utensor.get_gaunt(l1, l2)[source]
-

Calculate the Gaunt coefficents \(C_{l_1,l_2}(k,m_1,m_2)\)

-
-\[C_{l_1,l_2}(k,m_1,m_2)=\sqrt{\frac{4\pi}{2k+1}} \int -\mathop{d\phi} \mathop{d\theta} sin(\theta) -Y_{l_1}^{m_1\star}(\theta,\phi) Y_{k}^{m_1-m_2}(\theta,\phi) -Y_{l_2}^{m_2}(\theta,\phi)\]
-
-
Parameters:
-
-
l1: int

The first quantum number of angular momentum.

-
-
l2: int

The second quantum number of angular momentum.

-
-
-
-
Returns:
-
-
res: 3d float array

The calculated Gaunt coefficents.

-

The 1st index (\(= 0, 1, ..., l_1+l_2+1\)) is the order \(k\).

-

The 2nd index (\(= 0, 1, ... ,2l_1\)) is the magnetic quantum -number \(m_1\) plus \(l_1\)

-

The 3nd index (\(= 0, 1, ... ,2l_2\)) is the magnetic quantum -number \(m_2\) plus \(l_2\)

-
-
-
-
-

Notes

-

It should be noted that \(C_{l_1,l_2}(k,m_1,m_2)\) is -nonvanishing only when

-

\(k + l_1 + l_2 = \text{even}\),

-

and

-

\(|l_1 - l_2| \leq k \leq l_1 + l_2\).

-

Please see Ref. [1] p. 10 for more details.

-

References

-
-
-[1] -

Sugano S, Tanabe Y and Kamimura H. 1970. Multiplets of -Transition-Metal Ions in Crystals. Academic Press, New York and London.

-
-
-

Examples

-
>>> import edrixs
-
-
-

Get gaunt coefficients between \(p\)-shell and \(d\)-shell

-
>>> g = edrixs.get_gaunt(1, 2)
-
-
-
- -
-
-edrixs.coulomb_utensor.get_umat_kanamori(norbs, U, J)[source]
-

Calculate the Coulomb interaction tensor for a Kanamori-type interaction. -For the \(t2g\)-shell case, it is parameterized by \(U, J\).

-
-
Parameters:
-
-
norbs: int

number of orbitals (including spin).

-
-
U: float

Hubbard \(U\) for electrons residing on the same orbital with opposite spin.

-
-
J: float

Hund’s coupling.

-
-
-
-
Returns:
-
-
umat: 4d complex array

The calculated Coulomb interaction tensor

-
-
-
-
-
-

See also

-
-
coulomb_utensor.get_umat_kanamori_ge
-
coulomb_utensor.get_umat_slater
-
coulomb_utensor.umat_slater
-
-
-

Notes

-

The order of spin index is: up, down, up, down, …, up, down.

-
- -
-
-edrixs.coulomb_utensor.get_umat_kanamori_ge(norbs, U1, U2, J, Jx, Jp)[source]
-

Calculate the Coulomb interaction tensor for a Kanamori-type interaction. -For the general case, it is parameterized by \(U_1, U_2, J, J_x, J_p\).

-
-
Parameters:
-
-
norbs: int

number of orbitals (including spin).

-
-
U1: float

Hubbard \(U\) for electrons residing on the same orbital with opposite spin.

-
-
U2: float

Hubbard \(U\) for electrons residing on different orbitals.

-
-
J: float

Hund’s coupling for density-density interaction.

-
-
Jx: float

Hund’s coupling for spin flip.

-
-
Jp: float

Hund’s coupling for pair-hopping.

-
-
-
-
Returns:
-
-
umat: 4d complex array

The calculated Coulomb interaction tensor

-
-
-
-
-
-

See also

-
-
coulomb_utensor.get_umat_kanamori
-
coulomb_utensor.get_umat_slater
-
coulomb_utensor.umat_slater
-
-
-

Notes

-

The order of spin index is: up, down, up, down, …, up, down.

-
- -
-
-edrixs.coulomb_utensor.get_umat_slater(case, *args)[source]
-

Convenient adapter function to return the Coulomb interaction tensor for common case.

-
-
Parameters:
-
-
case: string

Indicates atomic shells, should be one of

-

For single shell:

-
    -
  • ‘s’: single \(s\)-shell (\(l=0\))

  • -
  • ‘p’: single \(p\)-shell (\(l=1\))

  • -
  • ‘p12’: single \(p_{1/2}\)-shell (\(l=1\))

  • -
  • ‘p32’: single \(p_{3/2}\)-shell (\(l=1\))

  • -
  • ‘t2g’: single \(t_{2g}\)-shell (\(l_{\text{eff}}=1\))

  • -
  • ‘d’: single \(d\)-shell (\(l=2\))

  • -
  • ‘d32’: single \(d_{3/2}\)-shell (\(l=2\))

  • -
  • ‘d52’: single \(d_{5/2}\)-shell (\(l=2\))

  • -
  • ‘f’: single \(f\)-shell (\(l=3\))

  • -
  • ‘f52’: single \(f_{5/2}\)-shell (\(l=3\))

  • -
  • ‘f72’: single \(f_{7/2}\)-shell (\(l=3\))

  • -
-

For two shells:

-

case = str1 + str2

-

where, str1 and str2 are strings and they can be any of

-

[‘s’, ‘p’, ‘p12’, ‘p32’, ‘t2g’, ‘d’, ‘d32’, ‘d52’, ‘f’, ‘f52’, ‘f72’]

-

For examples,

-
    -
  • ‘dp’: 1st \(d\)-shell and 2nd \(p\)-shell

  • -
  • ‘dp12’: 1st \(d\)-shell and 2nd \(p_{1/2}\)-shell

  • -
  • ‘f52p32’: 1st \(f_{5/2}\)-shell and 2nd \(p_{3/2}\)-shell

  • -
  • ‘t2gp’: 1st \(t_{2g}\)-shell and 2nd \(p\)-shell

  • -
-
-
*args: floats

Variable length argument list. Slater integrals. -The order of these integrals shoule be

-

For only one shell case,

-

args = [F0, F2, F4, F6, ….]

-

For two shells case,

-

args = [FX_11, FX_12, GX_12, FX_22]

-

where, 1 (2) means 1st (2nd)-shell, and X=0, 2, 4, … or X=1, 3, 5 …, -and X should be in ascending order. The following are possible cases:

-
    -
  • ‘s’:

  • -
-

args = [F0]

-
    -
  • ‘p’, ‘p12’, ‘p32’:

  • -
-

args = [F0, F2]

-
    -
  • ‘d’, ‘d32’, ‘d52’, ‘t2g’:

  • -
-

args = [F0, F2, F4]

-
    -
  • ‘f’, ‘f52’, ‘f72’:

  • -
-

args = [F0, F2, F4, F6]

-
    -
  • ‘ss’:

  • -
-

args = [F0_11, F0_12, G0_12, F0_22]

-
    -
  • ‘ps’, ‘p12s’, ‘p32s’:

  • -
-

args = [F0_11, F2_11, F0_12, G1_12, F0_22]

-
    -
  • ‘ds’, ‘d32s’, ‘d52s’, ‘t2gs’:

  • -
-

args = [F0_11, F2_11, F4_11, F0_12, G2_12, F0_22]

-
    -
  • ‘fs’, ‘f52s’, ‘f72s’:

  • -
-

args = [F0_11, F2_11, F4_11, F6_11, F0_12, G3_12, F0_22]

-
    -
  • ‘sp’, ‘sp12’, ‘sp32’:

  • -
-

args = [F0_11, F0_12, G1_12, F0_22, F2_22]

-
    -
  • ‘pp’, ‘pp12’, ‘pp32’, ‘p12p’, ‘p12p12’, ‘p12p32’, ‘p32p’, ‘p32p12’, ‘p32p32’:

  • -
-

args = [F0_11, F2_11, F0_12, F2_12, G0_12, G2_12, F0_22, F2_22]

-
    -
  • ‘dp’, ‘dp12’, ‘dp32’, ‘d32p’, ‘d32p12’, ‘d32p32’, ‘d52p’, ‘d52p12’, ‘d52p32’, -‘t2gp’, ‘t2gp12’, t2gp32’:

  • -
-

args = [F0_11, F2_11, F4_11, F0_12, F2_12, G1_12, G3_12, F0_22, F2_22]

-
    -
  • ‘fp’, ‘fp12’, ‘fp32’, ‘f52p’, ‘f52p12’, ‘f52p32’, ‘f72p’, ‘f72p12’, ‘f72p32’:

  • -
-

args = [F0_11, F2_11, F4_11, F6_11, F0_12, F2_12, G2_12, G4_12, F0_22, F2_22]

-
    -
  • ‘sd’, ‘sd32’, ‘sd52’:

  • -
-

args = [F0_11, F0_12, G2_12, F0_22, F2_22, F4_22]

-
    -
  • ‘pd’, ‘pd32’, ‘pd52’, ‘p12d’, ‘p12d32’, ‘p12d52’, ‘p32d’, ‘p32d32’, ‘p32d52’:

  • -
-

args = [F0_11, F2_11, F0_12, F2_12, G1_12, G3_12, F0_22, F2_22, F4_22]

-
    -
  • ‘dd’, ‘dd32’, ‘dd52’, ‘d32d’, ‘d32d32’, ‘d32d52’, ‘d52d’, ‘d52d32’, ‘d52d52’, -‘t2gd’, ‘t2gd32’, ‘t2gd52’:

  • -
-

args = [F0_11, F2_11, F4_11, F0_12, F2_12, F4_12, G0_12, G2_12, G4_12, F0_22, F2_22, F4_22]

-
    -
  • ‘fd’, ‘fd32’, ‘fd52’, ‘f52d’, ‘f52d32’, ‘f52d52’, ‘f72d’, ‘f72d32’, ‘f72d52’:

  • -
-

args = [F0_11, F2_11, F4_11, F6_11, F0_12, F2_12, F4_12, G1_12, G3_12, G5_12, -F0_22, F2_22, F4_22]

-
    -
  • ‘sf’, ‘sf52’, ‘sf72’:

  • -
-

args = [F0_11, F0_12, G3_12, F0_22, F2_22, F4_22, F6_22]

-
    -
  • ‘pf’, ‘pf52’, ‘pf72’, ‘p12f’, ‘p12f52’, ‘p12f72’, ‘p32f’, ‘p32f52’, ‘p32f72’:

  • -
-

args = [F0_11, F2_11, F0_12, F2_12, G2_12, G4_12, F0_22, F2_22, F4_22, F6_22]

-
    -
  • ‘df’, ‘df52’, ‘df72’, ‘d32f’, ‘d32f52’, ‘d32f72’, ‘d52f’, ‘d52f52’, ‘d52f72’, -‘t2gf’, ‘t2gf52’, ‘t2gf72’:

  • -
-

args = [F0_11, F2_11, F4_11, F0_12, F2_12, F4_12, G1_12, G3_12, G5_12, -F0_22, F2_22, F4_22, F6_22]

-
    -
  • ‘ff’, ‘ff52’, ‘ff72’, ‘f52f’, ‘f52f52’, ‘f52f72’, ‘f72f’, ‘f72f52’, ‘f72f72’:

  • -
-

args = [F0_11, F2_11, F4_11, F6_11, F0_12, F2_12, F4_12, F6_12, -G0_12, G2_12, G4_12, G6_12, F0_22, F2_22, F4_22, F6_22]

-
-
-
-
Returns:
-
-
umat: 4d array of complex

the Coulomb interaction tensor

-
-
-
-
-
-

See also

-
-
coulomb_utensor.umat_slater
-
coulomb_utensor.get_umat_kanamori
-
coulomb_utensor.get_umat_kanamori_ge
-
-
-

Examples

-
>>> import edrixs
->>> F0_dd, F2_dd, F4_dd = 3.0, 1.0, 0.5
->>> F0_dp, F2_dp, G1_dp, G3_dp = 2.0, 1.0, 0.2, 0.1
->>> F0_pp, F2_pp = 0.0, 0.0
->>> slater = [F0_dd, F2_dd, F4_dd, F0_dp, F2_dp, G1_dp, G3_dp, F0_pp, F2_pp]
->>> umat_d = edrixs.get_umat_slater('d', F0_dd, F2_dd, F4_dd)
->>> umat_dp = edrixs.get_umat_slater('dp', *slater)
->>> umat_t2gp = edrixs.get_umat_slater('t2gp', *slater)
->>> umat_dp32 = edrixs.get_umat_slater('dp32', *slater)
-
-
-
- -
-
-edrixs.coulomb_utensor.get_umat_slater_3shells(shell_name, *args)[source]
-

Given three shells, build the slater type of Coulomb tensors among -the three shells.

-
-
Parameters:
-
-
shell_name: tuple of three strings

Shells names.

-
-
*args: floats

Slater integrals. The order should be

-

FX_11, FX_12, GX_12, FX_22, FX_13, GX_13, FX_23, GX_23, FX_33

-

where, 1, 2, 3 means 1st, 2nd, 3rd shell, and X=0, 2, 4, … or X=1, 3, 5 …, -and X should be in ascending order.

-
-
-
-
Returns:
-
-
umat: 4d complex array

Rank-4 Coulomb tensors.

-
-
-
-
-
- -
-
-edrixs.coulomb_utensor.umat_slater(l_list, fk)[source]
-

Calculate the Coulomb interaction tensor which is parameterized by -Slater integrals \(F^{k}\):

-
-\[U_{m_{l_i}m_{s_i}, m_{l_j}m_{s_j}, m_{l_t}m_{s_t}, -m_{l_u}m_{s_u}}^{i,j,t,u} -=\frac{1}{2} \delta_{m_{s_i},m_{s_t}}\delta_{m_{s_j},m_{s_u}} -\delta_{m_{l_i}+m_{l_j}, m_{l_t}+m_{l_u}} -\sum_{k}C_{l_i,l_t}(k,m_{l_i},m_{l_t})C_{l_u,l_j} -(k,m_{l_u},m_{l_j})F^{k}_{i,j,t,u}\]
-

where \(m_s\) is the magnetic quantum number for spin -and \(m_l\) is the magnetic quantum number for orbital. -\(F^{k}_{i,j,t,u}\) are Slater integrals. -\(C_{l_i,l_j}(k,m_{l_i},m_{l_j})\) are Gaunt coefficients.

-
-
Parameters:
-
-
l_list: list of int

contains the quantum number of orbital angular momentum -\(l\) for each shell.

-
-
fk: dict of float

contains all the possible Slater integrals between the shells -in l_list, the key is a tuple of 5 ints (\(k,i,j,t,u\)), -where \(k\) is the order, -\(i,j,t,u\) are the shell indices begin with 1.

-
-
-
-
Returns:
-
-
umat: 4d array of complex

contains the Coulomb interaction tensor.

-
-
-
-
-
-

See also

-
-
coulomb_utensor.get_umat_slater
-
coulomb_utensor.get_umat_kanamori
-
coulomb_utensor.get_umat_kanamori_ge
-
-
-

Examples

-
>>> import edrixs
-
-
-

For only one \(d\)-shell

-
>>> l_list = [2]
->>> fk={}
->>> F0, F2, F4 = 5.0, 4.0 2.0
->>> fk[(0,1,1,1,1)] = F0
->>> fk[(2,1,1,1,1)] = F2
->>> fk[(4,1,1,1,1)] = F4
->>> umat_d = edrixs.umat_slater(l_list, fk)
-
-
-

For one \(d\)-shell and one \(p\)-shell

-
>>> l_list = [2,1]
->>> fk={}
->>> F0_dd, F2_dd, F4_dd = 5.0, 4.0, 2.0
->>> F0_dp, F2_dp = 4.0, 2.0
->>> G1_dp, G3_dp = 2.0, 1.0
->>> F0_pp, F2_pp = 2.0, 1.0
-
-
-
>>> fk[(0,1,1,1,1)] = F0_dd
->>> fk[(2,1,1,1,1)] = F2_dd
->>> fk[(4,1,1,1,1)] = F4_dd
-
-
-
>>> fk[(0,1,2,1,2)] = F0_dp
->>> fk[(0,2,1,2,1)] = F0_dp
->>> fk[(2,1,2,1,2)] = F2_dp
->>> fk[(2,2,1,2,1)] = F2_dp
-
-
-
>>> fk[(1,1,2,2,1)] = G1_dp
->>> fk[(1,2,1,1,2)] = G1_dp
->>> fk[(3,1,2,2,1)] = G3_dp
->>> fk[(3,2,1,1,2)] = G3_dp
-
-
-
>>> fk[(0,2,2,2,2)] = F0_pp
->>> fk[(2,2,2,2,2)] = F2_pp
-
-
-
>>> umat_dp = edrixs.umat_slater(l_list, fk)
-
-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/fit_hyb.html b/edrixs/reference/fit_hyb.html deleted file mode 100644 index 662f7792c6..0000000000 --- a/edrixs/reference/fit_hyb.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - fit_hyb — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

fit_hyb

-
-
-edrixs.fit_hyb.fit_func(x, *args)[source]
-

Given frequency \(\omega\), bath energy level \(\epsilon_{l}\) and -the hybridization strength \(V_{l}\), -return the hybridization function,

-
-\[\Delta(\omega)=\sum_{l=1}^{N}\frac{|V_{l}|^2}{\omega-\epsilon_{l}}.\]
-
-
Parameters:
-
-
x: 1d float array

Frequency \(\omega\), the first half is the real part and -the second half is the imaginary part.

-
-
args: 1d float array

The first half is the bath energy level \(\epsilon_{l}\) and the -second half if the hybridization strength \(V_{l}\).

-
-
-
-
Returns:
-
-
y: 1d float array

The calculated hybridization function \(\Delta(\omega)\), the -first half is the real part and the second half is the imaginary part.

-
-
-
-
-
- -
-
-edrixs.fit_hyb.fit_hyb(x, y, N, p0)[source]
-

Given the hybridization function \(\Delta(\omega)\), -call function curve_fit in scipy to -fit bath energy levels \(\epsilon_{l}\) and -hybridization strength \(V_{l}\).

-
-\[\Delta(\omega)=\sum_{l=1}^{N}\frac{|V_{l}|^2}{\omega-\epsilon_{l}}.\]
-
-
Parameters:
-
-
x: 1d complex array

Frequency \(\omega\).

-
-
y: 1d complex array

Hybridization function \(\Delta(\omega)\).

-
-
N: int

Number of bath sites

-
-
p0: N-length 1d float array

Initial guess, the first half is \(\epsilon_{l}\) and -the second half is \(V_{l}\).

-
-
-
-
Returns:
-
-
e: N-length 1d float array

The fitted bath energy levels \(\epsilon_{l}\).

-
-
v: N-length 1d float array

The fitted hybridization strength \(V_{l}\).

-
-
-
-
-
- -
-
-edrixs.fit_hyb.get_hyb(x, e, v)[source]
-

Given the fitted \(\epsilon_{l}\) and \(V_{l}\), calcualte the -hybridization function \(\Delta(\omega)\),

-
-\[\Delta(\omega)=\sum_{l=1}^{N}\frac{|V_{l}|^2}{\omega-\epsilon_{l}}.\]
-
-
Parameters:
-
-
x: 1d complex array

Frequency \(\omega\).

-
-
e: N-length 1d float array

The fitted bath energy levels.

-
-
v: N-length 1d float array

The fitted hybridization strength.

-
-
-
-
Returns:
-
-
y: 1d complex array

The calculated hybridization function \(\Delta(\omega)\).

-
-
-
-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/fock_basis.html b/edrixs/reference/fock_basis.html deleted file mode 100644 index 22d92d9203..0000000000 --- a/edrixs/reference/fock_basis.html +++ /dev/null @@ -1,567 +0,0 @@ - - - - - - - - - fock_basis — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

fock_basis

-
-
-edrixs.fock_basis.combination(n, m)[source]
-

Calculate the combination \(C_{n}^{m}\),

-
-\[C_{n}^{m} = \frac{n!}{m!(n-m)!}.\]
-
-
Parameters:
-
-
n: int

Number n.

-
-
m: int

Number m.

-
-
-
-
Returns:
-
-
res: int

The calculated result.

-
-
-
-
-

Examples

-
>>> import edrixs
->>> edrixs.combination(6, 2)
-15
-
-
-
- -
-
-edrixs.fock_basis.fock_bin(n, k)[source]
-

Return all the possible \(n\)-length binary -where \(k\) of \(n\) digitals are set to 1.

-
-
Parameters:
-
-
n: int

Binary length \(n\).

-
-
k: int

How many digitals are set to be 1.

-
-
-
-
Returns:
-
-
res: list of int-lists

A list of list containing the binary digitals.

-
-
-
-
-

Examples

-
>>> import edrixs
->>> edrixs.fock_bin(4, 2)
-[[1, 1, 0, 0],
- [1, 0, 1, 0],
- [1, 0, 0, 1],
- [0, 1, 1, 0],
- [0, 1, 0, 1],
- [0, 0, 1, 1]]
-
-
-
- -
-
-edrixs.fock_basis.get_fock_basis_by_NJz(norb, N, jz_list)[source]
-

Get decimal digitals to represent Fock states, use good quantum number:

-
    -
  • total angular momentum \(J_{z}\)

  • -
-
-
Parameters:
-
-
norb: int

Number of orbitals.

-
-
N: int

Number of total occupancy.

-
-
jz_list: list of int

Quantum number \(j_{z}\) for each orbital.

-
-
-
-
Returns:
-
-
res: dict

A dictionary containing the decimal digitals, the key is good quantum -numbers \(j_{z}\), the value is a list of int.

-
-
-
-
-

Examples

-
>>> import edrixs
->>> edrixs.get_fock_basis_by_NJz(6, 2, [-1, 1, -3, -1, 1, 3])
-{
- -6: [],
- -5: [],
- -4: [5, 12],
- -3: [],
- -2: [6, 9, 20],
- -1: [],
-  0: [3, 10, 17, 36, 24],
-  1: [],
-  2: [18, 33, 40],
-  3: [],
-  4: [34, 48],
-  5: [],
-  6: []
-}
-
-
-
- -
-
-edrixs.fock_basis.get_fock_basis_by_NLz(norb, N, lz_list)[source]
-

Get decimal digitals to represent Fock states, use good quantum number:

-
    -
  • orbital angular momentum \(L_{z}\)

  • -
-
-
Parameters:
-
-
norb: int

Number of orbitals.

-
-
N: int

Number of total occupancy.

-
-
lz_list: list of int

Quantum number \(l_{z}\) for each orbital.

-
-
-
-
Returns:
-
-
res: dict

A dictionary containing the decimal digitals, the key is good -quantum numbers \(L_{z}\), the value is a list of int.

-
-
-
-
-

Examples

-
>>> import edrixs
->>> edrixs.get_fock_basis_by_NLz(6, 2, [-1, -1, 0, 0, 1, 1])
-{
- -2: [3],
- -1: [5, 6, 9, 10],
-  0: [12, 17, 18, 33, 34],
-  1: [20, 36, 24, 40],
-  2: [48]
-}
-
-
-
- -
-
-edrixs.fock_basis.get_fock_basis_by_NSz(norb, N, sz_list)[source]
-

Get decimal digitals to represent Fock states, use good quantum number:

-
    -
  • spin angular momentum \(S_{z}\)

  • -
-
-
Parameters:
-
-
norb: int

Number of orbitals.

-
-
N: int

Number of total occupancy.

-
-
sz_list: list of int

Quantum number \(s_{z}\) for each orbital.

-
-
-
-
Returns:
-
-
res: dict

A dictionary containing the decimal digitals, the key is good quantum -numbers \(S_{z}\), the value is a list of int.

-
-
-
-
-

Examples

-
>>> import edrixs
->>> edrixs.get_fock_basis_by_NSz(6, 2, [1, -1, 1, -1, 1, -1])
-{
- -2: [10, 34, 40],
- -1: [],
-  0: [3, 6, 9, 12, 18, 33, 36, 24, 48],
-  1: [],
-  2: [5, 17, 20]
-}
-
-
-
- -
-
-edrixs.fock_basis.get_fock_basis_by_N_LzSz(norb, N, lz_list, sz_list)[source]
-

Get decimal digitals to represent Fock states, use good quantum number:

-
    -
  • orbital angular momentum \(L_{z}\)

  • -
  • spin angular momentum \(S_{z}\)

  • -
-
-
Parameters:
-
-
norb: int

Number of orbitals.

-
-
N: int

Number of total occupancy.

-
-
lz_list: list of int

Quantum number \(l_{z}\) for each orbital.

-
-
sz_list: list of int

Quantum number \(s_{z}\) for each orbital.

-
-
-
-
Returns:
-
-
basis: dict

A dictionary containing the decimal digitals, the key is a tuple containing good quantum -numbers ( \(l_{z}\), \(s_{z}\)), the value is a list of int.

-
-
-
-
-

Examples

-
>>> import edrixs
->>> edrixs.get_fock_basis_by_N_LzSz(6, 2, [-1, -1, 0, 0, 1, 1], [1, -1, 1, -1, 1, -1])
-{
- (-2, -2): [],
- (-2, -1): [],
-  (-2, 0): [3],
-  (-2, 1): [],
-  (-2, 2): [],
- (-1, -2): [10],
- (-1, -1): [],
-  (-1, 0): [6, 9],
-  (-1, 1): [],
-  (-1, 2): [5],
-  (0, -2): [34],
-  (0, -1): [],
-   (0, 0): [12, 18, 33],
-   (0, 1): [],
-   (0, 2): [17],
-  (1, -2): [40],
-  (1, -1): [],
-   (1, 0): [36, 24],
-   (1, 1): [],
-   (1, 2): [20],
-  (2, -2): [],
-  (2, -1): [],
-   (2, 0): [48],
-   (2, 1): [],
-   (2, 2): []
-}
-
-
-
- -
-
-edrixs.fock_basis.get_fock_basis_by_N_abelian(norb, N, a_list)[source]
-

Get decimal digitals to represent Fock states, use some Abelian good quantum number.

-
-
Parameters:
-
-
norb: int

Number of orbitals.

-
-
N: int

Number of total occupancy.

-
-
a_list: list of int

Quantum number of the Abelian symmetry for each orbital.

-
-
-
-
Returns:
-
-
basis: dict

A dictionary containing the decimal digitals, the key is good quantum numbers, -the value is a list of int.

-
-
-
-
-
- -
-
-edrixs.fock_basis.get_fock_bin_by_N(*args)[source]
-

Get binary form to represent a Fock state.

-
-
Parameters:
-
-
args: ints

args[0]: number of orbitals for 1st-shell,

-

args[1]: number of occupancy for 1st-shell,

-

args[2]: number of orbitals for 2nd-shell,

-

args[3]: number of occupancy for 2nd-shell,

-

-

args[ \(2N-2\)]: number of orbitals for \(N\) th-shell,

-

args[ \(2N-1\)]: number of occupancy for \(N\) th-shell.

-
-
-
-
Returns:
-
-
result: list of int list

The binary form of Fock states.

-
-
-
-
-

Examples

-
>>> import edrixs
->>> edrixs.get_fock_bin_by_N(4, 2)
-[[1, 1, 0, 0],
- [1, 0, 1, 0],
- [1, 0, 0, 1],
- [0, 1, 1, 0],
- [0, 1, 0, 1],
- [0, 0, 1, 1]]
-
-
-
>>> edrixs.get_fock_bin_by_N(4, 2, 2, 1)
-[[1, 1, 0, 0, 1, 0],
- [1, 0, 1, 0, 1, 0],
- [1, 0, 0, 1, 1, 0],
- [0, 1, 1, 0, 1, 0],
- [0, 1, 0, 1, 1, 0],
- [0, 0, 1, 1, 1, 0],
- [1, 1, 0, 0, 0, 1],
- [1, 0, 1, 0, 0, 1],
- [1, 0, 0, 1, 0, 1],
- [0, 1, 1, 0, 0, 1],
- [0, 1, 0, 1, 0, 1],
- [0, 0, 1, 1, 0, 1]]
-
-
-
- -
-
-edrixs.fock_basis.get_fock_full_N(norb, N)[source]
-

Get the decimal digitals to represent Fock states.

-
-
Parameters:
-
-
norb: int

Number of orbitals.

-
-
N: int

Number of occupancy.

-
-
-
-
Returns:
-
-
res: list of int

The decimal digitals to represent Fock states.

-
-
-
-
-

Examples

-
>>> import edrixs
->>> edrixs.fock_bin(4,2)
-[[1, 1, 0, 0],
- [1, 0, 1, 0],
- [0, 1, 1, 0],
- [1, 0, 0, 1],
- [0, 1, 0, 1],
- [0, 0, 1, 1]]
-
-
-
>>> import edrixs
->>> edrixs.get_fock_full_N(4,2)
-[3, 5, 6, 9, 10, 12]
-
-
-
- -
-
-edrixs.fock_basis.write_fock_dec_by_N(N, r, fname='fock_i.in')[source]
-

Get decimal digitals to represent Fock states, sort them by -ascending order and then write them to file.

-
-
Parameters:
-
-
N: int

Number of orbitals.

-
-
r: int

Number of occuancy.

-
-
fname: string

File name.

-
-
-
-
Returns:
-
-
ndim: int

The dimension of the Hilbert space

-
-
-
-
-

Examples

-
>>> import edrixs
->>> edrixs.write_fock_dec_by_N(4, 2, 'fock_i.in')
-file fock_i.in looks like
-15
-3
-5
-6
-9
-10
-12
-17
-18
-20
-24
-33
-34
-36
-40
-48
-
-
-

where, the first line is the total numer of Fock states, -and the following lines are the Fock states in decimal form.

-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/index.html b/edrixs/reference/index.html deleted file mode 100644 index d47ec073dd..0000000000 --- a/edrixs/reference/index.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - - - - edrixs Reference — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

edrixs Reference

-
-
Release:
-

-
-
Date:
-

Jan 09, 2025

-
-
-

This reference manual details functions, modules, and objects -included in EDRIXS, describing what they are and what they do.

-
-

Contents:

- -
-
-

Indices and tables

- -
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/iostream.html b/edrixs/reference/iostream.html deleted file mode 100644 index 431631c39b..0000000000 --- a/edrixs/reference/iostream.html +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - - - - iostream — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

iostream

-
-
-edrixs.iostream.dump_poles(obj, file_name='poles')[source]
-

Dump the objects of poles returned from XAS or RIXS calculations to file for later plotting.

-
-
Parameters:
-
-
obj: Python object

Object of poles, a dict or a list of dicts.

-
-
file_name: string

File name.

-
-
-
-
-
- -
-
-edrixs.iostream.load_poles(file_name='poles')[source]
-

Load the objects of poles from file.

-
-
Parameters:
-
-
file_name: string
-
-
-
Returns:
-
-
obj: Python objects

Poles object.

-
-
-
-
-
- -
-
-edrixs.iostream.read_poles_from_file(file_list)[source]
-

Read informations in files xas_poles.n or rixs_poles.n to a dict.

-
-
Parameters:
-
-
file_list: list of strings

Names of pole files.

-
-
pole_dict: dict

A dict containing information of poles.

-
-
-
-
-
- -
-
-edrixs.iostream.write_config(directory='.', ed_solver=1, num_val_orbs=2, num_core_orbs=2, neval=1, nvector=1, ncv=1, idump=True, num_gs=1, maxiter=500, linsys_max=1000, min_ndim=1000, nkryl=500, eigval_tol=1e-08, linsys_tol=1e-10, omega_in=0.0, gamma_in=0.1)[source]
-

Write control parameters in config.in file for ed_fsolver.

-
- -
-
-edrixs.iostream.write_emat(emat, fname, tol=1e-12, fmt_int='{:10d}', fmt_float='{:.15f}')[source]
-

Write the nonzeros of the rank-2 hopping matrices to file. -The first line is the number of nonzeros, and the following lines are the nonzero elements. -This file will be read by ed.x, xas.x or rixs.x.

-
-
Parameters:
-
-
emat: 2d complex array

The array to be written.

-
-
fname: str

File name.

-
-
tol: float

Precision.

-
-
fmt_int: str (default: ‘{:10d}’)

Format for printing integer numbers.

-
-
fmt_float: str (default: ‘{:.15f}’)

Format for printing float numbers.

-
-
-
-
-
- -
-
-edrixs.iostream.write_tensor(tensor, fname, only_nonzeros=False, tol=1e-10, fmt_int='{:10d}', fmt_float='{:.15f}')[source]
-

Write \(n\) -dimension numpy array to file, currently, \(n\) can be 1, 2, 3, 4, 5.

-
-
Parameters:
-
-
tensor: :math:`n` d float or complex array

The array needs to be written.

-
-
fname: str

File name.

-
-
only_nonzeros: logical (default: False)

Only write nonzero elements.

-
-
tol: float (default: 1E-10)

Only write the elements when their absolute value are larger than tol -and only_nonzeros=True.

-
-
fmt_int: str (default: ‘{:10d}’)

The format for printing integer numbers.

-
-
fmt_float: str (default: ‘{:.15f}’)

The format for printing float numbers.

-
-
-
-
-
- -
-
-edrixs.iostream.write_umat(umat, fname, tol=1e-12, fmt_int='{:10d}', fmt_float='{:.15f}')[source]
-

Write the nonzeros of the rank-4 Coulomb U tensor to file. -The first line is the number of nonzeros, and the following lines are the nonzero elements. -This file will be read by ed.x, xas.x or rixs.x.

-
-
Parameters:
-
-
umat: 4d complex array

The array to be written.

-
-
fname: str

File name.

-
-
tol: float (default: 1E-12)

Precision.

-
-
fmt_int: str (default: ‘{:10d}’)

Format for printing integer numbers.

-
-
fmt_float: str (default: ‘{:.15f}’)

Format for printing float numbers.

-
-
-
-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/manybody_operator.html b/edrixs/reference/manybody_operator.html deleted file mode 100644 index 417bdff4ff..0000000000 --- a/edrixs/reference/manybody_operator.html +++ /dev/null @@ -1,317 +0,0 @@ - - - - - - - - - manybody_operator — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

manybody_operator

-
-
-edrixs.manybody_operator.build_opers(nfermion, coeff, lb, rb=None, tol=1e-10)[source]
-

Build matrix form of many-body operators in the given Fock basis,

-
-\[<F_{l}|\sum_{ij}E_{ij}\hat{f}_{i}^{\dagger}\hat{f}_{j}|F_{r}>\]
-

or

-
-\[<F_l|\sum_{ij}U_{ijkl}\hat{f}_{i}^{\dagger}\hat{f}_{j}^{\dagger} -\hat{f}_{k}\hat{f}_{l}|F_r>\]
-
-
Parameters:
-
-
nfermion: int

Number of fermion operators. Options can only be 2 or 4 now.

-
-
coeff: array-like

The coefficients.

-
    -
  • if nfermion=2, coeff should be at least 2-dimension, and the last 2-dimension is -the matrix of coefficients of an operator. For examples,

    -
      -
    • coeff.shape = (3, 10, 10), means 3 operators with \(10 \times 10\) -coefficients matrix.

    • -
    • coeff.shape = (2, 3, 10, 10), means \(2 \times 3=6\) operators with -\(10 \times 10\) coefficients matrix.

    • -
    -
  • -
  • if nfermion=4, coeff should be at least 4-dimension, and the last 4-dimension is -the rank-4 tensor of coefficients of an operator. For examples,

    -
      -
    • coeff.shape = (3, 10, 10, 10, 10), means 3 operators with -\(10 \times 10 \times 10 \times 10\) coefficients tensor.

    • -
    • coeff.shape = (2, 3, 10, 10, 10, 10), means \(2 \times 3=6\) operators with -\(10 \times 10 \times 10 \times 10\) coefficients tensor.

    • -
    -
  • -
-
-
lb: list of array

Left fock basis \(<F_{l}|\).

-
-
rb: list of array

Right fock basis \(|F_{r}>\). -rb = lb if rb is None

-
-
tol: float (default: 1E-10)

Only consider the elements of emat that are larger than tol.

-
-
-
-
Returns:
-
-
hmat: array-like

At least 2-dimension and the last 2-dimension is matrix form of operators, -For examples,

-
    -
  • if nfermion=2, coeff.shape=(2, 3, 10, 10), hmat.shape=(2, 3, len(lb), len(rb))

  • -
  • if nfermion=4, coeff.shape=(2, 3, 10, 10, 10, 10), hmat.shape=(2, 3, len(lb), len(rb))

  • -
-
-
-
-
-
- -
-
-edrixs.manybody_operator.density_matrix(iorb, jorb, lb, rb)[source]
-

Calculate the matrix form of density operators \(\hat{f}_{i}^{\dagger}\hat{f}_{j}\) -in the given Fock basis,

-
-\[<F_{l}|\hat{f}_{i}^{\dagger}\hat{f}_{j}|F_{r}>\]
-
-
Parameters:
-
-
iorb: int

Orbital index.

-
-
jorb: int

Orbital index.

-
-
lb: list or array

Left fock basis \(<F_{l}|\).

-
-
rb: list or array

Right fock basis \(|F_{r}>\).

-
-
-
-
Returns:
-
-
hmat: 2d complex array

The calculated matrix form of the density operator.

-
-
-
-
-
- -
-
-edrixs.manybody_operator.four_fermion(umat, lb, rb=None, tol=1e-10)[source]
-

Build matrix form of a four-fermionic operator in the given Fock basis,

-
-\[<F_l|\sum_{ij}U_{ijkl}\hat{f}_{i}^{\dagger}\hat{f}_{j}^{\dagger} -\hat{f}_{k}\hat{f}_{l}|F_r>\]
-
-
Parameters:
-
-
umat: 4d complex array

The 4 index Coulomb interaction tensor.

-
-
lb: list of array

Left fock basis \(<F_{l}|\).

-
-
rb: list of array

Right fock basis \(|F_{r}>\). -rb = lb if rb is None

-
-
tol: float (default: 1E-10)

Only consider the elements of umat that are larger than tol.

-
-
-
-
Returns:
-
-
hmat: 2d complex array

The matrix form of the four-fermionic operator.

-
-
-
-
-
- -
-
-edrixs.manybody_operator.one_fermion_annihilation(iorb, lb, rb)[source]
-

Build matrix form of a fermionic annihilation operator in the given Fock basis.

-
-\[<F_{l}|\hat{f}_{i}|F_{r}>\]
-
-
Parameters:
-
-
iorb: int

Which orbital.

-
-
lb: list or array

Left fock basis \(<F_{l}|\).

-
-
rb: list of array

Right fock basis \(|F_{r}>\).

-
-
-
-
Returns:
-
-
hmat: 2d complex array

The matrix form of \(\hat{f}_{i}\).

-
-
-
-
-
- -
-
-edrixs.manybody_operator.two_fermion(emat, lb, rb=None, tol=1e-10)[source]
-

Build matrix form of a two-fermionic operator in the given Fock basis,

-
-\[<F_{l}|\sum_{ij}E_{ij}\hat{f}_{i}^{\dagger}\hat{f}_{j}|F_{r}>\]
-
-
Parameters:
-
-
emat: 2d complex array

The impurity matrix.

-
-
lb: list of array

Left fock basis \(<F_{l}|\).

-
-
rb: list of array

Right fock basis \(|F_{r}>\). -rb = lb if rb is None

-
-
tol: float (default: 1E-10)

Only consider the elements of emat that are larger than tol.

-
-
-
-
Returns:
-
-
hmat: 2d complex array

The matrix form of the two-fermionic operator.

-
-
-
-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/photon_transition.html b/edrixs/reference/photon_transition.html deleted file mode 100644 index bad5b3a596..0000000000 --- a/edrixs/reference/photon_transition.html +++ /dev/null @@ -1,499 +0,0 @@ - - - - - - - - - photon_transition — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

photon_transition

-
-
-edrixs.photon_transition.dipole_polvec_rixs(thin, thout, phi=0, alpha=0, beta=0, local_axis=None, pol_type=None)[source]
-

Return polarization vector of incident and scattered photons, for RIXS calculation.

-
-
Parameters:
-
-
thin: float

The incident angle (radian).

-
-
thout: float

The scattered angle (radian).

-
-
phi: float

The azimuthal angle (radian).

-
-
alpha: float

The angle between the polarization vector of the incident photon and -the scattering plane (radian)

-
-
beta: float

The angle between the polarization vector of the scattered photon and -the scattering plane (radian)

-
-
local_axis: 3*3 float array

The local axis defining the scattering geometry.

-
    -
  • \(x\)-axis: local_axis[:,0]

  • -
  • \(y\)-axis: local_axis[:,1]

  • -
  • \(z\)-axis: local_axis[:,2]

  • -
-

It will be an identity matrix if not provided.

-
-
pol_type: tuple of two strings

Specify types of polarization for incident and scattered photons. -case[0] for incident photon, case[1] for scattered photon. Options can be

-
    -
  • ‘linear’: Linear polarization

  • -
  • ‘left’ : Left-circular polarization.

  • -
  • ‘right’ : Right-circular polarization.

  • -
-

It will set pol_type=(‘linear’, ‘linear’) if not provided.

-
-
-
-
Returns:
-
-
ei_in_global: 3-length complex array

The linear polarization vector of the incident photon, -with respect to the global \(xyz\) -axis.

-
-
ef_out_global: 3-length complex array

The linear polarization vector of the scattered photon -with respect to the global \(xyz\) -axis.

-
-
-
-
-
- -
-
-edrixs.photon_transition.dipole_polvec_xas(thin, phi=0, alpha=0, local_axis=None, pol_type='linear')[source]
-

Return the linear polarization vector of incident photons, for XAS calculation.

-
-
Parameters:
-
-
thin: float

The incident angle (radian).

-
-
phi: float

The azimuthal angle (radian).

-
-
alpha: float

The angle between the polarization vector of the incident photon and -the scattering plane (radian)

-
-
local_axis: 3*3 float array

The local axis defining the scattering geometry.

-
-
    -
  • \(x\)-axis: local_axis[:,0]

  • -
-
-
    -
  • \(y\)-axis: local_axis[:,1]

  • -
  • \(z\)-axis: local_axis[:,2]

  • -
-

It will be an identity matrix if not provided.

-
-
pol_type: string
    -
  • ‘linear’: Linear polarization.

  • -
  • ‘left’ : Left-circular polarization.

  • -
  • ‘right’ : Right-circular polarization.

  • -
-
-
-
-
Returns:
-
-
ei_global: 3-length float array

The linear polarization vector of the incident photon, with resepct to the -global \(xyz\) -axis.

-
-
-
-
-
- -
-
-edrixs.photon_transition.get_trans_oper(case)[source]
-

Get the matrix of transition operators between two atomic shell in the complex -spherical harmonics basis.

-
-
Parameters:
-
-
case: string

A string indicating the two atomic shells, possible transitions are:

-
    -
  • ‘ss’: \(s \rightarrow s\)

  • -
  • ‘ps’: \(s \rightarrow p\)

  • -
  • ‘t2gs’: \(s \rightarrow t2g\)

  • -
  • ‘ds’: \(s \rightarrow d\)

  • -
  • ‘fs’: \(s \rightarrow f\)

  • -
  • ‘sp’: \(p \rightarrow s\)

  • -
  • ‘sp12’: \(p_{1/2} \rightarrow s\)

  • -
  • ‘sp32’: \(p_{3/2} \rightarrow s\)

  • -
  • ‘pp’: \(p \rightarrow p\)

  • -
  • ‘pp12’: \(p_{1/2} \rightarrow p\)

  • -
  • ‘pp32’: \(p_{3/2} \rightarrow p\)

  • -
  • ‘t2gp’: \(p \rightarrow t_{2g}\)

  • -
  • ‘t2gp12’: \(p_{1/2} \rightarrow t_{2g}\)

  • -
  • ‘t2gp32’: \(p_{3/2} \rightarrow t_{2g}\)

  • -
  • ‘dp’: \(p \rightarrow d\)

  • -
  • ‘dp12’: \(p_{1/2} \rightarrow d\)

  • -
  • ‘dp32’: \(p_{3/2} \rightarrow d\)

  • -
  • ‘fp’: \(p \rightarrow f\)

  • -
  • ‘fp12’: \(p_{1/2} \rightarrow f\)

  • -
  • ‘fp32’: \(p_{3/2} \rightarrow f\)

  • -
  • ‘sd’: \(d \rightarrow s\)

  • -
  • ‘sd32’: \(d_{3/2} \rightarrow s\)

  • -
  • ‘sd52’: \(d_{5/2} \rightarrow s\)

  • -
  • ‘pd’: \(d \rightarrow p\)

  • -
  • ‘pd32’: \(d_{3/2} \rightarrow p\)

  • -
  • ‘pd52’: \(d_{5/2} \rightarrow p\)

  • -
  • ‘t2gd’: \(d \rightarrow t_{2g}\)

  • -
  • ‘t2gd32’: \(d_{3/2} \rightarrow t_{2g}\)

  • -
  • ‘t2gd52’: \(d_{5/2} \rightarrow t_{2g}\)

  • -
  • ‘dd’: \(d \rightarrow d\)

  • -
  • ‘dd32’: \(d_{3/2} \rightarrow d\)

  • -
  • ‘dd52’: \(d_{5/2} \rightarrow d\)

  • -
  • ‘fd’: \(d \rightarrow f\)

  • -
  • ‘fd32’: \(d_{3/2} \rightarrow f\)

  • -
  • ‘fd52’: \(d_{5/2} \rightarrow f\)

  • -
  • ‘sf’: \(f \rightarrow s\)

  • -
  • ‘sf52’: \(f_{5/2} \rightarrow s\)

  • -
  • ‘sf72’: \(f_{7/2} \rightarrow s\)

  • -
  • ‘pf’: \(f \rightarrow p\)

  • -
  • ‘pf52’: \(f_{5/2} \rightarrow p\)

  • -
  • ‘pf72’: \(f_{7/2} \rightarrow p\)

  • -
  • ‘t2gf’: \(f \rightarrow t_{2g}\)

  • -
  • ‘t2gf52’: \(f_{5/2} \rightarrow t_{2g}\)

  • -
  • ‘t2gf72’: \(f_{7/2} \rightarrow t_{2g}\)

  • -
  • ‘df’: \(f \rightarrow d\)

  • -
  • ‘df52’: \(f_{5/2} \rightarrow d\)

  • -
  • ‘df72’: \(f_{7/2} \rightarrow d\)

  • -
  • ‘ff’: \(f \rightarrow f\)

  • -
  • ‘ff52’: \(f_{5/2} \rightarrow f\)

  • -
  • ‘ff72’: \(f_{7/2} \rightarrow f\)

  • -
-
-
-
-
Returns:
-
-
res: 2d complex array

The calculated transition matrix.

-
-
-
-
-

Examples

-
>>> import edrixs
-p to d transition
->>> trans_dp = get_trans_oper('dp')
-p to t2g transition
->>> trans_t2gp = get_trans_oper('t2gp')
-p_{3/2} to d transition
->>> trans_dp32 = get_trans_oper('dp32')
-
-
-
- -
-
-edrixs.photon_transition.get_wavevector_rixs(thin, thout, phi, ein, eout, local_axis=None)[source]
-

Return the wave vector of incident and scattered photons, for RIXS calculation.

-
-
Parameters:
-
-
thin: float

The incident angle in radian.

-
-
thout: float

The scattered angle in radian.

-
-
phi: float

The azimuthal angle in radian.

-
-
ein: float

Energy of the incident photon (eV).

-
-
eout: float

Energy of the scattered photon (eV).

-
-
local_axis: :math:`3 times 3` float array

The local \(z\) -axis, the angle thin and thout are defined with respect to this axis.

-
    -
  • \(x\)-axis: local_axis[:,0]

  • -
  • \(y\)-axis: local_axis[:,1]

  • -
  • \(z\)-axis: local_axis[:,2]

  • -
-

It will be an identity matrix if not provided.

-
-
-
-
Returns:
-
-
k_in_global: 3-length float array

The wave vector of the incident photon, with respect to the global \(xyz\) -axis.

-
-
k_out_global: 3-length float array

The wave vector of the scattered photon, with respect to the global \(xyz\) -axis.

-
-
-
-
-
- -
-
-edrixs.photon_transition.linear_polvec(theta, phi, alpha, local_axis=None, direction='in')[source]
-

Return linear polarization vector.

-
-
Parameters:
-
-
theta: float number

Incident or scattered angle (in radian) with respect to local_axis.

-
-
phi: float number

Azimuthal angle (in radian) with respect to the \(x\) of local_axis.

-
-
alpha: float number

The angle (in radian) between the polarization vector and the scattering plane.

-
-
local_axis: 3*3 float array

The local axis defining the scattering geometry.

-
    -
  • \(x\)-axis: local_axis[:,0]

  • -
  • \(y\)-axis: local_axis[:,1]

  • -
  • \(z\)-axis: local_axis[:,2]

  • -
-

It will be an identity matrix if not provided.

-
-
direction: string

The direction of photon wave, options can be

-
    -
  • ‘in’: incident photon

  • -
  • ‘out’: scattered photon

  • -
-
-
-
-
Returns:
-
-
polvec: list of 3 float number

The polarization vector.

-
-
-
-
-
- -
-
-edrixs.photon_transition.quadrupole_polvec(polvec, wavevec)[source]
-

Given dipolar polarization vector and wave-vector, return quadrupolar polarization vector.

-
-
Parameters:
-
-
polvec: 3 elements of complex array

Dipolar polarization vector of photon, \(\epsilon_{x}, \epsilon_{y}, \epsilon_{z}\), -NOTE: they can be complex when the polarization is circular.

-
-
wavevec: 3 elements of float array

Wavevector of photon, \(k_{x}, k_{y}, k_{z}\).

-
-
-
-
Returns:
-
-
quad_vec: 5 elements of float array

Quadrupolar polarization vector.

-
-
-
-
-
- -
-
-edrixs.photon_transition.unit_wavevector(theta, phi, local_axis=None, direction='in')[source]
-

Given incident or scattered angle, and azimuthal angle, return -unit wavevector with respect to global \(xyz\)-axis.

-
-
Parameters:
-
-
theta: float number

Incident or scattered angle (in radian), with respect to local_aixs.

-
-
phi: float number

Azimuthal angle (in radian), with respect to the \(x\) of local_axis.

-
-
local_axis: 3*3 float array

The local axis defining the scattering geometry.

-
    -
  • \(x\)-axis: local_axis[:,0]

  • -
  • \(y\)-axis: local_axis[:,1]

  • -
  • \(z\)-axis: local_axis[:,2]

  • -
-

It will be an identity matrix if not provided.

-
-
direction: string

The direction of photon wave, options can be

-
    -
  • ‘in’: incident photon

  • -
  • ‘out’: scattered photon

  • -
-
-
-
-
Returns:
-
-
unit_k: list of 3 float numbers

The unit wavevector.

-
-
-
-
-
- -
-
-edrixs.photon_transition.wavevector_with_length(theta, phi, energy, local_axis=None, direction='in')[source]
-

Given incident or scattered angle, azimuthal angle, energy of photon, return -wavevector with respect to global \(xyz\)-axis.

-
-
Parameters:
-
-
theta: float number

Incident or scattered angle (in radian), with respect to local_aixs.

-
-
phi: float number

Azimuthal angle (in radian), with respect to the \(x\) of local_axis.

-
-
energy: float number

Energy of photon (in eV).

-
-
local_axis: 3*3 float array

The local axis defining the scattering geometry.

-
    -
  • \(x\)-axis: local_axis[:,0]

  • -
  • \(y\)-axis: local_axis[:,1]

  • -
  • \(z\)-axis: local_axis[:,2]

  • -
-

It will be an identity matrix if not provided.

-
-
direction: string

The direction of photon wave, options can be

-
    -
  • ‘in’: incident photon

  • -
  • ‘out’: scattered photon

  • -
-
-
-
-
Returns:
-
-
k_with_length: list of 3 float numbers

The wavevector with length.

-
-
-
-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/plot_spectrum.html b/edrixs/reference/plot_spectrum.html deleted file mode 100644 index 76fd1ba762..0000000000 --- a/edrixs/reference/plot_spectrum.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - - - plot_spectrum — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

plot_spectrum

-
-
-edrixs.plot_spectrum.get_spectra_from_poles(poles_dict, omega_mesh, gamma_mesh, temperature)[source]
-

Given the dict of poles, calculate XAS or RIXS spectra using continued fraction formula,

-
-\[I(\omega_{i}) =-\frac{1}{\pi}\text{Im} \left[ \frac{1}{x - \alpha_{0} - -\frac{\beta_{1}^2}{x-\alpha_{1} - \frac{\beta_{2}^2}{x-\alpha_{2} - ...}} }\right],\]
-

where, \(x = \omega_{i}+i\Gamma_{i} + E_{g}\).

-
-
Parameters:
-
-
poles_dict: dict

Dict containing information of poles, which are calculated from -xas_fsolver and rixs_fsolver. -This dict is constructed by iostream.read_poles_from_file().

-
-
omega_mesh: 1d float array

Energy grid.

-
-
gamma_mesh: 1d float array

Life-time broadening.

-
-
temperature: float number

Temperature (K) for boltzmann distribution.

-
-
-
-
Returns:
-
-
spectra: 1d float array

The calculated XAS or RIXS spectra.

-
-
-
-
-
-

See also

-
-
iostream.read_poles_from_file

read XAS or RIXS poles files.

-
-
-
-
- -
-
-edrixs.plot_spectrum.merge_pole_dicts(list_pole_dict)[source]
-

Given a list of dict of poles, merge them into one dict of poles

-
-
Parameters:
-
-
list_pole_dict: list of dict

Dict containing information of poles, which are calculated from -xas_fsolver and rixs_fsolver.

-
-
-
-
Returns:
-
-
new_pole_dict: dict of poles

New dict of poles.

-
-
-
-
-
- -
-
-edrixs.plot_spectrum.plot_rixs_map(rixs_data, ominc_mesh, eloss_mesh, fname='rixsmap.pdf')[source]
-

Given 2d RIXS data, plot a RIXS map and save it to a pdf file.

-
-
Parameters:
-
-
rixs_data: 2d float array

Calculated RIXS data as a function of incident energy and energy loss.

-
-
ominc_mesh: 1d float array

Incident energy mesh.

-
-
eloss_mesh: 1d float array

Energy loss mesh.

-
-
fname: string

File name to save RIXS map.

-
-
-
-
-
- -
-
-edrixs.plot_spectrum.plot_spectrum(file_list, omega_mesh, gamma_mesh, T=1.0, fname='spectrum.dat', om_shift=0.0, fmt_float='{:.15f}')[source]
-

Reading poles \(\alpha\) and \(\beta\), and calculate -the spectrum using continued fraction formula,

-
-\[I(\omega_{i}) =-\frac{1}{\pi}\text{Im} \left[ \frac{1}{x - \alpha_{0} - -\frac{\beta_{1}^2}{x-\alpha_{1} - \frac{\beta_{2}^2}{x-\alpha_{2} - ...}} }\right],\]
-

where, \(x = \omega_{i}+i\Gamma_{i} + E_{g}\).

-
-
Parameters:
-
-
file_list: list of string

Name of poles file.

-
-
omega_mesh: 1d float array

The frequency mesh.

-
-
gamma_mesh: 1d float array

The broadening factor, in general, it is frequency dependent.

-
-
T: float (default: 1.0K)

Temperature (K).

-
-
fname: str (default: ‘spectrum.dat’)

File name to store spectrum.

-
-
om_shift: float (default: 0.0)

Energy shift.

-
-
fmt_float: str (default: ‘{:.15f}’)

Format for printing float numbers.

-
-
-
-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/rixs_utils.html b/edrixs/reference/rixs_utils.html deleted file mode 100644 index b2526cb64f..0000000000 --- a/edrixs/reference/rixs_utils.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - rixs_utils — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

rixs_utils

-
-
-edrixs.rixs_utils.scattering_mat(eval_i, eval_n, trans_mat_abs, trans_mat_emi, omega_inc, gamma_n)[source]
-

Calculate X-ray scattering magnitude.

-
-\[F^{ab}_{fi} = \sum_{n}\frac{<f|T_{a}|n><n|T_{b}|i>}{\omega_{in} - - E_{n} + E_{i} + i\Gamma_{n}},\]
-

where, \(T_{a}\) and \(T_{b}\) are components of transition -operators( \(a,b=x,y,z\)).

-
-
Parameters:
-
-
eval_i: 1d float array

Eigenvalues of the initial configuration without core-hole, \(E_i\).

-
-
eval_n: 1d float array

Eigenvalues of the intermediate configuration with core-hole, \(E_n\).

-
-
trans_mat_abs: 3d complex array

The transition operator for absorption process, \(<n|T_{b}|i>\).

-
-
trans_mat_emi: 3d complex array

The transition operator for emission process, \(<f|T_{a}|n>\).

-
-
omega_inc: float

The energy of incident photon, \(\omega_{in}\).

-
-
gamma_n: float

The broadening of the core-hole (eV), \(\Gamma_{n}\).

-
-
-
-
Returns:
-
-
Ffi: 4d complex array

The calculated scattering magnitude, \(F^{ab}_{fi}\).

-
-
-
-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/soc.html b/edrixs/reference/soc.html deleted file mode 100644 index 87cfa64c30..0000000000 --- a/edrixs/reference/soc.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - soc — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

soc

-
-
-edrixs.soc.atom_hsoc(case, soc)[source]
-

Return atomic spin-orbit coupling matrix \(\vec{l}\cdot\vec{s}\) -in complex spherical harmonics basis.

-
-
Parameters:
-
-
case: str

String label indicating atomic shell,

-
    -
  • ‘p’: for \(p\) -shell.

  • -
  • ‘t2g’: for \(t_{2g}\) -shell.

  • -
  • ‘d’: for \(d\) -shell.

  • -
  • ‘f’: for \(f\) -shell.

  • -
-
-
soc: float

The strength of spin-orbit coupling.

-
-
-
-
Returns:
-
-
hsoc: 2d complex array

The spin-orbit coupling matrix.

-
-
-
-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/solvers.html b/edrixs/reference/solvers.html deleted file mode 100644 index d02678abdc..0000000000 --- a/edrixs/reference/solvers.html +++ /dev/null @@ -1,1250 +0,0 @@ - - - - - - - - - solvers — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

solvers

-
-
-edrixs.solvers.ed_1v1c_fort(comm, shell_name, *, shell_level=None, v_soc=None, c_soc=0, v_noccu=1, slater=None, ext_B=None, on_which='spin', v_cfmat=None, v_othermat=None, do_ed=True, ed_solver=2, neval=1, nvector=1, ncv=3, idump=False, maxiter=500, eigval_tol=1e-08, min_ndim=1000)[source]
-

Perform ED for the case of one valence shell plus one Core-shell with Fortran ED solver.

-

The hopping and Coulomb terms of both the initial and intermediate Hamiltonians will be -constructed and written to files (hopping_i.in, hopping_n.in, coulomb_i.in and coulomb_n.in). -Fock basis for the initial Hamiltonian will be written to file (fock_i.in).

-

ED will be only performed on the initial Hamiltonian to find a few lowest eigenstates -do_ed=True. Only input files will be written if do_ed=False. -Due to large Hilbert space, the ed_fsolver written in Fortran will be called. -mpi4py and a MPI environment (mpich or openmpi) are required to launch ed_fsolver.

-

If do_ed=True, it will output the eigenvalues in file (eigvals.dat) and eigenvectors in files -(eigvec.n), where n means the n-th eigenvectors. The eigvec.n files will be used later -as the inputs for XAS and RIXS calculations.

-
-
Parameters:
-
-
comm: MPI_comm

The MPI communicator from mpi4py.

-
-
shell_name: tuple of two strings

Names of valence and core shells. The 1st (2nd) string in the tuple is for the -valence (core) shell.

-
    -
  • The 1st strings can only be ‘s’, ‘p’, ‘t2g’, ‘d’, ‘f’

  • -
  • The 2nd string can be ‘s’, ‘p’, ‘p12’, ‘p32’, ‘d’, ‘d32’, ‘d52’, -‘f’, ‘f52’, ‘f72’.

  • -
-

For example: shell_name=(‘d’, ‘p32’) may indicate a \(L_3\) edge transition from -core \(2p_{3/2}\) shell to valence \(3d\) shell for Ni.

-
-
shell_level: tuple of two float numbers

Energy level of valence (1st element) and core (2nd element) shells.

-

They will be set to zero if not provided.

-
-
v_soc: tuple of two float numbers

Spin-orbit coupling strength of the valence shell, -v1_soc[0] for the initial Hamiltonian, and -v1_soc[1] for the intermediate Hamiltonian.

-

They will be set to zero if not provided.

-
-
c_soc: float number

Spin-orbit coupling strength of core electrons.

-
-
v_noccu: int number

Total number of electrons in valence shells.

-
-
slater: tuple of two lists

Slater integrals for initial (1st list) and intermediate (2nd list) Hamiltonians. -The order of the elements in each list should be like this:

-

[FX_vv, FX_vc, GX_vc, FX_cc],

-

where X are integers with ascending order, it can be X=0, 2, 4, 6 or X=1, 3, 5. -One can ignore all the continuous zeros at the end of the list.

-

For example, if the full list is: [F0_dd, F2_dd, F4_dd, 0, F2_dp, 0, 0, 0, 0], one can -just provide [F0_dd, F2_dd, F4_dd, 0, F2_dp]

-

All the Slater integrals will be set to zero if slater==None.

-
-
ext_B: tuple of three float numbers

Vector of external magnetic field with respect to global \(xyz\)-axis applied -on the valence shell.

-

It will be set to zeros if not provided.

-
-
on_which: string

Apply Zeeman exchange field on which sector. Options are ‘spin’, ‘orbital’ or ‘both’.

-
-
v_cfmat: 2d complex array

Crystal field splitting Hamiltonian of the valence shell. The dimension and the orbital -order should be consistent with the type of the valence shell.

-

They will be zeros if not provided.

-
-
v_othermat: 2d complex array

Other possible Hamiltonian of the valence shell. The dimension and the orbital order -should be consistent with the type of the valence shell.

-

They will be zeros if not provided.

-
-
do_ed: logical

If do_end=True, diagonalize the Hamitlonian to find a few lowest eigenstates, return the -eigenvalues and density matirx, and write the eigenvectors in files eigvec.n, otherwise, -just write out the input files, do not perform the ED.

-
-
ed_solver: int

Type of ED solver, options can be 0, 1, 2

-
    -
  • 0: use Lapack to fully diagonalize Hamiltonian to get all the eigenvalues.

  • -
  • 1: use standard Lanczos algorithm to find only a few lowest eigenvalues, -no re-orthogonalization has been applied, so it is not very accurate.

  • -
  • 2: use parallel version of Arpack library to find a few lowest eigenvalues, -it is accurate and is the recommeded choice in real calculations of XAS and RIXS.

  • -
-
-
neval: int

Number of eigenvalues to be found. For ed_solver=2, the value should not be too small, -neval > 10 is usually a safe value.

-
-
nvector: int

Number of eigenvectors to be found and written into files.

-
-
ncv: int

Used for ed_solver=2, it should be at least ncv > neval + 2. Usually, set it a little -bit larger than neval, for example, set ncv=200 when neval=100.

-
-
idump: logical

Whether to dump the eigenvectors to files “eigvec.n”, where n means the n-th vectors.

-
-
maxiter: int

Maximum number of iterations in finding all the eigenvalues, used for ed_solver=1, 2.

-
-
eigval_tol: float

The convergence criteria of eigenvalues, used for ed_solver=1, 2.

-
-
min_ndim: int

The minimum dimension of the Hamiltonian when the ed_solver=1, 2 can be used, otherwise, -ed_solver=1 will be used.

-
-
-
-
Returns:
-
-
eval_i: 1d float array, shape=(neval, )

The eigenvalues of initial Hamiltonian.

-
-
denmat: 2d complex array, shape=(nvector, v_norb, v_norb))

The density matrix in the eigenstates.

-
-
-
-
-
- -
-
-edrixs.solvers.ed_1v1c_py(shell_name, *, shell_level=None, v_soc=None, c_soc=0, v_noccu=1, slater=None, ext_B=None, on_which='spin', v_cfmat=None, v_othermat=None, loc_axis=None, verbose=0)[source]
-

Perform ED for the case of two atomic shells, one valence plus one Core -shell with pure Python solver. -For example, for Ni-\(L_3\) edge RIXS, they are 3d valence and 2p core shells.

-

It will use scipy.linalag.eigh to exactly diagonalize both the initial and intermediate -Hamiltonians to get all the eigenvalues and eigenvectors, and the transition operators -will be built in the many-body eigenvector basis.

-

This solver is only suitable for small size of Hamiltonian, typically the dimension -of both initial and intermediate Hamiltonian are smaller than 10,000.

-
-
Parameters:
-
-
shell_name: tuple of two strings

Names of valence and core shells. The 1st (2nd) string in the tuple is for the -valence (core) shell.

-
    -
  • The 1st string can only be ‘s’, ‘p’, ‘t2g’, ‘d’, ‘f’,

  • -
  • The 2nd string can be ‘s’, ‘p’, ‘p12’, ‘p32’, ‘d’, ‘d32’, ‘d52’, -‘f’, ‘f52’, ‘f72’.

  • -
-

For example: shell_name=(‘d’, ‘p32’) indicates a \(L_3\) edge transition from -core \(p_{3/2}\) shell to valence \(d\) shell.

-
-
shell_level: tuple of two float numbers

Energy level of valence (1st element) and core (2nd element) shells.

-

They will be set to zero if not provided.

-
-
v_soc: tuple of two float numbers

Spin-orbit coupling strength of valence electrons, for the initial (1st element) -and intermediate (2nd element) Hamiltonians.

-

They will be set to zero if not provided.

-
-
c_soc: a float number

Spin-orbit coupling strength of core electrons.

-
-
v_noccu: int number

Number of electrons in valence shell.

-
-
slater: tuple of two lists

Slater integrals for initial (1st list) and intermediate (2nd list) Hamiltonians. -The order of the elements in each list should be like this:

-

[FX_vv, FX_vc, GX_vc, FX_cc],

-

where X are integers with ascending order, it can be X=0, 2, 4, 6 or X=1, 3, 5. -One can ignore all the continuous zeros at the end of the list.

-

For example, if the full list is: [F0_dd, F2_dd, F4_dd, 0, F2_dp, 0, 0, 0, 0], one can -just provide [F0_dd, F2_dd, F4_dd, 0, F2_dp]

-

All the Slater integrals will be set to zero if slater=None.

-
-
ext_B: tuple of three float numbers

Vector of external magnetic field with respect to global \(xyz\)-axis.

-

They will be set to zero if not provided.

-
-
on_which: string

Apply Zeeman exchange field on which sector. Options are ‘spin’, ‘orbital’ or ‘both’.

-
-
v_cfmat: 2d complex array

Crystal field splitting Hamiltonian of valence electrons. The dimension and the orbital -order should be consistent with the type of valence shell.

-

They will be zeros if not provided.

-
-
v_othermat: 2d complex array

Other possible Hamiltonian of valence electrons. The dimension and the orbital order -should be consistent with the type of valence shell.

-

They will be zeros if not provided.

-
-
loc_axis: 3*3 float array

The local axis with respect to which local orbitals are defined.

-
    -
  • x: local_axis[:,0],

  • -
  • y: local_axis[:,1],

  • -
  • z: local_axis[:,2].

  • -
-

It will be an identity matrix if not provided.

-
-
verbose: int

Level of writting data to files. Hopping matrices, Coulomb tensors, eigvenvalues -will be written if verbose > 0.

-
-
-
-
Returns:
-
-
eval_i: 1d float array

The eigenvalues of initial Hamiltonian.

-
-
eval_n: 1d float array

The eigenvalues of intermediate Hamiltonian.

-
-
trans_op: 3d complex array

The matrices of transition operators in the eigenvector basis. -Their components are defined with respect to the global \(xyz\)-axis.

-
-
-
-
-
- -
-
-edrixs.solvers.ed_2v1c_fort(comm, shell_name, *, shell_level=None, v1_soc=None, v2_soc=None, c_soc=0, v_tot_noccu=1, slater=None, v1_ext_B=None, v2_ext_B=None, v1_on_which='spin', v2_on_which='spin', v1_cfmat=None, v2_cfmat=None, v1_othermat=None, v2_othermat=None, hopping_v1v2=None, do_ed=True, ed_solver=2, neval=1, nvector=1, ncv=3, idump=False, maxiter=500, eigval_tol=1e-08, min_ndim=1000)[source]
-

Perform ED for the case of two valence shell plus one core-shell with Fortran solver. -For example, for Ni \(K\)-edge RIXS, \(1s\rightarrow 4p\) transition, -the valence shells involved in RIXS are \(3d\) and \(4p\).

-

The hopping and Coulomb terms of both the initial and intermediate Hamiltonians will be -constructed and written to files (hopping_i.in, hopping_n.in, coulomb_i.in and coulomb_n.in). -Fock basis for the initial Hamiltonian will be written to file (fock_i.in).

-

ED will be only performed on the initial Hamiltonian to find a few lowest eigenstates -do_ed=True. Only input files will be written if do_ed=False. -Due to large Hilbert space, the ed_fsolver written in Fortran will be called. -mpi4py and a MPI environment (mpich or openmpi) are required to launch ed_fsolver.

-

If do_ed=True, it will output the eigenvalues in file (eigvals.dat) and eigenvectors in files -(eigvec.n), where n means the n-th eigenvectors. The eigvec.n files will be used later -as the inputs for XAS and RIXS calculations.

-
-
Parameters:
-
-
comm: MPI_comm

The MPI communicator from mpi4py.

-
-
shell_name: tuple of three strings

Names of valence and core shells. The 1st (2nd) string in the tuple is for the -1st (2nd) valence shell, and the 3rd one is for the core shell.

-
    -
  • The 1st and 2nd strings can only be ‘s’, ‘p’, ‘t2g’, ‘d’, ‘f’

  • -
  • The 3nd string can be ‘s’, ‘p’, ‘p12’, ‘p32’, ‘d’, ‘d32’, ‘d52’, -‘f’, ‘f52’, ‘f72’.

  • -
-

For example: shell_name=(‘d’, ‘p’, ‘s’) may indicate a \(K\) edge transition from -core \(1s\) shell to valence \(3d\) and \(4p\) shell for Ni.

-
-
shell_level: tuple of three float numbers

Energy level of valence (1st and 2nd elements) and core (3nd element) shells.

-

They will be set to zero if not provided.

-
-
v1_soc: tuple of two float numbers

Spin-orbit coupling strength of the 1st valence shell, -v1_soc[0] for the initial Hamiltonian, and -v1_soc[1] for the intermediate Hamiltonian.

-

They will be set to zero if not provided.

-
-
v2_soc: tuple of two float numbers

Spin-orbit coupling strength of the 2nd valence shell, -v2_soc[0] for the initial Hamiltonian, and -v2_soc[1] for the intermediate Hamiltonian.

-

They will be set to zero if not provided.

-
-
c_soc: float number

Spin-orbit coupling strength of core electrons.

-
-
v_tot_noccu: int number

Total number of electrons in valence shells.

-
-
slater: tuple of two lists

Slater integrals for initial (1st list) and intermediate (2nd list) Hamiltonians. -The order of the elements in each list should be like this:

-

[FX_v1v1, FX_v1v2, GX_v1v2, FX_v2v2, FX_v1c, GX_v1c, FX_v2c, GX_v2c],

-

where X are integers with ascending order, it can be X=0, 2, 4, 6 or X=1, 3, 5. -One can ignore all the continuous zeros at the end of the list.

-

For example, if the full list is: [F0_dd, F2_dd, F4_dd, 0, F2_dp, 0, 0, 0, 0], one can -just provide [F0_dd, F2_dd, F4_dd, 0, F2_dp]

-

All the Slater integrals will be set to zero if slater==None.

-
-
v1_ext_B: tuple of three float numbers

Vector of external magnetic field with respect to global \(xyz\)-axis applied -on the 1st valence shell.

-

It will be set to zeros if not provided.

-
-
v2_ext_B: tuple of three float numbers

Vector of external magnetic field with respect to global \(xyz\)-axis applied -on the 2nd valence shell.

-

It will be set to zeros if not provided.

-
-
v1_on_which: string

Apply Zeeman exchange field on which sector. Options are ‘spin’, ‘orbital’ or ‘both’. -For the 1st valence shell.

-
-
v2_on_which: string

Apply Zeeman exchange field on which sector. Options are ‘spin’, ‘orbital’ or ‘both’. -For the 2nd valence shell.

-
-
v1_cfmat: 2d complex array

Crystal field splitting Hamiltonian of the 1st valence shell. The dimension and the orbital -order should be consistent with the type of the 1st valence shell.

-

They will be zeros if not provided.

-
-
v2_cfmat: 2d complex array

Crystal field splitting Hamiltonian of the 2nd valence shell. The dimension and the orbital -order should be consistent with the type of the 2nd valence shell.

-

They will be zeros if not provided.

-
-
v1_othermat: 2d complex array

Other possible Hamiltonian of the 1st valence shell. The dimension and the orbital order -should be consistent with the type of the 1st valence shell.

-

They will be zeros if not provided.

-
-
v2_othermat: 2d complex array

Other possible Hamiltonian of the 2nd valence shell. The dimension and the orbital order -should be consistent with the type of the 2nd valence shell.

-

They will be zeros if not provided.

-
-
hopping_v1v2: 2d complex array

Hopping between the two valence shells. The 1st-index (2nd-index) is the 1st (2nd) -valence shell.

-

They will be zeros if not provided.

-
-
do_ed: logical

If do_end=True, diagonalize the Hamitlonian to find a few lowest eigenstates, return the -eigenvalues and density matirx, and write the eigenvectors in files eigvec.n, otherwise, -just write out the input files, do not perform the ED.

-
-
ed_solver: int

Type of ED solver, options can be 0, 1, 2

-
    -
  • 0: use Lapack to fully diagonalize Hamiltonian to get all the eigenvalues.

  • -
  • 1: use standard Lanczos algorithm to find only a few lowest eigenvalues, -no re-orthogonalization has been applied, so it is not very accurate.

  • -
  • 2: use parallel version of Arpack library to find a few lowest eigenvalues, -it is accurate and is the recommeded choice in real calculations of XAS and RIXS.

  • -
-
-
neval: int

Number of eigenvalues to be found. For ed_solver=2, the value should not be too small, -neval > 10 is usually a safe value.

-
-
nvector: int

Number of eigenvectors to be found and written into files.

-
-
ncv: int

Used for ed_solver=2, it should be at least ncv > neval + 2. Usually, set it a little -bit larger than neval, for example, set ncv=200 when neval=100.

-
-
idump: logical

Whether to dump the eigenvectors to files “eigvec.n”, where n means the n-th vectors.

-
-
maxiter: int

Maximum number of iterations in finding all the eigenvalues, used for ed_solver=1, 2.

-
-
eigval_tol: float

The convergence criteria of eigenvalues, used for ed_solver=1, 2.

-
-
min_ndim: int

The minimum dimension of the Hamiltonian when the ed_solver=1, 2 can be used, otherwise, -ed_solver=1 will be used.

-
-
-
-
Returns:
-
-
eval_i: 1d float array, shape=(neval, )

The eigenvalues of initial Hamiltonian.

-
-
denmat: 2d complex array, shape=(nvector, v1v2_norb, v1v2_norb))

The density matrix in the eigenstates.

-
-
-
-
-
- -
-
-edrixs.solvers.ed_siam_fort(comm, shell_name, nbath, *, siam_type=0, v_noccu=1, static_core_pot=0, c_level=0, c_soc=0, trans_c2n=None, imp_mat=None, imp_mat_n=None, bath_level=None, bath_level_n=None, hyb=None, hyb_n=None, hopping=None, hopping_n=None, slater=None, ext_B=None, on_which='spin', do_ed=0, ed_solver=2, neval=1, nvector=1, ncv=3, idump=False, maxiter=1000, eigval_tol=1e-08, min_ndim=1000)[source]
-

Find the ground state of the initial Hamiltonian of a Single Impuirty Anderson Model (SIAM), -and also prepare input files, hopping_i.in, hopping_n.in, coulomb_i.in, coulomb_n.in -for following XAS and RIXS calculations.

-
-
Parameters:
-
-
comm: MPI_Comm

MPI Communicator

-
-
shell_name: tuple of two strings

Names of valence and core shells. The 1st (2nd) string in the tuple is for the -valence (core) shell.

-
    -
  • The 1st string can only be ‘s’, ‘p’, ‘t2g’, ‘d’, ‘f’,

  • -
  • The 2nd string can be ‘s’, ‘p’, ‘p12’, ‘p32’, ‘d’, ‘d32’, ‘d52’, -‘f’, ‘f52’, ‘f72’.

  • -
-

For example: shell_name=(‘d’, ‘p32’) indicates a \(L_3\) edge transition from -core \(p_{3/2}\) shell to valence \(d\) shell.

-
-
nbath: int

Number of bath sites.

-
-
siam_type: int

Type of SIAM Hamiltonian,

-
    -
  • 0: diagonal hybridization function, parameterized by imp_mat, bath_level and hyb

  • -
  • 1: general hybridization function, parameterized by matrix hopping

  • -
-

if siam_type=0, only imp_mat, bath_level and hyb are required, -if siam_type=1, only hopping is required.

-
-
v_noccu: int

Number of total occupancy of impurity and baths orbitals, required when do_ed=1, 2

-
-
static_core_pot: float

Static core hole potential.

-
-
c_level: float

Energy level of core shell.

-
-
c_soc: float

Spin-orbit coupling strength of core electrons.

-
-
trans_c2n: 2d complex array

The transformation matrix from the spherical harmonics basis to the basis on which -the imp_mat and hybridization function (bath_level, hyb, hopping) are defined.

-
-
imp_mat: 2d complex array

Impurity matrix for the impurity site, including CF or SOC, for siam_type=0 -and the initial configurations.

-
-
imp_mat_n: 2d complex array

Impurity matrix for the impurity site, including CF or SOC, for siam_type=0 -and the intermediate configurations. If imp_mat_n=None, imp_mat will be used.

-
-
bath_level: 2d complex array

Energy level of bath sites, 1st (2nd) dimension is for different bath sites (orbitals), -for siam_type=0 and the initial configurations.

-
-
bath_level_n: 2d complex array

Energy level of bath sites, 1st (2nd) dimension is for different bath sites (orbitals), -for siam_type=0 and the intermediate configurations. If bath_level_n=None, -bath_level will be used.

-
-
hyb: 2d complex array

Hybridization strength of bath sites, 1st (2nd) dimension is for different bath -sites (orbitals), for siam_type=0 and the initial configurations.

-
-
hyb_n: 2d complex array

Hybridization strength of bath sites, 1st (2nd) dimension is for different bath -sites (orbitals), for siam_type=0 and the intermediate configurations. -If hyb_n=None, hyb will be used.

-
-
hopping: 2d complex array

General hopping matrix when siam_type=1, including imp_mat and hybridization functions, -for siam_type=1 and the initial configurations.

-
-
hopping_n: 2d complex array

General hopping matrix when siam_type=1, including imp_mat and hybridization functions, -for siam_type=1 and the intermediate configurations. If hopping_n=None, -hopping will be used.

-
-
slater: tuple of two lists

Slater integrals for initial (1st list) and intermediate (2nd list) Hamiltonians. -The order of the elements in each list should be like this:

-

[FX_vv, FX_vc, GX_vc, FX_cc],

-

where X are integers with ascending order, it can be X=0, 2, 4, 6 or X=1, 3, 5. -One can ignore all the continuous zeros at the end of the list.

-

For example, if the full list is: [F0_dd, F2_dd, F4_dd, 0, F2_dp, 0, 0, 0, 0], one can -just provide [F0_dd, F2_dd, F4_dd, 0, F2_dp]

-

All the Slater integrals will be set to zero if slater=None.

-
-
ext_B: tuple of three float numbers

Vector of external magnetic field with respect to global \(xyz\)-axis.

-

They will be set to zero if not provided.

-
-
on_which: string

Apply Zeeman exchange field on which sector. Options are ‘spin’, ‘orbital’ or ‘both’.

-
-
do_ed: int
    -
  • 0: First, search the ground state in different subspaces of total occupancy -\(N\) with ed_solver=1, and then do a more accurate ED in the subspace -\(N\) where the ground state lies to find a few lowest eigenstates, return -the eigenvalues and density matirx, and write the eigenvectors in files eigvec.n

  • -
  • 1: Only do ED for given occupancy number v_noccu, return eigenvalues and -density matrix, write eigenvectors to files eigvec.n

  • -
  • 2: Do not do ED, only write parameters into files: hopping_i.in, hopping_n.in, -coulomb_i.in, coulomb_n.in for later XAS or RIXS calculations.

  • -
-
-
ed_solver: int

Type of ED solver, options can be 0, 1, 2

-
    -
  • 0: use Lapack to fully diagonalize Hamiltonian to get all the eigenvalues.

  • -
  • 1: use standard Lanczos algorithm to find only a few lowest eigenvalues, -no re-orthogonalization has been applied, so it is not very accurate.

  • -
  • 2: use parallel version of Arpack library to find a few lowest eigenvalues, -it is accurate and is the recommeded choice in real calculations of XAS and RIXS.

  • -
-
-
neval: int

Number of eigenvalues to be found. For ed_solver=2, the value should not be too small, -neval > 10 is usually a safe value.

-
-
nvector: int

Number of eigenvectors to be found and written into files.

-
-
ncv: int

Used for ed_solver=2, it should be at least ncv > neval + 2. Usually, set it a little -bit larger than neval, for example, set ncv=200 when neval=100.

-
-
idump: logical

Whether to dump the eigenvectors to files “eigvec.n”, where n means the n-th vectors.

-
-
maxiter: int

Maximum number of iterations in finding all the eigenvalues, used for ed_solver=1, 2.

-
-
eigval_tol: float

The convergence criteria of eigenvalues, used for ed_solver=1, 2.

-
-
min_ndim: int

The minimum dimension of the Hamiltonian when the ed_solver=1, 2 can be used, otherwise, -ed_solver=1 will be used.

-
-
-
-
Returns:
-
-
eval_i: 1d float array

Eigenvalues of initial Hamiltonian.

-
-
denmat: 2d complex array

Density matrix.

-
-
noccu_gs: int

Occupancy of the ground state.

-
-
-
-
-
- -
-
-edrixs.solvers.rixs_1v1c_fort(comm, shell_name, ominc, eloss, *, gamma_c=0.1, gamma_f=0.1, v_noccu=1, thin=1.0, thout=1.0, phi=0, pol_type=None, num_gs=1, nkryl=200, linsys_max=500, linsys_tol=1e-08, temperature=1.0, loc_axis=None, scatter_axis=None)[source]
-

Calculate RIXS for the case with one valence shell plus one core shell with Fortran solver.

-
-
Parameters:
-
-
comm: MPI_comm

MPI communicator.

-
-
shell_name: tuple of two strings

Names of valence and core shells. The 1st (2nd) string in the tuple is for the -valence (core) shell.

-
    -
  • The 1st string can only be ‘s’, ‘p’, ‘t2g’, ‘d’, ‘f’,

  • -
  • The 2nd string can be ‘s’, ‘p’, ‘p12’, ‘p32’, ‘d’, ‘d32’, ‘d52’, -‘f’, ‘f52’, ‘f72’.

  • -
-

For example: shell_name=(‘d’, ‘p32’) may indicate a \(L_3\) edge transition from -core \(2p_{3/2}\) shell to valence \(3d\) shell for Ni.

-
-
ominc: 1d float array

Incident energy of photon.

-
-
eloss: 1d float array

Energy loss.

-
-
gamma_c: a float number or a 1d float array with same shape as ominc.

The core-hole life-time broadening factor. It can be a constant value -or incident energy dependent.

-
-
gamma_f: a float number or a 1d float array with same shape as eloss.

The final states life-time broadening factor. It can be a constant value -or energy loss dependent.

-
-
v_noccu: int

Total occupancy of valence shells.

-
-
thin: float number

The incident angle of photon (in radian).

-
-
thout: float number

The scattered angle of photon (in radian).

-
-
phi: float number

Azimuthal angle (in radian), defined with respect to the -\(x\)-axis of scattering axis: scatter_axis[:,0].

-
-
pol_type: list of 4-elements-tuples

Type of polarizations. It has the following form:

-

(str1, alpha, str2, beta)

-

where, str1 (str2) can be ‘linear’, ‘left’, ‘right’, and alpha (beta) is -the angle (in radians) between the linear polarization vector and the scattering plane.

-

It will set pol_type=[(‘linear’, 0, ‘linear’, 0)] if not provided.

-
-
num_gs: int

Number of initial states used in RIXS calculations.

-
-
nkryl: int

Maximum number of poles obtained.

-
-
linsys_max: int

Maximum iterations of solving linear equations.

-
-
linsys_tol: float

Convergence for solving linear equations.

-
-
temperature: float number

Temperature (in K) for boltzmann distribution.

-
-
loc_axis: 3*3 float array

The local axis with respect to which local orbitals are defined.

-
    -
  • x: local_axis[:,0],

  • -
  • y: local_axis[:,1],

  • -
  • z: local_axis[:,2].

  • -
-

It will be an identity matrix if not provided.

-
-
scatter_axis: 3*3 float array

The local axis defining the scattering geometry. The scattering plane is defined in -the local \(zx\)-plane.

-
    -
  • local \(x\)-axis: scatter_axis[:,0]

  • -
  • local \(y\)-axis: scatter_axis[:,1]

  • -
  • local \(z\)-axis: scatter_axis[:,2]

  • -
-

It will be set to an identity matrix if not provided.

-
-
-
-
Returns:
-
-
rixs: 3d float array, shape=(len(ominc), len(eloss), len(pol_type))

The calculated RIXS spectra. The 1st dimension is for the incident energy, -the 2nd dimension is for the energy loss and the 3rd dimension is for -different polarizations.

-
-
poles: 2d list of dict, shape=(len(ominc), len(pol_type))

The calculated RIXS poles. The 1st dimension is for incident energy, and the -2nd dimension is for different polarizations.

-
-
-
-
-
- -
-
-edrixs.solvers.rixs_1v1c_py(eval_i, eval_n, trans_op, ominc, eloss, *, gamma_c=0.1, gamma_f=0.01, thin=1.0, thout=1.0, phi=0.0, pol_type=None, gs_list=None, temperature=1.0, scatter_axis=None, skip_gs=False)[source]
-

Calculate RIXS for the case of one valence shell plus one core shell with Python solver.

-

This solver is only suitable for small size of Hamiltonian, typically the dimension -of both initial and intermediate Hamiltonian are smaller than 10,000.

-
-
Parameters:
-
-
eval_i: 1d float array

The eigenvalues of the initial Hamiltonian.

-
-
eval_n: 1d float array

The eigenvalues of the intermediate Hamiltonian.

-
-
trans_op: 3d complex array

The transition operators in the eigenstates basis.

-
-
ominc: 1d float array

Incident energy of photon.

-
-
eloss: 1d float array

Energy loss.

-
-
gamma_c: a float number or a 1d float array with same shape as ominc.

The core-hole life-time broadening factor. It can be a constant value -or incident energy dependent.

-
-
gamma_f: a float number or a 1d float array with same shape as eloss.

The final states life-time broadening factor. It can be a constant value -or energy loss dependent.

-
-
thin: float number

The incident angle of photon (in radian).

-
-
thout: float number

The scattered angle of photon (in radian).

-
-
phi: float number

Azimuthal angle (in radian), defined with respect to the -\(x\)-axis of scattering axis: scatter_axis[:,0].

-
-
pol_type: list of 4-elements-tuples

Type of polarizations. It has the following form:

-

(str1, alpha, str2, beta)

-

where, str1 (str2) can be ‘linear’, ‘left’, ‘right’, ‘isotropic’ and alpha (beta) is -the angle (in radians) between the linear polarization vector and the scattering plane.

-

If str1 (or str2) is ‘isotropic’ then the polarization vector projects equally -along each axis and the other variables are ignored.

-

It will set pol_type=[(‘linear’, 0, ‘linear’, 0)] if not provided.

-
-
gs_list: 1d list of ints

The indices of initial states which will be used in RIXS calculations.

-

It will set gs_list=[0] if not provided.

-
-
temperature: float number

Temperature (in K) for boltzmann distribution.

-
-
scatter_axis: 3*3 float array

The local axis defining the scattering plane. The scattering plane is defined in -the local \(zx\)-plane.

-
    -
  • local \(x\)-axis: scatter_axis[:,0]

  • -
  • local \(y\)-axis: scatter_axis[:,1]

  • -
  • local \(z\)-axis: scatter_axis[:,2]

  • -
-

It will be an identity matrix if not provided.

-
-
skip_gs: bool

If True, transitions to the ground state(s) (forming the elastic peak) are omitted from -the calculation.

-
-
-
-
Returns:
-
-
rixs: 3d float array

The calculated RIXS spectra. The 1st dimension is for the incident energy, -the 2nd dimension is for the energy loss and the 3rd dimension is for -different polarizations.

-
-
-
-
-
- -
-
-edrixs.solvers.rixs_2v1c_fort(comm, shell_name, ominc, eloss, *, gamma_c=0.1, gamma_f=0.1, v_tot_noccu=1, trans_to_which=1, thin=1.0, thout=1.0, phi=0, pol_type=None, num_gs=1, nkryl=200, linsys_max=500, linsys_tol=1e-08, temperature=1.0, loc_axis=None, scatter_axis=None)[source]
-

Calculate RIXS for the case with 2 valence shells plus 1 core shell.

-
-
Parameters:
-
-
comm: MPI_comm

MPI communicator.

-
-
shell_name: tuple of three strings

Names of valence and core shells. The 1st (2nd) string in the tuple is for the -1st (2nd) valence shell, and the 3rd one is for the core shell.

-
    -
  • The 1st and 2nd strings can only be ‘s’, ‘p’, ‘t2g’, ‘d’, ‘f’,

  • -
  • The 3nd string can be ‘s’, ‘p’, ‘p12’, ‘p32’, ‘d’, ‘d32’, ‘d52’, -‘f’, ‘f52’, ‘f72’.

  • -
-

For example: shell_name=(‘d’, ‘p’, ‘s’) may indicate a \(K\) edge transition from -core \(1s\) shell to valence \(3d\) and \(4p\) shell for Ni.

-
-
ominc: 1d float array

Incident energy of photon.

-
-
eloss: 1d float array

Energy loss.

-
-
gamma_c: a float number or a 1d float array with same shape as ominc.

The core-hole life-time broadening factor. It can be a constant value -or incident energy dependent.

-
-
gamma_f: a float number or a 1d float array with same shape as eloss.

The final states life-time broadening factor. It can be a constant value -or energy loss dependent.

-
-
v_tot_noccu: int

Total occupancy of valence shells.

-
-
trans_to_which: int

Photon transition to which valence shell.

-
    -
  • 1: to 1st valence shell,

  • -
  • 2: to 2nd valence shell.

  • -
-
-
thin: float number

The incident angle of photon (in radian).

-
-
thout: float number

The scattered angle of photon (in radian).

-
-
phi: float number

Azimuthal angle (in radian), defined with respect to the -\(x\)-axis of scattering axis: scatter_axis[:,0].

-
-
pol_type: list of 4-elements-tuples

Type of polarizations. It has the following form:

-

(str1, alpha, str2, beta)

-

where, str1 (str2) can be ‘linear’, ‘left’, ‘right’, and alpha (beta) is -the angle (in radians) between the linear polarization vector and the scattering plane.

-

It will set pol_type=[(‘linear’, 0, ‘linear’, 0)] if not provided.

-
-
num_gs: int

Number of initial states used in RIXS calculations.

-
-
nkryl: int

Maximum number of poles obtained.

-
-
linsys_max: int

Maximum iterations of solving linear equations.

-
-
linsys_tol: float

Convergence for solving linear equations.

-
-
temperature: float number

Temperature (in K) for boltzmann distribution.

-
-
loc_axis: 3*3 float array

The local axis with respect to which local orbitals are defined.

-
    -
  • x: local_axis[:,0],

  • -
  • y: local_axis[:,1],

  • -
  • z: local_axis[:,2].

  • -
-

It will be an identity matrix if not provided.

-
-
scatter_axis: 3*3 float array

The local axis defining the scattering geometry. The scattering plane is defined in -the local \(zx\)-plane.

-
    -
  • local \(x\)-axis: scatter_axis[:,0]

  • -
  • local \(y\)-axis: scatter_axis[:,1]

  • -
  • local \(z\)-axis: scatter_axis[:,2]

  • -
-

It will be set to an identity matrix if not provided.

-
-
-
-
Returns:
-
-
rixs: 3d float array, shape=(len(ominc), len(eloss), len(pol_type))

The calculated RIXS spectra. The 1st dimension is for the incident energy, -the 2nd dimension is for the energy loss and the 3rd dimension is for -different polarizations.

-
-
poles: 2d list of dict, shape=(len(ominc), len(pol_type))

The calculated RIXS poles. The 1st dimension is for incident energy, and the -2nd dimension is for different polarizations.

-
-
-
-
-
- -
-
-edrixs.solvers.rixs_siam_fort(comm, shell_name, nbath, ominc, eloss, *, gamma_c=0.1, gamma_f=0.1, v_noccu=1, thin=1.0, thout=1.0, phi=0, pol_type=None, num_gs=1, nkryl=200, linsys_max=1000, linsys_tol=1e-10, temperature=1.0, loc_axis=None, scatter_axis=None)[source]
-

Calculate RIXS for single impurity Anderson model with Fortran solver.

-
-
Parameters:
-
-
comm: MPI_comm

MPI communicator.

-
-
shell_name: tuple of two strings

Names of valence and core shells. The 1st (2nd) string in the tuple is for the -valence (core) shell.

-
    -
  • The 1st string can only be ‘s’, ‘p’, ‘t2g’, ‘d’, ‘f’,

  • -
  • The 2nd string can be ‘s’, ‘p’, ‘p12’, ‘p32’, ‘d’, ‘d32’, ‘d52’, -‘f’, ‘f52’, ‘f72’.

  • -
-

For example: shell_name=(‘d’, ‘p32’) may indicate a \(L_3\) edge transition from -core \(2p_{3/2}\) shell to valence \(3d\) shell for Ni.

-
-
nbath: int

Number of bath sites.

-
-
ominc: 1d float array

Incident energy of photon.

-
-
eloss: 1d float array

Energy loss.

-
-
gamma_c: a float number or a 1d float array with same shape as ominc.

The core-hole life-time broadening factor. It can be a constant value -or incident energy dependent.

-
-
gamma_f: a float number or a 1d float array with same shape as eloss.

The final states life-time broadening factor. It can be a constant value -or energy loss dependent.

-
-
v_noccu: int

Total occupancy of valence shells.

-
-
thin: float number

The incident angle of photon (in radian).

-
-
thout: float number

The scattered angle of photon (in radian).

-
-
phi: float number

Azimuthal angle (in radian), defined with respect to the -\(x\)-axis of scattering axis: scatter_axis[:,0].

-
-
pol_type: list of 4-elements-tuples

Type of polarizations. It has the following form:

-

(str1, alpha, str2, beta)

-

where, str1 (str2) can be ‘linear’, ‘left’, ‘right’, and alpha (beta) is -the angle (in radians) between the linear polarization vector and the scattering plane.

-

It will set pol_type=[(‘linear’, 0, ‘linear’, 0)] if not provided.

-
-
num_gs: int

Number of initial states used in RIXS calculations.

-
-
nkryl: int

Maximum number of poles obtained.

-
-
linsys_max: int

Maximum iterations of solving linear equations.

-
-
linsys_tol: float

Convergence for solving linear equations.

-
-
temperature: float number

Temperature (in K) for boltzmann distribution.

-
-
loc_axis: 3*3 float array

The local axis with respect to which local orbitals are defined.

-
    -
  • x: local_axis[:,0],

  • -
  • y: local_axis[:,1],

  • -
  • z: local_axis[:,2].

  • -
-

It will be an identity matrix if not provided.

-
-
scatter_axis: 3*3 float array

The local axis defining the scattering geometry. The scattering plane is defined in -the local \(zx\)-plane.

-
    -
  • local \(x\)-axis: scatter_axis[:,0]

  • -
  • local \(y\)-axis: scatter_axis[:,1]

  • -
  • local \(z\)-axis: scatter_axis[:,2]

  • -
-

It will be set to an identity matrix if not provided.

-
-
-
-
Returns:
-
-
rixs: 3d float array, shape=(len(ominc), len(eloss), len(pol_type))

The calculated RIXS spectra. The 1st dimension is for the incident energy, -the 2nd dimension is for the energy loss and the 3rd dimension is for -different polarizations.

-
-
poles: 2d list of dict, shape=(len(ominc), len(pol_type))

The calculated RIXS poles. The 1st dimension is for incident energy, and the -2nd dimension is for different polarizations.

-
-
-
-
-
- -
-
-edrixs.solvers.xas_1v1c_fort(comm, shell_name, ominc, *, gamma_c=0.1, v_noccu=1, thin=1.0, phi=0, pol_type=None, num_gs=1, nkryl=200, temperature=1.0, loc_axis=None, scatter_axis=None)[source]
-

Calculate XAS for the case with one valence shells plus one core shell with Fortran solver.

-
-
Parameters:
-
-
comm: MPI_comm

MPI communicator.

-
-
shell_name: tuple of two strings

Names of valence and core shells. The 1st (2nd) string in the tuple is for the -valence (core) shell.

-
    -
  • The 1st string can only be ‘s’, ‘p’, ‘t2g’, ‘d’, ‘f’,

  • -
  • The 2nd string can be ‘s’, ‘p’, ‘p12’, ‘p32’, ‘d’, ‘d32’, ‘d52’, -‘f’, ‘f52’, ‘f72’.

  • -
-

For example: shell_name=(‘d’, ‘p32’) may indicate a \(L_3\) edge transition from -core \(2p_{3/2}\) shell to valence \(3d\) shell for Ni.

-
-
ominc: 1d float array

Incident energy of photon.

-
-
gamma_c: a float number or a 1d float array with the same shape as ominc.

The core-hole life-time broadening factor. It can be a constant value -or incident energy dependent.

-
-
v_noccu: int

Total occupancy of valence shells.

-
-
thin: float number

The incident angle of photon (in radian).

-
-
phi: float number

Azimuthal angle (in radian), defined with respect to the -\(x\)-axis of the local scattering axis: scatter_axis[:,0].

-
-
pol_type: list of tuples

Type of polarization, options can be:

-
    -
  • (‘linear’, alpha), linear polarization, where alpha is the angle between the -polarization vector and the scattering plane in radians.

  • -
  • (‘left’, 0), left circular polarization.

  • -
  • (‘right’, 0), right circular polarization.

  • -
  • (‘isotropic’, 0). isotropic polarization.

  • -
-

It will set pol_type=[(‘isotropic’, 0)] if not provided.

-
-
num_gs: int

Number of initial states used in XAS calculations.

-
-
nkryl: int

Maximum number of poles obtained.

-
-
temperature: float number

Temperature (in K) for boltzmann distribution.

-
-
loc_axis: 3*3 float array

The local axis with respect to which local orbitals are defined.

-
    -
  • x: local_axis[:,0],

  • -
  • y: local_axis[:,1],

  • -
  • z: local_axis[:,2].

  • -
-

It will be an identity matrix if not provided.

-
-
scatter_axis: 3*3 float array

The local axis defining the scattering geometry. The scattering plane is defined in -the local \(zx\)-plane.

-
    -
  • local \(x\)-axis: scatter_axis[:,0]

  • -
  • local \(y\)-axis: scatter_axis[:,1]

  • -
  • local \(z\)-axis: scatter_axis[:,2]

  • -
-

It will be set to an identity matrix if not provided.

-
-
-
-
Returns:
-
-
xas: 2d array, shape=(len(ominc), len(pol_type))

The calculated XAS spectra. The first dimension is for ominc, and the second dimension -if for different polarizations.

-
-
poles: list of dict, shape=(len(pol_type), )

The calculated XAS poles for different polarizations.

-
-
-
-
-
- -
-
-edrixs.solvers.xas_1v1c_py(eval_i, eval_n, trans_op, ominc, *, gamma_c=0.1, thin=1.0, phi=0, pol_type=None, gs_list=None, temperature=1.0, scatter_axis=None)[source]
-

Calculate XAS for the case of one valence shell plus one core shell with Python solver.

-

This solver is only suitable for small size of Hamiltonian, typically the dimension -of both initial and intermediate Hamiltonian are smaller than 10,000.

-
-
Parameters:
-
-
eval_i: 1d float array

The eigenvalues of the initial Hamiltonian.

-
-
eval_n: 1d float array

The eigenvalues of the intermediate Hamiltonian.

-
-
trans_op: 3d complex array

The transition operators in the eigenstates basis.

-
-
ominc: 1d float array

Incident energy of photon.

-
-
gamma_c: a float number or a 1d float array with the same shape as ominc.

The core-hole life-time broadening factor. It can be a constant value -or incident energy dependent.

-
-
thin: float number

The incident angle of photon (in radian).

-
-
phi: float number

Azimuthal angle (in radian), defined with respect to the -\(x\)-axis of the scattering axis: scatter_axis[:,0].

-
-
pol_type: list of tuples

Type of polarization, options can be:

-
    -
  • (‘linear’, alpha), linear polarization, where alpha is the angle between the -polarization vector and the scattering plane in radians.

  • -
  • (‘left’, 0), left circular polarization.

  • -
  • (‘right’, 0), right circular polarization.

  • -
  • (‘isotropic’, 0). isotropic polarization.

  • -
-

It will set pol_type=[(‘isotropic’, 0)] if not provided.

-
-
gs_list: 1d list of ints

The indices of initial states which will be used in XAS calculations.

-

It will set gs_list=[0] if not provided.

-
-
temperature: float number

Temperature (in K) for boltzmann distribution.

-
-
scatter_axis: 3*3 float array

The local axis defining the scattering plane. The scattering plane is defined in -the local \(zx\)-plane.

-

local \(x\)-axis: scatter_axis[:,0]

-

local \(y\)-axis: scatter_axis[:,1]

-

local \(z\)-axis: scatter_axis[:,2]

-

It will be set to an identity matrix if not provided.

-
-
-
-
Returns:
-
-
xas: 2d float array

The calculated XAS spectra. The 1st dimension is for the incident energy, and the -2nd dimension is for different polarizations.

-
-
-
-
-
- -
-
-edrixs.solvers.xas_2v1c_fort(comm, shell_name, ominc, *, gamma_c=0.1, v_tot_noccu=1, trans_to_which=1, thin=1.0, phi=0, pol_type=None, num_gs=1, nkryl=200, temperature=1.0, loc_axis=None, scatter_axis=None)[source]
-

Calculate XAS for the case with two valence shells plus one core shell with Fortran solver.

-
-
Parameters:
-
-
comm: MPI_comm

MPI communicator.

-
-
shell_name: tuple of three strings

Names of valence and core shells. The 1st (2nd) string in the tuple is for the -1st (2nd) valence shell, and the 3rd one is for the core shell.

-
    -
  • The 1st and 2nd strings can only be ‘s’, ‘p’, ‘t2g’, ‘d’, ‘f’,

  • -
  • The 3nd string can be ‘s’, ‘p’, ‘p12’, ‘p32’, ‘d’, ‘d32’, ‘d52’, -‘f’, ‘f52’, ‘f72’.

  • -
-

For example: shell_name=(‘d’, ‘p’, ‘s’) may indicate a \(K\) edge transition from -core \(1s\) shell to valence \(3d\) and \(4p\) shell for Ni.

-
-
ominc: 1d float array

Incident energy of photon.

-
-
gamma_c: a float number or a 1d float array with the same shape as ominc.

The core-hole life-time broadening factor. It can be a constant value -or incident energy dependent.

-
-
v_tot_noccu: int

Total occupancy of valence shells.

-
-
trans_to_which: int

Photon transition to which valence shell.

-
    -
  • 1: to 1st valence shell,

  • -
  • 2: to 2nd valence shell.

  • -
-
-
thin: float number

The incident angle of photon (in radian).

-
-
phi: float number

Azimuthal angle (in radian), defined with respect to the -\(x\)-axis of the local scattering axis: scatter_axis[:,0].

-
-
pol_type: list of tuples

Type of polarization, options can be:

-
    -
  • (‘linear’, alpha), linear polarization, where alpha is the angle between the -polarization vector and the scattering plane in radians.

  • -
  • (‘left’, 0), left circular polarization.

  • -
  • (‘right’, 0), right circular polarization.

  • -
  • (‘isotropic’, 0). isotropic polarization.

  • -
-

It will set pol_type=[(‘isotropic’, 0)] if not provided.

-
-
num_gs: int

Number of initial states used in XAS calculations.

-
-
nkryl: int

Maximum number of poles obtained.

-
-
temperature: float number

Temperature (in K) for boltzmann distribution.

-
-
loc_axis: 3*3 float array

The local axis with respect to which local orbitals are defined.

-
    -
  • x: local_axis[:,0],

  • -
  • y: local_axis[:,1],

  • -
  • z: local_axis[:,2].

  • -
-

It will be an identity matrix if not provided.

-
-
scatter_axis: 3*3 float array

The local axis defining the scattering geometry. The scattering plane is defined in -the local \(zx\)-plane.

-
    -
  • local \(x\)-axis: scatter_axis[:,0]

  • -
  • local \(y\)-axis: scatter_axis[:,1]

  • -
  • local \(z\)-axis: scatter_axis[:,2]

  • -
-

It will be set to an identity matrix if not provided.

-
-
-
-
Returns:
-
-
xas: 2d array, shape=(len(ominc), len(pol_type))

The calculated XAS spectra. The first dimension is for ominc, and the second dimension -if for different polarizations.

-
-
poles: list of dict, shape=(len(pol_type), )

The calculated XAS poles for different polarizations.

-
-
-
-
-
- -
-
-edrixs.solvers.xas_siam_fort(comm, shell_name, nbath, ominc, *, gamma_c=0.1, v_noccu=1, thin=1.0, phi=0, pol_type=None, num_gs=1, nkryl=200, temperature=1.0, loc_axis=None, scatter_axis=None)[source]
-

Calculate XAS for single impurity Anderson model (SIAM) with Fortran solver.

-
-
Parameters:
-
-
comm: MPI_comm

MPI communicator.

-
-
shell_name: tuple of two strings

Names of valence and core shells. The 1st (2nd) string in the tuple is for the -valence (core) shell.

-
    -
  • The 1st string can only be ‘s’, ‘p’, ‘t2g’, ‘d’, ‘f’,

  • -
  • The 2nd string can be ‘s’, ‘p’, ‘p12’, ‘p32’, ‘d’, ‘d32’, ‘d52’, -‘f’, ‘f52’, ‘f72’.

  • -
-

For example: shell_name=(‘d’, ‘p32’) may indicate a \(L_3\) edge transition from -core \(2p_{3/2}\) shell to valence \(3d\) shell for Ni.

-
-
nbath: int

Number of bath sites.

-
-
ominc: 1d float array

Incident energy of photon.

-
-
gamma_c: a float number or a 1d float array with the same shape as ominc.

The core-hole life-time broadening factor. It can be a constant value -or incident energy dependent.

-
-
v_noccu: int

Total occupancy of valence shells.

-
-
thin: float number

The incident angle of photon (in radian).

-
-
phi: float number

Azimuthal angle (in radian), defined with respect to the -\(x\)-axis of the local scattering axis: scatter_axis[:,0].

-
-
pol_type: list of tuples

Type of polarization, options can be:

-
    -
  • (‘linear’, alpha), linear polarization, where alpha is the angle between the -polarization vector and the scattering plane in radians.

  • -
  • (‘left’, 0), left circular polarization.

  • -
  • (‘right’, 0), right circular polarization.

  • -
  • (‘isotropic’, 0). isotropic polarization.

  • -
-

It will set pol_type=[(‘isotropic’, 0)] if not provided.

-
-
num_gs: int

Number of initial states used in XAS calculations.

-
-
nkryl: int

Maximum number of poles obtained.

-
-
temperature: float number

Temperature (in K) for boltzmann distribution.

-
-
loc_axis: 3*3 float array

The local axis with respect to which local orbitals are defined.

-
    -
  • x: local_axis[:,0],

  • -
  • y: local_axis[:,1],

  • -
  • z: local_axis[:,2].

  • -
-

It will be an identity matrix if not provided.

-
-
scatter_axis: 3*3 float array

The local axis defining the scattering geometry. The scattering plane is defined in -the local \(zx\)-plane.

-
    -
  • local \(x\)-axis: scatter_axis[:,0]

  • -
  • local \(y\)-axis: scatter_axis[:,1]

  • -
  • local \(z\)-axis: scatter_axis[:,2]

  • -
-

It will be set to an identity matrix if not provided.

-
-
-
-
Returns:
-
-
xas: 2d array, shape=(len(ominc), len(pol_type))

The calculated XAS spectra. The first dimension is for ominc, and the second dimension -if for different polarizations.

-
-
poles: list of dict, shape=(len(pol_type), )

The calculated XAS poles for different polarizations.

-
-
-
-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/utils.html b/edrixs/reference/utils.html deleted file mode 100644 index a47200f806..0000000000 --- a/edrixs/reference/utils.html +++ /dev/null @@ -1,872 +0,0 @@ - - - - - - - - - utils — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

utils

-
-
-edrixs.utils.CT_imp_bath(U_dd, Delta, n)[source]
-

Compute energies of the impurity and bath for an -Anderson impurity or charge-transfer model -appropriate for a \(d\)-shell transition metal compound.

-
-
Parameters:
-
-
U_dd: float

Coulomb interaction \(U_{dd}\)

-
-
Delta: float

Charge-transfer energy \(\Delta\)

-
-
ninteger

Number of electrons in the \(d\)-shell

-
-
-
-
Returns:
-
-
E_dfloat

Energy of the impurity states \(E_d\)

-
-
E_Lfloat

Energy of the bath states \(E_L\)

-
-
-
-
-

Notes

-

We credit our approach to Maurits Hakverkort, -Heidelberg University. -We define the state with a full set of bath orbitals to be zero -energy and write the energy levels using the same definitions -as [1] [2] [3].

-
    -
  • \(d^{n}L^{10}\) has energy \(0\)

  • -
  • \(d^{n+1}L^9\) has energy \(\Delta\)

  • -
  • \(d^{n+2}L^8\) has energy \(2\Delta + U_{dd}\)

  • -
-

Using this we can write and solve three linear equations to get -\(E_d\) and \(E_L\) the energies of the impurity and bath.

-
-
-\[\begin{split}\begin{aligned} -10 E_L + n E_d + n(n-1) \frac{U_{dd}}{2} &= 0 \\ - 9 E_L + (n+1) E_d + (n+1)n \frac{U_{dd}}{2} &= \Delta \\ - 8 E_L + (n+2) E_d + (n+1)(n+2) \frac{U_{dd}}{2} - &= 2\Delta + U_{dd} -\end{aligned}\end{split}\]
-
-

The solutions are:

-
-
-\[\begin{split}\begin{aligned} -E_d &= -\frac{10 \Delta - n (19 + n) U_{dd}/2}{10 + n} \\ -E_L &= -\frac{n ((1+n) U_{dd}/2-\Delta)}{10 + n} -\end{aligned}.\end{split}\]
-
-

References

-
-
-[1] -

J. Zaanen, G. A. Sawatzky, and J. W. Allen -Phys. Rev. Lett. 55, 418 (1985)

-
-
-[2] -

Maurits Haverkort et al., -Phys. Rev. B 85, 165113 (2012)

-
-
-[3] -

A. E. Bocquet et al., -Phys. Rev. B 53, 1161 (1996)

-
-
-
- -
-
-edrixs.utils.CT_imp_bath_core_hole(U_dd, U_pd, Delta, n)[source]
-

Compute energies of the impurity and bath for an -Anderson impurity or charge-transfer model -appropriate for a \(d\)-shell transition metal compound -with a core hole.

-
-
Parameters:
-
-
U_dd: float

Coulomb interaction \(U_{dd}\)

-
-
U_pd: float

Coulomb interaction \(U_{pd}\)

-
-
Delta: float

Charge-transfer energy \(\Delta\)

-
-
ninteger

Number of electrons in the \(d\)-shell \(n\)

-
-
-
-
Returns:
-
-
E_dcfloat

Energy of the impurity states \(E_{dc}\) with -a core hole

-
-
E_Lcfloat

Energy of the bath states \(E_{Lc}\) with a core -hole

-
-
E_pfloat

Energy of the core hole state \(E_\textrm{E_p}\)

-
-
-
-
-

Notes

-

We credit our approach to Maurits Hakverkort, -Heidelberg University. -We define the state with a full set of bath orbitals to be zero -energy and write the energy levels using the same definitions as -[1] [2] [3].

-
    -
  • \(2p^5 d^{n}L^{10}\) has energy \(0\)

  • -
  • \(2p^5 d^{n+1}L^9\) has energy \(\Delta + U_{dd} - U_{pd}\)

  • -
  • \(2p^5 d^{n+2}L^8\) has energy \(2\Delta + 3 U_{dd} - 2 U_{pd}\)

  • -
-

Using this we can write and solve linear equations to get -\(E_{dc}\), \(E_{Lc}\) and \(E_p\) the energies of the -impurity and bath with a core hole and the energy of the core hole.

-
-
-\[\begin{split}\begin{aligned} - 6 E_p + 10 E_{Lc} + n E_{dc} + n(n-1) \frac{U_{dd}}{2} - + 6 n U_{pd} &= 0 \\ - 6 E_p + 9 E_{Lc} + (n+1) E_{dc} + (n+1)n \frac{U_{dd}}{2} - + 6 (n+1) U_{pd} &= \Delta \\ - 6 E_p + 8 E_{Lc} + (n+2) E_{d} + (n+1)(n+2) \frac{U_{dd}}{2} - + 6 (n+2) U_{pd} &= 2 \Delta+U_{dd} \\ - 5 E_p + 10 E_{Lc} + (n+1) E_{d} + (n+1) n \frac{U_{dd}}{2} - + 5 (n+1) U_{pd} &= 0 \\ - 5 E_p + 9 E_{Lc} + (n+2) E_{dc} + (n+2)(n+1) \frac{U_{dd}}{2} - + 5 (n+2) U_{pd} &= \Delta+U_{dd}-U_{pd} \\ - 5 E_p + 8 E_{Lc} + (n+3) E_{dc} + (n+3)(n+2) \frac{U_{dd}}{2} - + 5 (n+3) U_{pd} &= 2 \Delta+3 U_{dd}-2 U_{pd} -\end{aligned}\end{split}\]
-
-

The solutions are:

-
-
-\[\begin{split}\begin{aligned} - E_{dc} &= \frac{10 \Delta - n (31+n) \frac{U_{dd}}{2}-90 U_{pd}}{16+n} \\ - E_{Lc} &= \frac{(1+n) (n \frac{U_{dd}}{2}+6*U_{pd})-(6+n) \Delta}{16+n} \\ - E_p &= \frac{10 \Delta + (1+n)(n\frac{U_{dd}}{2}-(10+n)*U_{pd}}{16+n} -\end{aligned}\end{split}\]
-
-

References

-
-
-[1] -

J. Zaanen, G. A. Sawatzky, and J. W. Allen -Phys. Rev. Lett. 55, 418 (1985)

-
-
-[2] -

Maurits Haverkort et al., -Phys. Rev. B 85, 165113 (2012)

-
-
-[3] -

A. E. Bocquet et al., -Phys. Rev. B 53, 1161 (1996)

-
-
-
- -
-
-edrixs.utils.F0F2F4F6_to_UdJH(F0, F2, F4, F6)[source]
-

Given \(F_0\), \(F_2\), \(F_4\) and \(F_6\), -return \(U_d\) and \(J_H\), for \(f\)-orbitals.

-
-
Parameters:
-
-
F0: float

Slater integral \(F_0\).

-
-
F2: float

Slater integral \(F_2\).

-
-
F4: float

Slater integral \(F_4\).

-
-
F6: float

Slater integral \(F_6\).

-
-
-
-
Returns:
-
-
Ud: float

Coulomb interaction \(U_d\).

-
-
JH: float

Hund’s coupling \(J_H\).

-
-
-
-
-
- -
-
-edrixs.utils.F0F2F4_to_UJ(F0, F2, F4)[source]
-

Given \(F_0\), \(F_2\) and \(F_4\), return \(U\) and \(J\), -for \(t2g\)-orbitals.

-
-
Parameters:
-
-
F0: float

Slater integral \(F_0\).

-
-
F2: float

Slater integral \(F_2\).

-
-
F4: float

Slater integral \(F_4\).

-
-
-
-
Returns:
-
-
U: float

Coulomb interaction \(U\).

-
-
J: float

Hund’s coupling \(J\).

-
-
-
-
-
- -
-
-edrixs.utils.F0F2F4_to_UdJH(F0, F2, F4)[source]
-

Given \(F_0\), \(F_2\) and \(F_4\), return \(U_d\) and \(J_H\), -for \(d\)-orbitals.

-
-
Parameters:
-
-
F0: float

Slater integral \(F_0\).

-
-
F2: float

Slater integral \(F_2\).

-
-
F4: float

Slater integral \(F_4\).

-
-
-
-
Returns:
-
-
Ud: float

Coulomb interaction \(U_d\).

-
-
JH: float

Hund’s coupling \(J_H\).

-
-
-
-
-
- -
-
-edrixs.utils.UJ_to_UdJH(U, J)[source]
-

Given Kanamori \(U\) and \(J\), return \(U_d\) and \(J_H\), -for \(t2g\)-orbitals.

-
-
Parameters:
-
-
U: float

Coulomb interaction \(U\).

-
-
J: float

Hund’s coupling \(J\).

-
-
-
-
Returns:
-
-
Ud: float

Coulomb interaction \(U_d\).

-
-
JH: float

Hund’s coupling \(J_{H}\).

-
-
-
-
-
- -
-
-edrixs.utils.UdJH_to_F0F2F4(Ud, JH)[source]
-

Given \(U_d\) and \(J_H\), return \(F_0\), \(F_2\) and \(F_4\), -for \(d\)-orbitals.

-
-
Parameters:
-
-
Ud: float

Coulomb interaction \(U_d\).

-
-
JH: float

Hund’s coupling \(J_H\).

-
-
-
-
Returns:
-
-
F0: float

Slater integral \(F_0\).

-
-
F2: float

Slater integral \(F_2\).

-
-
F4: float

Slater integral \(F_4\).

-
-
-
-
-
- -
-
-edrixs.utils.UdJH_to_F0F2F4F6(Ud, JH)[source]
-

Given \(U_d\) and \(J_H\), return \(F_0\), \(F_2\), \(F_4\) and \(F_6\), -for \(f\)-orbitals.

-
-
Parameters:
-
-
Ud: float

Coulomb interaction \(U_d\).

-
-
JH: float

Hund’s coupling \(J_H\).

-
-
-
-
Returns:
-
-
F0: float

Slater integral \(F_0\).

-
-
F2: float

Slater integral \(F_2\).

-
-
F4: float

Slater integral \(F_4\).

-
-
F6: float

Slater integral \(F_6\).

-
-
-
-
-
- -
-
-edrixs.utils.UdJH_to_UJ(Ud, JH)[source]
-

Given \(U_d\) and \(J_H\), return Kanamori \(U\) and \(J\), -for \(t2g\)-orbitals.

-
-
Parameters:
-
-
Ud: float

Coulomb interaction \(U_d\).

-
-
JH: float

Hund’s coupling \(J_H\).

-
-
-
-
Returns:
-
-
U: float

Coulomb interaction \(U\) in Kanamori form.

-
-
J: float

Hund’s coupling \(J\) in Kanamori form.

-
-
-
-
-
- -
-
-edrixs.utils.beta_to_kelvin(beta)[source]
-

Convert \(\beta\) to Kelvin.

-
-
Parameters:
-
-
beta: float

Inversion temperature.

-
-
-
-
Returns:
-
-
T: float

Temperature (K).

-
-
-
-
-
- -
-
-edrixs.utils.boltz_dist(gs, T)[source]
-

Return Boltzmann distributition.

-
-
Parameters:
-
-
gs: 1d float array

Energy levels.

-
-
T: float

Temperature in Kelvin.

-
-
-
-
Returns:
-
-
res: 1d float array

The Boltzmann distributition.

-
-
-
-
-
- -
-
-edrixs.utils.case_to_shell_name(case)[source]
-

Return the shell names for different cases.

-
-
Parameters:
-
-
case: string

A string describing the shells included.

-
-
-
-
Returns:
-
-
shell_name: tuple of one or two strings

The name of shells.

-
-
-
-
-

Examples

-
>>> import edrixs
->>> edrixs.case_to_shell_name('d')
-('d',)
->>> edrixs.case_to_shell_name('t2gp32')
-('t2g', 'p32')
-
-
-
- -
-
-edrixs.utils.edge_to_shell_name(edge_name, with_main_qn=False)[source]
-

Given edge name, return shell name. -If one needs to include both spin-orbit split edges of one shell, -one can use string, for example, ‘L23’ means both L2 and L3 edges -are considered in the calculations, and the shell name will be ‘p’.

-
-
Parameters:
-
-
edge_name: string

Standard edge name.

-
-
with_main_qn: logical

If true, the shell name will include the main quantum number.

-
-
Returns
-
——-
-
shell_name: string

Shell name.

-
    -
  • with_main_qn=True, shell_name will include the main quantum number, -for example, 2p

  • -
  • with_main_qn=False, shell_name will not include the main quantum number, -for example, p

  • -
-
-
-
-
-
- -
-
-edrixs.utils.get_atom_data(atom, v_name, v_noccu, edge=None, trans_to_which=1, label=None)[source]
-

Return Slater integrals, spin-orbit coupling strength, edge energy and core hole -life-time broadening for an atom with given type of valence shells, occupancy of -valence shells and the x-ray resonant edge.

-

The Slater integrals and spin-orbit coupling are calculated by Cowan’s code -(https://github.com/mretegan/atomic-parameters) based on Hartree-Fock -approximation. These numbers are just initial guess and serve as a start point, -you need to rescale them to reproduce your XAS or RIXS spectra.

-

NOTE: F0 is not calculated by Cowan’s code, they are all set to be zero, you need to -set F0 by yourself.

-
-
Parameters:
-
-
atom: string

Name of atom, for example, ‘Ni’, ‘Cu’, ‘Ir’, ‘U’.

-
-
v_name: a string or a tuple of one or two strings

Names of one or two valence shells. Set it to a single string if there is only -one valence shell, or set it to a tuple of two strings if there are two valence -shells. For example, v_name=’3d’, v_name=(‘3d’, ‘4p’)

-
-
v_noccu: a int or a tuple of one or two ints

Occupancy of valence shells before x-ray absorption (without a core hole). -Set it to a single int if there is only one valence shell, or set it to a -tuple of two ints if there are two valence shells. The order should be -consistent with that in v_name. -For example, v_name=’3d’, v_noccu=8, v_name=(‘3d’, ‘4p’), v_noccu=(8, 0).

-
-
edge: a string

X-ray resonant edge. If edge is not None, both the information of -the initial (without a core hole) and intermediate (with a core hole) Hamiltonians -will be returned, otherwise, only the information of the initial Hamiltonian -will be returned. It can be,

-
    -
  • K, L1, L2, L3, M1, M2, M3, M4, M5, N1, N2, N3, N4, N5, -N6, N7, O1, O2, O3, O4, O5, P1, P2, P3

  • -
  • L23 (both L2 and L3), M23 (both M2 and M3), M45 (both M4 and M5) -N23 (both N2 and N3), N45 (both N4 and N5), N67 (both N6 and N7) -O23 (both O2 and O3), O45 (both O4 and O5), P23 (both P2 and P3)

  • -
-
-
trans_to_which: int

If there are two valence shells, this variable is used to indicate which -valence shell the photon transition happens.

-
    -
  • 1: to the first valence shell

  • -
  • 2: to the second valence shell

  • -
-
-
label: a string or tuple of strings

User-defined symbols to label the names of Slater integrals.

-
    -
  • one element, for the valence shell

  • -
  • two elements, 1st (2nd)-element for the 1st (2nd) valence shells or -1st-element for the 1st valence shell and the 2nd one for the core shell.

  • -
  • three elements, the 1st (2nd)-element is for the 1st (2nd) valence shell, -the 3rd one is for the core shell

  • -
-
-
-
-
Returns:
-
-
res: dict

Atomic data. A dict likes this if edge is None:

-
res={
-    'slater_i': [(name of slater integrals, vaule of slater integrals), (), ...],
-    'v_soc': [list of SOC for each atomic shell in v_name],
-}
-
-
-

otherwise,

-
res={
-    'slater_i': [(name of slater integrals, value of slater integrals), (), ...],
-    'slater_n': [(name of slater integrals, value of slater integrals), (), ...],
-    'v_soc': [list of SOC for each atomic shell in v_name],
-    'c_soc': SOC of core shell,
-    'edge_ene': [list of edge energy, 2 elements if edge is any of
-    "L23, M23, M45, N23, N45, N67, O23, O45, P23", othewise only 1 element],
-    'gamma_c': [list of core hole life-time broadening, 2 elements if edge is any of
-    "L23, M23, M45, N23, N45, N67, O23, O45, P23", othewise only 1 element],
-}
-
-
-
-
-
-
-

Examples

-
>>> import edrixs
->>> res = edrixs.get_atom_data('Ni', v_name='3d', v_noccu=8)
->>> res
-{'slater_i': [('F0_11', 0.0), ('F2_11', 13.886), ('F4_11', 8.67)],
- 'v_soc_i': [0.112]}
->>> name, slater = [list(i) for i in zip(*res['slater_i'])]
->>> name
-['F0_11', 'F2_11', 'F4_11']
->>> slater
-[0.0, 13.886, 8.67]
->>> slater = [i * 0.8 for i in slater]
->>> slater[0] = edrixs.get_F0('d', slater[1], slater[2])
->>> slater
-[0.5728507936507936, 11.1088, 6.936]
-
-
-
>>> import edrixs
->>> res=edrixs.get_atom_data('Ni', v_name='3d', v_noccu=8, edge='L3', label=('d', 'p'))
->>> res
-{'slater_i': [('F0_dd', 0.0), ('F2_dd', 12.234), ('F4_dd', 7.598)],
- 'v_soc_i': [0.083],
- 'slater_n': [('F0_dd', 0.0), ('F2_dd', 12.234), ('F4_dd', 7.598),
-  ('F0_dp', 0.0), ('F2_dp', 7.721), ('G1_dp', 5.787), ('G3_dp', 3.291),
-  ('F0_pp', 0.0), ('F2_pp', 0.0)],
- 'v_soc_n': [0.102],
- 'c_soc': 11.507,
- 'edge_ene': [852.7],
- 'gamma_c': [0.275]}
->>> name_i, slater_i = [list(i) for i in zip(*res['slater_i'])]
->>> name_n, slater_n = [list(i) for i in zip(*res['slater_n'])]
->>> name_i
-['F0_dd', 'F2_dd', 'F4_dd']
->>> slater_i
-[0.0, 12.234, 7.598]
->>> name_n
-['F0_dd', 'F2_dd', 'F4_dd', 'F0_dp', 'F2_dp', 'G1_dp', 'G3_dp', 'F0_pp', 'F2_pp']
->>> slater_n
-[0.0, 12.234, 7.598, 0.0, 7.721, 5.787, 3.291, 0.0, 0.0]
->>> slater_n[0] = edrixs.get_F0('d', slater_n[1], slater_n[2])
->>> slater_n[3] = edrixs.get_F0('dp', slater_n[5], slater_n[6])
->>> slater_n
-[0.6295873015873016, 12.234, 7.598, 0.5268428571428572, 7.721, 5.787, 3.291, 0.0, 0.0]
-
-
-
>>> import edrixs
->>> import collections
->>> res=edrixs.get_atom_data('Ni', v_name=('3d', '4p'), v_noccu=(8, 0),
-...     edge='K', trans_to_which=2, label=('d', 'p', 's'))
->>> res
-{'slater_i': [('F0_dd', 0.0), ('F2_dd', 12.234), ('F4_dd', 7.598),
-  ('F0_dp', 0.0), ('F2_dp', 0.0), ('G1_dp', 0.0), ('G3_dp', 0.0),
-  ('F0_pp', 0.0), ('F2_pp', 0.0)],
- 'v_soc_i': [0.083, 0.0],
- 'slater_n': [('F0_dd', 0.0), ('F2_dd', 13.851), ('F4_dd', 8.643),
-  ('F0_dp', 0.0), ('F2_dp', 2.299), ('G1_dp', 0.828), ('G3_dp', 0.713),
-  ('F0_pp', 0.0), ('F2_pp', 0.0),
-  ('F0_ds', 0.0), ('G2_ds', 0.079),
-  ('F0_ps', 0.0), ('G1_ps', 0.194),
-  ('F0_ss', 0.0)],
- 'v_soc_n': [0.113, 0.093],
- 'c_soc': 0.0,
- 'edge_ene': [8333.0],
- 'gamma_c': [0.81]}
->>> slat_i = collections.OrderedDict(res['slater_i'])
->>> slat_n = collections.OrderedDict(res['slater_n'])
->>> list(slat_i.keys())
-['F0_dd', 'F2_dd', 'F4_dd', 'F0_dp', 'F2_dp', 'G1_dp', 'G3_dp', 'F0_pp', 'F2_pp']
->>> list(slat_i.values())
-[0.0, 12.234, 7.598, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
->>> list(slat_n.keys())
-['F0_dd', 'F2_dd', 'F4_dd', 'F0_dp', 'F2_dp', 'G1_dp', 'G3_dp', 'F0_pp', 'F2_pp',
- 'F0_ds', 'G2_ds', 'F0_ps', 'G1_ps', 'F0_ss']
->>> list(slat_n.values())
-[0.0, 13.851, 8.643, 0.0, 2.299, 0.828, 0.713, 0.0, 0.0,
- 0.0, 0.079, 0.0, 0.194, 0.0]
-
-
-
- -
-
-edrixs.utils.info_atomic_shell()[source]
-

Return a dict to describe the information of atomic shell. -The key is a string of the shell’s name, the value is a 2-elments tuple, -the first value is the orbital angular moment number and -the second value is the dimension of the Hilbert space.

-
-
Returns:
-
-
info: dict

The dict describing info of atomic shell.

-
-
-
-
-
- -
-
-edrixs.utils.kelvin_to_beta(k)[source]
-

Convert temperature from Kelvin to \(\beta\).

-
-
Parameters:
-
-
k: float

Temperature in Kelvin.

-
-
-
-
Returns:
-
-
beta: float

Inversion temperature.

-
-
-
-
-
- -
-
-edrixs.utils.rescale(old_list, scale=None)[source]
-

Rescale a 1d list.

-
-
Parameters:
-
-
old_list: 1d list of numerical values

Input list.

-
-
scale: a list of tuples

The scaling factors.

-
-
-
-
Returns:
-
-
new_list: 1d list

The rescaled list.

-
-
-
-
-
- -
-
-edrixs.utils.slater_integrals_name(shell_name, label=None)[source]
-

Given shell names, return the names of required Slater integrals. -The order of these names in the return list is according to the convention:

-
    -
  • For 1 shell: [FX_11]

  • -
  • For 2 shells: [FX_11, FX_12, GX_12, FX_22]

  • -
  • For 3 shells: [FX_11, FX_12, GX_12, FX_22, FX_13, GX_13, FX_23, GX_23, FX_33]

  • -
-

where, X=0, 2, 4, 6, or X=1, 3, 5, X shoule be in ascending order.

-
-
Parameters:
-
-
shell_name: tuple of strings

Name of shells. Its length should be less and equal than 3.

-
-
label: tuple of strings

Label of shells, same shape as shell_name.

-

If not provided, label will be set to

-
    -
  • label=(1,) for one shell, or

  • -
  • label=(1,2) for two shells, or

  • -
  • label=(1,2,3) for three shells

  • -
-
-
-
-
Returns:
-
-
res: list of strings

Names of Slater integrals.

-
-
-
-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/reference/wannier_ham.html b/edrixs/reference/wannier_ham.html deleted file mode 100644 index 517dd34b17..0000000000 --- a/edrixs/reference/wannier_ham.html +++ /dev/null @@ -1,386 +0,0 @@ - - - - - - - - - wannier_ham — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

wannier_ham

-
-
-class edrixs.wannier_ham.HR(nwann, nrpt, irpt0, rpts, deg_rpt, hr)[source]
-

Class for post-process of the Wannier90 tight-binding (TB) Hamiltonian in real space.

-
-
Parameters:
-
-
nwann: int

Number of Wannier orbitals.

-
-
nrpt: int

Number of \(r\) points.

-
-
irpt0: int

Index of the point (0,0,0).

-
-
rpts: float array

The coordinates of \(r\) points.

-
-
deg_rpt: int array

Degenerancy of \(r\) points.

-
-
hr: complex array

Hamiltonian \(H(r)\) from Wannier90.

-
-
-
-
-
-
-static copy_hr(other)[source]
-

Copy instance of HR.

-
-
Parameters:
-
-
other: HR object

A HR object to be copied.

-
-
-
-
Returns:
-
-
HR: HR object

Return a new HR object.

-
-
-
-
-
- -
-
-static from_file(fname='wannier90_hr.dat')[source]
-

Generate a TB Hamiltonian from Wannier90 output file “case_hr.dat”.

-
-
Parameters:
-
-
fname: str

The file that contains the Wannier90 output file: “case_hr.dat”.

-
-
-
-
Returns:
-
-
HR: HR object

A HR object.

-
-
-
-
-
- -
-
-get_hr(ispin)[source]
-

Return the Hamiltonian of \(H(r)\).

-
-
Parameters:
-
-
ispin: logical

Whether to include spin degree of freedom or not (default: False)

-
-
-
-
Returns:
-
-
hr: 3d complex array

The Hamiltonian \(H(r)\).

-
-
-
-
-
- -
-
-get_hr0(ispin=False)[source]
-

Return the on-site term \(H(r=0)\).

-
-
Parameters:
-
-
ispin: logical

Whether to include spin degree of freedom or not (default: False).

-
-
-
-
Returns:
-
-
hr: 2d complex array

The on-site Hamiltonian.

-
-
-
-
-
- -
- -
-
-class edrixs.wannier_ham.KVec(kpt_type='uni', kbase=None, nkpt=None, kvec=None)[source]
-

Define \(k\) points in BZ, high symmetry line or uniform grid.

-
-
Parameters:
-
-
kpt_type: str

The type of \(k\) points, ‘uni’ or ‘sym’.

-
-
kbase: :math:`3 times 3` float array

The basis vectors of the primitive reciprocal space.

-
-
nkpt: int

Number of \(k\) points.

-
-
kvec: float array

The \(k\) points.

-
-
-
-
-
-
-kvec_from_file(fname)[source]
-

Read \(k\) points from file.

-
-
Parameters:
-
-
fname: str

File name.

-
-
-
-
-
- -
-
-set_base(kbase)[source]
-

Set the basis of the primitive reciprocal.

-
-
Parameters:
-
-
kbase: :math:`3 times 3` float array

The basis with respect to the global axis.

-
-
-
-
-
- -
- -
-
-class edrixs.wannier_ham.SymKVec(kbase=None, hsymkpt=None, klen=None)[source]
-

Class for defining \(k\) points in high symmetry line, derived from KVec.

-
-
Parameters:
-
-
kbase: :math:`3 times 3` float array

Basis of the primitive reciprocal lattice.

-
-
hsymkpt: float array

Starting and end \(k\) points along high symmetry lines.

-
-
klen: float array

Length of segments of \(k\) points line.

-
-
-
-
-
-
-from_hsymkpt(nkpt_per_path=20)[source]
-

Given starting and end \(k\) points of each segment, -and the number of points per each segment, -return the high symmetry \(k\) points.

-
-
Parameters:
-
-
nkpt_per_path: int

Number of \(k\) points per each segment.

-
-
-
-
-
- -
-
-from_hsymkpt_uni(step)[source]
-

Given a step, return high symmetry \(k\) points.

-
-
Parameters:
-
-
step: float

Step size.

-
-
-
-
-
- -
-
-get_klen()[source]
-

Return length of \(k\) points segments.

-
- -
- -
-
-class edrixs.wannier_ham.UniKVec(grid=None)[source]
-

Class for defining uniform \(k\) points grid, derived from KVec.

-
-
Parameters:
-
-
grid: 3-elements tuple

Three numbers defining a uniform grid, for example: \(11 \times 11 \times 11\).

-
-
-
-
-
-
-from_grid()[source]
-

Return uniform \(k\) points.

-
- -
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/release-history.html b/edrixs/release-history.html deleted file mode 100644 index 66c8e0a0de..0000000000 --- a/edrixs/release-history.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - Release History — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Release History

-
-

Initial Release (YYYY-MM-DD)

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/search.html b/edrixs/search.html deleted file mode 100644 index dc38118ee7..0000000000 --- a/edrixs/search.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - Search — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
-
    -
  • - -
  • -
  • -
-
-
-
-
- - - - -
- -
- -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/edrixs/searchindex.js b/edrixs/searchindex.js deleted file mode 100644 index e01e39a242..0000000000 --- a/edrixs/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({"alltitles": {"1. Intra orbital": [[9, "intra-orbital"]], "2. Inter orbital Coulomb interactions": [[9, "inter-orbital-coulomb-interactions"]], "3. Inter-orbital exchange interactions": [[9, "inter-orbital-exchange-interactions"]], "4. Pair hopping term": [[9, "pair-hopping-term"]], "5. Three orbital": [[9, "three-orbital"]], "6. Four orbital": [[9, "four-orbital"]], "Anderson impurity model for NiO XAS": [[3, null]], "Angular dependence": [[7, "angular-dependence"]], "Basis transform": [[9, "basis-transform"]], "Build from source": [[36, "build-from-source"]], "Build matrices describing interactions": [[3, "build-matrices-describing-interactions"]], "Build the Fock basis and Hamiltonain and Diagonalize": [[4, "build-the-fock-basis-and-hamiltonain-and-diagonalize"]], "Charge transfer excitons": [[8, "charge-transfer-excitons"]], "Charge-transfer energy for NiO": [[5, null]], "Computation times": [[11, null], [29, null]], "Compute RIXS": [[2, "compute-rixs"]], "Compute XAS": [[2, "compute-xas"]], "Computing expectation values": [[0, "computing-expectation-values"]], "Connecton between atomic and charge transfer limits": [[8, "connecton-between-atomic-and-charge-transfer-limits"]], "Contents:": [[18, null]], "Coulomb interactions": [[0, "coulomb-interactions"], [3, "coulomb-interactions"], [9, null]], "Create basis": [[0, "create-basis"]], "Create function to populate and diagonalize matrices": [[6, "create-function-to-populate-and-diagonalize-matrices"]], "Create matrix": [[9, "create-matrix"]], "Crystal field matrices": [[1, "crystal-field-matrices"]], "Crystal field on an atom": [[1, "crystal-field-on-an-atom"]], "Crystal fields": [[1, null]], "Determine eigenvectors and occupations": [[5, "determine-eigenvectors-and-occupations"]], "Diagonalization": [[2, "diagonalization"], [8, "diagonalization"]], "Diagonalize the matrix": [[0, "diagonalize-the-matrix"]], "Diagonalizing by blocks": [[5, "diagonalizing-by-blocks"]], "ED": [[31, null]], "EDRIXS papers": [[37, null]], "Effects of multi-orbital terms": [[9, "effects-of-multi-orbital-terms"]], "Eigenvectors": [[7, "eigenvectors"]], "Energy level diagram": [[0, "energy-level-diagram"]], "Energy of the bath states": [[3, "energy-of-the-bath-states"]], "Energy splitting in ligand states": [[5, "energy-splitting-in-ligand-states"]], "Energy to lowest energy ligand orbital": [[5, "energy-to-lowest-energy-ligand-orbital"]], "Exact diagonalization": [[0, null]], "Examples": [[34, null]], "Examples from our CPC paper": [[34, "examples-from-our-cpc-paper"]], "Extended examples": [[34, "extended-examples"]], "Four fermion matrix": [[4, "four-fermion-matrix"]], "Full d shell calculation": [[2, "full-d-shell-calculation"]], "Ground state analysis for NiO": [[4, null]], "Hamiltonian": [[4, "hamiltonian"]], "Hello RIXS!": [[39, "hello-rixs"]], "How to cite": [[37, "how-to-cite"]], "Hubbard Dimer": [[6, null]], "Hund\u2019s Interactions in charge transfer insulators": [[8, null]], "Import parameters": [[4, "import-parameters"]], "Indices and tables": [[18, "indices-and-tables"]], "Initial Release (YYYY-MM-DD)": [[28, "initial-release-yyyy-mm-dd"]], "Initialize matrices": [[6, "initialize-matrices"]], "Install and use edrixs via Anaconda": [[36, "install-and-use-edrixs-via-anaconda"]], "Installation": [[36, null]], "Interactions": [[9, "interactions"]], "Number of electrons": [[3, "number-of-electrons"]], "Papers using EDRIXS": [[37, "papers-using-edrixs"]], "Parameterizing interactions": [[9, "parameterizing-interactions"]], "Parameters": [[0, "parameters"]], "Pedagogical examples": [[10, null]], "Plot": [[4, "plot"], [7, "plot"]], "Plot XAS and RIXS": [[2, "plot-xas-and-rixs"]], "Quickstart tutorial": [[39, null]], "RIXS": [[32, null]], "RIXS calculations for an atomic model": [[2, null]], "Release History": [[28, null]], "Requirements": [[36, "requirements"]], "Run edrixs in a docker container": [[40, "run-edrixs-in-a-docker-container"]], "Run through orbitals": [[7, "run-through-orbitals"]], "Setup": [[8, "setup"]], "Sharing your code": [[40, "sharing-your-code"]], "Slater parameters": [[2, "slater-parameters"]], "Specify active core and valence orbitals": [[2, "specify-active-core-and-valence-orbitals"]], "Spin orbit coupling": [[0, "spin-orbit-coupling"]], "State analysis": [[4, "state-analysis"]], "Table of 2 orbital interactions": [[9, "id3"]], "Table of 3 orbital interactions": [[9, "id4"]], "Table of 4 orbital interactions": [[9, "id5"]], "The atomic limit": [[8, "the-atomic-limit"]], "The large U limit": [[6, "the-large-u-limit"]], "Tips for python and edrixs": [[38, null]], "Transform interactions into Fock basis": [[0, "transform-interactions-into-fock-basis"]], "Transition operators and scattering matrix": [[7, "transition-operators-and-scattering-matrix"]], "Two fermion matrix": [[4, "two-fermion-matrix"]], "U dependence": [[6, "u-dependence"]], "Ubuntu Linux 20.04": [[36, "ubuntu-linux-20-04"]], "Use Homebrew": [[36, "use-homebrew"]], "Use MacPorts": [[36, "use-macports"]], "Use edrixs as an ED calculator": [[39, "use-edrixs-as-an-ed-calculator"]], "What is edrixs?": [[41, null]], "Where are the holes for large hopping": [[8, "where-are-the-holes-for-large-hopping"]], "X-ray transitions": [[7, null]], "XAS": [[33, null]], "angular_momentum": [[13, null]], "basis_transform": [[14, null]], "coulomb_utensor": [[15, null]], "edrixs Documentation": [[12, null]], "edrixs Reference": [[18, null]], "edrixs User Guide": [[35, null]], "edrixs and docker": [[40, null]], "edrixs basics": [[30, null]], "fit_hyb": [[16, null]], "fock_basis": [[17, null]], "iostream": [[19, null]], "macOS Mojave (OSX 10.14)": [[36, "macos-mojave-osx-10-14"]], "manybody_operator": [[20, null]], "photon_transition": [[21, null]], "plot_spectrum": [[22, null]], "rixs_utils": [[23, null]], "soc": [[24, null]], "solvers": [[25, null]], "utils": [[26, null]], "wannier_ham": [[27, null]]}, "docnames": ["auto_examples/example_0_ed_calculator", "auto_examples/example_1_crystal_field", "auto_examples/example_2_single_atom_RIXS", "auto_examples/example_3_AIM_XAS", "auto_examples/example_4_GS_analysis", "auto_examples/example_5_charge_transfer", "auto_examples/example_6_Hubbard_dimer", "auto_examples/example_7_transitions", "auto_examples/example_8_Hunds_interactions", "auto_examples/example_9_Coulomb", "auto_examples/index", "auto_examples/sg_execution_times", "index", "reference/angular_momentum", "reference/basis_transform", "reference/coulomb_utensor", "reference/fit_hyb", "reference/fock_basis", "reference/index", "reference/iostream", "reference/manybody_operator", "reference/photon_transition", "reference/plot_spectrum", "reference/rixs_utils", "reference/soc", "reference/solvers", "reference/utils", "reference/wannier_ham", "release-history", "sg_execution_times", "user/basics", "user/basics.ed", "user/basics.rixs", "user/basics.xas", "user/examples", "user/index", "user/installation", "user/papers", "user/pythontips", "user/quickstart", "user/usedocker", "user/whatisedrixs"], "envversion": {"sphinx": 64, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx.ext.viewcode": 1}, "filenames": ["auto_examples/example_0_ed_calculator.rst", "auto_examples/example_1_crystal_field.rst", "auto_examples/example_2_single_atom_RIXS.rst", "auto_examples/example_3_AIM_XAS.rst", "auto_examples/example_4_GS_analysis.rst", "auto_examples/example_5_charge_transfer.rst", "auto_examples/example_6_Hubbard_dimer.rst", "auto_examples/example_7_transitions.rst", "auto_examples/example_8_Hunds_interactions.rst", "auto_examples/example_9_Coulomb.rst", "auto_examples/index.rst", "auto_examples/sg_execution_times.rst", "index.rst", "reference/angular_momentum.rst", "reference/basis_transform.rst", "reference/coulomb_utensor.rst", "reference/fit_hyb.rst", "reference/fock_basis.rst", "reference/index.rst", "reference/iostream.rst", "reference/manybody_operator.rst", "reference/photon_transition.rst", "reference/plot_spectrum.rst", "reference/rixs_utils.rst", "reference/soc.rst", "reference/solvers.rst", "reference/utils.rst", "reference/wannier_ham.rst", "release-history.rst", "sg_execution_times.rst", "user/basics.rst", "user/basics.ed.rst", "user/basics.rixs.rst", "user/basics.xas.rst", "user/examples.rst", "user/index.rst", "user/installation.rst", "user/papers.rst", "user/pythontips.rst", "user/quickstart.rst", "user/usedocker.rst", "user/whatisedrixs.rst"], "indexentries": {"atom_hsoc() (in module edrixs.soc)": [[24, "edrixs.soc.atom_hsoc", false]], "beta_to_kelvin() (in module edrixs.utils)": [[26, "edrixs.utils.beta_to_kelvin", false]], "boltz_dist() (in module edrixs.utils)": [[26, "edrixs.utils.boltz_dist", false]], "build_opers() (in module edrixs.manybody_operator)": [[20, "edrixs.manybody_operator.build_opers", false]], "case_to_shell_name() (in module edrixs.utils)": [[26, "edrixs.utils.case_to_shell_name", false]], "cb_op() (in module edrixs.basis_transform)": [[14, "edrixs.basis_transform.cb_op", false]], "cb_op2() (in module edrixs.basis_transform)": [[14, "edrixs.basis_transform.cb_op2", false]], "cf_cubic_d() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.cf_cubic_d", false]], "cf_square_planar_d() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.cf_square_planar_d", false]], "cf_tetragonal_d() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.cf_tetragonal_d", false]], "cf_trigonal_t2g() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.cf_trigonal_t2g", false]], "combination() (in module edrixs.fock_basis)": [[17, "edrixs.fock_basis.combination", false]], "copy_hr() (edrixs.wannier_ham.hr static method)": [[27, "edrixs.wannier_ham.HR.copy_hr", false]], "ct_imp_bath() (in module edrixs.utils)": [[26, "edrixs.utils.CT_imp_bath", false]], "ct_imp_bath_core_hole() (in module edrixs.utils)": [[26, "edrixs.utils.CT_imp_bath_core_hole", false]], "density_matrix() (in module edrixs.manybody_operator)": [[20, "edrixs.manybody_operator.density_matrix", false]], "dipole_polvec_rixs() (in module edrixs.photon_transition)": [[21, "edrixs.photon_transition.dipole_polvec_rixs", false]], "dipole_polvec_xas() (in module edrixs.photon_transition)": [[21, "edrixs.photon_transition.dipole_polvec_xas", false]], "dmat_spinor() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.dmat_spinor", false]], "dump_poles() (in module edrixs.iostream)": [[19, "edrixs.iostream.dump_poles", false]], "ed_1v1c_fort() (in module edrixs.solvers)": [[25, "edrixs.solvers.ed_1v1c_fort", false]], "ed_1v1c_py() (in module edrixs.solvers)": [[25, "edrixs.solvers.ed_1v1c_py", false]], "ed_2v1c_fort() (in module edrixs.solvers)": [[25, "edrixs.solvers.ed_2v1c_fort", false]], "ed_siam_fort() (in module edrixs.solvers)": [[25, "edrixs.solvers.ed_siam_fort", false]], "edge_to_shell_name() (in module edrixs.utils)": [[26, "edrixs.utils.edge_to_shell_name", false]], "edrixs": [[18, "module-edrixs", false]], "edrixs.angular_momentum": [[13, "module-edrixs.angular_momentum", false]], "edrixs.basis_transform": [[14, "module-edrixs.basis_transform", false]], "edrixs.coulomb_utensor": [[15, "module-edrixs.coulomb_utensor", false]], "edrixs.fit_hyb": [[16, "module-edrixs.fit_hyb", false]], "edrixs.fock_basis": [[17, "module-edrixs.fock_basis", false]], "edrixs.iostream": [[19, "module-edrixs.iostream", false]], "edrixs.manybody_operator": [[20, "module-edrixs.manybody_operator", false]], "edrixs.photon_transition": [[21, "module-edrixs.photon_transition", false]], "edrixs.plot_spectrum": [[22, "module-edrixs.plot_spectrum", false]], "edrixs.rixs_utils": [[23, "module-edrixs.rixs_utils", false]], "edrixs.soc": [[24, "module-edrixs.soc", false]], "edrixs.solvers": [[25, "module-edrixs.solvers", false]], "edrixs.utils": [[26, "module-edrixs.utils", false]], "edrixs.wannier_ham": [[27, "module-edrixs.wannier_ham", false]], "euler_to_rmat() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.euler_to_rmat", false]], "f0f2f4_to_udjh() (in module edrixs.utils)": [[26, "edrixs.utils.F0F2F4_to_UdJH", false]], "f0f2f4_to_uj() (in module edrixs.utils)": [[26, "edrixs.utils.F0F2F4_to_UJ", false]], "f0f2f4f6_to_udjh() (in module edrixs.utils)": [[26, "edrixs.utils.F0F2F4F6_to_UdJH", false]], "fit_func() (in module edrixs.fit_hyb)": [[16, "edrixs.fit_hyb.fit_func", false]], "fit_hyb() (in module edrixs.fit_hyb)": [[16, "edrixs.fit_hyb.fit_hyb", false]], "fock_bin() (in module edrixs.fock_basis)": [[17, "edrixs.fock_basis.fock_bin", false]], "four_fermion() (in module edrixs.manybody_operator)": [[20, "edrixs.manybody_operator.four_fermion", false]], "fourier_hr2hk() (in module edrixs.basis_transform)": [[14, "edrixs.basis_transform.fourier_hr2hk", false]], "from_file() (edrixs.wannier_ham.hr static method)": [[27, "edrixs.wannier_ham.HR.from_file", false]], "from_grid() (edrixs.wannier_ham.unikvec method)": [[27, "edrixs.wannier_ham.UniKVec.from_grid", false]], "from_hsymkpt() (edrixs.wannier_ham.symkvec method)": [[27, "edrixs.wannier_ham.SymKVec.from_hsymkpt", false]], "from_hsymkpt_uni() (edrixs.wannier_ham.symkvec method)": [[27, "edrixs.wannier_ham.SymKVec.from_hsymkpt_uni", false]], "get_atom_data() (in module edrixs.utils)": [[26, "edrixs.utils.get_atom_data", false]], "get_fock_basis_by_n_abelian() (in module edrixs.fock_basis)": [[17, "edrixs.fock_basis.get_fock_basis_by_N_abelian", false]], "get_fock_basis_by_n_lzsz() (in module edrixs.fock_basis)": [[17, "edrixs.fock_basis.get_fock_basis_by_N_LzSz", false]], "get_fock_basis_by_njz() (in module edrixs.fock_basis)": [[17, "edrixs.fock_basis.get_fock_basis_by_NJz", false]], "get_fock_basis_by_nlz() (in module edrixs.fock_basis)": [[17, "edrixs.fock_basis.get_fock_basis_by_NLz", false]], "get_fock_basis_by_nsz() (in module edrixs.fock_basis)": [[17, "edrixs.fock_basis.get_fock_basis_by_NSz", false]], "get_fock_bin_by_n() (in module edrixs.fock_basis)": [[17, "edrixs.fock_basis.get_fock_bin_by_N", false]], "get_fock_full_n() (in module edrixs.fock_basis)": [[17, "edrixs.fock_basis.get_fock_full_N", false]], "get_gaunt() (in module edrixs.coulomb_utensor)": [[15, "edrixs.coulomb_utensor.get_gaunt", false]], "get_hr() (edrixs.wannier_ham.hr method)": [[27, "edrixs.wannier_ham.HR.get_hr", false]], "get_hr0() (edrixs.wannier_ham.hr method)": [[27, "edrixs.wannier_ham.HR.get_hr0", false]], "get_hyb() (in module edrixs.fit_hyb)": [[16, "edrixs.fit_hyb.get_hyb", false]], "get_klen() (edrixs.wannier_ham.symkvec method)": [[27, "edrixs.wannier_ham.SymKVec.get_klen", false]], "get_ladd() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.get_ladd", false]], "get_lminus() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.get_lminus", false]], "get_lx() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.get_lx", false]], "get_ly() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.get_ly", false]], "get_lz() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.get_lz", false]], "get_orb_momentum() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.get_orb_momentum", false]], "get_pauli() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.get_pauli", false]], "get_spectra_from_poles() (in module edrixs.plot_spectrum)": [[22, "edrixs.plot_spectrum.get_spectra_from_poles", false]], "get_spin_momentum() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.get_spin_momentum", false]], "get_sx() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.get_sx", false]], "get_sy() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.get_sy", false]], "get_sz() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.get_sz", false]], "get_trans_oper() (in module edrixs.photon_transition)": [[21, "edrixs.photon_transition.get_trans_oper", false]], "get_umat_kanamori() (in module edrixs.coulomb_utensor)": [[15, "edrixs.coulomb_utensor.get_umat_kanamori", false]], "get_umat_kanamori_ge() (in module edrixs.coulomb_utensor)": [[15, "edrixs.coulomb_utensor.get_umat_kanamori_ge", false]], "get_umat_slater() (in module edrixs.coulomb_utensor)": [[15, "edrixs.coulomb_utensor.get_umat_slater", false]], "get_umat_slater_3shells() (in module edrixs.coulomb_utensor)": [[15, "edrixs.coulomb_utensor.get_umat_slater_3shells", false]], "get_wavevector_rixs() (in module edrixs.photon_transition)": [[21, "edrixs.photon_transition.get_wavevector_rixs", false]], "get_wigner_dmat() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.get_wigner_dmat", false]], "hr (class in edrixs.wannier_ham)": [[27, "edrixs.wannier_ham.HR", false]], "info_atomic_shell() (in module edrixs.utils)": [[26, "edrixs.utils.info_atomic_shell", false]], "kelvin_to_beta() (in module edrixs.utils)": [[26, "edrixs.utils.kelvin_to_beta", false]], "kvec (class in edrixs.wannier_ham)": [[27, "edrixs.wannier_ham.KVec", false]], "kvec_from_file() (edrixs.wannier_ham.kvec method)": [[27, "edrixs.wannier_ham.KVec.kvec_from_file", false]], "linear_polvec() (in module edrixs.photon_transition)": [[21, "edrixs.photon_transition.linear_polvec", false]], "load_poles() (in module edrixs.iostream)": [[19, "edrixs.iostream.load_poles", false]], "merge_pole_dicts() (in module edrixs.plot_spectrum)": [[22, "edrixs.plot_spectrum.merge_pole_dicts", false]], "module": [[13, "module-edrixs.angular_momentum", false], [14, "module-edrixs.basis_transform", false], [15, "module-edrixs.coulomb_utensor", false], [16, "module-edrixs.fit_hyb", false], [17, "module-edrixs.fock_basis", false], [18, "module-edrixs", false], [19, "module-edrixs.iostream", false], [20, "module-edrixs.manybody_operator", false], [21, "module-edrixs.photon_transition", false], [22, "module-edrixs.plot_spectrum", false], [23, "module-edrixs.rixs_utils", false], [24, "module-edrixs.soc", false], [25, "module-edrixs.solvers", false], [26, "module-edrixs.utils", false], [27, "module-edrixs.wannier_ham", false]], "one_fermion_annihilation() (in module edrixs.manybody_operator)": [[20, "edrixs.manybody_operator.one_fermion_annihilation", false]], "plot_rixs_map() (in module edrixs.plot_spectrum)": [[22, "edrixs.plot_spectrum.plot_rixs_map", false]], "plot_spectrum() (in module edrixs.plot_spectrum)": [[22, "edrixs.plot_spectrum.plot_spectrum", false]], "quadrupole_polvec() (in module edrixs.photon_transition)": [[21, "edrixs.photon_transition.quadrupole_polvec", false]], "read_poles_from_file() (in module edrixs.iostream)": [[19, "edrixs.iostream.read_poles_from_file", false]], "rescale() (in module edrixs.utils)": [[26, "edrixs.utils.rescale", false]], "rixs_1v1c_fort() (in module edrixs.solvers)": [[25, "edrixs.solvers.rixs_1v1c_fort", false]], "rixs_1v1c_py() (in module edrixs.solvers)": [[25, "edrixs.solvers.rixs_1v1c_py", false]], "rixs_2v1c_fort() (in module edrixs.solvers)": [[25, "edrixs.solvers.rixs_2v1c_fort", false]], "rixs_siam_fort() (in module edrixs.solvers)": [[25, "edrixs.solvers.rixs_siam_fort", false]], "rmat_to_euler() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.rmat_to_euler", false]], "scattering_mat() (in module edrixs.rixs_utils)": [[23, "edrixs.rixs_utils.scattering_mat", false]], "set_base() (edrixs.wannier_ham.kvec method)": [[27, "edrixs.wannier_ham.KVec.set_base", false]], "slater_integrals_name() (in module edrixs.utils)": [[26, "edrixs.utils.slater_integrals_name", false]], "symkvec (class in edrixs.wannier_ham)": [[27, "edrixs.wannier_ham.SymKVec", false]], "tmat_c2j() (in module edrixs.basis_transform)": [[14, "edrixs.basis_transform.tmat_c2j", false]], "tmat_c2r() (in module edrixs.basis_transform)": [[14, "edrixs.basis_transform.tmat_c2r", false]], "tmat_cub2r_f() (in module edrixs.basis_transform)": [[14, "edrixs.basis_transform.tmat_cub2r_f", false]], "tmat_r2c() (in module edrixs.basis_transform)": [[14, "edrixs.basis_transform.tmat_r2c", false]], "tmat_r2cub_f() (in module edrixs.basis_transform)": [[14, "edrixs.basis_transform.tmat_r2cub_f", false]], "transform_utensor() (in module edrixs.basis_transform)": [[14, "edrixs.basis_transform.transform_utensor", false]], "two_fermion() (in module edrixs.manybody_operator)": [[20, "edrixs.manybody_operator.two_fermion", false]], "udjh_to_f0f2f4() (in module edrixs.utils)": [[26, "edrixs.utils.UdJH_to_F0F2F4", false]], "udjh_to_f0f2f4f6() (in module edrixs.utils)": [[26, "edrixs.utils.UdJH_to_F0F2F4F6", false]], "udjh_to_uj() (in module edrixs.utils)": [[26, "edrixs.utils.UdJH_to_UJ", false]], "uj_to_udjh() (in module edrixs.utils)": [[26, "edrixs.utils.UJ_to_UdJH", false]], "umat_slater() (in module edrixs.coulomb_utensor)": [[15, "edrixs.coulomb_utensor.umat_slater", false]], "unikvec (class in edrixs.wannier_ham)": [[27, "edrixs.wannier_ham.UniKVec", false]], "unit_wavevector() (in module edrixs.photon_transition)": [[21, "edrixs.photon_transition.unit_wavevector", false]], "wavevector_with_length() (in module edrixs.photon_transition)": [[21, "edrixs.photon_transition.wavevector_with_length", false]], "where_is_angle() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.where_is_angle", false]], "write_config() (in module edrixs.iostream)": [[19, "edrixs.iostream.write_config", false]], "write_emat() (in module edrixs.iostream)": [[19, "edrixs.iostream.write_emat", false]], "write_fock_dec_by_n() (in module edrixs.fock_basis)": [[17, "edrixs.fock_basis.write_fock_dec_by_N", false]], "write_tensor() (in module edrixs.iostream)": [[19, "edrixs.iostream.write_tensor", false]], "write_umat() (in module edrixs.iostream)": [[19, "edrixs.iostream.write_umat", false]], "xas_1v1c_fort() (in module edrixs.solvers)": [[25, "edrixs.solvers.xas_1v1c_fort", false]], "xas_1v1c_py() (in module edrixs.solvers)": [[25, "edrixs.solvers.xas_1v1c_py", false]], "xas_2v1c_fort() (in module edrixs.solvers)": [[25, "edrixs.solvers.xas_2v1c_fort", false]], "xas_siam_fort() (in module edrixs.solvers)": [[25, "edrixs.solvers.xas_siam_fort", false]], "zx_to_rmat() (in module edrixs.angular_momentum)": [[13, "edrixs.angular_momentum.zx_to_rmat", false]]}, "objects": {"": [[18, 0, 0, "-", "edrixs"]], "edrixs": [[13, 0, 0, "-", "angular_momentum"], [14, 0, 0, "-", "basis_transform"], [15, 0, 0, "-", "coulomb_utensor"], [16, 0, 0, "-", "fit_hyb"], [17, 0, 0, "-", "fock_basis"], [19, 0, 0, "-", "iostream"], [20, 0, 0, "-", "manybody_operator"], [21, 0, 0, "-", "photon_transition"], [22, 0, 0, "-", "plot_spectrum"], [23, 0, 0, "-", "rixs_utils"], [24, 0, 0, "-", "soc"], [25, 0, 0, "-", "solvers"], [26, 0, 0, "-", "utils"], [27, 0, 0, "-", "wannier_ham"]], "edrixs.angular_momentum": [[13, 1, 1, "", "cf_cubic_d"], [13, 1, 1, "", "cf_square_planar_d"], [13, 1, 1, "", "cf_tetragonal_d"], [13, 1, 1, "", "cf_trigonal_t2g"], [13, 1, 1, "", "dmat_spinor"], [13, 1, 1, "", "euler_to_rmat"], [13, 1, 1, "", "get_ladd"], [13, 1, 1, "", "get_lminus"], [13, 1, 1, "", "get_lx"], [13, 1, 1, "", "get_ly"], [13, 1, 1, "", "get_lz"], [13, 1, 1, "", "get_orb_momentum"], [13, 1, 1, "", "get_pauli"], [13, 1, 1, "", "get_spin_momentum"], [13, 1, 1, "", "get_sx"], [13, 1, 1, "", "get_sy"], [13, 1, 1, "", "get_sz"], [13, 1, 1, "", "get_wigner_dmat"], [13, 1, 1, "", "rmat_to_euler"], [13, 1, 1, "", "where_is_angle"], [13, 1, 1, "", "zx_to_rmat"]], "edrixs.basis_transform": [[14, 1, 1, "", "cb_op"], [14, 1, 1, "", "cb_op2"], [14, 1, 1, "", "fourier_hr2hk"], [14, 1, 1, "", "tmat_c2j"], [14, 1, 1, "", "tmat_c2r"], [14, 1, 1, "", "tmat_cub2r_f"], [14, 1, 1, "", "tmat_r2c"], [14, 1, 1, "", "tmat_r2cub_f"], [14, 1, 1, "", "transform_utensor"]], "edrixs.coulomb_utensor": [[15, 1, 1, "", "get_gaunt"], [15, 1, 1, "", "get_umat_kanamori"], [15, 1, 1, "", "get_umat_kanamori_ge"], [15, 1, 1, "", "get_umat_slater"], [15, 1, 1, "", "get_umat_slater_3shells"], [15, 1, 1, "", "umat_slater"]], "edrixs.fit_hyb": [[16, 1, 1, "", "fit_func"], [16, 1, 1, "", "fit_hyb"], [16, 1, 1, "", "get_hyb"]], "edrixs.fock_basis": [[17, 1, 1, "", "combination"], [17, 1, 1, "", "fock_bin"], [17, 1, 1, "", "get_fock_basis_by_NJz"], [17, 1, 1, "", "get_fock_basis_by_NLz"], [17, 1, 1, "", "get_fock_basis_by_NSz"], [17, 1, 1, "", "get_fock_basis_by_N_LzSz"], [17, 1, 1, "", "get_fock_basis_by_N_abelian"], [17, 1, 1, "", "get_fock_bin_by_N"], [17, 1, 1, "", "get_fock_full_N"], [17, 1, 1, "", "write_fock_dec_by_N"]], "edrixs.iostream": [[19, 1, 1, "", "dump_poles"], [19, 1, 1, "", "load_poles"], [19, 1, 1, "", "read_poles_from_file"], [19, 1, 1, "", "write_config"], [19, 1, 1, "", "write_emat"], [19, 1, 1, "", "write_tensor"], [19, 1, 1, "", "write_umat"]], "edrixs.manybody_operator": [[20, 1, 1, "", "build_opers"], [20, 1, 1, "", "density_matrix"], [20, 1, 1, "", "four_fermion"], [20, 1, 1, "", "one_fermion_annihilation"], [20, 1, 1, "", "two_fermion"]], "edrixs.photon_transition": [[21, 1, 1, "", "dipole_polvec_rixs"], [21, 1, 1, "", "dipole_polvec_xas"], [21, 1, 1, "", "get_trans_oper"], [21, 1, 1, "", "get_wavevector_rixs"], [21, 1, 1, "", "linear_polvec"], [21, 1, 1, "", "quadrupole_polvec"], [21, 1, 1, "", "unit_wavevector"], [21, 1, 1, "", "wavevector_with_length"]], "edrixs.plot_spectrum": [[22, 1, 1, "", "get_spectra_from_poles"], [22, 1, 1, "", "merge_pole_dicts"], [22, 1, 1, "", "plot_rixs_map"], [22, 1, 1, "", "plot_spectrum"]], "edrixs.rixs_utils": [[23, 1, 1, "", "scattering_mat"]], "edrixs.soc": [[24, 1, 1, "", "atom_hsoc"]], "edrixs.solvers": [[25, 1, 1, "", "ed_1v1c_fort"], [25, 1, 1, "", "ed_1v1c_py"], [25, 1, 1, "", "ed_2v1c_fort"], [25, 1, 1, "", "ed_siam_fort"], [25, 1, 1, "", "rixs_1v1c_fort"], [25, 1, 1, "", "rixs_1v1c_py"], [25, 1, 1, "", "rixs_2v1c_fort"], [25, 1, 1, "", "rixs_siam_fort"], [25, 1, 1, "", "xas_1v1c_fort"], [25, 1, 1, "", "xas_1v1c_py"], [25, 1, 1, "", "xas_2v1c_fort"], [25, 1, 1, "", "xas_siam_fort"]], "edrixs.utils": [[26, 1, 1, "", "CT_imp_bath"], [26, 1, 1, "", "CT_imp_bath_core_hole"], [26, 1, 1, "", "F0F2F4F6_to_UdJH"], [26, 1, 1, "", "F0F2F4_to_UJ"], [26, 1, 1, "", "F0F2F4_to_UdJH"], [26, 1, 1, "", "UJ_to_UdJH"], [26, 1, 1, "", "UdJH_to_F0F2F4"], [26, 1, 1, "", "UdJH_to_F0F2F4F6"], [26, 1, 1, "", "UdJH_to_UJ"], [26, 1, 1, "", "beta_to_kelvin"], [26, 1, 1, "", "boltz_dist"], [26, 1, 1, "", "case_to_shell_name"], [26, 1, 1, "", "edge_to_shell_name"], [26, 1, 1, "", "get_atom_data"], [26, 1, 1, "", "info_atomic_shell"], [26, 1, 1, "", "kelvin_to_beta"], [26, 1, 1, "", "rescale"], [26, 1, 1, "", "slater_integrals_name"]], "edrixs.wannier_ham": [[27, 2, 1, "", "HR"], [27, 2, 1, "", "KVec"], [27, 2, 1, "", "SymKVec"], [27, 2, 1, "", "UniKVec"]], "edrixs.wannier_ham.HR": [[27, 3, 1, "", "copy_hr"], [27, 3, 1, "", "from_file"], [27, 3, 1, "", "get_hr"], [27, 3, 1, "", "get_hr0"]], "edrixs.wannier_ham.KVec": [[27, 3, 1, "", "kvec_from_file"], [27, 3, 1, "", "set_base"]], "edrixs.wannier_ham.SymKVec": [[27, 3, 1, "", "from_hsymkpt"], [27, 3, 1, "", "from_hsymkpt_uni"], [27, 3, 1, "", "get_klen"]], "edrixs.wannier_ham.UniKVec": [[27, 3, 1, "", "from_grid"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"], "2": ["py", "class", "Python class"], "3": ["py", "method", "Python method"]}, "objtypes": {"0": "py:module", "1": "py:function", "2": "py:class", "3": "py:method"}, "terms": {"": [0, 2, 3, 4, 5, 6, 7, 9, 10, 11, 15, 21, 24, 25, 26, 29, 36, 37], "0": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 17, 19, 21, 22, 25, 26, 27, 29, 36, 39, 40], "00": [3, 8, 11, 29], "000": [0, 25, 39], "000000": 6, "0000000000": [2, 3], "0001": 6, "004": [4, 6], "004000": 6, "00595": 1, "009481": 39, "00983": 37, "01": [6, 11, 25, 29], "011021": 37, "011055": 37, "016609": 39, "018": 39, "02": 2, "02677": 37, "03": [11, 29], "035104": 37, "04": [39, 40], "040": 0, "041007": 37, "045134": 37, "05": 39, "054408": 37, "06": 3, "063": 0, "07": [11, 29], "0700000000": 2, "073": 0, "075132": 37, "0784000000": 3, "079": 26, "08": [19, 25], "083": 26, "084406": 37, "085146": 34, "085150": 2, "0881857143": 2, "08937": 7, "09": [18, 35], "090736j": 13, "093": 26, "095": [6, 11, 29], "0_d": 2, "0f": [0, 1], "0k": 22, "1": [0, 1, 2, 3, 4, 5, 6, 7, 8, 13, 14, 15, 16, 17, 19, 21, 22, 25, 26, 34, 36, 39], "10": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15, 17, 19, 20, 25, 26, 29, 37, 39], "100": [3, 8, 25, 39], "1000": [3, 6, 8, 19, 25, 39], "10000": 6, "1008": 2, "10112": 37, "1012": 37, "1016": 39, "102": 26, "103": 7, "104": 37, "105": 37, "106": 37, "106401": [6, 34], "108": 37, "1088": 26, "109": 37, "10d": 19, "10d_q": [1, 2, 9], "10dq": 13, "10f_4": 9, "11": [0, 26, 27, 37], "112": 26, "11200": 2, "11215": 2, "11230": 2, "113": 26, "114": 34, "115123": 37, "1161": [3, 26], "117": 34, "117003": 7, "117201": 37, "118": 34, "12": [0, 1, 3, 9, 17, 19, 26, 37], "122": [6, 34], "123": 37, "125": 37, "126401": 37, "129": 37, "12f_4": 9, "13": [0, 26, 37], "138": [0, 11, 29], "14": [0, 9, 37, 39], "147401": 34, "149": [1, 11, 29], "14orb": 36, "15": [0, 2, 3, 17, 39], "150": 9, "151": [2, 3, 34, 37, 39], "1538461538": 2, "156": 37, "156402": 34, "15f": [19, 22], "15f_4": 9, "16": [26, 36, 39], "165": [2, 3, 34, 39], "165113": [3, 26], "17": 17, "171": 4, "175": 9, "1768000000": 3, "179506": 3, "18": [3, 4, 17], "180": [2, 3, 7, 39], "183391": 39, "189": 3, "18f_4": 9, "19": 26, "190816": 13, "194": 26, "1970": [9, 15], "198": 0, "1985": [5, 26], "1994": 3, "1996": [3, 26], "1d": [13, 16, 22, 23, 25, 26], "1e": [2, 3, 6, 7, 8, 9, 19, 20, 25], "1e10": 8, "1e3": 7, "1f": [1, 6], "1s3p": 37, "1st": [15, 17, 25, 26], "1t": 37, "2": [0, 1, 2, 3, 4, 5, 6, 7, 8, 13, 14, 15, 16, 17, 19, 20, 21, 22, 25, 26, 34, 36, 37, 39], "20": [4, 5, 8, 9, 17, 27, 39], "200": [3, 25], "2009": 7, "2011": 1, "2012": [3, 26], "2014": 8, "2015": 34, "2016": 34, "2017": [2, 34], "2018": 2, "2019": [2, 3, 6, 34, 37, 39], "2020": 37, "2021": [1, 37], "2022": [7, 37], "2023": 37, "2024": 37, "2025": [18, 35], "205105": 37, "207201": 37, "21": 3, "210": 2, "2110": 7, "217": 9, "22": 40, "220931j": 13, "224845": 13, "2300096": 37, "2301": 37, "2310": 37, "234": 26, "235114": 2, "236": [8, 11, 29], "236401": 34, "24": [2, 17], "243": [2, 3, 34, 37, 39], "25": [2, 3, 8], "250": 9, "27": 3, "275": 26, "2788": 3, "2807": 3, "291": 26, "294663": 13, "299": 26, "2_2": 1, "2_x": 0, "2_y": 0, "2_z": 0, "2b": 9, "2d": [13, 14, 19, 20, 21, 22, 24, 25, 27], "2f": [6, 8], "2f_2": 9, "2g": [1, 2, 9, 14, 15, 21, 24, 39], "2j": 13, "2k": 15, "2l_1": 15, "2l_2": 15, "2ll": 13, "2n": 17, "2nd": [15, 17, 25, 26], "2p": [3, 25, 26, 39], "2p_": [2, 7, 25, 39], "3": [0, 1, 2, 3, 6, 7, 8, 13, 14, 15, 17, 19, 20, 21, 25, 26, 27, 34, 36, 37, 39, 40], "30": [2, 8], "300": [2, 3, 9, 39], "31": 26, "33": 17, "333": 3, "34": 17, "3461538462": 2, "347398": 13, "34f_4": 9, "35": [9, 13], "35f_4": 9, "36": [3, 17], "367": 3, "368": [9, 11, 29], "375": 9, "396": 0, "3b": 9, "3c": 9, "3d": [0, 1, 3, 7, 13, 14, 15, 23, 25, 26, 27, 39], "3f": [0, 3, 4, 5, 9], "3f_2": 9, "3f_4": 9, "3j": 9, "3nd": [15, 25], "3rd": [15, 25, 26], "3z": [1, 7, 8, 9], "3z2": [1, 3], "4": [0, 1, 2, 3, 4, 5, 6, 7, 8, 14, 15, 17, 19, 20, 25, 26, 34, 36, 37, 39], "40": 17, "400": [0, 2], "41": [3, 9], "416147": 13, "418": [5, 26], "42": 2, "421": [4, 11, 29], "427": 0, "433": 9, "44": 3, "441": 9, "454649": 13, "467": 3, "478": [5, 11, 29], "48": [3, 17], "49": 9, "491295j": 13, "4d": [14, 15, 19, 20, 23], "4f": 37, "4f_2": 9, "4p": [25, 26], "4t": 6, "5": [0, 1, 2, 3, 5, 6, 7, 8, 15, 17, 19, 21, 25, 26, 34, 37, 39], "50": [2, 3, 6], "500": [19, 25], "5018": 37, "507": 26, "511": 3, "514": [7, 11, 29], "517": 5, "5268428571428572": 26, "53": [3, 26], "541041j": 13, "548": [3, 11, 29], "55": [5, 26], "550": 9, "56": 3, "5690000000": 2, "5728507936507936": 26, "598": 26, "5d": [2, 34, 37], "5f": 34, "6": [0, 1, 2, 3, 5, 6, 7, 8, 13, 14, 17, 20, 25, 26, 34, 36, 37, 39], "60": [2, 37], "604": 0, "6295873015873016": 26, "6296000000": 3, "63": 3, "6328000000": 3, "636536": 13, "643": 26, "643849j": 13, "65": 39, "650": 9, "67": 26, "673": 0, "675": 9, "6f": 3, "7": [0, 1, 3, 7, 8, 9, 15, 21, 26, 36, 37, 39], "707": 6, "708073j": 13, "71": 1, "713": 26, "721": 26, "74": 8, "75": 39, "750": 0, "77": 3, "787": 26, "7872000000": 3, "7883818012": 3, "8": [0, 1, 3, 4, 5, 6, 7, 8, 9, 26, 36, 37, 39], "80": 3, "800": 0, "802": 0, "8036698413": 3, "81": 26, "820494": 3, "825": 4, "827": 0, "828": 26, "8333": 26, "85": [3, 26], "851": 26, "852": 26, "857": [3, 39], "886": 26, "8888": 40, "890519": 39, "8l": [4, 5], "9": [0, 1, 3, 4, 5, 8, 17, 26, 36, 39], "90": [1, 7, 26], "900": 9, "9214742857": 3, "927": 0, "932": [11, 29], "936": 26, "94": 9, "95": [2, 39], "9570000000": 2, "96": 34, "97": 2, "985": [2, 11, 29], "99": 8, "9l": [4, 5], "A": [2, 3, 5, 9, 14, 17, 19, 21, 26, 27, 34, 36, 37, 38], "As": [2, 3, 7, 8, 9], "At": [14, 20], "By": [2, 3], "For": [0, 3, 6, 7, 8, 9, 13, 14, 15, 20, 25, 26, 36, 38], "If": [2, 3, 7, 9, 13, 25, 26, 36, 37, 38, 39, 40], "In": [0, 1, 2, 3, 4, 6, 7, 8, 9, 36, 38], "It": [0, 7, 8, 9, 15, 21, 25, 26, 41], "Its": 26, "NOT": 36, "Of": 0, "On": 9, "One": [3, 5, 25], "That": [3, 5], "The": [0, 1, 2, 3, 4, 5, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 34, 38, 39, 40], "Their": 25, "Then": [0, 36], "There": [1, 39], "These": [0, 1, 2, 3, 8, 9, 26, 34, 38], "To": [0, 1, 2, 6, 9, 36, 40], "With": [0, 4], "_": [0, 4, 5, 6, 7, 9, 14, 15, 20, 23, 39], "_2": 1, "__main__": 3, "__name__": 3, "a_list": 17, "ab": [3, 4, 5, 7, 8, 9, 23], "abelian": 17, "abl": 3, "about": 2, "abov": [3, 36], "absolut": 19, "absoprt": 7, "absorpt": [23, 26], "academ": [9, 15], "access": [2, 7, 40], "accord": [3, 26], "account": [3, 5, 8, 34], "accur": [3, 25], "acevedo": 37, "acquir": 6, "act": 8, "action": 0, "activ": [8, 36], "ad": [1, 4], "adam": 37, "adapt": [3, 15], "add": [0, 2, 7, 8, 36], "addit": [2, 4, 9, 34], "address": 34, "adiabat": 8, "adjust": [2, 3], "advanc": [6, 37], "advantag": 5, "advic": 2, "after": [5, 38], "ag": 37, "again": [0, 8], "against": 8, "ahn": 37, "aim": [2, 9, 38], "al": [1, 2, 3, 6, 7, 26, 34, 39], "alessia": 37, "alex": 37, "alexand": 37, "alexandru": 37, "algorithm": 25, "alia": 36, "align": [2, 26], "all": [0, 3, 4, 5, 7, 8, 9, 10, 15, 17, 25, 26, 29, 36, 38], "allen": [5, 26], "allow": [0, 3, 34, 40], "along": [2, 3, 6, 7, 8, 25, 27], "alpha": [4, 5, 6, 7, 9, 13, 21, 22, 25], "alpha_": 22, "alreadi": [2, 5, 36, 39], "also": [0, 1, 2, 3, 4, 8, 25, 36, 38, 40], "altern": [9, 36], "although": [5, 6], "alwai": [2, 8, 9, 36], "ament": 7, "among": [0, 1, 15], "amount": 2, "amplitud": 7, "an": [0, 3, 6, 8, 9, 10, 11, 13, 14, 20, 21, 25, 26, 29, 37, 38, 40, 41], "analysi": [5, 7, 10, 11, 29], "analyt": 5, "analyz": [4, 6], "anderson": [4, 5, 8, 10, 11, 25, 26, 29, 34], "andrei": 37, "andrew": 34, "angew": 37, "angl": [2, 3, 7, 13, 21, 25, 39], "angular": [0, 3, 13, 14, 15, 17, 26], "angular_momentum": [1, 12, 18], "ani": [15, 26, 36, 40], "anihil": 9, "anirudh": 37, "ankit": 37, "annett": 37, "annihil": 20, "anoth": [1, 3, 8, 9, 14], "anselm": 37, "anticip": 9, "antiferromagnet": 37, "antisymmetr": [0, 8], "anubhab": 37, "anymor": 40, "anyon": 40, "anywher": 40, "app": 36, "appear": 2, "append": [5, 6], "appli": [1, 2, 3, 4, 5, 6, 8, 14, 25], "applic": [37, 38, 40], "appreci": [8, 37], "approach": [7, 26], "appropri": [2, 3, 26], "approx6": 2, "approxim": [0, 6, 26], "apt": 36, "ar": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 13, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 34, 36, 37, 38, 39], "arang": [1, 3, 4, 5, 7, 8], "arata": 3, "archiv": 36, "aren": 9, "arg": [15, 16, 17], "argmax": 2, "argument": 15, "around": 8, "arpack": [25, 36], "arrai": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27], "arrang": [1, 2], "art": [0, 2], "artifici": 3, "arxiv": [1, 7, 37], "ascend": [15, 17, 25, 26], "aspect": 39, "assert": 3, "assess": 37, "assign": [1, 4], "associ": [3, 13], "assum": [2, 3, 8, 36], "atom": [0, 3, 5, 9, 10, 11, 15, 21, 24, 25, 26, 29, 34], "atom_hsoc": [0, 3, 18, 24, 38, 39], "auto": [2, 39], "auto_exampl": 11, "auto_examples_jupyt": 10, "auto_examples_python": 10, "autom": 40, "automat": 36, "avail": [34, 36, 38, 40], "avoid": [0, 5], "ax": [0, 2, 3, 4, 5, 7, 8, 9], "ax1": 39, "ax2": 39, "ax3": 39, "ax4": 39, "axi": [2, 3, 4, 5, 6, 8, 21, 25, 27, 39], "axial": 13, "axr": 8, "axvlin": 8, "azimuth": [3, 21, 25, 39], "b": [2, 3, 7, 9, 14, 23, 26, 34, 37, 39], "ba": 37, "ba2yoso6": 34, "ba3inir2o9": 34, "ba5alir2o11": 34, "bahrami": 37, "balanc": 1, "band": [2, 3], "bar": 9, "barbour": 37, "bartkowiak": 37, "base": [3, 4, 7, 9, 26, 37, 40, 41], "bash_profil": 36, "bashrc": 36, "basi": [1, 3, 5, 6, 7, 8, 13, 14, 17, 20, 21, 24, 25, 27, 39], "basic": [12, 35], "basis_d": 5, "basis_l": 5, "basis_transform": [12, 18], "bath": [4, 5, 16, 25, 26], "bath_level": [3, 4, 5, 25], "bath_level_n": [3, 25], "bath_occup": 3, "bauer": 37, "bbox_to_anchor": 7, "beam": [2, 3], "becaus": [0, 5, 7, 8, 36, 38], "becom": 9, "been": [1, 8, 25, 36], "befor": [3, 9, 26], "begin": [4, 6, 7, 9, 15, 26], "behavior": 37, "behind": [10, 39], "beigi": 37, "being": 3, "below": [5, 10], "benjamin": 37, "beta": [4, 5, 6, 7, 9, 13, 21, 22, 25, 26], "beta_": 22, "beta_to_kelvin": [18, 26], "better": 8, "betto": 37, "between": [1, 3, 5, 6, 7, 9, 13, 15, 21, 25, 34, 41], "bin": [36, 39], "binari": [0, 17], "bind": [14, 27], "bisogni": 37, "bit": 25, "bla": 36, "bli": 36, "block": [4, 6], "bo": 2, "bocquet": [3, 26], "bodi": [0, 2, 20, 25, 39], "bohr": 3, "boltz_dist": [2, 18, 26], "boltzmann": [2, 3, 22, 25, 26], "bond": 8, "book": 8, "bool": 25, "bootstrap": 36, "botana": 37, "both": [0, 1, 2, 3, 5, 6, 7, 8, 25, 26, 34, 36], "bottom": [0, 39], "bo\u017eovi\u0107": 37, "braicovich": 37, "branch": [0, 36], "braver": 38, "break": [8, 9], "brew": 36, "broaden": [2, 3, 22, 23, 25, 26, 39], "broken": 37, "brook": 37, "brookhaven": 41, "brows": 38, "browser": 40, "brute": 38, "bug": 36, "build": [0, 2, 6, 7, 15, 20, 40], "build_ext": 36, "build_op": [0, 1, 4, 5, 6, 8, 9, 18, 20, 39], "built": [4, 25, 36, 40], "bz": 27, "bz2": 36, "c": [0, 7, 9, 36, 37, 39], "c0": [7, 8], "c1": [7, 8], "c2": 7, "c3": 7, "c_": [15, 17], "c_level": [3, 25], "c_soc": [2, 3, 25, 26, 39], "cach": 36, "calcualt": 16, "calcul": [0, 1, 3, 5, 7, 8, 9, 10, 11, 13, 15, 16, 17, 19, 20, 21, 22, 23, 25, 26, 29], "calder": 37, "call": [1, 2, 3, 8, 16, 25, 36, 40], "cambridg": 8, "can": [0, 1, 2, 3, 5, 6, 7, 9, 15, 19, 20, 21, 25, 26, 34, 36, 37, 38, 39, 40], "cannot": [3, 36], "cao": 37, "captur": 8, "capua": 37, "care": [0, 3], "cartesian": [0, 13], "casa": 37, "case": [1, 2, 3, 5, 6, 7, 8, 13, 14, 15, 21, 24, 25, 26, 36], "case_hr": 27, "case_to_shell_nam": [18, 26], "castillo": 37, "caus": [9, 36], "cb_op": [0, 1, 3, 4, 5, 6, 7, 8, 9, 14, 18], "cb_op2": [14, 18], "cbh": 9, "cc": 36, "cd": 36, "cd_cubic_d": 38, "cdot": [7, 24], "cell": 36, "cellar": 36, "center": [3, 41], "cf": [3, 13, 25, 39], "cf_cubic_d": [1, 2, 9, 13, 18], "cf_split": 7, "cf_square_planar_d": [13, 18], "cf_tetragonal_d": [1, 13, 18, 39], "cf_trigonal_t2g": [13, 18], "cfg": 36, "cfmat": 1, "cfmat_rhb": 1, "chamorro": 37, "chandrasekaran": 37, "chang": [0, 6, 8, 14, 36], "channel": 2, "charact": [8, 37], "charg": [3, 10, 11, 26, 29, 37], "charl": 37, "check": [1, 3, 36], "checkout": [39, 40], "chem": 37, "chemistri": 37, "choic": [25, 38], "choos": [1, 7, 38], "chosen": [0, 7], "chun": 37, "cind": 9, "circ": 7, "circular": [3, 21, 25], "cite": 3, "clang": 36, "clarifi": [4, 9], "class": 27, "claudio": 37, "clear": [0, 2], "clebsch": 9, "clone": 36, "close": 36, "cluster": [3, 6, 34], "cmap": 39, "co": 13, "cobalt": 37, "code": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 26, 36, 37, 38, 39], "coeff": 20, "coeffcient": 4, "coeffic": 15, "coeffici": [9, 15, 20], "coefic": 9, "colaboratori": 36, "collabor": 41, "collect": 26, "color": [0, 7, 8, 9], "colorbar": 2, "column": [1, 3, 9], "com": [26, 36], "combin": [0, 1, 3, 8, 9, 17, 18, 38], "come": [0, 3, 4, 9, 36], "comm": [3, 25, 37], "comm_world": 3, "command": [3, 36, 38, 40], "comment": 36, "common": [1, 2, 7, 9, 15], "commun": [2, 3, 25, 34, 37, 39], "compar": 3, "compil": 36, "complet": 7, "complex": [1, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 19, 20, 21, 23, 24, 25, 27, 37], "complex128": 6, "complic": 0, "compon": [0, 3, 8, 13, 23, 25], "compos": [1, 40], "compound": [8, 26], "comprehens": 3, "comput": [1, 3, 7, 26, 34, 37, 38, 39, 41], "comscop": 41, "concaten": 3, "concept": [10, 39], "conda": 36, "condacolab": 36, "condens": 41, "condit": [6, 8], "config": [7, 19], "config_fc": 36, "configur": [2, 7, 8, 23, 25, 36], "confus": [0, 1], "conj": [4, 5, 7, 8], "conjug": 4, "connect": [6, 8, 40], "consequ": [3, 6, 9], "conserv": 3, "consid": [0, 1, 3, 4, 5, 7, 8, 20, 26], "consider": [0, 2], "consist": [0, 25, 26], "constant": [3, 8, 25], "construct": [0, 3, 8, 9, 22, 25], "contain": [3, 6, 15, 17, 19, 22, 27], "content": [36, 40], "continu": [8, 22, 25], "continuum": 37, "contribut": 4, "control": [1, 19], "conveni": [0, 7, 15], "convent": [0, 2, 4, 6, 9, 26], "converg": 25, "convers": 6, "convert": [2, 3, 26], "coordin": [2, 13, 14, 27], "copi": [9, 27, 38], "copy_hr": 27, "core": [0, 3, 23, 25, 26, 39], "correct": 36, "correctli": 2, "correl": [3, 37], "correspond": [0, 1, 8, 36], "correspondingli": 7, "cosa": 13, "cosin": 13, "cost": [1, 2, 3, 8, 9], "could": 1, "coulomb": [1, 4, 5, 6, 8, 10, 11, 14, 15, 19, 20, 25, 26, 29], "coulomb_i": [3, 25], "coulomb_n": [3, 25], "coulomb_utensor": [12, 18], "count": [8, 9], "coupl": [2, 3, 14, 15, 24, 25, 26, 37, 39], "cours": 3, "coval": 3, "cowan": [3, 26], "cpc": 39, "creat": [1, 3, 4, 8, 36, 40], "creation": [6, 9], "credit": [7, 26], "criteria": 25, "cross": [6, 8], "crreo": 37, "crucial": 9, "crunch": 3, "crystal": [2, 3, 5, 7, 8, 9, 10, 11, 13, 15, 25, 29, 39], "ct_imp_bath": [3, 18, 26], "ct_imp_bath_core_hol": [3, 18, 26], "cu": [26, 37], "cubic": [1, 2, 3, 8, 9, 13, 14], "cuprat": 7, "curl": 36, "current": [6, 19, 36], "curve_fit": 16, "cut_index": 2, "cxx": 36, "d": [0, 1, 3, 4, 5, 7, 8, 9, 13, 14, 15, 19, 21, 24, 25, 26, 37, 39], "d0": 8, "d1": [1, 8, 13, 39], "d2": 8, "d3": [1, 13, 39], "d32": [15, 25], "d32d": 15, "d32d32": 15, "d32d52": 15, "d32f": 15, "d32f52": 15, "d32f72": 15, "d32p": 15, "d32p12": 15, "d32p32": 15, "d52": [15, 25], "d52d": 15, "d52d32": 15, "d52d52": 15, "d52f": 15, "d52f52": 15, "d52f72": 15, "d52p": 15, "d52p12": 15, "d52p32": 15, "d_": [1, 7, 8, 15, 21], "d_tmat": 7, "dagger": [0, 1, 4, 6, 7, 9, 14, 20], "daniel": 8, "darancet": 37, "dat": [3, 22, 25, 27], "data": [3, 22, 25, 26, 40], "databas": [2, 3, 7], "date": [18, 35, 36], "david": 37, "dc": [3, 26], "dd": [3, 12, 15, 21, 26, 37], "dd32": [15, 21], "dd52": [15, 21], "dd_level": 7, "de": 37, "dean": 37, "debeer": 37, "debugg": 38, "decim": [0, 1, 17], "decker": 37, "deep": 38, "def": [1, 2, 6, 7, 8, 9], "default": [2, 3, 4, 9, 13, 14, 19, 20, 22, 27, 36], "defin": [0, 1, 3, 5, 6, 7, 8, 9, 21, 25, 26, 27], "definit": [5, 26], "defint": 39, "deg_rpt": [14, 27], "degen": 0, "degener": [14, 27], "degeneraci": [0, 1], "degeneracy2": 0, "degenvalu": 1, "degre": [14, 27], "delft": 37, "deliber": 38, "deloc": 37, "delta": [3, 4, 6, 9, 13, 16, 26], "delta_": [9, 15], "demonstr": [6, 9], "denmat": [3, 25], "denot": [3, 9], "densiti": [15, 20, 25], "density_matrix": [18, 20], "depend": [2, 8, 9, 13, 22, 25], "der": 37, "deriv": 27, "describ": [0, 1, 4, 7, 9, 18, 26], "design": [38, 41], "desir": [0, 2, 36], "despit": 8, "detail": [1, 3, 4, 9, 15, 18, 38], "detector": 7, "determin": [0, 1, 3, 6, 7, 36, 37], "dev": 36, "develop": 41, "df": [15, 21], "df52": [15, 21], "df72": [15, 21], "dft": 3, "di": 37, "diag": 7, "diagaon": 7, "diagon": [1, 3, 7, 9, 10, 11, 14, 25, 29, 39, 41], "diagonal_indic": 3, "diagonl": 1, "diamond": 37, "dict": [15, 17, 19, 22, 25, 26], "dictat": 0, "dictionari": 17, "did": 4, "diego": 37, "differ": [1, 2, 3, 8, 9, 14, 15, 25, 26, 34, 38], "difficult": 9, "digit": 17, "dimens": [2, 13, 14, 17, 19, 20, 25, 26, 39], "dimension": 37, "dimer": [8, 10, 11, 29, 34, 37], "dipolar": 21, "dipole_polvec_rix": [7, 18, 21], "dipole_polvec_xa": [18, 21], "dir": 36, "direct": [7, 9, 21, 34], "directori": [19, 36, 38, 40], "disa": 37, "disapp": 5, "discala": 37, "discoveri": 1, "discuss": [0, 8], "disord": 37, "distinct": [1, 8, 9], "distinguish": 9, "distort": 13, "distribut": [0, 3, 8, 22, 25], "distributit": 26, "divis": 41, "dmat": 13, "dmat_spinor": [13, 18], "do": [2, 3, 4, 5, 18, 25, 36, 37], "do_e": [3, 25], "do_end": 25, "doc": 1, "docker": [12, 35, 36, 38], "dockerfil": 40, "docstr": 2, "document": [3, 38], "doe": [2, 5, 7, 9, 36, 38], "doi": 39, "domin": [2, 8], "don": 40, "done": [2, 5, 7, 36, 38], "dot": [0, 2, 6, 7, 8], "doubl": [6, 8, 9], "down": [0, 1, 7, 13, 15], "downarrow": [1, 6, 8, 9], "download": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 36], "dp": [2, 3, 15, 21, 26, 39], "dp12": [15, 21], "dp32": [7, 15, 21], "dt": 13, "dtype": [1, 3, 4, 5, 6, 7, 8], "due": [9, 25], "dump": [19, 25], "dump_pol": [18, 19], "dure": [3, 8], "dx2": 3, "dxy": 3, "dz2": 3, "dzx": 3, "dzy": 3, "e": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16, 26, 36, 37, 38], "e1": 39, "e2": [0, 39], "e_": [1, 3, 9, 20, 22, 23, 26, 39], "e_d": [3, 26], "e_d_mat": 3, "e_dc": [3, 26], "e_dc_mat": 3, "e_g": 8, "e_i": 23, "e_l": [3, 8, 26], "e_lc": [3, 26], "e_n": 23, "e_p": [3, 26], "e_to_ligand": 5, "eaav4020": 6, "each": [1, 3, 6, 7, 8, 9, 14, 15, 17, 25, 26, 27], "easi": [0, 38], "easier": 40, "easiest": [3, 5, 8], "easili": 36, "ed": [2, 3, 5, 19, 25, 30, 36, 37], "ed_1v1c_fort": [18, 25], "ed_1v1c_pi": [2, 18, 25, 39], "ed_2v1c_fort": [18, 25], "ed_fsolv": [19, 25], "ed_siam_fort": [3, 18, 25], "ed_solv": [3, 19, 25], "edg": [1, 2, 3, 7, 25, 26, 34, 37, 39], "edge_en": [26, 39], "edge_nam": 26, "edge_to_shell_nam": [18, 26], "edit": 36, "edrix": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27], "edrixs_env": 36, "ef": 7, "ef_out_glob": 21, "eff": [15, 39], "effect": [4, 8], "effici": 3, "eg": 13, "ei": 7, "ei_glob": 21, "ei_in_glob": 21, "eigenenergi": [2, 9], "eigenst": [2, 6, 9, 25], "eigenvalu": [0, 1, 9, 23, 25, 39], "eigenvector": [0, 1, 4, 6, 25, 39], "eigh": [0, 1, 4, 5, 6, 7, 8, 9, 25, 39], "eight": 8, "eignevector": 1, "eignvalu": 0, "eignvector": 0, "eigval": 25, "eigval_tol": [19, 25], "eigvals_onli": 5, "eigvec": 25, "eigvenvalu": 25, "eigvenvector": 0, "ein": 21, "either": [2, 3, 38], "el": [5, 8], "elast": 25, "electron": [0, 1, 2, 4, 6, 7, 8, 9, 15, 25, 26, 34, 37, 39], "element": [0, 1, 7, 9, 19, 20, 21, 25, 26, 27], "elment": 26, "eloss": [2, 25, 39], "eloss_mesh": 22, "elucid": 37, "emat": [4, 6, 7, 8, 9, 19, 20, 39], "emat_chb": [4, 5], "emat_rhb": [4, 5, 7], "emerg": 37, "emiliano": 37, "emiss": [7, 23, 37], "emit": 2, "empir": 2, "empti": [0, 1], "enabl": 36, "end": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 25, 26, 27], "endeavor": 36, "energet": [9, 37], "energi": [1, 2, 4, 6, 7, 8, 9, 10, 11, 16, 21, 22, 23, 25, 26, 29, 37, 39], "enhanc": 37, "enjoi": 36, "enough": 7, "enter": 38, "entri": 4, "enumer": [0, 2, 9], "env": 39, "environ": [25, 36, 40], "eout": 21, "epsilon_": [16, 21], "eqnarrai": 9, "equal": [8, 9, 25, 26], "equat": [3, 4, 6, 7, 9, 25, 26], "equival": [0, 8], "error": [5, 36], "especi": 3, "essenti": 36, "estev": 37, "et": [1, 2, 3, 6, 7, 26, 34, 39], "etc": [0, 1], "euler": 13, "euler_to_rmat": [13, 18], "ev": [2, 3, 4, 5, 9, 21, 23, 39], "eval": 0, "eval_i": [2, 3, 23, 25, 39], "eval_n": [2, 23, 25, 39], "evalu": 1, "even": [8, 15, 38], "everyon": 3, "everyth": [1, 2], "exact": [1, 2, 4, 7, 10, 11, 29, 39, 41], "exactli": 25, "examin": [7, 8], "exampl": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 17, 20, 21, 25, 26, 27, 29, 35, 36, 39], "example_0_ed_calcul": [0, 11, 29], "example_1_crystal_field": [1, 11, 29], "example_2_single_atom_rix": [2, 11, 29], "example_3_aim_xa": [3, 4, 5, 11, 29], "example_4_gs_analysi": [4, 11, 29], "example_5_charge_transf": [5, 11, 29], "example_6_hubbard_dim": [6, 11, 29], "example_7_transit": [7, 11, 29], "example_8_hunds_interact": [8, 11, 29], "example_9_coulomb": [9, 11, 29], "example_aim_xa": 3, "excel": 38, "exchang": [4, 6, 8, 25, 37], "excit": [2, 3, 7, 8, 34, 37], "excitedstate_vector": 7, "execut": [2, 3, 11, 29, 36, 38, 40], "exercis": [4, 6, 8], "exist": 9, "expect": [1, 2, 6, 8, 36], "experi": [2, 3], "experiment": [2, 37], "explain": [1, 3, 7, 39], "explan": 8, "explicitli": [3, 36], "exploratori": 38, "export": 36, "expres": 9, "express": 9, "ext_b": [3, 4, 5, 25], "extent": 39, "extern": [3, 25], "extra_emat": 6, "ey": [3, 4, 5], "f": [0, 2, 4, 5, 6, 7, 8, 9, 14, 15, 20, 21, 23, 24, 25, 26, 37], "f0": [0, 9, 15, 26, 39], "f0_11": [15, 26], "f0_12": 15, "f0_22": 15, "f0_cc": [2, 3], "f0_d": [2, 26], "f0_dd": [3, 4, 5, 15, 25, 26, 39], "f0_dp": [2, 3, 15, 26, 39], "f0_p": 26, "f0_pp": [15, 26], "f0_ss": 26, "f0_vc": [2, 3], "f0_vv": [2, 3], "f0f2f4_to_udjh": [18, 26], "f0f2f4_to_uj": [18, 26], "f0f2f4f6_to_udjh": [18, 26], "f2": [0, 9, 15, 26, 39], "f2_11": [15, 26], "f2_12": 15, "f2_22": 15, "f2_cc": [2, 3], "f2_d": 2, "f2_dd": [3, 4, 5, 15, 25, 26], "f2_dp": [2, 3, 15, 25, 26], "f2_pp": [15, 26], "f2_vc": [2, 3], "f2_vv": [2, 3], "f2py": 36, "f4": [9, 15, 26, 39], "f4_11": [15, 26], "f4_12": 15, "f4_22": 15, "f4_d": 2, "f4_dd": [3, 4, 5, 15, 25, 26], "f4_vv": [2, 3], "f52": [15, 25], "f52d": 15, "f52d32": 15, "f52d52": 15, "f52f": 15, "f52f52": 15, "f52f72": 15, "f52p": 15, "f52p12": 15, "f52p32": 15, "f6": [15, 26], "f6_11": 15, "f6_12": 15, "f6_22": 15, "f72": [15, 25], "f72d": 15, "f72d32": 15, "f72d52": 15, "f72f": 15, "f72f52": 15, "f72f72": 15, "f72p": 15, "f72p12": 15, "f72p32": 15, "f77": 36, "f77exec": 36, "f90": 36, "f90exec": 36, "f_": [15, 20, 21], "f_0": [9, 26], "f_2": [9, 26], "f_4": [9, 26], "f_6": 26, "f_l": [0, 20], "f_nsf": 7, "f_r": [0, 20], "f_sf": 7, "fabbri": [34, 37], "fabian": 37, "facilit": 38, "fact": [3, 7], "factor": [2, 22, 25, 26], "fals": [0, 13, 14, 19, 25, 26, 27], "familiar": 39, "far": [3, 34], "favor": 8, "favorit": [3, 39], "fc": 36, "fd": [15, 21], "fd32": [15, 21], "fd52": [15, 21], "feel": 38, "fermion": [0, 6, 8, 9, 20, 34], "ferrimagnet": 37, "fesi": 37, "fetch": 36, "few": [2, 7, 25], "fewer": 3, "ff": [15, 21], "ff52": [15, 21], "ff72": [15, 21], "ffi": 23, "fi": 23, "field": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 25, 29, 39], "fiet": 2, "fifth": 8, "fig": [0, 2, 3, 4, 5, 7, 8, 9, 39], "figsiz": [2, 7, 8, 9, 39], "figur": [2, 6, 39], "file": [3, 11, 17, 19, 22, 25, 27, 29, 36, 38, 40], "file_list": [19, 22], "file_nam": 19, "film": 37, "final": [2, 3, 5, 25, 39], "find": [0, 3, 9, 25, 38], "finit": 5, "first": [0, 1, 4, 5, 6, 7, 8, 9, 13, 15, 16, 17, 19, 25, 26, 36, 39], "fit": 16, "fit_func": [16, 18], "fit_hyb": [12, 18], "fix": 7, "fk": [2, 15], "flag": 38, "flexibl": 38, "flip": [7, 15], "float": [13, 14, 15, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27], "fmt_float": [19, 22], "fmt_int": 19, "fname": [17, 19, 22, 27], "fock": [1, 2, 3, 6, 17, 20, 25, 26], "fock_basi": [12, 18], "fock_bin": [17, 18], "fock_i": [17, 25], "follow": [0, 1, 2, 3, 4, 5, 6, 9, 15, 17, 19, 25, 36, 37, 40], "font": 39, "fontsiz": 7, "footnot": [1, 2, 3, 5, 6, 7, 8, 9, 34], "forbid": 0, "forc": 38, "forg": 36, "form": [0, 1, 2, 6, 7, 8, 9, 13, 14, 17, 20, 25, 26], "format": [0, 1, 3, 4, 6, 19, 22], "former": 9, "formuat": 7, "formul": 3, "formula": 22, "fortran": [25, 36, 38], "found": 25, "four": [0, 1, 2, 6, 8, 20], "four_fermion": [18, 20], "fourier": 14, "fourier_hr2hk": [14, 18], "fourth": 8, "fp": [15, 21], "fp12": [15, 21], "fp32": [15, 21], "frac": [2, 9, 13, 15, 16, 17, 22, 23, 26], "fraction": [8, 14, 22], "frame": 2, "framework": 36, "frederick": 37, "freedom": [14, 27], "freeland": 37, "frequenc": [16, 22], "from": [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 14, 19, 22, 25, 26, 27, 29, 38, 39, 40], "from_fil": 27, "from_grid": 27, "from_hsymkpt": 27, "from_hsymkpt_uni": 27, "frustrat": 37, "fssl": 36, "full": [0, 1, 3, 4, 5, 6, 7, 8, 9, 25, 26], "fulli": 25, "fumag": 37, "fun": 0, "function": [0, 1, 2, 3, 7, 8, 9, 15, 16, 18, 22, 25, 38], "further": [3, 9], "futher": 9, "fx_11": [15, 26], "fx_12": [15, 26], "fx_13": [15, 26], "fx_22": [15, 26], "fx_23": [15, 26], "fx_33": [15, 26], "fx_cc": 25, "fx_v1c": 25, "fx_v1v1": 25, "fx_v1v2": 25, "fx_v2c": 25, "fx_v2v2": 25, "fx_vc": 25, "fx_vv": 25, "f\u00f6hlisch": 37, "g": [1, 3, 5, 7, 9, 15, 22, 26, 34, 36, 37, 38], "g0_12": 15, "g1_12": 15, "g1_dp": [2, 3, 15, 26], "g1_p": 26, "g1_vc": [2, 3], "g2_12": 15, "g2_d": 26, "g3_12": 15, "g3_dp": [2, 3, 15, 26], "g3_vc": [2, 3], "g4_12": 15, "g5_12": 15, "g6_12": 15, "gabriel": 37, "gabriella": 37, "galleri": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 29], "gamma": [4, 6, 9, 13], "gamma_": [22, 23], "gamma_c": [2, 3, 25, 26, 39], "gamma_c_stat": 3, "gamma_f": [2, 25, 39], "gamma_in": 19, "gamma_mesh": 22, "gamma_n": 23, "gaunt": [9, 15], "gaussian": 39, "gcc": 36, "gcc8": 36, "gcc9": 36, "ge": 37, "gener": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 15, 22, 25, 27, 38], "gennaro": 37, "geometri": [2, 21, 25], "geondzhian": 37, "georgescu": 37, "georgio": 2, "get": [0, 3, 4, 9, 13, 14, 15, 17, 21, 25, 26, 36, 39], "get_atom_data": [1, 2, 3, 18, 26, 39], "get_config": 36, "get_eigenvector": 7, "get_f": 7, "get_f0": [2, 3, 26, 39], "get_fock_basis_by_n_abelian": [17, 18], "get_fock_basis_by_n_lzsz": [17, 18], "get_fock_basis_by_njz": [17, 18], "get_fock_basis_by_nlz": [17, 18], "get_fock_basis_by_nsz": [17, 18], "get_fock_bin_by_n": [0, 1, 4, 5, 6, 8, 9, 17, 18, 39], "get_fock_full_n": [17, 18], "get_gaunt": [9, 15, 18], "get_hr": 27, "get_hr0": 27, "get_hyb": [16, 18], "get_i": 7, "get_input": 36, "get_klen": 27, "get_ladd": [13, 18], "get_li": [13, 18], "get_lminu": [13, 18], "get_lx": [13, 18], "get_lz": [13, 18], "get_orb_momentum": [0, 13, 18], "get_pauli": [13, 18], "get_rank": 3, "get_si": [4, 5, 13, 18], "get_single_particle_repesent": 6, "get_siz": 3, "get_spectra_from_pol": [18, 22], "get_spin_momentum": [0, 6, 7, 8, 13, 18], "get_sx": [4, 5, 13, 18], "get_sz": [4, 5, 13, 18], "get_trans_op": [7, 18, 21], "get_umat_kanamori": [8, 15, 18], "get_umat_kanamori_g": [15, 18], "get_umat_slat": [0, 1, 4, 5, 6, 9, 15, 18, 39], "get_umat_slater_3shel": [15, 18], "get_wavevector_rix": [18, 21], "get_wigner_dmat": [13, 18], "get_yticklabel": 8, "geun": 37, "gfortran": 36, "gg": [6, 8], "ghiringhelli": 37, "giacomo": 37, "gilberto": 37, "gilmor": 37, "git": 36, "github": [26, 34, 36, 40], "githubusercont": 36, "give": 39, "given": [0, 13, 15, 16, 20, 21, 22, 25, 26, 27], "gk": 2, "global": [21, 25, 27], "go": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 36], "goe": 1, "gog": 37, "gone": 1, "good": [8, 17, 39], "googl": 36, "gordon": 9, "got": 0, "graphic": 0, "great": [8, 37], "gregori": 2, "grid": [22, 27, 39], "ground": [1, 2, 3, 5, 6, 7, 8, 10, 11, 25, 29, 37], "groundstate_vector": 7, "group": [7, 14, 37], "gs_energi": 5, "gs_list": [2, 25, 39], "gu": 37, "guess": [16, 26], "guid": 12, "guillaum": 37, "gx_12": [15, 26], "gx_13": [15, 26], "gx_23": [15, 26], "gx_v1c": 25, "gx_v1v2": 25, "gx_v2c": 25, "gx_vc": 25, "gz": 36, "h": [0, 1, 4, 5, 6, 8, 9, 14, 15, 26, 27, 37, 39], "h2": 0, "ha": [0, 2, 3, 5, 7, 8, 25, 26, 36], "hahn": 37, "hakverkort": 26, "haldar": 37, "half": [0, 2, 3, 9, 16], "hamiltonian": [0, 2, 3, 6, 7, 8, 13, 14, 25, 26, 27, 39, 41], "hamitlonian": 25, "han": 37, "hand": [2, 7, 8, 13], "handl": 6, "happen": [1, 6, 7, 8, 26], "harmmon": 4, "harmon": [1, 3, 4, 7, 9, 13, 14, 21, 24, 25], "hartre": [2, 3, 26], "haskel": 37, "hat": [0, 1, 4, 6, 9, 14, 20], "hauser": 37, "have": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 34, 36, 40], "haverkort": [3, 26], "hd": 5, "he": 37, "header": [0, 6], "heavi": 34, "heavyweight": 38, "heidelberg": 26, "help": [6, 7, 40], "henthorn": 37, "here": [0, 2, 3, 5, 6, 7, 9, 34, 38], "heterostructur": [34, 37], "hidden": 3, "high": [1, 8, 27, 37], "higher": 3, "highest": [0, 1], "hilbert": [17, 25, 26], "histori": 12, "hk": 14, "hl": 5, "hline": 9, "hmat": 20, "ho": 37, "hole": [1, 2, 3, 7, 23, 25, 26, 39], "home": 40, "honeycomb": 37, "hood": 7, "hop": [3, 5, 6, 15, 19, 25], "hope": 2, "hopefulli": 4, "hopping_i": [3, 25], "hopping_n": [3, 25], "hopping_v1v2": 25, "horizontalalign": 0, "host": 3, "how": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 34, 36, 39], "howev": [8, 36], "hr": [14, 18, 27], "hsoc": 24, "hspace": [7, 39], "hsymkpt": 27, "http": [26, 36, 39], "hua": 37, "hubbard": [8, 10, 11, 15, 29], "huge": 38, "hund": [0, 2, 10, 11, 15, 26, 29, 37], "hyb": [3, 4, 5, 25], "hyb_n": 25, "hybrid": [3, 5, 16, 25, 37], "i": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 25, 26, 35, 36, 37, 38, 39, 40], "ident": [21, 25], "idump": [3, 19, 25], "ifort": 36, "ignac": 37, "ignor": [3, 25], "ii": [36, 41], "ij": [0, 14, 20], "ijkl": [0, 9, 20], "illustr": [2, 5, 10], "im": 22, "imag": 40, "imaginari": 16, "immedi": [1, 9, 40], "imp_mat": [3, 4, 5, 25], "imp_mat_n": [3, 25], "implement": [1, 2, 3, 8, 9, 36], "import": [0, 1, 2, 3, 5, 6, 7, 8, 9, 13, 15, 17, 21, 26, 36, 38, 39], "importlib": [4, 5], "impos": [1, 8, 9], "impuirti": 25, "impur": [4, 5, 8, 10, 11, 20, 25, 26, 29, 34], "impurity_occup": 3, "imshow": 39, "incid": [2, 3, 7, 21, 22, 23, 25, 39], "includ": [0, 1, 2, 3, 4, 6, 8, 9, 13, 14, 15, 18, 25, 26, 27, 34, 36, 38, 39, 40], "include_dir": 36, "incom": [2, 7], "ind": [0, 8], "independ": [7, 9, 13, 37], "index": [1, 3, 15, 18, 20, 25, 27], "indic": [4, 6, 9, 12, 15, 21, 24, 25, 26], "indx": [1, 4, 5], "indx1": 4, "indx2": 4, "inelast": 37, "infin": 13, "influenc": 34, "info": [2, 3, 8, 26], "info_atomic_shel": [18, 26], "inform": [0, 19, 22, 26], "initi": [2, 3, 12, 16, 23, 25, 26, 39], "initiailli": 0, "inorgan": 37, "input": [3, 25, 26], "inspect": [3, 38], "instal": [12, 35, 40], "instanc": 27, "instruct": 36, "insul": [10, 11, 29, 37], "int": [9, 13, 14, 15, 16, 17, 20, 25, 26, 27, 37], "integ": [3, 19, 25, 26], "integr": [0, 2, 3, 9, 15, 25, 26, 39], "intel": 36, "intens": [2, 3, 7, 39], "interact": [1, 2, 4, 5, 6, 10, 11, 14, 15, 20, 26, 29, 37, 38], "intercal": 37, "interest": [1, 8, 9], "interfac": 38, "intermedi": [2, 3, 23, 25, 26, 39], "interplai": [8, 37], "interpol": 39, "interpret": [0, 6], "invers": [2, 26], "invok": 38, "involv": [1, 3, 6, 7, 9, 25], "ion": [9, 15, 37], "iorb": 20, "iostream": [12, 18, 22], "ip": 40, "ipynb": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "ipython": [2, 38, 40], "ir": [2, 26, 34, 37], "irid": [2, 34, 37], "iron": 37, "irpt0": 27, "irrelev": 8, "isclos": 5, "ismail": 37, "isotrop": [3, 25, 39], "ispin": [0, 1, 7, 9, 13, 14, 27], "issu": 36, "iter": 25, "itertool": 9, "its": [2, 3, 6, 36, 38], "itself": 3, "j": [0, 3, 5, 6, 7, 9, 13, 14, 15, 20, 26, 37, 39], "j2": 0, "j2_val": 0, "j2_val_soc": 0, "j_": [17, 26], "j_h": [2, 8, 26], "j_p": 15, "j_x": 15, "j_z": 14, "jan": [18, 35, 37], "jarrig": 37, "jennif": 37, "jeremi": 37, "jh": [2, 8, 26, 39], "jia": 37, "jiaqi": 37, "jiemin": 37, "jo": 3, "john": 37, "johnston": 37, "jonathan": 37, "jorb": 20, "jp": 15, "jpn": 3, "jungho": 37, "junji": 37, "juptyer": 38, "jupyt": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 38, 40], "just": [3, 5, 25, 26, 38], "justin": 37, "jx": 15, "jz_list": 17, "k": [0, 2, 8, 9, 14, 15, 17, 20, 22, 25, 26, 27, 37], "k_": 21, "k_in_glob": 21, "k_out_glob": 21, "k_with_length": 21, "kamimura": [9, 15], "kanamori": [8, 15, 26], "kari": 37, "karl": 37, "kayahan": 37, "kbase": 27, "keep": [4, 7, 36], "kei": [15, 17, 26, 37], "keith": 37, "kelvin": [3, 26], "kelvin_to_beta": [18, 26], "kept": 34, "khomskii": 8, "kim": 37, "kinet": 6, "klen": 27, "know": [0, 2, 3, 7], "kotliar": 37, "kourti": 37, "kpt_type": 27, "kugler": 37, "kuiken": 37, "kumar": 37, "kvec": [14, 18, 27], "kvec_from_fil": 27, "l": [0, 1, 2, 3, 4, 5, 6, 8, 9, 13, 14, 15, 16, 20, 24, 26, 34, 36, 37], "l1": [15, 26], "l100416": 37, "l2": [0, 15, 26, 39], "l23": [26, 39], "l2_val": 0, "l2_val_soc": 0, "l3": [1, 2, 3, 26, 39], "l_": [15, 17, 39], "l_1": 15, "l_2": [15, 39], "l_3": [2, 7, 25, 39], "l_i": 15, "l_j": 15, "l_list": 15, "l_t": 15, "l_u": 15, "l_x": 13, "l_y": 13, "l_z": 13, "la": 37, "la2nio4": 34, "lab": [2, 38, 40], "label": [2, 4, 5, 6, 7, 8, 9, 13, 14, 24, 26], "laboratori": 41, "lack": 5, "ladd": 13, "lam": 2, "lambda": 2, "lanczo": 25, "langaug": 8, "langl": [7, 9], "languag": [7, 8], "lanio3": 34, "lanio3_thin": 36, "lapack": [25, 36], "larg": [5, 9, 25, 37], "larger": [0, 7, 19, 20, 25], "larpack": 36, "last": [1, 4, 5, 14, 20], "later": [1, 2, 9, 19, 25], "latest": 36, "latter": 8, "lattic": [27, 37], "launch": [25, 39], "layer": [37, 38], "lb": 20, "lc": [3, 26], "learn": 39, "least": [14, 20, 25], "lee": 37, "left": [0, 7, 8, 9, 14, 20, 21, 22, 25, 39], "legend": [2, 4, 5, 7, 8, 9], "legitim": 0, "len": [0, 1, 2, 6, 9, 20, 25, 39], "length": [15, 16, 17, 21, 26, 27], "leq": 15, "less": [0, 7, 26], "let": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "lett": [5, 6, 7, 26, 34, 37], "level": [1, 3, 13, 16, 25, 26, 39], "lh": 39, "li": [25, 37], "lib": 36, "libarpack2": 36, "libopenbla": 36, "libopenmpi": 36, "libparpack2": 36, "libpython3": 36, "librari": [25, 36], "library_dir": 36, "life": [22, 25, 26, 39, 40], "lifetim": [2, 3], "ligand": [3, 4, 8, 13], "light": 41, "liir": 37, "like": [0, 3, 6, 9, 14, 17, 20, 25, 26, 36, 37, 38, 40], "limit": [3, 5, 13], "lin": 37, "linalag": 25, "linalg": [0, 1, 4, 5, 6, 7, 8, 9, 39], "line": [17, 19, 27, 36, 38], "linear": [2, 3, 21, 25, 26, 39], "linear_polvec": [18, 21], "linestyl": [8, 9], "linewidth": 1, "link": 36, "linspac": [2, 3, 6, 7, 8, 39], "linsys_max": [19, 25], "linsys_tol": [19, 25], "linux": 40, "list": [0, 2, 3, 9, 15, 17, 19, 20, 21, 22, 25, 26, 39], "list_pole_dict": 22, "literatur": 3, "littl": 25, "liu": 37, "live": [4, 9], "ll": [6, 8, 13], "lminu": 13, "ln": 36, "load": [0, 8, 19, 38], "load_pol": [18, 19], "loc": [0, 7], "loc_axi": [2, 3, 25], "local": [3, 21, 25, 36, 37], "local_aix": 21, "local_axi": [21, 25], "locat": 8, "logic": [13, 14, 19, 25, 26, 27], "london": [9, 15], "long": [0, 7, 40], "longer": 13, "look": [1, 4, 7, 8, 17, 38], "loop": 3, "lopenbla": 36, "lopez": 37, "lorentzian": 2, "loss": [2, 22, 25, 39], "lot": 4, "low": [1, 2, 3, 6, 7, 8, 37], "lower": [0, 1, 13, 39], "lowest": [0, 1, 25], "lowest_energy_to_transfer_electron": 5, "lparpack": 36, "lu": 37, "luca": 37, "lucio": 37, "ludwig": 37, "luo": 37, "luuk": 7, "lx": 13, "ly": [3, 13], "lz": 13, "lz_list": 17, "m": [1, 7, 13, 17, 36, 37, 38], "m1": 26, "m2": 26, "m23": 26, "m3": 26, "m4": 26, "m45": 26, "m5": 26, "m_": 15, "m_1": 15, "m_2": 15, "m_l": [1, 15], "machin": 36, "made": [4, 38], "magnet": [3, 6, 7, 15, 25, 37], "magneton": 3, "magnitud": [9, 23], "mai": [25, 36], "main": [3, 6, 26], "maintain": [9, 41], "major": [4, 38], "make": [0, 1, 2, 3, 7, 8, 9, 36, 38, 40], "mani": [0, 2, 3, 7, 17, 20, 25, 38, 39], "manifold": [2, 8], "manual": 18, "manuscript": 34, "manybody_oper": [12, 18], "map": [2, 22, 39], "marcaud": 37, "marco": 37, "marcu": 37, "mari": 37, "mark": 37, "master": 36, "match": 2, "materi": [1, 2, 3, 6, 7, 37, 41], "math": [19, 21, 27], "mathbf": [0, 9], "mathcal": 7, "mathemat": 0, "mathop": 15, "matirx": 25, "matplotlib": [0, 2, 3, 4, 5, 6, 7, 8, 9, 36, 38, 39], "matric": [0, 7, 9, 14, 19, 25], "matrix": [1, 2, 3, 6, 8, 13, 14, 20, 21, 24, 25], "matteo": 37, "matter": 41, "maurit": [3, 26], "max": 39, "maxim": [6, 8], "maximum": [2, 3, 25], "maxit": [19, 25], "mazzoli": 37, "mazzon": 37, "mb": [11, 29], "mcgale": 37, "mcqueen": 37, "mean": [0, 3, 7, 8, 13, 14, 15, 20, 25, 26, 38, 39], "meant": 2, "measur": 6, "mechan": 0, "melnick": 37, "mem": [11, 29], "merg": 22, "merge_pole_dict": [18, 22], "mesh": 22, "messag": [0, 1, 3, 4], "metal": [3, 8, 9, 15, 26], "miao": 37, "might": [9, 36, 38, 40], "min": [1, 5, 9, 39], "min_ndim": [19, 25], "mind": [4, 7], "minimum": 25, "minut": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "mitchel": 37, "mitrano": 37, "mix": [4, 5, 8, 9], "mkl": 36, "mm": 12, "mnfe": 37, "model": [1, 4, 5, 8, 10, 11, 25, 26, 29, 34, 37, 41], "modifi": 38, "modul": [0, 1, 8, 18], "modulu": 4, "moment": 26, "momentum": [0, 3, 13, 14, 15, 17, 37], "more": [0, 1, 3, 4, 7, 8, 9, 15, 25, 36, 38], "most": 3, "mourig": 37, "move": [2, 3, 8], "mp": 36, "mpi": [3, 25, 36], "mpi4pi": [3, 25, 36], "mpi_comm": 25, "mpi_dir": 36, "mpicc": 36, "mpich": [25, 36], "mpicxx": 36, "mpif77": 36, "mpif90": 36, "mpifc": 36, "mpirun": [3, 36], "mpl": 39, "mretegan": 26, "msugano": 9, "mu_b": 3, "much": 7, "multi": 6, "multipl": [1, 3], "multiplet": [3, 9, 15, 39], "multipli": 0, "multipoint": 37, "must": [0, 2, 3], "mxing": 9, "my_solv": 38, "mybind": 40, "myoutput": 38, "myscript": 38, "myung": 37, "n": [0, 2, 3, 6, 7, 8, 16, 17, 19, 23, 25, 26], "n1": 26, "n2": 26, "n23": 26, "n3": 26, "n4": 26, "n45": 26, "n5": 26, "n6": 26, "n67": 26, "n7": 26, "n_d": [3, 5], "n_fermion": 0, "n_ligand_hol": 5, "nalpha": 4, "name": [14, 15, 17, 19, 22, 25, 26, 27, 36, 38, 40], "name_i": [26, 39], "name_n": [26, 39], "namespac": 38, "nation": 41, "nativ": 0, "natur": 37, "nbath": [3, 25], "ncv": [3, 19, 25], "nd": [3, 4, 5], "nd_complex_harmoic_basi": 1, "nd_expt": 1, "nd_op": 1, "nd_real_harmoic_basi": 1, "nd_vec": 1, "ndim": 17, "ne": 8, "necess": 1, "necessari": [0, 8], "need": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 19, 26, 36, 40], "neg": 3, "neglig": 2, "nelson": 37, "neval": [3, 19, 25], "new": [1, 9, 14, 15, 22, 27, 36], "new_list": 26, "new_pole_dict": 22, "newer": 36, "newest": 36, "nexcit": 8, "nfermion": 20, "ng": 36, "ni": [1, 3, 8, 25, 26, 34, 37, 39], "nice": 40, "nichola": 37, "nickel": [7, 8, 37], "nio": [8, 10, 11, 29, 37], "nip": [8, 37], "nirh": 37, "nitrogenas": 37, "nkpt": [14, 27], "nkpt_per_path": 27, "nkryl": [3, 19, 25], "noccu": [0, 1, 3, 6, 8, 39], "noccu_g": [3, 25], "nomin": 3, "non": [2, 7], "none": [2, 6, 14, 20, 21, 25, 26, 27], "nonmagnet": 37, "nonvanish": 15, "nonzero": 19, "norb": [0, 1, 6, 8, 14, 15, 17, 39], "norb_bath": [3, 4, 5], "norb_d": [3, 4, 5], "normal": [3, 9, 13], "norman": 37, "notat": [3, 7, 9], "note": [0, 1, 2, 3, 6, 7, 9, 13, 15, 21, 26, 36], "notebook": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 36, 40], "noth": 3, "now": [0, 1, 3, 4, 7, 8, 20, 36, 41], "np": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 36, 39], "nrpt": [14, 27], "nsf": 7, "nsl": 36, "ntot": [4, 5], "num_core_orb": 19, "num_d_electron": [4, 5, 8], "num_g": [3, 19, 25], "num_val_orb": 19, "number": [0, 1, 2, 6, 8, 13, 14, 15, 16, 17, 19, 20, 21, 22, 25, 26, 27, 39], "numer": [0, 5, 17, 26, 37], "numpi": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 36, 39], "numpydoc": 36, "nvector": [3, 19, 25], "nwann": 27, "o": [1, 3, 8, 14, 34, 37, 39, 40], "o1": 26, "o2": 26, "o23": 26, "o3": 26, "o4": 26, "o45": 26, "o5": 26, "obei": 9, "obj": 19, "object": [7, 18, 19, 27, 38], "observ": 8, "obtain": [0, 2, 3, 7, 9, 25], "obvious": 8, "occuanc": 17, "occup": [0, 1, 3, 6, 8, 17, 25, 26, 39], "occupi": [0, 9], "occupli": 4, "octahedra": 34, "off": [1, 2, 4, 5, 6, 9, 39], "offset": [2, 3], "often": [1, 3, 5], "old": 36, "old_list": 26, "om_shift": [3, 22], "omega": 16, "omega_": [22, 23], "omega_in": 19, "omega_inc": 23, "omega_mesh": 22, "ominc": [2, 25], "ominc_mesh": 22, "ominc_rixs_l2": 39, "ominc_rixs_l3": 39, "ominc_xa": [2, 3, 39], "omit": 25, "on_which": [3, 25], "onc": [0, 8, 9, 40], "one": [1, 2, 3, 5, 7, 8, 9, 14, 15, 22, 25, 26, 36, 38], "one_fermion_annihil": [18, 20], "ones": [3, 36], "onli": [1, 2, 3, 6, 8, 9, 13, 14, 15, 19, 20, 25, 26, 36], "onlin": 38, "only_nonzero": 19, "onto": [0, 8], "op": [0, 6, 8], "open": [36, 37, 40, 41], "openbla": 36, "opencollab": 36, "openmpi": [25, 36], "oper": [0, 1, 2, 3, 4, 6, 8, 9, 13, 14, 20, 21, 23, 25], "oper_o": 14, "operato": 14, "opj": 0, "opl": 0, "opposit": [8, 9, 15], "ops_squar": 6, "opt": 36, "option": [1, 20, 21, 25, 38], "orb_l": 14, "orb_mom": 0, "orbit": [1, 3, 4, 6, 8, 13, 14, 15, 17, 20, 24, 25, 26, 27, 34, 37, 39], "orbital_energi": 3, "orbital_index": 7, "orbital_ord": 7, "order": [0, 2, 3, 6, 7, 9, 13, 14, 15, 17, 25, 26, 37], "ordereddict": 26, "org": [36, 39], "oribt": 14, "orient": [2, 34], "origin": [3, 34, 39], "orthogon": 25, "oseo": 37, "other": [4, 7, 8, 9, 25, 27, 36, 40], "otherwis": [13, 25, 26, 39], "othewis": 26, "our": [0, 1, 2, 3, 5, 8, 9, 26, 38, 39], "out": [0, 1, 2, 3, 4, 6, 7, 21, 25], "outgo": [2, 7], "outlin": [5, 34], "output": [1, 3, 25, 27, 38], "over": [2, 3, 6, 8, 9, 38], "overal": [0, 2, 8], "overcom": 8, "oxid": 37, "oxygen": [3, 5, 37], "p": [0, 2, 3, 7, 14, 15, 21, 24, 25, 26, 37, 39], "p0": 16, "p1": 26, "p12": [15, 25], "p12d": 15, "p12d32": 15, "p12d52": 15, "p12f": 15, "p12f52": 15, "p12f72": 15, "p12p": 15, "p12p12": 15, "p12p32": 15, "p2": 26, "p23": 26, "p3": 26, "p32": [2, 15, 25, 26], "p32d": 15, "p32d32": 15, "p32d52": 15, "p32f": 15, "p32f52": 15, "p32f72": 15, "p32p": 15, "p32p12": 15, "p32p32": 15, "p_": [15, 21, 25], "p_x": 3, "p_y": 3, "p_z": 3, "packag": [36, 38], "page": [18, 39], "pai": 3, "pair": [1, 3, 15], "pairwis": 9, "panel": 8, "paper": [3, 12, 35], "paradigm": 8, "parallel": [2, 25], "paramet": [1, 3, 7, 8, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 39], "parameter": [2, 8, 15, 25], "parametr": 9, "parammet": 4, "paramt": 13, "pariti": 6, "parpack": 36, "part": [16, 39, 41], "particl": [0, 6, 7, 9], "particular": [9, 34], "pass": [1, 2, 3], "path": 36, "pauli": [7, 13], "pcolormesh": 2, "pd": [15, 21, 26], "pd32": [15, 21], "pd52": [15, 21], "pdb": 38, "pdf": 22, "peak": 25, "pedagog": [12, 39], "pelliciari": 37, "peng": 37, "pentaval": 37, "per": [0, 3, 8, 27], "perfectli": 2, "perform": [3, 7, 9, 25], "pf": [15, 21], "pf52": [15, 21], "pf72": [15, 21], "phi": [2, 3, 7, 14, 15, 21, 25, 39], "photon": [21, 23, 25, 26], "photon_transit": [12, 18], "phy": [2, 3, 5, 6, 7, 26, 34, 37], "physic": [2, 3, 6, 8, 34, 37, 39, 41], "pi": [2, 3, 7, 13, 15, 22, 39], "pick": 4, "pierr": 37, "pietzsch": 37, "ping": 37, "pip": 36, "pip3": 36, "place": 38, "plai": [6, 36], "planar": [13, 37], "plane": [2, 7, 21, 25], "pleas": [15, 36], "plot": [0, 3, 5, 6, 8, 9, 19, 22, 38, 39], "plot_index": 7, "plot_it": 2, "plot_rixs_map": [18, 22], "plot_spectrum": [12, 18], "plt": [0, 2, 3, 4, 5, 6, 7, 8, 9, 39], "plu": [3, 15, 25], "plumb": 37, "plutonium": 34, "point": [14, 26, 27, 36], "pol_label": 7, "pol_typ": [2, 3, 21, 25, 39], "pol_type_rix": 2, "polar": [2, 3, 7, 21, 25, 37, 39], "polaron": 37, "pole": [19, 22, 25], "pole_dict": 19, "poles_dict": 22, "poltype_rix": 39, "poltype_xa": [3, 39], "polvec": 21, "popul": [2, 3, 4, 5, 8], "port": [36, 40], "posit": 3, "possibl": [15, 17, 21, 25, 38], "post": [3, 27], "potenti": 25, "powder": 3, "pp": [5, 15, 21], "pp12": [15, 21], "pp32": [15, 21], "practis": 8, "precis": [1, 5, 6, 19], "predict": 0, "prefer": 0, "prefix": 36, "prepar": 25, "present": [3, 8], "presev": 8, "press": [8, 9, 15], "previou": 6, "previous": 4, "primairli": 8, "prime": [1, 9, 14], "primit": 27, "print": [0, 1, 3, 4, 5, 6, 8, 9, 19, 22, 38, 39], "prior": 0, "prob": 2, "probabl": 9, "probe": 37, "problem": [0, 3, 4, 5, 6, 7, 8, 9, 36], "procedur": 1, "proceedur": [1, 2], "process": [3, 7, 9, 23, 27, 36, 40], "processor": 3, "produc": 8, "program": 38, "project": [0, 25, 40, 41], "promot": 8, "properli": 36, "properti": [4, 9, 37], "prove": 1, "provid": [2, 7, 8, 9, 21, 25, 26], "psi": [9, 14], "psi_": 9, "public": 38, "publish": 37, "pure": 25, "purpos": 3, "put": [1, 2, 4, 7, 36], "py": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 29, 36, 38], "py37": 36, "pyplot": [0, 2, 3, 4, 5, 6, 7, 8, 9, 39], "pyrochlor": [34, 37], "python": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 19, 25, 35, 36, 39], "python3": [36, 38], "python37": 36, "q": [36, 37], "quad_vec": 21, "quadrupolar": 21, "quadrupole_polvec": [18, 21], "qualit": 2, "qualiti": 38, "quant_2j": 13, "quanti": 2, "quantiti": 0, "quantiz": 9, "quantum": [0, 6, 8, 13, 14, 15, 17, 26], "quasiparticl": 37, "question": [2, 7], "quickstart": [12, 35], "r": [1, 4, 5, 7, 8, 9, 13, 14, 17, 20, 27, 37, 39], "r2": [1, 3], "racah": 9, "rad": 2, "radian": [3, 7, 13, 21, 25], "rai": [2, 3, 10, 11, 23, 26, 29, 37], "rainbow": 39, "rais": 13, "rang": [3, 4, 5, 6, 7, 8, 9, 13, 39], "rangl": [7, 9], "rank": [3, 14, 15, 19, 20], "rather": 40, "ratio": 8, "ravel": [2, 8], "raw": [3, 36], "rb": 20, "rcparam": 39, "re": [13, 14, 15, 17, 21, 25, 26, 39], "read": [2, 7, 19, 22, 27], "read_poles_from_fil": [18, 19, 22], "readabl": 38, "reader": [0, 7], "readi": 36, "real": [0, 1, 3, 4, 6, 7, 8, 9, 14, 16, 25, 27], "realist": 8, "realli": 37, "reassur": 0, "rebeca": 37, "recal": [0, 1, 7], "reciproc": 27, "recommed": 25, "recommend": 36, "redirect": 38, "redo": [0, 1], "reduc": 8, "ref": [2, 3, 15, 34], "refer": [3, 5, 9, 12, 15, 26], "region": 4, "rel": [7, 36, 38], "relat": [0, 6, 9], "relationship": 3, "releas": [12, 18, 35, 36], "relev": [0, 3, 7, 8], "reload": [4, 5], "rememb": [0, 3], "remov": 2, "renorm": 37, "rep": 6, "repeat": [5, 7], "repesent": 6, "replac": [2, 36], "repo": 38, "repo2dock": 40, "repositori": 34, "repres": [2, 3, 6, 7, 8, 17], "represent": [4, 14], "reproduc": [26, 40], "repuls": [1, 8, 9], "requir": [0, 2, 5, 7, 8, 9, 25, 26], "requri": 8, "rescal": [18, 26, 39], "research": [2, 6, 7, 37], "resepct": 21, "reshap": 1, "resid": 15, "resolut": [2, 37], "resolv": [2, 7], "reson": [2, 26, 37], "respect": [2, 3, 4, 6, 21, 25, 27, 38], "respositori": 40, "rest": 1, "result": [0, 5, 13, 17], "return": [0, 1, 6, 7, 8, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 38, 40], "reus": 2, "rev": [2, 3, 5, 6, 7, 26, 34, 37], "revelli": 6, "rich": 38, "right": [0, 2, 7, 8, 9, 13, 14, 20, 21, 22, 25, 39], "rightarrow": [3, 5, 7, 8, 21, 25], "risk": 3, "rix": [3, 7, 10, 11, 19, 21, 22, 25, 26, 29, 30, 34, 36, 40, 41], "rixs_1v1c_fort": [18, 25], "rixs_1v1c_pi": [2, 18, 25, 39], "rixs_2v1c_fort": [18, 25], "rixs_data": 22, "rixs_fsolv": 22, "rixs_full_d_shel": 2, "rixs_l2": 39, "rixs_l3": 39, "rixs_pol": 19, "rixs_pol_sum": 2, "rixs_siam_fort": [18, 25], "rixs_util": [12, 18], "rixscut": 2, "rixsmap": [2, 22], "rm": 40, "rmat": 13, "rmat_to_eul": [13, 18], "roberto": 37, "rocksalt": 3, "role": 37, "root": 40, "roser": 37, "rossi": [1, 37], "rotat": [9, 13], "roughli": 3, "round": [0, 1, 6], "routin": 0, "row": [1, 3], "rpt": 27, "rubenstein": 37, "rubi": 36, "rule": 0, "run": [0, 1, 2, 3, 4, 5, 6, 8, 9, 36, 38, 39], "run_fedsolv": 36, "run_rixs_fsolv": 36, "runtime_library_dir": 36, "ruotsalainen": 37, "rvec": 14, "r\u00e9gi": 37, "s2": 0, "s2_val": 0, "s2_val_soc": 0, "s_": 17, "s_i": 15, "s_j": 15, "s_squared_exp": 8, "s_squared_op": 8, "s_t": 15, "s_u": 15, "s_x": 13, "s_y": 13, "s_z": [8, 13], "s_z_exp": 8, "safe": [3, 25], "sahar": 37, "sai": [0, 3, 38], "salluzzo": 37, "sambri": 37, "same": [0, 1, 3, 4, 5, 6, 8, 9, 14, 15, 25, 26, 36], "sampl": [2, 3], "sangja": 37, "sarita": 37, "satisfi": 13, "save": [3, 6, 22, 38], "savetxt": 3, "sawatzki": [5, 26], "sbin": 36, "scalar": 13, "scale": [1, 2, 3, 8, 26], "scale_dd": 3, "scale_dp": 3, "scaleu": 1, "scatter": [21, 23, 25, 37, 39], "scatter_axi": [2, 25], "scattering_mat": [18, 23], "schmidt": 37, "schulz": 37, "scienc": [6, 41], "scipi": [0, 1, 4, 5, 6, 7, 8, 9, 16, 25, 36, 39], "screen": 3, "script": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 34, 38], "sd": [15, 21], "sd32": [15, 21], "sd52": [15, 21], "sear": 37, "search": [3, 18, 25], "second": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 15, 16, 25, 26], "section": 34, "sector": 25, "see": [0, 1, 2, 3, 4, 5, 6, 8, 9, 15, 34, 38, 39], "seem": 8, "segment": 27, "select": 36, "selfupd": 36, "semimet": 37, "sens": [1, 5, 8], "separ": [5, 9, 36], "serena": 37, "seri": [0, 7, 9], "serv": 26, "servic": 40, "session": 40, "set": [1, 2, 3, 4, 7, 9, 17, 21, 25, 26, 27, 36, 38], "set_bas": 27, "set_color": 8, "set_printopt": [1, 6], "set_ticks_posit": 0, "set_titl": [2, 3, 4, 5, 8, 9], "set_trac": 38, "set_vis": 0, "set_xlabel": [2, 3, 4, 5, 7, 8], "set_xlim": 2, "set_xtick": [0, 9], "set_ylabel": [0, 2, 3, 4, 5, 7, 8, 9], "set_ylim": [2, 8, 9], "setup": [36, 39], "seung": 37, "sever": [7, 36], "sf": [7, 15, 21], "sf52": [15, 21], "sf72": [15, 21], "shade": 2, "shape": [0, 2, 3, 13, 14, 20, 25, 26], "share": [6, 8], "sharei": 7, "sharex": 7, "sharifzadeh": 37, "shell": [0, 1, 3, 4, 9, 14, 15, 17, 21, 24, 25, 26, 39], "shell_level": [2, 25, 39], "shell_nam": [2, 3, 15, 25, 26], "shen": [7, 37], "shi": 37, "shift": [2, 3, 22, 39], "shorthand": 9, "shoul": [15, 26], "should": [1, 2, 3, 15, 20, 25, 26, 36, 38], "show": [0, 2, 3, 4, 5, 6, 7, 8, 9, 34, 36, 38, 39], "shown": 2, "si": 39, "siam": 25, "siam_typ": [3, 25], "sigma": [6, 7, 9, 13], "sigma_": 9, "sigma_i": 13, "sigma_x": 13, "sigma_z": 13, "sign": 3, "signatur": 37, "similar": [2, 8, 36], "simpl": [1, 7, 39], "simplest": [0, 8], "simplfi": 8, "simpli": [3, 8, 38], "simplic": 8, "simul": [1, 3, 37, 39, 41], "sin": [13, 15], "sina": 13, "sinc": [0, 3, 4, 6, 7, 8, 9], "sine": 13, "singl": [0, 2, 6, 15, 25, 26, 34], "singlet": [6, 8], "sister": 8, "site": [2, 3, 6, 16, 25, 27, 34, 36, 37], "six": [0, 1, 3, 8], "size": [3, 4, 9, 25, 27, 39], "skip_g": 25, "skyrmion": 37, "slat_i": [26, 39], "slat_n": [26, 39], "slater": [0, 1, 3, 9, 15, 25, 26, 39], "slater_i": [1, 2, 3, 26, 39], "slater_integrals_nam": [18, 26], "slater_n": [2, 3, 26, 39], "slower": 3, "small": [0, 8, 25, 39], "smaller": [0, 8, 25], "smooth": 6, "sn": 39, "so": [0, 1, 2, 3, 4, 5, 6, 7, 8, 25, 40], "soc": [0, 3, 12, 18, 25, 26, 38], "soften": 37, "sohrab": 37, "solid": [1, 3], "solut": 26, "solv": [3, 6, 8, 9, 25, 26, 36], "solver": [3, 12, 18, 38], "some": [2, 5, 7, 9, 10, 17, 36, 37], "some_funct": 36, "sometim": 3, "sort": 17, "sourc": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 37, 38, 39, 41], "sp": [15, 21], "sp12": [15, 21], "sp32": [15, 21], "space": [14, 17, 25, 26, 27], "span": 2, "specif": [7, 37], "specifi": [0, 3, 4, 6, 7, 21, 40], "spectra": [9, 22, 25, 26, 34, 37, 41], "spectral": 2, "spectroscop": 3, "spectroscopi": [37, 41], "spectrum": [2, 3, 22], "spheric": [3, 9, 13, 14, 21, 24, 25], "sphinx": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 29, 36], "spin": [1, 2, 3, 4, 6, 7, 8, 9, 13, 14, 15, 17, 24, 25, 26, 27, 34, 37, 39], "spin_index": 7, "spin_label": 7, "spin_mom": [0, 6, 8], "spin_mom_one_sit": 6, "spin_pair": 1, "spine": 0, "spinon": 37, "spinor": 13, "split": [0, 1, 3, 6, 7, 13, 25, 26], "sqrt": [0, 9, 13, 15], "squar": [0, 4, 13, 37], "sr": [2, 37], "src": 36, "srtio": 37, "ss": [15, 21], "ssq_exp": 6, "stamokosta": 2, "stand": 9, "standard": [0, 3, 7, 25, 26, 38, 40], "star": 15, "staro": 37, "start": [1, 2, 6, 7, 8, 9, 26, 27, 36, 38, 39, 41], "state": [0, 1, 2, 6, 7, 8, 9, 10, 11, 17, 25, 26, 29, 37, 39], "statement": 38, "static": [25, 27], "static_core_pot": 25, "statist": 9, "stefano": 37, "step": [5, 27, 40], "still": 0, "store": [9, 22, 36, 40], "str": [19, 22, 24, 27], "str1": [15, 25], "str2": [15, 25], "straightforward": 36, "straightforwardli": [38, 40], "strang": 36, "strength": [16, 24, 25, 26, 39], "string": [1, 14, 15, 17, 19, 21, 22, 24, 25, 26], "strong": [3, 8, 13, 37], "strongli": 8, "structur": [3, 4, 6, 37], "struggl": 40, "studi": 37, "subplot": [0, 2, 3, 4, 5, 7, 8, 9, 39], "subplots_adjust": [7, 9, 39], "subset_by_index": 5, "subshel": 2, "subspac": [3, 25], "substanti": 9, "success": 36, "sudo": 36, "sugano": 15, "suggest": [36, 38], "suitabl": 25, "sum": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 39], "sum_": [0, 4, 6, 9, 15, 16, 20, 23], "sum_n": 7, "summari": [2, 3], "sun": 37, "sup": 37, "support": 36, "suppress": 1, "suptitl": 9, "sure": [36, 38], "surround": 3, "swap": 9, "switch": [0, 1, 5, 9], "sx": [4, 5, 13], "sy": [4, 5, 13], "sym": 27, "symbol": [9, 26], "symkvec": [18, 27], "symmeter": 9, "symmetr": 8, "symmetri": [0, 3, 9, 17, 27, 37], "symmmetri": 9, "sympi": 36, "syncrotron": 41, "system": [2, 9, 14, 36, 39, 40], "sz": [4, 5, 6, 8, 13], "sz_exp": 6, "sz_list": 17, "t": [0, 1, 2, 3, 6, 7, 8, 9, 15, 22, 26, 37, 40], "t2g": [2, 13, 14, 15, 21, 24, 25, 26, 39], "t2gd": [15, 21], "t2gd32": [15, 21], "t2gd52": [15, 21], "t2gf": [15, 21], "t2gf52": [15, 21], "t2gf72": [15, 21], "t2gp": [15, 21], "t2gp12": [15, 21], "t2gp32": [15, 21, 26], "t_": [1, 2, 4, 5, 6, 9, 14, 15, 21, 23, 24, 39], "t_c2j": 14, "t_c2r": 14, "t_cub2r": 14, "t_l": 14, "t_pp": 5, "t_r": 14, "t_r2c": 14, "t_r2cub": 14, "ta": 37, "tabl": 12, "taekyung": 37, "tafti": 37, "take": [0, 1, 2, 3, 5, 7, 34, 36], "taken": 34, "takeo": 3, "tanab": [9, 15], "tanaka": 3, "tar": 36, "task": [6, 7, 38], "tb": 27, "tbeta": 4, "tdegeneraci": 1, "tell": [1, 36, 38], "temperatur": [2, 3, 22, 25, 26, 39], "ten_dq": [1, 2, 3, 9, 13, 39], "ten_dq_bath": 3, "tend": 8, "tensor": [0, 9, 14, 15, 19, 20, 25], "term": [0, 1, 2, 3, 4, 5, 6, 7, 8, 25, 27], "termin": [36, 38, 39, 40], "test": [2, 3, 9, 36], "tetragon": [1, 8, 13, 39], "text": [0, 9, 15, 22, 36], "textbook": 9, "textrm": 26, "tgamma": 4, "th": [17, 25], "than": [0, 3, 7, 8, 19, 20, 25, 26, 40], "thei": [0, 1, 4, 6, 8, 9, 15, 18, 21, 25, 26, 36], "them": [4, 6, 7, 13, 17, 22, 26], "theori": 3, "therefor": [1, 3, 4, 8], "thermal": [2, 3], "theta": [2, 7, 15, 21], "thi": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 18, 19, 21, 22, 25, 26, 34, 36, 38, 39, 40], "thin": [2, 3, 7, 21, 25, 37, 39], "thing": [0, 1, 3, 5], "think": 3, "third": [0, 13], "thoma": 37, "those": [2, 3, 8, 9], "though": 8, "thout": [2, 7, 21, 25, 39], "three": [0, 3, 7, 13, 15, 25, 26, 27], "through": [4, 36], "thu": 34, "tiantian": 37, "tick": 8, "tight": [14, 27], "tight_layout": 8, "tild": 7, "time": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 20, 21, 22, 25, 26, 27, 39], "times10": [4, 9], "times2": 6, "times20": 4, "times3": 7, "times4": 6, "tini": 6, "tip": [12, 35], "titan": 37, "titl": [7, 39], "tl": 14, "tl_": 14, "tmat": [4, 5, 14], "tmat_c2j": [14, 18], "tmat_c2r": [1, 3, 9, 14, 18], "tmat_cub2r_f": [14, 18], "tmat_r2c": [1, 7, 14, 18], "tmat_r2cub_f": [14, 18], "togeth": 36, "toi": 8, "tol": [19, 20], "too": 25, "tool": 36, "toolkit": [37, 41], "top": [0, 2, 9, 39], "topolog": 37, "torr": 37, "tot_mom": 0, "total": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 17, 25, 29], "tr": 14, "tr_": 14, "track": 0, "trans_c2n": [3, 4, 5, 25], "trans_dp": 21, "trans_dp32": 21, "trans_mat_ab": 23, "trans_mat_emi": 23, "trans_op": [2, 25, 39], "trans_t2gp": 21, "trans_to_which": [25, 26], "transer": 5, "transfer": [3, 10, 11, 26, 29], "transform": [1, 3, 4, 7, 13, 14, 25], "transform_utensor": [9, 14, 18], "transit": [2, 3, 4, 5, 8, 9, 10, 11, 15, 21, 23, 25, 26, 29, 34, 39], "transpar": 1, "transpos": [4, 5], "treat": 8, "trick": 2, "trigon": 13, "trimer": 37, "triplet": [6, 8], "troubl": 3, "true": [0, 1, 3, 5, 6, 7, 9, 13, 19, 25, 26], "trust": 0, "try": 36, "tsz": 8, "tupl": [15, 17, 21, 25, 26, 27], "turn": 5, "tutori": [1, 12, 35], "twice": 13, "twinx": 8, "two": [0, 1, 2, 3, 6, 8, 9, 13, 15, 20, 21, 25, 26, 34, 36, 37], "two_fermion": [18, 20], "two_theta": 7, "txt": 38, "type": [3, 6, 9, 15, 21, 25, 26, 27, 38, 39], "typic": [3, 25], "u": [0, 1, 3, 7, 8, 9, 15, 19, 26, 37, 39], "u1": 15, "u2": 15, "u_": [0, 3, 4, 6, 9, 15, 20, 26], "u_0": 9, "u_1": 15, "u_2": 15, "u_d": 26, "u_dd": [3, 26], "u_dp": 3, "u_mat_1sit": 6, "u_pd": 26, "ubuntu": 40, "ud": [2, 26, 39], "udjh_to_f0f2f4": [2, 18, 26, 39], "udjh_to_f0f2f4f6": [18, 26], "udjh_to_uj": [18, 26], "uj_to_udjh": [18, 26, 39], "umat": [0, 1, 4, 5, 6, 8, 9, 14, 15, 19, 20, 39], "umat_chb": 9, "umat_d": 15, "umat_delectron": [4, 5], "umat_dp": 15, "umat_dp32": 15, "umat_new": 14, "umat_no_multiorbit": 9, "umat_slat": [9, 15, 18], "umat_t2gp": 15, "uncorrel": 3, "under": [7, 8, 9, 38], "underli": 38, "underlin": [3, 5, 8], "understand": [0, 7, 8], "uni": [8, 27], "uniform": 27, "unikvec": [18, 27], "uniqu": [0, 1], "unique_": 1, "unit": [13, 21], "unit_k": 21, "unit_wavevector": [18, 21], "unitari": [1, 14], "univers": [8, 26], "unless": 3, "up": [0, 1, 4, 7, 13, 15, 36, 40], "uparrow": [1, 6, 8, 9], "updat": 36, "upgrad": 36, "upon": 1, "upper": 7, "upton": 37, "url": 40, "uru2si2": 34, "us": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 17, 22, 25, 26, 34, 38, 40], "usag": [10, 38], "user": [12, 26, 36], "usr": [36, 39], "usual": [3, 25, 36], "util": [2, 3, 12, 18], "v": [0, 1, 3, 4, 5, 6, 8, 9, 16, 36, 37], "v0": 36, "v1": [36, 39], "v1_cfmat": 25, "v1_ext_b": 25, "v1_on_which": 25, "v1_othermat": 25, "v1_soc": 25, "v1v2_norb": 25, "v2": [0, 39], "v2_cfmat": 25, "v2_ext_b": 25, "v2_on_which": 25, "v2_othermat": 25, "v2_soc": 25, "v3": 36, "v_": 16, "v_cfmat": [2, 25, 39], "v_name": [26, 39], "v_noccu": [2, 3, 4, 5, 25, 26, 39], "v_norb": 25, "v_orbl": [4, 5], "v_othermat": 25, "v_soc": [2, 25, 26, 39], "v_soc_i": [3, 26, 39], "v_soc_n": [3, 26, 39], "v_tot_noccu": 25, "val": 9, "valanc": [2, 3], "valenc": [0, 3, 7, 25, 26, 37, 39], "valentina": 37, "valent\u00ed": 37, "valid": 0, "valu": [1, 3, 6, 7, 8, 9, 17, 19, 25, 26], "values_list": 0, "van": 37, "vari": [3, 4], "variabl": [2, 9, 15, 25, 26, 36, 38], "variou": 9, "vaul": 26, "vec": [6, 7, 24], "vector": [3, 7, 13, 21, 25, 27], "vector_f": 7, "vector_i": 7, "veg": 3, "venv": 36, "verbos": 25, "veri": [25, 38], "version": [25, 36, 40], "verticalalign": 0, "via": [0, 1, 2, 3, 8, 9, 38], "virtual": 36, "virtual_env": 36, "vizual": 5, "volum": 40, "von": 37, "vt2g": 3, "w": [5, 7, 26, 37], "wa": [5, 7, 41], "waal": 37, "wai": [1, 3, 4, 5, 8, 36, 38, 40], "walker": 37, "wang": [2, 3, 6, 34, 37, 39], "wannier": 27, "wannier90": [14, 27], "wannier90_hr": 27, "wannier_ham": [12, 18], "want": [0, 1, 2, 3, 6, 7, 9, 36, 38], "wave": 21, "wavefunct": 9, "wavevec": 21, "wavevector": [4, 21], "wavevector_with_length": [18, 21], "we": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 26, 34, 36, 38, 39, 40], "websit": 2, "weichselbaum": 37, "weight": [2, 4, 6], "well": [6, 7, 9], "wenjian": 37, "weyherm\u00fcl": 37, "wget": 36, "what": [1, 2, 5, 6, 7, 8, 12, 18, 35], "when": [0, 1, 2, 3, 5, 15, 19, 21, 25, 36], "whenev": 8, "where": [0, 1, 2, 3, 5, 6, 9, 15, 17, 22, 23, 25, 26, 34, 36, 38], "where_is_angl": [13, 18], "wherea": 5, "whether": [7, 8, 9, 13, 14, 25, 27, 36], "which": [0, 1, 2, 3, 5, 6, 7, 8, 9, 13, 14, 15, 20, 22, 25, 26, 36, 38, 40], "while": [8, 36, 38], "who": 7, "widget": 38, "width": [2, 3], "wigner": [9, 13], "window": 36, "wish": 36, "with_main_qn": 26, "within": [6, 8, 36, 38], "without": [3, 9, 23, 26, 38, 39], "won": 3, "wong": 37, "work": [0, 1, 3, 5, 36, 37, 38, 39], "working_dir": 40, "world": 39, "would": [0, 1, 3, 8, 37, 38, 40], "wrai": 34, "writ": 25, "write": [1, 3, 7, 8, 9, 17, 19, 25, 26], "write_config": [18, 19], "write_emat": [18, 19], "write_fock_dec_by_n": [17, 18], "write_tensor": [18, 19], "write_umat": [18, 19], "written": [2, 3, 9, 19, 25], "wspace": [9, 39], "x": [1, 2, 3, 8, 9, 10, 11, 13, 15, 16, 19, 21, 22, 23, 25, 26, 29, 36, 37], "x2": [1, 3], "xa": [4, 5, 10, 11, 19, 21, 22, 25, 26, 29, 30, 34, 39, 41], "xas_1v1c_fort": [18, 25], "xas_1v1c_pi": [2, 18, 25, 39], "xas_2v1c_fort": [18, 25], "xas_fsolv": 22, "xas_full_d_shel": 2, "xas_pol": [3, 19], "xas_siam_fort": [3, 18, 25], "xcode": 36, "xi": 37, "xianyi": 36, "xin": 37, "xjf": 36, "xlabel": [6, 39], "xmax": 9, "xmin": 9, "xuan": 37, "xun": 37, "xy": [1, 3, 7, 9], "xyz": [21, 25], "xz": [1, 7, 9], "xzf": 36, "y": [1, 2, 3, 7, 8, 9, 13, 15, 16, 21, 23, 25, 34, 37, 39], "y2": [1, 3], "y_": 15, "yan": 37, "yang": 37, "yanhong": 37, "yao": [7, 37], "yaxi": 0, "yichen": 37, "yield": 5, "yilin": 37, "yimei": 37, "yin": 37, "ying": 37, "yiro": 2, "ylabel": [6, 39], "yml": 40, "york": [9, 15], "you": [3, 9, 26, 36, 37, 38, 39, 40], "youguo": 37, "your": [26, 36, 37, 38, 39], "yourself": 26, "yu": 37, "yuan": 2, "yue": 37, "yyyi": 12, "yz": [1, 3, 7, 9], "z": [2, 3, 6, 7, 8, 13, 17, 21, 23, 25, 37], "zaanen": [5, 26], "zager": 37, "zeeman": [4, 5, 6, 7, 25], "zero": [1, 3, 4, 5, 6, 7, 8, 25, 26], "zeta_d_i": [3, 39], "zeta_d_n": [3, 39], "zeta_p": 39, "zeta_p_n": 39, "zhan": 37, "zhang": 37, "zhao": 37, "zhou": 37, "zhu": 37, "zip": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 26, 39], "zx": [1, 3, 25], "zx_to_rmat": [13, 18], "zy": 1}, "titles": ["Exact diagonalization", "Crystal fields", "RIXS calculations for an atomic model", "Anderson impurity model for NiO XAS", "Ground state analysis for NiO", "Charge-transfer energy for NiO", "Hubbard Dimer", "X-ray transitions", "Hund\u2019s Interactions in charge transfer insulators", "Coulomb interactions", "Pedagogical examples", "Computation times", "edrixs Documentation", "angular_momentum", "basis_transform", "coulomb_utensor", "fit_hyb", "fock_basis", "edrixs Reference", "iostream", "manybody_operator", "photon_transition", "plot_spectrum", "rixs_utils", "soc", "solvers", "utils", "wannier_ham", "Release History", "Computation times", "edrixs basics", "ED", "RIXS", "XAS", "Examples", "edrixs User Guide", "Installation", "EDRIXS papers", "Tips for python and edrixs", "Quickstart tutorial", "edrixs and docker", "What is edrixs?"], "titleterms": {"": 8, "04": 36, "1": 9, "10": 36, "14": 36, "2": 9, "20": 36, "3": 9, "4": 9, "5": 9, "6": 9, "The": [6, 8], "activ": 2, "an": [1, 2, 39], "anaconda": 36, "analysi": 4, "anderson": 3, "angular": 7, "angular_momentum": 13, "ar": 8, "atom": [1, 2, 8], "basi": [0, 4, 9], "basic": 30, "basis_transform": 14, "bath": 3, "between": 8, "block": 5, "build": [3, 4, 36], "calcul": [2, 39], "charg": [5, 8], "cite": 37, "code": 40, "comput": [0, 2, 11, 29], "connecton": 8, "contain": 40, "content": 18, "core": 2, "coulomb": [0, 3, 9], "coulomb_utensor": 15, "coupl": 0, "cpc": 34, "creat": [0, 6, 9], "crystal": 1, "d": 2, "dd": 28, "depend": [6, 7], "describ": 3, "determin": 5, "diagon": [0, 2, 4, 5, 6, 8], "diagram": 0, "dimer": 6, "docker": 40, "document": 12, "ed": [31, 39], "edrix": [12, 18, 30, 35, 36, 37, 38, 39, 40, 41], "effect": 9, "eigenvector": [5, 7], "electron": 3, "energi": [0, 3, 5], "exact": 0, "exampl": [10, 34], "exchang": 9, "exciton": 8, "expect": 0, "extend": 34, "fermion": 4, "field": 1, "fit_hyb": 16, "fock": [0, 4], "fock_basi": 17, "four": [4, 9], "from": [34, 36], "full": 2, "function": 6, "ground": 4, "guid": 35, "hamiltonain": 4, "hamiltonian": 4, "hello": 39, "histori": 28, "hole": 8, "homebrew": 36, "hop": [8, 9], "how": 37, "hubbard": 6, "hund": 8, "i": 41, "import": 4, "impur": 3, "indic": 18, "initi": [6, 28], "instal": 36, "insul": 8, "inter": 9, "interact": [0, 3, 8, 9], "intra": 9, "iostream": 19, "larg": [6, 8], "level": 0, "ligand": 5, "limit": [6, 8], "linux": 36, "lowest": 5, "maco": 36, "macport": 36, "manybody_oper": 20, "matric": [1, 3, 6], "matrix": [0, 4, 7, 9], "mm": 28, "model": [2, 3], "mojav": 36, "multi": 9, "nio": [3, 4, 5], "number": 3, "occup": 5, "oper": 7, "orbit": [0, 2, 5, 7, 9], "osx": 36, "our": 34, "pair": 9, "paper": [34, 37], "paramet": [0, 2, 4], "parameter": 9, "pedagog": 10, "photon_transit": 21, "plot": [2, 4, 7], "plot_spectrum": 22, "popul": 6, "python": 38, "quickstart": 39, "rai": 7, "refer": 18, "releas": 28, "requir": 36, "rix": [2, 32, 39], "rixs_util": 23, "run": [7, 40], "scatter": 7, "setup": 8, "share": 40, "shell": 2, "slater": 2, "soc": 24, "solver": 25, "sourc": 36, "specifi": 2, "spin": 0, "split": 5, "state": [3, 4, 5], "tabl": [9, 18], "term": 9, "three": 9, "through": 7, "time": [11, 29], "tip": 38, "transfer": [5, 8], "transform": [0, 9], "transit": 7, "tutori": 39, "two": 4, "u": 6, "ubuntu": 36, "us": [36, 37, 39], "user": 35, "util": 26, "valenc": 2, "valu": 0, "via": 36, "wannier_ham": 27, "what": 41, "where": 8, "x": 7, "xa": [2, 3, 33], "your": 40, "yyyi": 28}}) \ No newline at end of file diff --git a/edrixs/sg_execution_times.html b/edrixs/sg_execution_times.html deleted file mode 100644 index a824b1aadc..0000000000 --- a/edrixs/sg_execution_times.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - Computation times — edrixs documentation - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Computation times

-

00:07.932 total execution time for 10 files from all galleries:

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Example

Time

Mem (MB)

RIXS calculations for an atomic model (../../examples/sphinx/example_2_single_atom_RIXS.py)

00:03.985

0.0

Hund’s Interactions in charge transfer insulators (../../examples/sphinx/example_8_Hunds_interactions.py)

00:01.236

0.0

Anderson impurity model for NiO XAS (../../examples/sphinx/example_3_AIM_XAS.py)

00:00.548

0.0

X-ray transitions (../../examples/sphinx/example_7_transitions.py)

00:00.514

0.0

Charge-transfer energy for NiO (../../examples/sphinx/example_5_charge_transfer.py)

00:00.478

0.0

Ground state analysis for NiO (../../examples/sphinx/example_4_GS_analysis.py)

00:00.421

0.0

Coulomb interactions (../../examples/sphinx/example_9_Coulomb.py)

00:00.368

0.0

Crystal fields (../../examples/sphinx/example_1_crystal_field.py)

00:00.149

0.0

Exact diagonalization (../../examples/sphinx/example_0_ed_calculator.py)

00:00.138

0.0

Hubbard Dimer (../../examples/sphinx/example_6_Hubbard_dimer.py)

00:00.095

0.0

-
-
- - -
-
-
- -
- -
-

© Copyright 2019, Brookhaven National Lab.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/user/basics.ed.html b/edrixs/user/basics.ed.html deleted file mode 100644 index 2066397d99..0000000000 --- a/edrixs/user/basics.ed.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - ED — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
- -
-
- -
-

ED

-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/user/basics.html b/edrixs/user/basics.html deleted file mode 100644 index 1c5be33379..0000000000 --- a/edrixs/user/basics.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - edrixs basics — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

edrixs basics

-
- -
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/user/basics.rixs.html b/edrixs/user/basics.rixs.html deleted file mode 100644 index cc3d9bdfcb..0000000000 --- a/edrixs/user/basics.rixs.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - RIXS — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
- -
-
- -
-

RIXS

-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/user/basics.xas.html b/edrixs/user/basics.xas.html deleted file mode 100644 index bfb3d95a36..0000000000 --- a/edrixs/user/basics.xas.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - XAS — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
- -
-
- -
-

XAS

-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/user/examples.html b/edrixs/user/examples.html deleted file mode 100644 index 9cde56f8c3..0000000000 --- a/edrixs/user/examples.html +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - Examples — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Examples

-

Here we outline the examples available.

-
-

Examples from our CPC paper

-

The original examples from our Computer Physics Communications paper [1] are -kept in our -GitHub repository. -These are scripts that compute XAS and RIXS for particular physical -models including:

-
    -
  • Single atom model for Ni. See Ref. [1] section 5.1.

  • -
  • A two-site Ir-Ir cluster model. -See Ref. [1] section 5.2. This allows the modeling of dimer excitations in RIXS where electrons transition between atoms. -We used this model in our manuscript on Ba5AlIr2O11. [2]

  • -
  • Anderson impurity model. -See Ref. [1] section 5.3. This addresses Ba2YOsO6.

  • -
-
-
-

Extended examples

-

Additional examples are available -here. -Thus far we have addressed.

- -

Footnotes

- -
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/user/index.html b/edrixs/user/index.html deleted file mode 100644 index d82581b1a5..0000000000 --- a/edrixs/user/index.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - edrixs User Guide — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

edrixs User Guide

-
-
Release:
-

-
-
Date:
-

Jan 09, 2025

-
-
- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/user/installation.html b/edrixs/user/installation.html deleted file mode 100644 index 0262796d5b..0000000000 --- a/edrixs/user/installation.html +++ /dev/null @@ -1,493 +0,0 @@ - - - - - - - - - Installation — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Installation

-

For Linux users we suggest installing with anaconda. For Windows and macOS machines, we suggest using the docker instructions, which are relatively straightforward. If desired, you can also compile the code from the source for Linux.

-
-

Install and use edrixs via Anaconda

-

A conda package has been built for Linux. To use edrixs via Anaconda, you need first to install Anaconda in your system. -We recommend installing edrixs into a separate environment, for example, called edrixs_env, together with any other packages you might want to use like this:

-
conda create --name edrixs_env -c conda-forge python=3.10 edrixs matplotlib
-
-
-

We endeavor to keep the conda-forge release up to date, but note that these builds will usually not correspond to the latest version of edrixs, which is available in the master branch of edrixs.

-

edrixs will also run on Google Colaboratory, but does not come installed as default. Installing it requires a you to install conda and then edrixs, which can be done by executing a cell:

-
!pip install -q condacolab
-import condacolab
-condacolab.install()
-!conda install -c conda-forge edrixs
-
-
-

from within a notebook cell.

-
-
-

Requirements

-

Several tools and libraries are required to build and install edrixs,

-
-
    -
  • Fortran compiler: gfortran and ifort are supported

  • -
  • MPI environment: openmpi and mpich are tested

  • -
  • MPI Fortran and C compilers: mpif90, mpicc

  • -
  • BLAS and LAPACK libraries: OpenBLAS with gfortran and MKL with ifort

  • -
  • ARPACK library: arpack-ng with mpi enabled

  • -
  • Only Python3 is supported

  • -
  • numpy, scipy, sympy, matplotlib, sphinx, numpydoc

  • -
  • mpi4py with the same MPI implementation libraries (openmpi or mpich) as building edrixs

  • -
-
-
-
-

Build from source

-

We will show how to build edrixs from source on Ubuntu Linux 20.04 and macOS Mojave (OSX 10.14) as examples. -We will use gcc, gfortran, openmpi and OpenBLAS in these examples. -Building edrixs on other versions of Linux or macOS, or with Intel’s ifort+MKL will be similar.

-
-

Ubuntu Linux 20.04

-

Install compilers and tools:

-
sudo apt-get update
-sudo apt-get install build-essential gfortran gcc
-sudo apt-get install git wget
-sudo apt-get install python3 libpython3-dev python3-pip python3-venv
-
-
-

Create and activate a python virtual environment for edrixs:

-
python3 -m venv VIRTUAL_ENV
-source VIRTUAL_ENV/bin/activate
-
-
-

where VIRTUAL_ENV should be replaced by the directory where you wish to install edrixs.

-

Alternatively create and activate a conda environment for edrixs:

-
conda create --name edrixs_env python=3.8
-conda activate edrixs_env
-
-
-

We will assume python and pip are pointing to the activated environment from now on. -Check we are using the expected python and pip:

-
which python
-which pip
-python --version
-
-
-

Fetch the latest version of pip:

-
pip install --upgrade pip
-
-
-

openmpi, OpenBLAS, ARPACK can be installed by apt-get, but their versions are old and may not work properly. -However, they can also be compiled from source easily. In the following, we will show both ways, but we always recommend to build newer ones from source.

-

openmpi can be installed by:

-
sudo apt-get install libopenmpi-dev
-
-
-

or from newer version of source, for example v3.1.4:

-
wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.4.tar.bz2
-tar -xjf openmpi-3.1.4.tar.bz2
-cd openmpi-3.1.4
-./configure CC=gcc CXX=g++ FC=gfortran
-make
-sudo make install
-
-
-

the compiling process will take a while.

-

OpenBLAS can be installed by:

-
sudo apt-get install libopenblas-dev
-
-
-

or from a newer version of source:

-
wget https://github.com/xianyi/OpenBLAS/archive/v0.3.6.tar.gz
-tar -xzf v0.3.6.tar.gz
-cd OpenBLAS-0.3.6
-make CC=gcc FC=gfortran
-sudo make PREFIX=/usr/local install
-
-
-

ARPACK can be installed by:

-
sudo apt-get install libarpack2-dev libparpack2-dev
-
-
-

or from a newer version of source:

-
wget https://github.com/opencollab/arpack-ng/archive/3.6.3.tar.gz
-tar -xzf 3.6.3.tar.gz
-cd arpack-ng-3.6.3
-./bootstrap
-./configure --enable-mpi --with-blas="-L/usr/local/lib/ -lopenblas" FC=gfortran F77=gfortran MPIFC=mpif90 MPIF77=mpif90
-make
-sudo make install
-
-
-

mpi4py can be installed by:

-
export MPICC=/usr/local/bin/mpicc
-sudo pip install --no-cache-dir mpi4py
-
-
-

or from source:

-
wget https://github.com/mpi4py/mpi4py/archive/3.0.1.tar.gz
-tar xzf 3.0.1.tar.gz
-cd mpi4py-3.0.1
-
-
-

edit mpi.cfg to set MPI paths as following:

-
[mpi]
-mpi_dir              = /usr/local
-mpicc                = %(mpi_dir)s/bin/mpicc
-mpicxx               = %(mpi_dir)s/bin/mpicxx
-include_dirs         = %(mpi_dir)s/include
-libraries            = mpi
-library_dirs         = %(mpi_dir)s/lib
-runtime_library_dirs = %(mpi_dir)s/lib
-
-
-

and comment all other contents. Then, build and install by:

-
python setup.py build
-sudo pip install .
-
-
-

Check whether the MPI paths are correct by:

-
python
->>> import mpi4py
->>> mpi4py.get_config()
-{'mpicc': '/usr/local/bin/mpicc',
- 'mpicxx': '/usr/local/bin/mpicxx',
- 'include_dirs': '/usr/local/include',
- 'libraries': 'mpi',
- 'library_dirs': '/usr/local/lib',
- 'runtime_library_dirs': '/usr/local/lib'}
-
-
-

Now, we are ready to build edrixs:

-
git clone https://github.com/NSLS-II/edrixs.git
-cd edrixs
-pip install -v .
-
-
-

Start to play with edrixs by:

-
python
->>> import edrixs
->>> edrixs.some_functions(...)
-
-
-

or go to examples directory to run some examples:

-
cd examples/more/ED/14orb
-./get_inputs.py
-mpirun -np 2 ed.x
-mpirun -np 2 ./run_fedsolver.py
-cd ../../RIXS/LaNiO3_thin
-mpirun -np 2 ./run_rixs_fsolver.py
-
-
-

if no errors, the installation is successful.

-
-
-

macOS Mojave (OSX 10.14)

-

Install newest Xcode through App store.

-
-

Use MacPorts

-

Download and install MacPorts. -Update MacPorts by:

-
sudo port -v selfupdate
-
-
-

Install gcc8, arpack, openblas and openmpi:

-
sudo port -v install gcc8
-sudo port select gcc mp-gcc8
-sudo port -v install openmpi-default +gcc8
-sudo port -v install openblas +gcc8
-sudo port -v install arpack +openblas +openmpi
-sudo port select --set mpi openmpi-mp-fortran
-
-
-

Install Python, pip, numpy, scipy, sympy, matplotlib:

-
sudo port -v install python37 py37-pip
-sudo port -v install py37-numpy +gcc8 +openblas
-sudo port -v install py37-scipy +gcc8 +openblas
-sudo port -v install py37-sympy
-sudo port -v install py37-matplotlib
-
-
-

Notes:

-
    -
  • DO NOT use pip to install numpy because it will use clang as default compiler, which has a strange bug when using f2py with mpif90 compiler. If you cannot solve this issue by sudo port install py37-numpy +gcc8, you can compile numpy from its source with gcc compiler. Always use gcc to compile numpy if you want to build it from source.

  • -
  • You can also try gcc9 if it is already available, but be sure to change all gcc8 to gcc9 in the above commands.

  • -
-

We will assume python pointing to python3.7 and pip pointing to pip3.7 from now on. If this is not the case, you can make links explicitly. -Check we are using the expected python and pip:

-
which python
-python --version
-which pip
-pip --version
-
-
-

Add the following two lines into ~/.bash_profile:

-
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
-export PATH=/opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin:$PATH
-
-
-

Close current terminal and open a new one.

-

Install mpi4py:

-
export MPICC=/opt/local/bin/mpicc
-sudo pip install --no-cache-dir mpi4py
-
-
-

Please be sure to check whether the MPI paths of mpi4py are correct by:

-
python
->>> import mpi4py
->>> mpi4py.get_config()
-{'mpicc': '/opt/local/bin/mpicc'}
-
-
-

Now, we are ready to build edrixs:

-
git clone https://github.com/NSLS-II/edrixs.git
-cd edrixs
-make -C src F90=mpif90 LIBS="-L/opt/local/lib -lopenblas -lparpack -larpack"
-make -C src install
-python setup.py config_fc --f77exec=mpif90 --f90exec=mpif90 build_ext --libraries=openblas,parpack,arpack --library-dirs=/opt/local/lib
-sudo pip install .
-
-
-

You can add edrixs/bin to the environment variable PATH in ~/.bash_profile.

-

Go to examples directory to run some examples:

-
cd examples/more/ED/14orb
-./get_inputs.py
-mpirun -np 2 ../../../../src/ed.x
-mpirun -np 2 ./run_fedsolver.py
-cd ../../RIXS/LaNiO3_thin
-mpirun -np 2 ./run_rixs_fsolver.py
-
-
-

if no errors, the installation is successful.

-

All done, enjoy!

-
-
-

Use Homebrew

-

Install Homebrew:

-
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
-
-

Add following line to ~/.bash_profile:

-
export PATH="/usr/local/bin:$PATH"
-
-
-

Install gcc9:

-
brew install gcc@9
-
-
-

Install openblas and arpack:

-
brew install openblas
-brew install arpack
-
-
-

openmpi has been automatically installed when installing arpack.

-

Install python3.7:

-
brew install python
-
-
-

We will assume python pointing to python3.7 and pip pointing to pip3.7 from now on. If this is not the case, you can make link explicitly. -Check we are using the expected python and pip:

-
which python
-python --version
-which pip
-pip --version
-
-
-

Make links if gcc, g++ and gfortran are not pointing to gcc-9, g++-9, gfortran-9, for example:

-
ln -s /usr/local/Cellar/gcc/9.1.0/bin/gcc-9 /usr/local/bin/gcc
-ln -s /usr/local/Cellar/gcc/9.1.0/bin/g++-9 /usr/local/bin/g++
-ln -s /usr/local/Cellar/gcc/9.1.0/bin/gfortran-9 /usr/local/bin/gfortran
-
-
-

DO NOT install numpy through pip because it uses clang as default compiler, which will cause problems. -We will build numpy from source with gcc:

-
wget https://github.com/numpy/numpy/archive/v1.16.3.tar.gz
-tar xzf v1.16.3.tar.gz
-cd numpy-1.16.3
-export CC=gcc CXX=g++
-python setup.py build
-pip install .
-
-
-

You might need to do brew install wget if it is not already installed. -If you have BLIS or MKL installed, you will need to tell numpy to compile with -openblas. Create a file in the numpy directory called site.cfg and put the -following text in it:

-
[openblas]
-libraries = openblas
-library_dirs = /usr/local/Cellar/openblas/0.3.9/lib
-include_dirs = /usr/local/Cellar/openblas/0.3.9/include
-runtime_library_dirs = /usr/local/Cellar/openblas/0.3.9/lib
-
-
-

Now we are ready to install scipy, sympy, matplotlib:

-
pip install scipy sympy matplotlib
-export MPICC=/usr/local/bin/mpicc
-pip install --no-cache-dir mpi4py
-
-
-

Please be sure to check whether the MPI paths of mpi4py are correct by:

-
python
->>> import mpi4py
->>> mpi4py.get_config()
-{'mpicc': '/usr/local/bin/mpicc'}
-
-
-

Now, we are ready to build edrixs:

-
git clone https://github.com/NSLS-II/edrixs.git
-cd edrixs
-make -C src F90=mpif90 LIBS="-L/usr/local/opt/openblas/lib -lopenblas -L/usr/local/lib -lparpack -larpack"
-make -C src install
-python setup.py config_fc --f77exec=mpif90 --f90exec=mpif90 build_ext --libraries=openblas,parpack,arpack --library-dirs=/usr/local/lib:/usr/local/opt/openblas/lib
-pip install .
-
-
-

You can add edrixs/bin to the environment variable PATH in ~/.bash_profile.

-

Go to examples directory to run some examples:

-
cd examples/more/ED/14orb
-./get_inputs.py
-mpirun -np 2 ../../../../src/ed.x
-mpirun -np 2 ./run_fedsolver.py
-cd ../../RIXS/LaNiO3_thin
-mpirun -np 2 ./run_rixs_fsolver.py
-
-
-

if no errors, the installation is successful.

-

All done, enjoy!

- -
-
-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/user/papers.html b/edrixs/user/papers.html deleted file mode 100644 index 05716a77b2..0000000000 --- a/edrixs/user/papers.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - EDRIXS papers — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

EDRIXS papers

-
-

How to cite

-

If you are using the EDRIXS code to do some studies and would like to publish your great works, it would be really appreciated if you can cite the following paper:

- -
-
-

Papers using EDRIXS

-
    -
  • Strong Orbital Polarization in a Cobaltate-Titanate Oxide Heterostructure, Sangjae Lee, Alex Taekyung Lee, Alexandru B. Georgescu, Gilberto Fabbris, Myung-Geun Han, Yimei Zhu, John W. Freeland, Ankit S. Disa, Yichen Jia, Mark P. M. Dean, Frederick J. Walker, Sohrab Ismail-Beigi, and Charles H. Ahn, Phys. Rev. Lett. 123, 117201 (2019)

  • -
  • Large Polarons as Key Quasiparticles in SrTiO3 and SrTiO3-Based Heterostructures, Andrey Geondzhian, Alessia Sambri, Gabriella M. De Luca, Roberto Di Capua, Emiliano Di Gennaro, Davide Betto, Matteo Rossi, Ying Ying Peng, Roberto Fumagalli, Nicholas B. Brookes, Lucio Braicovich, Keith Gilmore, Giacomo Ghiringhelli, and Marco Salluzzo, Phys. Rev. Lett. 125, 126401 (2020)

  • -
  • Enhanced hybridization in the electronic ground state of the intercalated honeycomb iridate Ag3LiIr2O6, A. de la Torre, B. Zager, F. Bahrami, M. DiScala, J. R. Chamorro, M. H. Upton, G. Fabbris, D. Haskel, D. Casa, T. M. McQueen, F. Tafti, and K. W. Plumb, Phys. Rev. B 104, L100416 (2021)

  • -
  • Probing Physical Oxidation State by Resonant X-ray Emission Spectroscopy: Applications to Iron Model Complexes and Nitrogenase, Rebeca G. Castillo, Anselm W. Hahn, Benjamin E. Van Kuiken, Justin T. Henthorn, Jeremy McGale, and Serena DeBeer, Angew. Chem. Int. Ed. 60, 10112–1012 (2021)

  • -
  • Computing Local Multipoint Correlators Using the Numerical Renormalization Group, Seung-Sup B. Lee, Fabian B. Kugler, and Jan von Delft, Phys. Rev. X 11, 041007 (2021)

  • -
  • Role of Oxygen States in the Low Valence Nickelate La4Ni3O8, Y. Shen, J. Sears, G. Fabbris, J. Li, J. Pelliciari, I. Jarrige, Xi He, I. Božović, M. Mitrano, Junjie Zhang, J. F. Mitchell, A. S. Botana, V. Bisogni, M. R. Norman, S. Johnston, and M. P. M. Dean, Phys. Rev. X 12, 011055 (2022)

  • -
  • Role of disorder in electronic and magnetic properties of Ag3LiIr2O6, Ying Li and Roser Valentí, Phys. Rev. B 105, 115123 (2022)

  • -
  • Excited-state exchange interaction in NiO determined by high-resolution resonant inelastic x-ray scattering at the Ni M2,3edges Chun-Yu Liu, Kari Ruotsalainen, Karl Bauer, Régis Decker, Annette Pietzsch, and Alexander Föhlisch, Phys. Rev. B 106, 035104 (2022)

  • -
  • Electronic ground state of two nonmagnetic pentavalent honeycomb iridates, A. de la Torre, B. Zager, J. R. Chamorro, M. H. Upton, G. Fabbris, D. Haskel, D. Casa, T. M. McQueen, and K. W. Plumb, Phys. Rev. Materials 6, 084406 (2022)

  • -
  • Emergence of Spinons in Layered Trimer Iridate Ba4Ir3O10 , Y. Shen, J. Sears, G. Fabbris, A. Weichselbaum, W. Yin, H. Zhao, D. G. Mazzone, H. Miao, M. H. Upton, D. Casa, R. Acevedo-Esteves, C. Nelson, A. M. Barbour, C. Mazzoli, G. Cao, and M. P. M. Dean, Phys. Rev. Lett. 129, 207201 (2022)

  • -
  • Site-specific electronic and magnetic excitations of the skyrmion material Cu2OSeO3, Yanhong Gu, Yilin Wang, Jiaqi Lin, Jonathan Pelliciari, Jiemin Li, Myung-Geun Han, Marcus Schmidt, Gabriel Kotliar, Claudio Mazzoli, Mark P. M. Dean, and Valentina Bisogni, Communications Physics 5, 156 (2022)

  • -
  • Electronic structure of the frustrated diamond lattice magnet NiRh2O4, B. Zager, J. R. Chamorro, L. Ge, F. Bahrami, V. Bisogni, J. Pelliciari, J. Li, G. Fabbris, T. M. McQueen, M. Mourigal, and K. W. Plumb, Phys. Rev. B 106, 045134 (2022)

  • -
  • Electronic Character of Charge Order in Square-Planar Low-Valence Nickelates, Y. Shen, J. Sears, G. Fabbris, J. Li, J. Pelliciari, M. Mitrano, W. He, Junjie Zhang, J. F. Mitchell, V. Bisogni, M. R. Norman, S. Johnston, and M. P. M. Dean, Phys. Rev. X 13, 011021 (2023)

  • -
  • Resonant inelastic X-ray scattering in topological semimetal FeSi, Yao Shen, Anirudh Chandrasekaran, Jennifer Sears, Tiantian Zhang, Xin Han, Youguo Shi, Jiemin Li, Jonathan Pelliciari, Valentina Bisogni, Mark P. M. Dean, Stefanos Kourtis, arXiv:2301.02677 (2023)

  • -
  • Momentum-independent magnetic excitation continuum in the honeycomb iridate H3LiIr2O6, A. de la Torre, B. Zager, F. Bahrami, M. H. Upton, J. Kim, G. Fabbris, G. -H. Lee, W. Yang, D. Haskel, F. Tafti, K. W. Plumb, Nature Comm. 14, 5018 (2023)

  • -
  • Low-energy electronic interactions in ferrimagnetic Sr2CrReO6 thin films, Guillaume Marcaud, Alex Taekyung Lee, Adam J. Hauser, F. Y. Yang, Sangjae Lee, Diego Casa, Mary Upton, Thomas Gog, Kayahan Saritas, Yilin Wang, Mark P. M. Dean, Hua Zhou, Zhan Zhang, F. J. Walker, Ignace Jarrige, Sohrab Ismail-Beigi, and Charles Ahn, Phys. Rev. B 108, 075132 (2023)

  • -
  • Softening of dd-excitation in the resonant inelastic x-ray scattering spectra as a signature of Hund’s coupling in nickelates, U Kumar, C Melnick, G Kotliar, arXiv:2310.00983 (2023)

  • -
  • Interplay of broken symmetry and delocalized excitations in the insulating state of 1T-TaS2, Xun Jia, Anubhab Haldar, Jungho Kim, Yilin Wang, Gilberto Fabbris, Karl Ludwig, Stefanos Kourtis, Mary Upton, Yu Liu, Wenjian Lu, Xuan Luo, Yu-Ping Sun, Diego Casa, Sahar Sharifzadeh, Pierre T. Darancet, Yue Cao, Phys. Rev. B 108, 205105 (2023)

  • -
  • Local site behavior of the 5d and 4f ions in the frustrated pyrochlore Ho2Os2O7, S. Calder, Z. Y. Zhao, M. H. Upton, and J.-Q. Yan, Phys. Rev. B 109, 054408 (2024)

  • -
  • Elucidating the Role of Dimensionality on the Electronic Structure of the Van der Waals Antiferromagnet NiPS3, M. F. DiScala, D. Staros, A. de la Torre, A. Lopez, D. Wong, C. Schulz, M. Bartkowiak, B. Rubenstein, K. W. Plumb, Advanced Physics Research 3, 2300096 (2024)

  • -
  • Experimentally Assessing the Electronic Structure and Spin-State Energetics in MnFe Dimers Using 1s3p Resonant Inelastic X-ray Scattering, Rebeca G. Castillo, Benjamin E. Van Kuiken, Thomas Weyhermüller, and Serena DeBeer, Inorganic Chemistry (2024)

  • -
-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/user/pythontips.html b/edrixs/user/pythontips.html deleted file mode 100644 index b0920de5e4..0000000000 --- a/edrixs/user/pythontips.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - Tips for python and edrixs — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Tips for python and edrixs

-

In the design of edrixs, we made a deliberate choice to use -python for the application programming interface. This is -because of its readability, easy of use and flexibility to run and combine it -in many different ways.

-

The standard way to run a python script myscript.py is:

-
python myscript.py
-
-
-

This will generate the outputs of the script such as plots you choose to save -and print statements will be returned into the terminal. You can save the print -output by simply redirecting the output to a file:

-
python myscript.py > myoutput.txt
-
-
-

Python also includes an excellent plotting package -matplotlib, which one can use to make publication -quality plots.

-

While our aim is that the huge majority of tasks can be done without modifying -the underlying code all the python layers of code are easy to modify if you -would like to. If you want to modify, say, solvers.py. we would suggest copying -solvers.py to your working directory under a different name e.g. -my_solvers.py. Executing %run my_solvers.py -from within your script will then load the functions from the file into your -namespace. Just be sure to tell the script to load functions from edrixs -(and not via a relative file import) i.e. from .soc import atom_hsoc -should be from edrixs.soc import atom_hsoc.

-

For more exploratory usage, IPython or -Jupyter -can be very useful. (See edrixs and docker for invoking jupyter over docker.) -After starting IPython by typing ipython at the command line -you might find it useful to execute your script via:

-
%run -i myscript.py
-
-
-

The interactive flag -i means that all the variables and functions you loaded -will be available to you at the command line. These can be straightforwardly printed -or inspected via the ? or ?? flags, which show you the object documentation -and the object code respectively.:

-
from edrixs import cd_cubic_d
-cd_cubic_d??
-
-
-

Including %matplotlib widget in your script -will facilitate interactive plots. All these interactive options are also available -in the rich outputs possible within the -juptyer lab interface.

-

A brute force option to look at a variable deep within the code is to use a debugger:

-
python3 -m pdb myscript.py
-
-
-

Use import pdb; pdb.set_trace() to set the place where you want to enter the -debugger. See here for more details.

-

If you are feeling even braver, you can browse the Fortran code which does the -heavyweight computation. Either in the source edrixs directory or via the online -edrixs repo.

-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/user/quickstart.html b/edrixs/user/quickstart.html deleted file mode 100644 index 0c170dc608..0000000000 --- a/edrixs/user/quickstart.html +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - Quickstart tutorial — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Quickstart tutorial

-

If you are already familiar with multiplet calculations this page and our -examples page are a good part to start. Otherwise, checkout -our Pedagogical examples to learn the concepts -behind how edrixs works. The first example explains Exact diagonalization.

-
-

Use edrixs as an ED calculator

-

edrixs can be used as a simple ED calculator to get eigenvalues (eigenvectors) of a many-body Hamiltonian with small size dimension (\(< 1,000\)). -We will give an example to get eigenvalues for a \(t_{2g}\)-orbital system (\(l_{eff}=1\)). There are 6 orbitals including spin.

-

Launch your favorite python terminal:

-
>>> import edrixs
->>> import scipy
->>> norb = 6
->>> noccu = 2
->>> Ud, JH = edrixs.UJ_to_UdJH(4, 1)
->>> F0, F2, F4 = edrixs.UdJH_to_F0F2F4(Ud, JH)
->>> umat = edrixs.get_umat_slater('t2g', F0, F2, F4)
->>> emat = edrixs.atom_hsoc('t2g', 0.2)
->>> basis = edrixs.get_fock_bin_by_N(norb, noccu)
->>> H = edrixs.build_opers(4, umat, basis)
->>> e1, v1 = scipy.linalg.eigh(H)
->>> H += edrixs.build_opers(2, emat, basis)
->>> e2, v2 = scipy.linalg.eigh(H)
->>> print(e1)
-[1. 1. 1. 1. 1. 1. 1. 1. 1. 3. 3. 3. 3. 3. 6.]
->>> print(e2)
-[0.890519 0.890519 0.890519 0.890519 0.890519 1.1      1.1      1.1
- 1.183391 3.009481 3.009481 3.009481 3.009481 3.009481 6.016609]
-
-
-
-
-

Hello RIXS!

-

This is a “Hello World!” example for RIXS simulations at Ni (\(3d^8\)) \(L_{2/3}\) edges. -\(L_3\) means transition from Ni-\(2p_{3/2}\) to Ni-\(3d\), and -\(L_2\) means transition from Ni-\(2p_{1/2}\) to Ni-\(3d\).

-
#!/usr/bin/env python
-
-import numpy as np
-import matplotlib.pyplot as plt
-import matplotlib as mpl
-import edrixs
-
-# Setup parameters
-# ----------------
-# Number of occupancy of 3d shell
-noccu = 8
-
-res = edrixs.get_atom_data('Ni', v_name='3d', v_noccu=noccu, edge='L23')
-name_i, slat_i = [list(i) for i in zip(*res['slater_i'])]
-name_n, slat_n = [list(i) for i in zip(*res['slater_n'])]
-
-# Slater integrals for initial Hamiltonian without core-hole
-si = edrixs.rescale(slat_i, ([1, 2], [0.65]*2))
-si[0] = edrixs.get_F0('d', si[1], si[2])    # F0_dd
-
-# Slater integrals for intermediate Hamiltonian with core-hole
-sn = edrixs.rescale(slat_n, ([1, 2, 4, 5, 6], [0.65, 0.65, 0.95, 0.7, 0.7]))
-sn[0] = edrixs.get_F0('d', sn[1], sn[2])     # F0_dd
-sn[3] = edrixs.get_F0('dp', sn[5], sn[6])    # F0_dp
-
-slater = (si, sn)
-
-# Spin-orbit coupling strengths
-zeta_d_i = res['v_soc_i'][0]  # valence 3d electron without core-hole
-zeta_d_n = res['v_soc_n'][0]  # valence 3d electron with core-hole
-# E_{L2} - E_{L3} = 1.5 * zeta_p
-zeta_p_n = (res['edge_ene'][0] - res['edge_ene'][1]) / 1.5  # core 2p electron
-
-# Tetragonal crystal field
-cf = edrixs.cf_tetragonal_d(ten_dq=1.3, d1=0.05, d3=0.2)
-
-# Level shift of the core shell
-off = 857.4
-
-# Life time broadening
-gamma_c = res['gamma_c'][1]  # core hole
-gamma_f = 0.1  # final states
-
-# Incident, scattered, azimuthal angles
-# See Figure 1 of Y. Wang et al.,
-# `Computer Physics Communications 243, 151-165 (2019)
-# <https://doi.org/10.1016/j.cpc.2019.04.018>`_
-# for the defintion of the scattering angles.
-thin, thout, phi = 15 / 180.0 * np.pi, 75 / 180.0 * np.pi, 0.0
-
-# Polarization types
-poltype_xas = [('isotropic', 0.0)]  # for XAS
-poltype_rixs = [('linear', 0, 'linear', 0), ('linear', 0, 'linear', np.pi/2.0)]  # for RIXS
-
-# Energy grid
-ominc_xas = np.linspace(off - 10, off + 20, 1000)  # for XAS
-ominc_rixs_L3 = np.linspace(-5.9 + off, -0.9 + off, 100)  # incident energy at L3 edge
-ominc_rixs_L2 = np.linspace(10.4 + off, 14.9 + off, 100)  # incident energy at L3 edge
-eloss = np.linspace(-0.5, 5.0, 1000)  # energy loss for RIXS
-
-# Run ED
-eval_i, eval_n, trans_op = edrixs.ed_1v1c_py(
-    ('d', 'p'), shell_level=(0.0, -off), v_soc=(zeta_d_i, zeta_d_n),
-    c_soc=zeta_p_n, v_noccu=noccu, slater=slater, v_cfmat=cf
-)
-
-# Run XAS
-xas = edrixs.xas_1v1c_py(
-    eval_i, eval_n, trans_op, ominc_xas, gamma_c=gamma_c, thin=thin, phi=phi,
-    pol_type=poltype_xas, gs_list=[0, 1, 2], temperature=300
-)
-
-# Run RIXS at L3 edge
-rixs_L3 = edrixs.rixs_1v1c_py(
-    eval_i, eval_n, trans_op, ominc_rixs_L3, eloss, gamma_c=gamma_c, gamma_f=gamma_f,
-    thin=thin, thout=thout, phi=phi, pol_type=poltype_rixs, gs_list=[0, 1, 2],
-    temperature=300
-)
-
-# Run RIXS at L2 edge
-rixs_L2 = edrixs.rixs_1v1c_py(
-    eval_i, eval_n, trans_op, ominc_rixs_L2, eloss, gamma_c=gamma_c, gamma_f=gamma_f,
-    thin=thin, thout=thout, phi=phi, pol_type=poltype_rixs, gs_list=[0, 1, 2],
-    temperature=300
-)
-
-# Plot
-fig = plt.figure(figsize=(16, 14))
-mpl.rcParams['font.size'] = 20
-
-ax1 = plt.subplot(2, 2, 1)
-plt.grid()
-plt.plot(range(len(eval_i)), eval_i - min(eval_i), '-o')
-plt.xlabel(r'Multiplets')
-plt.ylabel(r'Energy (eV)')
-plt.title(r'(a) Energy of multiplets')
-
-ax2 = plt.subplot(2, 2, 2)
-plt.grid()
-plt.plot(ominc_xas, xas[:, 0], '-')
-plt.xlabel(r'Incident Energy (eV)')
-plt.ylabel(r'XAS Intensity (a.u.)')
-plt.title(r'(b) Isotropic XAS')
-
-ax3 = plt.subplot(2, 2, 3)
-plt.imshow(np.sum(rixs_L3, axis=2),
-           extent=[min(eloss), max(eloss), min(ominc_rixs_L3), max(ominc_rixs_L3)],
-           origin='lower', aspect='auto', cmap='rainbow', interpolation='gaussian')
-plt.xlabel(r'Energy loss (eV)')
-plt.ylabel(r'Incident Energy (eV)')
-plt.title(r'(c) RIXS map at $L_3$ edge  (LH)')
-
-ax4 = plt.subplot(2, 2, 4)
-plt.imshow(np.sum(rixs_L2, axis=2),
-           extent=[min(eloss), max(eloss), min(ominc_rixs_L2), max(ominc_rixs_L2)],
-           origin='lower', aspect='auto', cmap='rainbow', interpolation='gaussian')
-plt.xlabel(r'Energy loss (eV)')
-plt.ylabel(r'Incident Energy (eV)')
-plt.title(r'(d) RIXS map at $L_2$ edge (LH)')
-
-plt.subplots_adjust(left=0.1, right=0.9, bottom=0.1, top=0.9, wspace=0.2, hspace=0.3)
-plt.show()
-
-
-

(Source code)

-
-../_images/helloworld.png -
-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/user/usedocker.html b/edrixs/user/usedocker.html deleted file mode 100644 index f763435896..0000000000 --- a/edrixs/user/usedocker.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - edrixs and docker — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

edrixs and docker

-
-

Run edrixs in a docker container

-

To make life easier, we have built a docker image based on Ubuntu Linux (22.04) for edrixs, so you don’t need to struggle with the installation anymore. -The docker image can be used on any OS as long as the docker application is available. -Follow these steps to use the docker image:

-
    -
  • Install the docker application on your system.

  • -
  • Once Docker is running, create a directory to store data and create a file called docker-compose.yml with contents

    -
    version:  '3'
    -services:
    -  edrixs-jupyter:
    -      image: edrixs/edrixs
    -      volumes:
    -        - ./:/home/rixs
    -      working_dir: /home/rixs
    -      ports:
    -        - 8888:8888
    -      command: "jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root"
    -  edrixs-ipython:
    -      image: edrixs/edrixs
    -      volumes:
    -        - ./:/home/rixs
    -      working_dir: /home/rixs
    -
    -
    -

    and execute

    -
    docker compose up
    -
    -
    -

    This will return a url, which you can open to connect to the jupyter session.

    -
  • -
  • If you would like to access a terminal rather than jupyter run

    -
    docker compose run --rm edrixs-ipython
    -
    -
    -
  • -
-
-
-

Sharing your code

-

Using Docker is a nice way to straightforwardly share your code with others. The standard way to specify which docker image is needed to run your code is to include a file named Dockerfile with the following contents

-
FROM edrixs/edrixs
-
-
-

You might like to checkout the jupyter-repo2docker project, which helps automate the process of building and connecting to docker images. The mybinder project might also be helpful as this will open a github respository of notebooks in an executable environment, making your code immediately reproducible by anyone, anywhere.

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/edrixs/user/whatisedrixs.html b/edrixs/user/whatisedrixs.html deleted file mode 100644 index 90f5ccb418..0000000000 --- a/edrixs/user/whatisedrixs.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - What is edrixs? — edrixs documentation - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

What is edrixs?

-

EDRIXS is an open source toolkit for simulating XAS and RIXS spectra based on exact diagonalization of model Hamiltonians. -It was started as part of COMSCOPE project in the -Center for Computational Material Spectroscopy and Design, Brookhaven National Laboratory and is now maintained and -developed in collaboration between the Condensed Matter Physics and Materials Science Division -and the National Syncrotron Light Source II.

-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file