solvers
build_op returns a zero-argument functools.partial with a .backend
attribute. Numerical get_ops returns these factories for both Hamiltonians
and each transition component. ed and rixs dispatch using
hmat_i.backend; xas uses hmat_n.backend. The backend receives the
factories unchanged. All staged backend solvers require factories.
Dense, SciPy, and PETSc ED construct all inputs at calculation start.
PETSc XAS and RIXS accept matrix_lifetime in backend_kws.
Fortran disk handles are callable, returning themselves; native Fortran manages
actual matrix construction.
Call a numerical factory explicitly to obtain a concrete matrix for arithmetic.
Backend-neutral solver interface and deprecated legacy workflows.
Physical model construction lives in edrixs.models. Numerical operator
construction and spectral solvers are implemented in *_backend.py modules.
- edrixs.solvers.build_op(emat, umat, lb, rb=None, *, backend='scipy', basis_method='combinadic', use_numba=True, backend_kws=None)[source]
Prepare a labeled callable that builds a many-body operator.
- Parameters:
- ematarray-like or None
Coefficients of the one-body part. Pass
Nonewhen the operator has no one-body contribution.- umatarray-like, sparse matrix, or None
Coefficients of the two-body part. Pass
Nonewhen the operator has no two-body contribution.- lbFockBasisSpec or FockBasis
Basis metadata or realized basis for the output (left) many-body space.
- rbFockBasisSpec, FockBasis, or None, optional
Basis metadata or realized basis for the input (right) many-body space. When omitted,
lbis used for both sides.- backendstr, optional
Backend name. The default is
'scipy'.- basis_method{‘combinadic’, ‘explicit’}, optional
Representation used when
lb/rbare compact basis specifications. The default is the implicit combinadic representation.- use_numbabool, optional
JIT-compile matrix-entry construction. The default is True and requires Numba. Pass False to use Python construction without Numba.
- backend_kwsmapping, optional
Backend-specific construction options. Accepted names, defaults, and constraints are in the EDRIXS backend keyword reference: https://edrixs.github.io/edrixs/dev/user/backend.html#backend-options
- Returns:
- functools.partial
Zero-argument matrix factory with a
backendattribute. Each call builds a fresh matrix. Coefficient arrays are retained by reference; later edits affect subsequent builds. Matrix construction and its backend-specific validation run when the factory is called.
- edrixs.solvers.ed(hmat_i, num_evals=1, *, shift=0.0, backend_kws=None)[source]
Compute low-energy initial states through a numerical backend.
Read
hmat_i.backendand pass the factory to that backend. Fortran disk handles are passed directly to the Fortran backend.- Parameters:
- hmat_ilabeled operator factory or Fortran disk handle
Initial/final Hamiltonian.
- num_evalsint, optional
Number of lowest eigenpairs to return.
- shiftfloat, optional
Real energy offset, normally the final output of a model constructor. Dense, SciPy, and PETSc ED diagonalize
hmat_i - shift * Iand add the offset back to the returned eigenvalues. The supplied Hamiltonian is not modified. Default zero; Fortran ED warns and ignores nonzero shifts, continuing with the original Hamiltonian.- backend_kwsmapping, optional
Backend-specific eigensolver options. Accepted names, defaults, and constraints are in the EDRIXS backend keyword reference: https://edrixs.github.io/edrixs/dev/user/backend.html#backend-options
- Returns:
- eigenvalues, eigenvectors
Lowest retained eigenpairs, with eigenvalues on the original energy reference even when a nonzero
shiftis supplied.
- 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_ed=True, diagonalize the Hamiltonian to find a few lowest eigenstates, return the eigenvalues and density matrix, 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 recommended 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.linalg.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 writing data to files. Hopping matrices, Coulomb tensors, eigenvalues 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_ed=True, diagonalize the Hamiltonian to find a few lowest eigenstates, return the eigenvalues and density matrix, 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 recommended 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 matrix, 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 recommended 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.get_ops(emat_i, umat_i, basis_i, emat_n, umat_n, basis_n, trans_mat, *, backend='scipy', basis_method='combinadic', use_numba=True, backend_kws=None)[source]
Build initial/intermediate Hamiltonians and transition operators.
- Parameters:
- emat_i, umat_i, basis_i, emat_n, umat_n, basis_n, trans_mat
Backend-neutral problem definition returned by
edrixs.modelsmodel functions. Both sectors use the full orbital space, with a filled initial core. Transitions act directly between these bases.- backend{‘scipy’, ‘dense’, ‘petsc’, ‘fortran’}, optional
Backend used for the returned operators. The default is
'scipy'. The'fortran'backend writes the whole problem to native files in the working directory and returns on-disk markers;basis_methodanduse_numbado not apply to it.- basis_method{‘combinadic’, ‘explicit’}, optional
Basis representation constructed from the model metadata. The default is
'combinadic'.- use_numbabool, optional
JIT-compile matrix-entry construction. The default is True and requires Numba. Pass False to use Python construction without Numba.
- backend_kwsmapping, optional
Backend-specific operator-construction options. Accepted names, defaults, and constraints are in the EDRIXS backend keyword reference: https://edrixs.github.io/edrixs/dev/user/backend.html#backend-options
- Returns:
- hmat_i, hmat_n, trans_ops
Initial/final Hamiltonian, intermediate Hamiltonian, and transition labeled factories for the selected numerical backend, or disk handles for Fortran. Call a numerical factory to obtain its matrix.
- edrixs.solvers.get_ops_disk()[source]
Return handles for a staged Fortran problem in the current directory.
This reconnects to native Fortran input files previously written by
get_ops()withbackend='fortran'. It does not read operator data into memory or modify the files.- Returns:
- hmat_i, hmat_n, trans_ops
Disk-backed Fortran handles for the initial/final Hamiltonian, intermediate Hamiltonian, and transition operators.
- edrixs.solvers.rixs(eval_i, evec_i, hmat_i, hmat_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, temperature=1.0, scatter_axis=None, skip_gs=False, return_poles=False, backend_kws=None)[source]
Calculate resonant inelastic X-ray scattering spectra through a backend.
Backend-neutral physical arguments are passed directly. Numerical controls belong in
backend_kws. The backend is read fromhmat_i.backendand controls matrix construction and lifetime.If
skip_gsis true, transitions into the retained initial-state subspace are omitted from the final-state spectrum, matching the legacyskip_gsbehavior.- Parameters:
- eval_iarray-like of float, shape (nstate,)
Energies of the retained initial states, normally returned by
ed().- evec_ibackend-owned eigenvector representation
Retained initial-state eigenvectors returned by
ed(). For the'dense'and'scipy'backends this is a two-dimensional array whose columnibelongs toeval_i[i].- hmat_ilabeled operator factory or Fortran disk handle
Initial- and final-state Hamiltonian.
- hmat_nlabeled operator factory or Fortran disk handle
Intermediate-state Hamiltonian. Both Hamiltonians are normally returned by
get_ops().- trans_opsequence of labeled operator factories or Fortran disk handles
Transition operators from the initial/final Hilbert space to the intermediate Hilbert space. There must be three components for a dipole transition or five for a quadrupole transition.
- omincarray-like of float, shape (n_ominc,)
Incident photon-energy grid.
- elossarray-like of float, shape (n_eloss,)
Energy-loss grid.
- gamma_cfloat or array-like of float, optional
Core-hole lifetime broadening. An array must have the same shape as
ominc. Default is0.1.- gamma_ffloat or array-like of float, optional
Final-state broadening. An array must have the same shape as
eloss. Default is0.01.- thin, thout, phifloat, optional
Incident, scattered, and azimuthal angles in radians. Defaults are
1.0,1.0, and0.0, respectively.- pol_typesequence of tuple or None, optional
Polarization channels. Each entry is
(in_kind, alpha, out_kind, beta), where each kind is'linear','left', or'right'andalphaandbetaare the linear polarization angles in radians. The angles are ignored for circular polarization. Isotropic RIXS polarization is not supported. The default is[('linear', 0.0, 'linear', 0.0)].- temperaturefloat, optional
Temperature in kelvin used for the Boltzmann weights of the retained initial states. Default is
1.0.- scatter_axisarray-like of float, shape (3, 3), or None, optional
Cartesian axes defining the scattering frame. The identity matrix is used by default.
- skip_gsbool, optional
If True, project the retained initial-state subspace out of the final states. This option is not supported by the Fortran backend. Default is False.
- return_polesbool, optional
If True, also return the continued-fraction pole data. Default is False.
- backend_kwsmapping or None, optional
Backend-specific solver settings. Accepted names, defaults, and constraints are in the EDRIXS backend keyword reference: https://edrixs.github.io/edrixs/dev/user/backend.html#backend-options
- Returns:
- spectrumnumpy.ndarray
RIXS intensity with shape
(len(ominc), len(eloss), len(pol_type)). Whenpol_typeisNone, the third dimension has length one.- poleslist of list of dict, optional
Continued-fraction poles indexed first by incident energy and then by polarization. Returned together with
spectrumonly whenreturn_polesis True.
See also
edrixs.solvers.edCompute the retained initial-state eigenpairs.
edrixs.solvers.xasCalculate an X-ray absorption spectrum.
Examples
After constructing the operators and retained eigenstates, calculate a linear-polarization RIXS spectrum:
>>> import numpy as np >>> import edrixs >>> ominc = np.linspace(-1.0, 1.0, 11) >>> eloss = np.linspace(0.0, 5.0, 501) >>> spectrum = edrixs.rixs( ... eval_i, evec_i, hmat_i, hmat_n, trans_ops, ominc, eloss, ... pol_type=[('linear', 0.0, 'linear', 0.0)] ... )
- 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’, or ‘right’ and alpha (beta) is the angle (in radians) between the linear polarization vector and the scattering plane.
'isotropic'is not supported for RIXS; passing it emits aUserWarningand raisesValueError.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(eval_i, evec_i, hmat_n, trans_op, ominc, *, gamma_c=0.1, thin=1.0, phi=0.0, pol_type=None, temperature=1.0, scatter_axis=None, backend_kws=None)[source]
Calculate X-ray absorption spectra through a numerical backend.
Backend-neutral physical arguments are passed directly. Numerical controls belong in
backend_kws. The backend is read fromhmat_n.backend. The backend controls matrix construction and lifetime.- Parameters:
- eval_iarray-like of float, shape (nstate,)
Energies of the retained initial states, normally returned by
ed().- evec_ibackend-owned eigenvector representation
Retained initial-state eigenvectors returned by
ed(). For the'dense'and'scipy'backends this is a two-dimensional array whose columnibelongs toeval_i[i].- hmat_nlabeled operator factory or Fortran disk handle
Intermediate-state Hamiltonian, normally returned by
get_ops().- trans_opsequence of labeled operator factories or Fortran disk handles
Transition operators from the initial to the intermediate Hilbert space. There must be three components for a dipole transition or five for a quadrupole transition.
- omincarray-like of float, shape (n_ominc,)
Incident photon-energy grid.
- gamma_cfloat or array-like of float, optional
Core-hole lifetime broadening. An array must have the same shape as
ominc. Default is0.1.- thin, phifloat, optional
Incident and azimuthal angles in radians. Defaults are
1.0and0.0, respectively.- pol_typesequence of tuple or None, optional
Polarization channels. Each entry is
(kind, alpha), wherekindis'linear','left','right', or'isotropic'andalphais the linear-polarization angle in radians. The angle is ignored for circular and isotropic polarization. The default is[('isotropic', 0.0)].- temperaturefloat, optional
Temperature in kelvin used for the Boltzmann weights of the retained initial states. Default is
1.0.- scatter_axisarray-like of float, shape (3, 3), or None, optional
Cartesian axes defining the scattering frame. The identity matrix is used by default.
- backend_kwsmapping or None, optional
Backend-specific solver settings. Accepted names, defaults, and constraints are in the EDRIXS backend keyword reference: https://edrixs.github.io/edrixs/dev/user/backend.html#backend-options
- Returns:
- numpy.ndarray
XAS intensity with shape
(len(ominc), len(pol_type)). Whenpol_typeisNone, the second dimension has length one.
See also
edrixs.solvers.edCompute the retained initial-state eigenpairs.
edrixs.solvers.rixsCalculate a resonant inelastic X-ray scattering spectrum.
Examples
After constructing the operators and retained eigenstates, calculate an isotropic spectrum on an incident-energy grid:
>>> import numpy as np >>> import edrixs >>> ominc = np.linspace(-5.0, 5.0, 201) >>> spectrum = edrixs.xas( ... eval_i, evec_i, hmat_n, trans_ops, ominc, ... pol_type=[('isotropic', 0.0)] ... )
- 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.