@@ -353,17 +353,23 @@ function eigen(
353353 end
354354
355355 # <fermions>
356+ L_arrow_dir = Out
356357 if hasqns (A) && using_auto_fermion ()
357- if ! all (i -> dir (i) == Out, Lis)
358- error (" With auto_fermion enabled, left inds in eigen must have Out arrows" )
359- end
360- if ! all (i -> dir (i) == In, Ris)
361- error (" With auto_fermion enabled, right inds in eigen must have Out arrows" )
358+ # Make arrows of combined ITensor
359+ # match those of index sets
360+ # TODO : also support Out,Out and In,In cases?
361+ # I.e. through a R_arrow_dir variable?
362+ if all (i -> dir (i) == Out, Lis) && all (i -> dir (i) == In, Ris)
363+ L_arrow_dir = Out
364+ elseif all (i -> dir (i) == In, Lis) && all (i -> dir (i) == Out, Ris)
365+ L_arrow_dir = In
366+ else
367+ error (" With auto_fermion enabled, index sets in eigen must have all arrows the same, and opposite between the sets" )
362368 end
363369 end
364370
365- CL = combiner (Lis... ; dir= Out , tags= " CMB,left" )
366- CR = combiner (dag (Ris)... ; dir= Out , tags= " CMB,right" )
371+ CL = combiner (Lis... ; dir= L_arrow_dir , tags= " CMB,left" )
372+ CR = combiner (dag (Ris)... ; dir= L_arrow_dir , tags= " CMB,right" )
367373
368374 AC = A * dag (CR) * CL
369375
0 commit comments