From b1c46173989fb8a0a4229b3329446ad427c24da4 Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Sun, 24 Jul 2016 05:57:50 +0100 Subject: [PATCH] Add test graphs --- tests/graphs/.gitignore | 1 + tests/graphs/graph2.g6 | 2 ++ tests/graphs/graph3.g6 | 4 +++ tests/graphs/graph4.g6 | 11 +++++++ tests/graphs/graph5.g6 | 34 ++++++++++++++++++++++ tests/test_measurement_deterministic.py | 38 +++++++++++++++++++++++++ 6 files changed, 90 insertions(+) create mode 100644 tests/graphs/.gitignore create mode 100644 tests/graphs/graph2.g6 create mode 100644 tests/graphs/graph3.g6 create mode 100644 tests/graphs/graph4.g6 create mode 100644 tests/graphs/graph5.g6 create mode 100644 tests/test_measurement_deterministic.py diff --git a/tests/graphs/.gitignore b/tests/graphs/.gitignore new file mode 100644 index 0000000..8a58ef6 --- /dev/null +++ b/tests/graphs/.gitignore @@ -0,0 +1 @@ +graph9.g6 diff --git a/tests/graphs/graph2.g6 b/tests/graphs/graph2.g6 new file mode 100644 index 0000000..47c6bbe --- /dev/null +++ b/tests/graphs/graph2.g6 @@ -0,0 +1,2 @@ +A? +A_ diff --git a/tests/graphs/graph3.g6 b/tests/graphs/graph3.g6 new file mode 100644 index 0000000..b19caa6 --- /dev/null +++ b/tests/graphs/graph3.g6 @@ -0,0 +1,4 @@ +B? +BO +BW +Bw diff --git a/tests/graphs/graph4.g6 b/tests/graphs/graph4.g6 new file mode 100644 index 0000000..0c248ce --- /dev/null +++ b/tests/graphs/graph4.g6 @@ -0,0 +1,11 @@ +C? +CC +CE +CF +CQ +CT +CU +CV +C] +C^ +C~ diff --git a/tests/graphs/graph5.g6 b/tests/graphs/graph5.g6 new file mode 100644 index 0000000..1771b06 --- /dev/null +++ b/tests/graphs/graph5.g6 @@ -0,0 +1,34 @@ +D?? +D?_ +D?o +D?w +D?{ +DCO +DCW +DCc +DCo +DCs +DCw +DC{ +DEk +DEo +DEs +DEw +DE{ +DFw +DF{ +DQg +DQo +DQw +DQ{ +DTk +DTw +DT{ +DUW +DUw +DU{ +DV{ +D]w +D]{ +D^{ +D~{ diff --git a/tests/test_measurement_deterministic.py b/tests/test_measurement_deterministic.py new file mode 100644 index 0000000..baabc4d --- /dev/null +++ b/tests/test_measurement_deterministic.py @@ -0,0 +1,38 @@ +from abp import GraphState, clifford +from anders_briegel import graphsim +import numpy as np +from tqdm import tqdm +import dummy +import itertools as it + +import networkx as nx + + +def all_simple_graphs(filename="tests/graph5.g6"): + """ Generate all possible simple graphs """ + with open(filename) as f: + for line in tqdm(f): + yield nx.parse_graph6(line.strip()) + +def rotated(simple_graphs): + for g in simple_graphs: + for r in it.product(*[range(24)]*2): + yield g, r + + +print len(list(rotated(all_simple_graphs()))) + + +#N = 3 +#m = {1: graphsim.lco_X, 2: graphsim.lco_Y, 3: graphsim.lco_Z} + +#measurements = (3, 2, 1) +#outcomes = (0, 1) +#local_ops = it.combinations_with_replacement(range(24), N) +#edge_patterns = + +#print list(local_ops) + +#print len(list(local_ops)) +#print list(edge_patterns) +