File tree 2 files changed +14
-12
lines changed
2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -462,7 +462,7 @@ def strings_to_addresses(
462
462
"""
463
463
if not len (strings ):
464
464
return np .array ([])
465
- if isinstance (strings , np .ndarray ):
465
+ if isinstance (strings , np .ndarray ) and strings . ndim == 2 :
466
466
bitstring_type = BitstringType .BIT_ARRAY
467
467
elif isinstance (strings [0 ], str ):
468
468
bitstring_type = BitstringType .STRING
Original file line number Diff line number Diff line change @@ -549,17 +549,19 @@ def test_strings_to_addresses_int():
549
549
nelec = (2 , 1 )
550
550
dim = ffsim .dim (norb , nelec )
551
551
indices = ffsim .strings_to_addresses (
552
- [
553
- 0b001011 ,
554
- 0b010011 ,
555
- 0b100011 ,
556
- 0b001101 ,
557
- 0b010101 ,
558
- 0b100101 ,
559
- 0b001110 ,
560
- 0b010110 ,
561
- 0b100110 ,
562
- ],
552
+ np .array (
553
+ [
554
+ 0b001011 ,
555
+ 0b010011 ,
556
+ 0b100011 ,
557
+ 0b001101 ,
558
+ 0b010101 ,
559
+ 0b100101 ,
560
+ 0b001110 ,
561
+ 0b010110 ,
562
+ 0b100110 ,
563
+ ]
564
+ ),
563
565
norb ,
564
566
nelec ,
565
567
)
You can’t perform that action at this time.
0 commit comments