forked from anitalu724/pyzx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gf2^16_mult_tpar.qc
7743 lines (7742 loc) · 76.6 KB
/
gf2^16_mult_tpar.qc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Original circuit
# qubits: 48
# qubits used: 48
# H: 62
# cnot: 1837
# X: 0
# T: 1792
# P: 0
# Z: 0
# tdepth (by partitions): 768
# tdepth (by critical paths): 180
# Optimized circuit
# qubits: 48
# qubits used: 48
# H: 62
# cnot: 6592
# X: 0
# T: 1040
# P: 16
# Z: 4
# tdepth (by partitions): 24
# tdepth (by critical paths): 24
# Time: 5.150 s
.v a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15
.i a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
.o a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15
BEGIN
H c0
H c1
H c2
H c3
H c4
H c5
H c6
H c7
H c8
H c9
H c10
H c11
H c12
H c13
H c14
tof b15 a0
tof b15 a1
tof b15 a2
tof b15 a3
tof b11 a5
tof b13 a4
tof b10 a6
tof b10 a7
tof b8 a9
tof b9 a8
tof b6 a11
tof b7 a10
tof b4 a13
tof b5 a12
tof b2 a15
tof b3 a14
tof b2 b1
tof b4 b0
tof b3 b2
tof b4 b3
tof b5 b4
tof b6 b5
tof c0 b8
tof b7 b6
tof b8 b7
tof c0 b8
tof b9 b8
tof b10 b9
tof b11 b10
tof b12 b11
tof b13 b12
tof b14 b13
tof c0 b15
tof c2 b14
tof c2 c0
tof c2 c1
tof c4 c3
tof c6 c4
tof c6 c5
tof c8 c6
tof c9 c8
tof c8 c9
tof c6 c9
tof c6 c8
tof c4 c5
tof c4 c9
tof c4 c8
tof c4 c6
tof c3 c8
tof c2 c8
tof c2 c15
tof c3 c9
tof c2 c10
tof c3 c6
tof c2 c7
tof c3 c4
tof c3 c5
tof c0 c1
tof c0 c15
tof c0 c2
tof b14 c10
tof b14 c8
tof b14 c7
tof b14 c0
tof b13 c0
tof b12 c0
tof c0 c1
tof b13 c8
tof b13 c7
tof c0 b15
tof c0 c9
tof b13 b14
tof b11 b12
tof b10 b11
tof b12 c7
tof b11 b15
tof b11 c9
tof b11 c0
tof b9 c9
tof b8 c9
tof c9 c5
tof c9 c3
tof b9 c0
tof b7 c9
tof b6 c9
tof b7 c15
tof c9 c8
tof c9 c6
tof c9 c4
tof b7 c5
tof b7 c3
tof b7 c2
tof b5 c4
tof b4 c4
tof b5 c8
tof b5 c6
tof b5 c9
tof b3 c4
tof a15 b1
tof a14 c4
tof a14 b3
tof a15 b2
tof a13 b0
tof a12 c8
tof a12 c6
tof a12 b5
tof a13 b4
tof a10 c5
tof a10 c2
tof a11 b6
tof a8 c0
tof a9 b8
tof a9 b7
tof a9 c15
tof a7 b15
tof a6 b11
tof a7 b10
tof a7 b9
tof a4 b14
tof a4 b13
tof a5 b12
T* b1
T* c15
T b7
T* c0
T* b9
T* a6
T* a5
T* a1
T* a15
T* a14
T* a13
T* a12
T* a11
T* a10
T* a9
T* a8
T* a7
T* c1
T* a4
T* a2
T* b2
T* b3
T* b4
T* b5
T* b6
T* c2
T* b8
T* b10
T* b11
T* b12
T* b13
T* b14
T* a3
T* c9
T* c3
T* c5
T* c4
T* b15
T* c7
T* c6
T c8
T* c10
T* a0
T* b0
tof b9 c15
tof a13 a14
tof a12 a14
tof a11 a14
tof a10 b1
tof b2 a14
tof b3 a14
tof b4 a14
tof b5 a14
tof b6 a14
tof b8 c15
tof b15 c15
tof a14 b1
tof a14 c15
tof a10 c0
tof a9 a11
tof a8 c0
tof b6 a11
tof c2 a11
tof b8 c0
tof a11 b7
tof a11 c0
tof a9 b9
tof a7 a6
tof c1 a6
tof a4 b9
tof c2 b9
tof b8 b9
tof b10 a5
tof b11 a6
tof b14 b9
tof a5 b9
tof a5 a6
tof a2 a4
tof b12 a5
tof b13 a4
tof b15 a5
tof a4 a5
tof a4 a1
tof a13 a15
tof a12 a14
tof a11 a14
tof a9 a14
tof b3 a15
tof b4 a15
tof b5 a14
tof c2 a14
tof a14 a15
tof b3 a13
tof b4 a13
tof b5 a12
tof c9 a13
tof c9 a12
tof a9 a11
tof b5 a10
tof c2 b4
tof c9 b4
tof b4 a11
tof b4 a10
tof a2 a8
tof c2 a9
tof b8 a9
tof b10 a8
tof b12 a8
tof b13 a8
tof b14 a8
tof b15 a8
tof a4 c1
tof b8 a7
tof b11 c1
tof b12 a2
tof b13 a7
tof b14 a7
tof b15 a7
tof a2 a7
tof a2 c1
tof b12 a2
tof b13 a2
tof b15 a4
tof b4 b2
tof b5 b3
tof c2 b2
tof c9 b2
tof b6 b5
tof c2 b4
tof c2 b5
tof c2 b6
tof b13 b11
tof b14 b12
tof c7 b15
tof b12 b11
tof b15 b12
tof b15 b13
tof c7 b13
tof c7 b14
tof b15 a3
tof c7 a3
tof c6 b15
tof c10 c7
tof c11 c6
tof c10 c11
tof c6 c11
tof c7 c11
tof c11 a0
tof c7 c10
tof b15 a0
tof b15 c11
tof b15 c6
tof c9 c4
tof b13 c7
tof b13 c11
tof b12 b14
tof b12 c10
tof b12 c6
tof b12 c7
tof b12 b15
tof b10 c10
tof b8 c10
tof b8 b15
tof b10 b12
tof b8 b11
tof b8 c5
tof c2 b0
tof b6 b0
tof c2 c6
tof c2 c7
tof c2 c8
tof c2 b15
tof c2 b12
tof b4 b5
tof b4 c9
tof a4 a0
tof a4 a3
tof a2 c6
tof a2 b15
tof a2 b12
tof a2 c11
tof a2 b13
tof a4 b10
tof a4 b14
tof a2 c10
tof c1 c11
tof c1 b11
tof a7 c5
tof a7 b8
tof a9 a8
tof a9 b15
tof a8 b10
tof a9 b11
tof a9 c5
tof a9 b8
tof a9 c2
tof a9 b6
tof a9 c10
tof a9 b5
tof a9 a7
tof a10 b5
tof a11 a10
tof a10 c6
tof a10 c7
tof a10 c8
tof a10 b15
tof a10 b12
tof b5 c5
tof b5 b8
tof a10 c2
tof b5 b6
tof a11 b4
tof a12 a11
tof a13 a12
tof a12 b3
tof a11 b0
tof a13 c4
tof a11 c9
tof a11 b6
tof a12 b4
tof a11 c3
tof a14 b2
tof a14 c4
tof a14 c9
tof a5 a1
tof a5 a0
tof a5 c6
tof a5 b15
tof a5 b12
tof a5 c11
tof a5 b13
tof a5 c5
tof a5 b8
tof a5 b14
tof a5 a4
tof a5 c10
tof a5 a2
tof a5 a8
tof a5 a7
tof a5 a3
tof a6 b11
tof b9 b11
tof b9 c6
tof b9 c7
tof b9 c8
tof b9 b12
tof a6 c11
tof b9 b10
tof b9 b8
tof a6 c1
tof b9 c10
tof b9 a8
tof b9 a7
tof c0 b9
tof b7 b9
tof b9 c8
tof b9 b15
tof b9 c5
T* a15
T* b2
T* b3
T* c0
T b7
T* a3
T* a5
T* a6
T b9
T* a13
T* a9
T* a7
T* a8
T* a2
T* a14
T* a12
T* a11
T* c3
T* a10
T* b5
T* c10
T* a4
T* c1
T* b14
T* b4
T* b6
T* c2
T* b8
T c5
T* b11
T* b10
T* b13
T* c11
T* c9
T* c4
T* b12
T b15
T* c8
T* c7
T c6
T* c15
T* a1
T* a0
T* b0
T* b1
tof a11 a15
tof a10 b2
tof b4 a15
tof b6 b2
tof a7 c0
tof a8 c0
tof a12 c0
tof a11 c0
tof a10 c0
tof c10 c0
tof a4 c0
tof c1 c0
tof b14 c0
tof b4 c0
tof b6 c0
tof c2 b5
tof b8 c0
tof b10 c0
tof b13 c0
tof c11 c0
tof b5 b3
tof b5 c0
tof a6 b7
tof a9 b7
tof a7 a3
tof a12 b7
tof a11 b7
tof a10 a8
tof b5 a3
tof c10 a3
tof a4 b7
tof c1 b7
tof b4 b7
tof b6 b7
tof c2 b7
tof b8 a3
tof b10 a8
tof b13 b7
tof a8 b7
tof a8 a3
tof b9 a6
tof a8 a6
tof a10 a6
tof c1 a6
tof b13 a4
tof a4 a5
tof a4 a6
tof a7 b9
tof a8 b9
tof a12 b9
tof c3 b9
tof b5 b9
tof c10 b9
tof a4 b9
tof c1 b9
tof b14 b9
tof b4 a13
tof b6 b9
tof b8 b9
tof c11 b9
tof c9 a13
tof a8 a9
tof a10 a9
tof b5 a9
tof c10 a9
tof a4 a9
tof c2 a9
tof b8 a7
tof a7 a9
tof b11 a7
tof a10 a8
tof c10 a8
tof a4 a8
tof c1 a2
tof b11 a8
tof c11 a2
tof b13 a8
tof b13 a2
tof a11 a14
tof c3 a12
tof c1 a14
tof b14 a14
tof b8 b5
tof b13 a14
tof c11 a14
tof c9 a14
tof b12 b5
tof a12 a14
tof b5 a12
tof a10 a11
tof b4 a11
tof b6 a11
tof b8 c3
tof b11 c3
tof b12 a11
tof b5 a11
tof b5 c3
tof b6 a10
tof b8 a10
tof b12 a10
tof c5 a10
tof c5 b5
tof b4 c10
tof c5 a4
tof b11 c10
tof b13 a4
tof c9 c10
tof b12 a4
tof b8 c10
tof b8 a4
tof b8 b14
tof b13 c1
tof c11 c1
tof c5 b4
tof c9 b4
tof b12 b4
tof b12 b8
tof c6 b8
tof b15 b11
tof b0 c6
tof c6 c5
tof c6 b11
tof b12 b13
tof c6 b13
tof b1 b13
tof b0 b10
tof b0 b13
tof c6 c11
tof b0 c4
tof c6 c4
tof c6 b12
tof c6 b15
tof b0 b15
tof b1 c6
tof a0 c15
tof b0 c15
tof b1 a1
tof b1 a0
tof b1 b0
tof b12 c15
tof b12 b0
tof b12 b15
tof b12 a0
tof b12 a1
tof b13 b0
tof b13 a0
tof b13 a1
tof b13 b1
tof b11 b15
tof c5 b11
tof b15 c15
tof c5 a0
tof c5 a1
tof c5 b12
tof c5 b10
tof c5 c6
tof c5 c11
tof b8 c4
tof b8 b15
tof b8 a0
tof b8 a1
tof b8 b10
tof b8 b13
tof b8 c5
tof b8 b1
tof b4 c15
tof b4 c4
tof b4 c9
tof b4 c5
tof b14 c11
tof c1 b14
tof c1 c15
tof b14 b15
tof c1 b10
tof b14 c6
tof a4 c15
tof a4 a0
tof a4 a1
tof a4 b10
tof a4 c9
tof a4 b4
tof a4 b12
tof b5 a4
tof a10 b5
tof a4 c2
tof a10 c4
tof b5 b6
tof a10 c6
tof a10 c11
tof a4 c9
tof b5 c1
tof b5 b8
tof b5 b0
tof a4 c7
tof a4 c8
tof a10 b11
tof c3 c15
tof a11 c3
tof a11 c4
tof c3 b15
tof a11 c6
tof a11 c9
tof a11 b13
tof a11 c5
tof a11 b1
tof a11 b4
tof a11 b12
tof a11 c10
tof a12 c6
tof a14 c6
tof a12 c15
tof a12 c4
tof a12 b15
tof a12 c3
tof a12 c11
tof a12 b8
tof a12 b11
tof a12 a10
tof a8 a2
tof a8 c2
tof a8 b15
tof a8 b14
tof a8 a14
tof a8 b13
tof a8 c1
tof a8 b1
tof a8 b4
tof a8 b0
tof a8 b12
tof a8 c7
tof a8 c8
tof a8 a4
tof a7 b13
tof a9 b13
tof a7 c2
tof a7 b15
tof a7 c3
tof b13 c6
tof a7 b14
tof a7 a14
tof a7 c1
tof a7 b1
tof a7 b4
tof a7 b0
tof a7 b12
tof a7 c7
tof a7 c10
tof a7 c8
tof a7 a4
tof a7 b5
tof a7 b11
tof b9 c11
tof b9 a14
tof b9 b8
tof b9 b11
tof b9 a12
tof b9 c4
tof b9 a10
tof a5 c2
tof a6 c11
tof a6 a14
tof a6 b8
tof a6 b11
tof a6 a12
tof a6 c4
tof a6 a10
tof a6 b9
tof b7 c11
tof b7 a14
tof b7 b8
tof b7 b11
tof b7 a12
tof b7 c4
tof b7 a10
tof b7 b9
tof b7 a6
tof c0 b14
tof c0 b8
tof c0 b11
tof c0 a12
tof c0 c4
tof c0 a10
tof c0 b9
tof c0 a6
tof c0 b7
T a14
T* b14
T c11
T* c0
T* a2
T b7
T* a6
T* a13
T* c9
T* b6
T* a8
T b9
T* a10
T c4
T a12
T* a7
T* b10
T* a11
T* a9
T* b11
T* b5
T* a4
T* c8
T* c10
T* c7
T* b12
T* b0
T* b8
T* b4
T* b1
T* c1
T* c5
T* b13
T* a15
T* b2
T* b3
T* c6
T* c3
T* a5
T* a1
T* a0
T* b15
T* a3
T* c2
T* c15
tof c11 b14
tof a7 b14
tof a9 a14
tof b5 b14
tof b12 a4
tof b0 b14
tof b1 a4
tof b3 a4
tof c6 a14
tof a4 a14
tof a4 b14
tof b7 c0
tof a13 a2
tof a11 c11
tof b5 a2
tof b12 a2
tof b4 a2
tof b1 c0
tof c1 a2
tof c0 c11
tof a2 c0
tof a6 b7
tof b9 a2
tof b5 b7
tof b12 b7
tof b0 b7
tof b1 b7
tof b9 a13
tof a11 a13
tof a9 a6
tof b0 a13
tof b4 a13
tof b1 b12
tof c1 a13
tof c6 a6
tof b12 a6
tof b12 a13
tof a8 c9
tof b9 b6
tof b5 c9
tof b0 c9
tof b1 b6
tof b3 c9
tof a4 c9
tof a4 b6
tof a12 b9
tof b5 a8
tof b1 b9
tof b15 a8
tof b0 a8
tof b0 b9
tof a12 c4
tof a7 a10
tof a11 a10
tof b5 a10
tof c10 c4
tof b12 c4
tof b4 c4
tof b1 a10
tof b0 a10
tof b0 c4
tof a9 a7
tof a4 a12
tof c8 a12
tof b0 b5
tof b3 b5
tof b5 a12
tof b5 a7
tof b12 a11
tof b0 b10
tof b4 a11
tof b1 a11
tof c1 b10
tof b15 b10
tof b0 b11
tof c1 b11
tof c6 a9
tof b15 c3
tof c3 a9
tof c3 b11
tof b8 b0
tof c1 b0
tof b3 b0
tof c6 b5
tof a4 b5
tof b0 a4
tof b12 c10
tof b8 c8
tof b4 c10
tof c1 c8
tof c3 c8
tof a3 c10
tof c10 c8
tof b15 c10
tof b0 c7
tof b8 c7
tof b1 b4
tof c1 c7
tof c5 b4
tof b3 c7
tof b12 c7
tof b4 b12
tof b1 b0
tof c1 b8
tof b13 b0
tof b3 b0
tof b8 b0
tof b13 b1
tof a15 b1
tof b3 b1
tof c6 b1
tof c3 b1
tof a5 b4
tof c2 b4
tof b13 c5
tof a15 c5
tof b3 c5
tof c6 c5
tof c3 c5
tof c12 c1
tof b3 a15
tof c6 a15
tof c12 a15
tof c12 c6
tof c6 b2
tof c6 b3
tof a5 c3
tof c2 c3
tof c12 c6
tof c3 c6
tof a3 a1
tof c2 a5
tof b15 a5
tof b15 a1
tof c12 a0
tof b15 a0
tof c2 a3
tof a3 c2
tof a0 c15
tof b15 a3
tof b15 c2
tof a5 a0
tof c3 a5
tof c6 c3
tof a5 c15
tof c6 a0
tof c3 c12
tof b3 c12
tof a15 c15
tof b13 c15
tof a15 a0
tof a15 b3
tof a15 b2
tof c5 c2
tof c1 a15
tof b1 c5
tof b4 c5
tof b1 c15
tof b1 a0
tof b1 c12
tof b1 b3
tof b4 a3
tof b1 c2
tof b1 a15
tof b4 c6
tof b1 b2
tof b0 b8
tof b8 a0
tof b0 c12
tof b8 b13
tof b0 a15
tof b8 b2
tof b0 b1
tof b12 c15
tof b12 b13
tof b12 a3
tof b12 c2
tof b12 c6
tof b12 b4
tof c10 c15
tof c8 c15
tof c8 a0
tof c10 a1
tof c10 a3
tof c10 c2
tof c10 b15
tof a4 c8
tof b5 c8
tof a4 c15
tof c8 a0
tof a4 b13
tof a4 b2
tof a4 b8
tof a9 c15
tof a9 c12
tof a9 b3
tof a9 c6
tof a9 a5
tof a9 c3
tof a9 b2
tof a9 b1
tof a9 c8
tof a11 c2