Skip to content

Add parity warnings to Fermion and Electron site types #1662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/lib/SiteTypes/src/sitetypes/electron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ function space(
if !isnothing(conserve_parity)
conserve_nfparity = conserve_parity
end
if conserve_nf && conserve_nfparity
@warn "Setting conserve_nfparity=true when conserve_nf=true for \"Electron\" SiteType will have no effect, and only the \"Nf\" quantum number will be explicitly conserved."
end
if conserve_sz && conserve_nf
return [
QN((qnname_nf, 0, -1), (qnname_sz, 0)) => 1
Expand Down
3 changes: 3 additions & 0 deletions src/lib/SiteTypes/src/sitetypes/fermion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ function space(
if !isnothing(conserve_parity)
conserve_nfparity = conserve_parity
end
if conserve_nf && conserve_nfparity
@warn "Setting conserve_nfparity=true when conserve_nf=true for \"Fermion\" SiteType will have no effect, and only the \"Nf\" quantum number will be explicitly conserved."
end
if conserve_sz == true
conserve_sz = "Up"
end
Expand Down
Loading