@@ -347,6 +347,7 @@ def construct_fogi_quantities(primitive_op_labels, gauge_action_matrices,
347347
348348
349349    """ 
350+     print_lattices  =  True 
350351    assert (dependent_fogi_action  in  ('drop' , 'mark' ))
351352    orthogonalize_relationals  =  True 
352353    set_size_dims  =  {}
@@ -483,16 +484,13 @@ def resolve_norm_order(vecs_to_normalize, label_lists, given_norm_order):
483484        ccomms [(op_label ,)] =  complement 
484485        #gauge_action_for_op[op_label] = ga 
485486
486-         #print("Commutant:"); _mt.print_mx(commutant) 
487-         #print("Names: ", errgen_names) 
488-         #print("Complement:"); _mt.print_mx(complement) 
489487
490488    smaller_sets  =  [(op_label ,) for  op_label  in  primitive_op_labels ]
491489    max_size  =  len (primitive_op_labels )
492-      
490+ 
493491    for  set_size  in  range (1 , max_size ):
494492        larger_sets  =  []
495-         print (f' { set_size = } ' 
493+         print (set_size )
496494        num_indep_vecs_from_smaller_sets  =  fogi_dirs .shape [1 ]
497495        for  op_label  in  primitive_op_labels :
498496            for  existing_set  in  smaller_sets :
@@ -752,6 +750,7 @@ def scipy_pinv(A, rcond):
752750
753751                    ccomms [new_set ] =  union_space 
754752                    set_size_dims [new_set ] =  len (new_indep_cols )
753+                     
755754                    #print("Complement:\n"); _mt.print_mx(union_space) 
756755
757756                larger_sets .append (new_set )
@@ -769,23 +768,28 @@ def scipy_pinv(A, rcond):
769768        fogi_dirs  =  fogi_dirs .real 
770769    if  _spsl .norm (dep_fogi_dirs .imag ) <  1e-6 :
771770        dep_fogi_dirs  =  dep_fogi_dirs .real 
772-     ''' 
773-     keys = list(set_size_dims.keys()) 
774-     gate_abbrevs = {'Gxpi2:0':'X', 'Gypi2:0': 'Y','Gzpi2:0':'Z', 'rho0':'rho', 'Mdefault': 'M'} 
775-     key_strings = {} 
776-     for key in keys: 
777-         key_strings[key] = [gate_abbrevs[label.__str__()] for label in key] 
778-     print(list(key_strings.values() )) 
779-     keys.sort(key = lambda x: -len(x))  
780-     curr_length = 1  
781-     for  key in keys : 
782-         if len(key) != curr_length:  
783-             print(' \n ' ) 
784-             curr_length = len( key)  
785-         print(key_strings[key], set_size_dims[key], end='     ') 
786-         '''  
771+     if   print_lattices : 
772+          keys  =  list (set_size_dims .keys ())
773+          gate_abbrevs  =  {'Gxpi:0'  :  'Xpi' , 'Gt:0' : 'T:0' , 'Gt:1' : 'T:1' , 'Gh:0' : 'H:0' , 'Gh:1' : 'H:1' , 'Gympi2:1' : 'Ym:1' , 'Gcz:0:1' : 'CZ' , ' Gxpi2:0''X:0 ' , 'Gypi2:0' : 'Y:0 ' ,'Gzpi2:0' :'Z:0 ' , 'rho0' :'rho:0 ' , 'Mdefault' : 'M:0'  ,  'Gn:0' :  'GN' , 'Gxpi2:1' : 'X:1' ,  'Gypi2:1' :  'Y:1' , 'Gzpi2:1' : 'Z:1' ,  'Gx:0' :  'X:0' ,  'Gx:1' :  'X:0' ,  'Gz:0' :  'Z:0' ,  'Gz:1' :  'Z:1' ,  'Gy:0' :  'Y:0 '
774+          key_strings  =  {}
775+          for  key  in  keys :
776+              key_strings [key ] =  [gate_abbrevs [label .__str__ ()] for  label  in  key ]
777+          keys . sort ( key   =   lambda   x :  - len ( x ))
778+          curr_length   =   1 
779+          for   key   in   keys : 
780+              if   len ( key )  !=   curr_length :
781+                  print ( ' \n ' ) 
782+                  curr_length   =   len ( key )
783+             if   set_size_dims [ key ]  >   0 : 
784+                  print (key_strings [key ], set_size_dims [key ], end = '     ' )
785+         
787786
788- 
787+     for  i  in  range (1 , set_size ):
788+         summation  =  0 
789+         for  op_set  in  set_size_dims .keys ():
790+             if  len (op_set ) ==  i :
791+                 summation  +=  set_size_dims [op_set ]
792+         print (i , summation )
789793    return  (fogi_dirs , fogi_meta , dep_fogi_dirs , dep_fogi_meta )
790794
791795
0 commit comments