@@ -2,7 +2,7 @@ using Rimu
22using Rimu. BitStringAddresses
33using Rimu. BitStringAddresses: num_chunks, chunks
44using Rimu. BitStringAddresses: remove_ghost_bits, has_ghost_bits
5- using Rimu. BitStringAddresses: occupied_modes, update_component
5+ using Rimu. BitStringAddresses: occupied_modes, occupied_mode_map, unoccupied_modes, unoccupied_mode_map, update_component
66using Rimu. BitStringAddresses: parse_address
77using Rimu. BitStringAddresses: destroy, create
88using Random
229229
230230 @test collect (occupied_modes (middle_empty)) == [[2 , 1 , 0 ], [8 , 127 , 128 ]]
231231 end
232+ @testset " occupied_mode_map" begin
233+ for b in (middle_full, middle_empty, two_full)
234+ @test occupied_mode_map (b) == collect (occupied_modes (b))
235+ end
236+ end
232237 @testset " Randomized tests" begin
233238 # Note: the random number for these tests will be the same everytime. This is still
234239 # an ok way to look for errors.
354359 for o in (small, big, giant)
355360 f = FermiFS (o)
356361 sites = collect (occupied_modes (f))
362+ @test occupied_mode_map (f) == sites
357363 @test getproperty .(sites, :mode ) == findall (≠ (0 ), onr (f))
358364 end
359365 end
366+ @testset " unoccupied_modes" begin
367+ for o in (small, big, giant)
368+ f = FermiFS (o)
369+ sites = collect (unoccupied_modes (f))
370+ @test unoccupied_mode_map (f) == sites
371+ @test getproperty .(sites, :mode ) == findall (== (0 ), onr (f))
372+ end
373+ end
360374 @testset " Randomized Tests" begin
361375 function rand_onr_fermi (N, M)
362376 return SVector {M} (shuffle ([ones (Int,N); zeros (Int,M - N)]))
0 commit comments