From fe0e229473f53b9fe756a4df7c946dcf2661e89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvatore=20Mandr=C3=A0?= Date: Wed, 16 Oct 2019 15:01:05 -0700 Subject: [PATCH 1/5] Add grids. --- config/grid/ibm_rochester.txt | 10 ++++++++++ config/grid/rigetti_aspen.txt | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 config/grid/ibm_rochester.txt create mode 100644 config/grid/rigetti_aspen.txt diff --git a/config/grid/ibm_rochester.txt b/config/grid/ibm_rochester.txt new file mode 100644 index 00000000..0fe11f00 --- /dev/null +++ b/config/grid/ibm_rochester.txt @@ -0,0 +1,10 @@ +001111100 +001000100 +111111111 +100010001 +111111111 +001000100 +111111111 +100010001 +111111111 +001000100 diff --git a/config/grid/rigetti_aspen.txt b/config/grid/rigetti_aspen.txt new file mode 100644 index 00000000..0b511c34 --- /dev/null +++ b/config/grid/rigetti_aspen.txt @@ -0,0 +1,4 @@ +1111 +1111 +1111 +1111 From 40e2ddbda4020f7d7814a769185c23aa5fa18c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvatore=20Mandr=C3=A0?= Date: Wed, 16 Oct 2019 15:01:24 -0700 Subject: [PATCH 2/5] Patters are updated to follow the corresponding grids. --- config/patterns/ibm_rochester.txt | 35 ++++++++++++++++++++----------- config/patterns/rigetti_aspen.txt | 6 +++--- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/config/patterns/ibm_rochester.txt b/config/patterns/ibm_rochester.txt index 6d86229d..cbd8c44b 100644 --- a/config/patterns/ibm_rochester.txt +++ b/config/patterns/ibm_rochester.txt @@ -1,14 +1,25 @@ { - 'A': {(0, 1), (2, 3), (4, 6), (5, 9), (7, 8), (10, 11), (12, 13), - (14, 15), (16, 19), (18, 27), (20, 21), (23, 24), (25, 26), - (28, 32), (30, 31), (33, 34), (36, 37), (38, 41), (39, 42), - (43, 44), (45, 46), (47, 48), (49, 50)}, - 'B': {(0, 5), (1, 2), (3, 4), (6, 13), (7, 16), (9, 10), (11, 12), - (15, 18), (17, 23), (19, 20), (21, 22), (24, 25), (26, 27), - (29, 36), (30, 39), (32, 33), (34, 35), (37, 38), (40, 46), - (41, 50), (42, 43), (44, 45), (48, 49)}, - 'C': {(0, 5), (1, 2), (3, 4), (7, 16), (8, 9), (11, 17), (13, 14), - (15, 18), (19, 20), (21, 28), (22, 23), (25, 29), (26, 27), - (30, 39), (31, 32), (34, 40), (35, 36), (37, 38), (41, 50), - (42, 43), (44, 51), (46, 47), (48, 52)}, + 'A': + { + (54, 55), (42, 43), (63, 72), (40, 41), (18, 19), + (35, 44), (47, 56), (25, 26), (27, 36), (6, 15), + (60, 61), (37, 38), (4, 5), (73, 74), (2, 3), + (23, 24), (62, 71), (75, 76), (21, 22), (77, 78), + (57, 58), (11, 20), (79, 80) + }, + 'B': + { + (74, 75), (31, 40), (22, 23), (61, 62), (36, 37), + (5, 6), (26, 35), (72, 73), (71, 80), (54, 63), + (58, 59), (20, 21), (18, 27), (56, 57), (51, 60), + (41, 42), (78, 79), (43, 44), (67, 76), (38, 39), + (15, 24), (2, 11), (3, 4) + }, + 'C': { + (61, 62), (36, 37), (5, 6), (26, 35), (58, 67), + (72, 73), (71, 80), (54, 63), (22, 31), (76, 77), + (18, 27), (3, 4), (39, 40), (78, 87), (42, 51), + (74, 83), (55, 56), (19, 20), (38, 47), (43, 44), + (2, 11), (24, 25), (59, 60) + } } diff --git a/config/patterns/rigetti_aspen.txt b/config/patterns/rigetti_aspen.txt index ff4a8824..27240e83 100644 --- a/config/patterns/rigetti_aspen.txt +++ b/config/patterns/rigetti_aspen.txt @@ -1,5 +1,5 @@ { - 'A': {(0, 7), (1, 14), (15, 8), (9, 10), (11, 12), (13, 2), (3, 4), (5, 6)}, - 'B': {(0, 1), (14, 15), (8, 9), (10, 11), (12, 13), (2, 3), (4, 5), (6, 7)}, - 'C': {(0, 7), (1, 2), (14, 13), (15, 8), (9, 10), (11, 12), (3, 4), (5, 6)}, + 'A' : { (0,1), (5 ,9), (12,13), (4,8), (2,3), (7,11), (14,15), (6,10) } + 'B' : { (1,5), (9,13), (8,12), (0,4), (2,6), (10,14), (11,15), (3.7) } + 'C' : { (0,1), (5,6), (2,3), (7,11), (14,15), (9,10), (12,13), (4,8) } } From bf2fbd4a8b5e05c1333d74f19c060bea61235bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvatore=20Mandr=C3=A0?= Date: Wed, 16 Oct 2019 15:01:45 -0700 Subject: [PATCH 3/5] Improve script. --- python/circuits/generator.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/circuits/generator.py b/python/circuits/generator.py index df90dca8..f72164a6 100644 --- a/python/circuits/generator.py +++ b/python/circuits/generator.py @@ -209,28 +209,28 @@ def main(args): if __name__ == '__main__': arg_parser = argparse.ArgumentParser() - arg_parser.add_argument('--pattern-file', + arg_parser.add_argument('--pattern-file', '-p', type=str, required=True, help=f'pattern filename') arg_parser.add_argument( - '--sequence', + '--sequence', '-s', type=str, required=True, help=f'sequence of device-specific coupler activation patterns') arg_parser.add_argument( - '--single_qubit_gates', + '--single_qubit_gates', '-1', type=str, required=True, help= 'comma-separated list of single-qubit gates known to qsim, e.g. h, x_1_2' ) arg_parser.add_argument( - '--two_qubit_gate', + '--two_qubit_gate', '-2', type=str, required=True, help='name of the two-qubit gate known to qsim, e.g. cz, fs') - arg_parser.add_argument('--depth', + arg_parser.add_argument('--depth', '-d', type=int, required=True, help='number of layers of two-qubit gates') From 9682f26288987e0ceffc836d45d3a094df190ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvatore=20Mandr=C3=A0?= Date: Sun, 20 Oct 2019 13:06:05 -0700 Subject: [PATCH 4/5] Fix. --- config/patterns/ibm_rochester.txt | 12 ++++++------ config/patterns/rigetti_aspen.txt | 6 +++--- config/patterns/test.txt | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/config/patterns/ibm_rochester.txt b/config/patterns/ibm_rochester.txt index cbd8c44b..7ba8b532 100644 --- a/config/patterns/ibm_rochester.txt +++ b/config/patterns/ibm_rochester.txt @@ -1,25 +1,25 @@ { 'A': - { + [ (54, 55), (42, 43), (63, 72), (40, 41), (18, 19), (35, 44), (47, 56), (25, 26), (27, 36), (6, 15), (60, 61), (37, 38), (4, 5), (73, 74), (2, 3), (23, 24), (62, 71), (75, 76), (21, 22), (77, 78), (57, 58), (11, 20), (79, 80) - }, + ], 'B': - { + [ (74, 75), (31, 40), (22, 23), (61, 62), (36, 37), (5, 6), (26, 35), (72, 73), (71, 80), (54, 63), (58, 59), (20, 21), (18, 27), (56, 57), (51, 60), (41, 42), (78, 79), (43, 44), (67, 76), (38, 39), (15, 24), (2, 11), (3, 4) - }, - 'C': { + ], + 'C': [ (61, 62), (36, 37), (5, 6), (26, 35), (58, 67), (72, 73), (71, 80), (54, 63), (22, 31), (76, 77), (18, 27), (3, 4), (39, 40), (78, 87), (42, 51), (74, 83), (55, 56), (19, 20), (38, 47), (43, 44), (2, 11), (24, 25), (59, 60) - } + ] } diff --git a/config/patterns/rigetti_aspen.txt b/config/patterns/rigetti_aspen.txt index 27240e83..4a4033d2 100644 --- a/config/patterns/rigetti_aspen.txt +++ b/config/patterns/rigetti_aspen.txt @@ -1,5 +1,5 @@ { - 'A' : { (0,1), (5 ,9), (12,13), (4,8), (2,3), (7,11), (14,15), (6,10) } - 'B' : { (1,5), (9,13), (8,12), (0,4), (2,6), (10,14), (11,15), (3.7) } - 'C' : { (0,1), (5,6), (2,3), (7,11), (14,15), (9,10), (12,13), (4,8) } + 'A' : [ (0,1), (5,9), (12,13), (4,8), (2,3), (7,11), (14,15), (6,10) ], + 'B' : [ (1,5), (9,13), (8,12), (0,4), (2,6), (10,14), (11,15), (3,7) ], + 'C' : [ (0,1), (5,6), (2,3), (7,11), (14,15), (9,10), (12,13), (4,8) ] } diff --git a/config/patterns/test.txt b/config/patterns/test.txt index 58941578..831050ae 100644 --- a/config/patterns/test.txt +++ b/config/patterns/test.txt @@ -1,4 +1,4 @@ { - 'A': {(0, 2), (1, 3)}, - 'B': {(0, 1), (2, 3)} + 'A': [(0, 2), (1, 3)], + 'B': [(0, 1), (2, 3)] } From 2c069990a56835a2cbf9bfd06985ea488680fba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvatore=20Mandr=C3=A0?= Date: Fri, 8 Nov 2019 19:22:36 -0800 Subject: [PATCH 5/5] Fix format. --- python/circuits/generator.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/circuits/generator.py b/python/circuits/generator.py index 7eeaa166..160861b1 100644 --- a/python/circuits/generator.py +++ b/python/circuits/generator.py @@ -215,12 +215,14 @@ def main(args): if __name__ == '__main__': arg_parser = argparse.ArgumentParser() - arg_parser.add_argument('--pattern-file', '-p', + arg_parser.add_argument('--pattern-file', + '-p', type=str, required=True, help=f'pattern filename') arg_parser.add_argument( - '--sequence', '-s', + '--sequence', + '-s', type=str, required=True, help=f'sequence of device-specific coupler activation patterns') @@ -236,7 +238,8 @@ def main(args): type=str, required=True, help='name of the two-qubit gate known to qsim, e.g. cz, fs') - arg_parser.add_argument('--depth', '-d', + arg_parser.add_argument('--depth', + '-d', type=int, required=True, help='number of layers of two-qubit gates')