@@ -712,11 +712,11 @@ def find_equivalences(
712
712
num_different_dags_with_same_hash [hashtag ] = len (output_dict_ )
713
713
714
714
hashtags_in_more_equivalences = set ()
715
+ more_equivalences = []
716
+ equivalent_called_2 = 0
717
+ num_equivalences_under_phase_shift = 0
718
+ possible_num_equivalences_under_phase_shift = 0
715
719
if check_equivalence_with_different_hash :
716
- more_equivalences = []
717
- equivalent_called_2 = 0
718
- num_equivalences_under_phase_shift = 0
719
- possible_num_equivalences_under_phase_shift = 0
720
720
print ("Start checking equivalence with different hash..." )
721
721
for hashtag , dags in output_dict .items ():
722
722
from collections import defaultdict
@@ -847,12 +847,12 @@ def find_equivalences(
847
847
)
848
848
output_dict = [more_equivalences , output_dict ]
849
849
if print_basic_info :
850
- print (
851
- f" Solver invoked { equivalent_called_2 } times to find { len (more_equivalences )} equivalences"
852
- f" with different hash,"
853
- f" including { num_equivalences_under_phase_shift } out of"
854
- f" { possible_num_equivalences_under_phase_shift } possible equivalences under phase shift."
855
- )
850
+ print (f"End checking equivalence with different hash."
851
+ f" Solver invoked { equivalent_called_2 } times to find { len (more_equivalences )} equivalences"
852
+ f" with different hash,"
853
+ f" including { num_equivalences_under_phase_shift } out of"
854
+ f" { possible_num_equivalences_under_phase_shift } possible equivalences under phase shift."
855
+ )
856
856
else :
857
857
# Add a placeholder here
858
858
output_dict = [[], output_dict ]
@@ -866,10 +866,15 @@ def find_equivalences(
866
866
t_end = time .monotonic ()
867
867
if print_basic_info :
868
868
print (
869
- f"{ total_equivalence_found } equivalences found in { t_end - t_start } seconds"
870
- f" (solver invoked { equivalent_called } times for { num_dags } DAGs"
869
+ f"{ total_equivalence_found + len (more_equivalences )} equivalences"
870
+ f"{ f' (including { len (more_equivalences )} with different hash values)' if len (more_equivalences ) > 0 else '' } "
871
+ f" found in { t_end - t_start } seconds"
872
+ f" (solver invoked { equivalent_called + equivalent_called_2 } times"
873
+ f"{ f' (including { equivalent_called_2 } times for circuits with different hash values)' if equivalent_called_2 > 0 else '' } "
874
+ f" for { num_dags } circuits"
871
875
f" with { num_hashtags } different hash values and { num_potential_equivalences } potential equivalences),"
872
- f" output { len (output_dict [1 ])} equivalence classes."
876
+ f" output { len (output_dict [1 ])} equivalence classes"
877
+ f"{ f' (will be merged into { len (output_dict [1 ]) - len (more_equivalences )} equivalence classes after dealing with equivalent equivalence classes with different hash values)' if len (more_equivalences ) > 0 else '' } ."
873
878
)
874
879
t_start = time .monotonic ()
875
880
dump_json (output_dict , output_file )
0 commit comments