5959"""
6060Symmetrize the Hubbard occupation matrix according to the l quantum number of the manifold.
6161"""
62- function symmetrize_nhub (nhubbard:: Array{Matrix{Complex{T}}} , lattice, symmetries, positions) where {T}
62+ function symmetrize_nhub (nhubbard:: Array{Matrix{Complex{T}}} ,
63+ lattice, symmetries, positions) where {T}
6364 # For now we apply symmetries only on nII terms, not on cross-atom terms (nIJ)
6465 # WARNING: To implement +V this will need to be changed!
6566
@@ -83,7 +84,7 @@ function symmetrize_nhub(nhubbard::Array{Matrix{Complex{T}}}, lattice, symmetrie
8384 sym_atom = find_symmetry_preimage (positions, positions[iatom], symmetry)
8485 for m1 in 1 : size (ns[σ, iatom, iatom], 1 ), m2 in 1 : size (ns[σ, iatom, iatom], 2 )
8586 # TODO : Here QE flips spin for time-reversal in collinear systems, should we?
86- for m0 in 1 : size (nhubbard[σ, iatom, iatom], 1 ), m00 in 1 : size (nhubbard[σ, iatom, iatom], 2 )
87+ for m0 in 1 : size (nhubbard[σ,iatom,iatom],1 ), m00 in 1 : size (nhubbard[σ,iatom,iatom],2 )
8788 ns[σ, iatom, iatom][m1, m2] += WigD[m0, m1] *
8889 nhubbard[σ, sym_atom, sym_atom][m0, m00] *
8990 WigD[m00, m2]
@@ -135,14 +136,15 @@ function compute_nhubbard(manifold::OrbitalManifold,
135136 # We divide by filled_occ to deal with the physical two spin channels separately.
136137 ψk, projk, nk = @views ψ[ik], projectors[ik], occupation[ik]/ filled_occ
137138 c = projk' * ψk # <ϕ|ψ>
138- # The matrix product is done over the bands. In QE, basis.kweights[ik]*nk[ibnd] would be wg(ik,ibnd)
139+ # The matrix product is done over the bands.
140+ # In QE, basis.kweights[ik]*nk[ibnd] would be wg(ik,ibnd)
139141 n_matrix[σ, :, :] .+ = basis. kweights[ik] * c * diagm (nk) * c'
140142 end
141143 n_matrix = mpi_sum (n_matrix, basis. comm_kpts)
142144
143145 # Now I want to reshape it to match the notation used in the papers.
144- # Reshape into n[I, J, σ][m1, m2] where I, J indicate the atom in the Hubbard manifold, σ is the spin,
145- # m1 and m2 are magnetic quantum numbers (n, l are fixed)
146+ # Reshape into n[I, J, σ][m1, m2] where I, J indicate the atom in the Hubbard manifold,
147+ # σ is the spin, m1 and m2 are magnetic quantum numbers (n, l are fixed)
146148 manifold_atoms = findall (at -> at. species == Symbol (manifold. species), basis. model. atoms)
147149 natoms = length (manifold_atoms) # Number of atoms of the species in the manifold
148150 nhubbard = Array {Matrix{Complex{T}}} (undef, nspins, natoms, natoms)
@@ -178,7 +180,8 @@ function compute_nhubbard(manifold::OrbitalManifold,
178180 return (; nhubbard, manifold_labels= labels, p_I)
179181end
180182
181- function reshape_hubbard_proj (basis, projectors:: Vector{Matrix{Complex{T}}} , labels, manifold) where {T}
183+ function reshape_hubbard_proj (basis, projectors:: Vector{Matrix{Complex{T}}} ,
184+ labels, manifold) where {T}
182185 manifold_atoms = findall (at -> at. species == Symbol (manifold. species), basis. model. atoms)
183186 natoms = length (manifold_atoms)
184187 nprojs = length (labels)
0 commit comments