Skip to content

Commit

Permalink
Commutators now in PConv and fix faulty automatic indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasgrunwald committed Mar 20, 2024
1 parent 9b311f8 commit 97dfa6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/basis_embedding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ Map operator `op` in Full-Hilbert space into half-filled U(1) subspace.
function map_u1(op)
if size(op, 1) == 4^2 # Fermions
idx = idx_fermi
elseif size(op, 1) == 16^2 # 2-band Fermions
idx = idx_multi
else
error("No automatic mapping implemented! Call function with idx instead.")
end
Expand Down
7 changes: 2 additions & 5 deletions test/embedding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ using LadderOperators
using LinearAlgebra: I
using Test

# Convenience functions for checking the functions
commutator(A, B) = A*B - B * A
anti_commutator(A, B) = A*B + B * A

# —————————————————————————————————— Spinless Fermions ————————————————————————————————— #
Nsites = 3
Nsites = 4
Cdag, C, Z, N = local_spinless_fermions()
Cdag_, C_ = ladder_operators(:spinless, Nsites)

Expand All @@ -32,6 +28,7 @@ N = embed_fock(Nsites, N) # directly translate to fock space
@test C == C
end

##
# —————————————————————————————————— Spinful Fermions —————————————————————————————————— #
Nsites = 2
Cdag, C, Z, N = local_fermions()
Expand Down

0 comments on commit 97dfa6d

Please sign in to comment.