Skip to content

Commit ef12424

Browse files
author
mkangquantum
committed
hgp canonical codeword fixed
1 parent 045e7fa commit ef12424

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

doc/intro.ipynb

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,6 @@
331331
"print('# layers of entangling gates: ', depth)"
332332
]
333333
},
334-
{
335-
"cell_type": "markdown",
336-
"id": "27121110",
337-
"metadata": {},
338-
"source": [
339-
"For the BPC code, logical operators are written in the form in Eq. 30 of arXiv:2411.03302"
340-
]
341-
},
342334
{
343335
"cell_type": "code",
344336
"execution_count": 14,
@@ -349,14 +341,15 @@
349341
"name": "stdout",
350342
"output_type": "stream",
351343
"text": [
352-
"Z0 : [45 46 48 49 51 52 54 55 57 58] , X0 : [ 0 1 3 4 6 7 9 10 12 13]\n",
353-
"Z1 : [46 47 49 50 52 53 55 56 58 59] , X1 : [ 1 2 4 5 7 8 10 11 13 14]\n",
354-
"Z2 : [60 61 63 64 66 67 69 70 72 73] , X2 : [15 16 18 19 21 22 24 25 27 28]\n",
355-
"Z3 : [61 62 64 65 67 68 70 71 73 74] , X3 : [16 17 19 20 22 23 25 26 28 29]\n",
356-
"Z4 : [ 0 3 6 9 12 15 18 21 24 27] , X4 : [45 48 51 54 57 60 63 66 69 72]\n",
357-
"Z5 : [ 1 4 7 10 13 16 19 22 25 28] , X5 : [46 49 52 55 58 61 64 67 70 73]\n",
358-
"Z6 : [15 18 21 24 27 30 33 36 39 42] , X6 : [60 63 66 69 72 75 78 81 84 87]\n",
359-
"Z7 : [16 19 22 25 28 31 34 37 40 43] , X7 : [61 64 67 70 73 76 79 82 85 88]\n"
344+
"Z0 : [ 2 5 8 11 14 17 20 23 26 29] , X0 : [15 16 18 19 21 22 24 25 27 28]\n",
345+
"Z1 : [ 0 3 6 9 12 30 33 36 39 42] , X1 : [15 17 18 20 21 23 24 26 27 29]\n",
346+
"Z2 : [ 1 4 7 10 13 31 34 37 40 43] , X2 : [30 31 33 34 36 37 39 40 42 43]\n",
347+
"Z3 : [ 0 3 6 9 12 15 18 21 24 27] , X3 : [30 32 33 35 36 38 39 41 42 44]\n",
348+
"Z4 : [ 1 2 3 4 5 7 8 12 13 14 15 18 19 20 24 31 32 33 36 37 38 39 40 41\n",
349+
" 45 46] , X4 : [15 17 20 22 24 25 32 37 39 42 45 60]\n",
350+
"Z5 : [ 1 3 7 15 16 18 21 24 25 30 31 33 34 39 45 47] , X5 : [16 18 21 23 25 26 30 31 34 36 37 38 39 42 46 61]\n",
351+
"Z6 : [ 0 1 2 3 7 8 15 21 24 25 26 30 33 34 35 39 60 61] , X6 : [ 0 5 10 12 15 17 20 22 24 25 30 35 40 42 45 75]\n",
352+
"Z7 : [ 3 4 6 7 12 16 18 22 30 31 33 36 39 40 60 62] , X7 : [ 0 3 4 7 9 10 11 12 16 18 21 23 25 26 30 33 34 37 39 40 41 42 46 76]\n"
360353
]
361354
}
362355
],
@@ -400,7 +393,7 @@
400393
"name": "stderr",
401394
"output_type": "stream",
402395
"text": [
403-
"100%|██████████| 100/100 [00:10<00:00, 9.45it/s]"
396+
"100%|██████████| 100/100 [00:10<00:00, 9.50it/s]"
404397
]
405398
},
406399
{
@@ -455,7 +448,7 @@
455448
"name": "stderr",
456449
"output_type": "stream",
457450
"text": [
458-
"100%|██████████| 100/100 [00:09<00:00, 10.29it/s]\n"
451+
"100%|██████████| 100/100 [00:09<00:00, 10.09it/s]\n"
459452
]
460453
}
461454
],

src/quits/qldpc_code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,8 @@ def __init__(self, p1, p2, lift_size, factor):
620620

621621
self.hz = np.concatenate((h2, h1T), axis=1)
622622
self.hx = np.concatenate((h1, h2T), axis=1)
623-
self.lz, self.lx = self.get_logicals() # logical operators in the "canonical form"
623+
self.lz, self.lx = compute_lz_and_lx(self.hx, self.hz)
624+
# self.lz, self.lx = self.get_logicals() # logical operators in the "canonical form"
624625

625626
def get_block_mat(self, power):
626627
gen_mat = self.get_circulant_mat(self.factor, 1)
@@ -633,6 +634,7 @@ def get_block_mat(self, power):
633634
mat = mat * mat_placeholder * self.factor
634635
return mat, mat_placeholder
635636

637+
# WRONG; SHOULD BE FIXED LATER
636638
def get_logicals(self):
637639
'''
638640
:return: Logical operators of the code as a list of tuples (logical_z, logical_x)

0 commit comments

Comments
 (0)