CSS product code  0.1
C++ library to estimate distance of CSS codes. Some particular construction of CSS codes are implemented.
dist.h
Go to the documentation of this file.
1 
5 #ifndef DIST_H
6 #define DIST_H
7 //Weilei Zeng, April 28
8 
9 
10 //#include <string> //already inlcuded in itbase.h
11 //#include <itpp/itbase.h> //already included in itcomm.h
12 #include <itpp/itcomm.h> //LDPC_Code
13 //#include <stdio.h>
14 
15 namespace common {
16 
17  //const int MAX_M=6;//maximum of the length of the complex chain
18 
19  const int INF=999;
25  int min_wt_decoding(itpp::GF2mat C);
26 
33  int min_wt_decoding(itpp::GF2mat C, itpp::GF2mat G);
34 
36  int save_dist(int d, char * filename);
37 
43  int rand_dist(itpp::GF2mat C, int perm_try=10);
44 
50  int classical_dist(itpp::GF2mat G);
51 
52 
54  itpp::GF2mat nullSpace(itpp::GF2mat G);
55 
63  itpp::GF2mat getC(itpp::GF2mat G_x,itpp::GF2mat G_z,int flip=0);//return C_x or C_z if flip=1
64 
72  int quantum_dist_v2(itpp::GF2mat G_x, itpp::GF2mat G_z, int flip=0);//without expectation value
73 
82  int quantum_dist(itpp::GF2mat G_x, itpp::GF2mat G_z, int dist_expected, int debug, int flip=0);
83  //right or x distance of (G_x,G_z)
84  //flip left and right if flip = 1
85 
93  int hypergraph_dist(itpp::GF2mat Aj, itpp::GF2mat Ajplus,int dist_expected,int flip=0);
94 
95 
96  //following functions for bp_new, Belief Propagation decoder.
97 
98 
100  int draw_toric_x_error(itpp::bvec error_bits);
101 
103  int draw_toric_x_error(itpp::bvec error_bits, std::string header);
104 
111  itpp::bvec find_error(itpp::bvec e_in, itpp::GF2mat H);
112 
116  itpp::GF2mat get_check_code734(int L);//L=7n
117 
120  itpp::GF2mat get_check_code743(int L);//L=7n
122  itpp::GF2mat get_check_rept(int L);
123 
131  itpp::GF2mat get_check(int generator_flag, int L);
132 
133 
134  itpp::LDPC_Code GF2mat_to_LDPC_Code(itpp::GF2mat G);
135 
137  itpp::LDPC_Code MM_to_LDPC_Code(char * filename);
138 
139 
140 
141 } //namespace common
142 
143 #endif //#ifndef DIST_H
144 
common::classical_dist
int classical_dist(itpp::GF2mat G)
Definition: dist.cpp:114
common::get_check
itpp::GF2mat get_check(int generator_flag, int L)
Definition: dist.cpp:524
common::nullSpace
itpp::GF2mat nullSpace(itpp::GF2mat G)
Definition: dist.cpp:133
common::get_check_code734
itpp::GF2mat get_check_code734(int L)
Definition: dist.cpp:471
common::GF2mat_to_LDPC_Code
itpp::LDPC_Code GF2mat_to_LDPC_Code(itpp::GF2mat G)
Definition: dist.cpp:550
common::find_error
itpp::bvec find_error(itpp::bvec e_in, itpp::GF2mat H)
Definition: dist.cpp:446
common::INF
const int INF
Definition: dist.h:19
common::quantum_dist_v2
int quantum_dist_v2(itpp::GF2mat G_x, itpp::GF2mat G_z, int flip=0)
Definition: dist.cpp:179
common::save_dist
int save_dist(int d, char *filename)
Definition: dist.cpp:73
common::hypergraph_dist
int hypergraph_dist(itpp::GF2mat Aj, itpp::GF2mat Ajplus, int dist_expected, int flip=0)
Definition: dist.cpp:292
common::rand_dist
int rand_dist(itpp::GF2mat C, int perm_try=10)
Definition: dist.cpp:82
common::get_check_code743
itpp::GF2mat get_check_code743(int L)
Definition: dist.cpp:490
common::get_check_rept
itpp::GF2mat get_check_rept(int L)
Definition: dist.cpp:513
common::draw_toric_x_error
int draw_toric_x_error(itpp::bvec error_bits)
Definition: dist.cpp:389
common::MM_to_LDPC_Code
itpp::LDPC_Code MM_to_LDPC_Code(char *filename)
Definition: dist.cpp:559
common::quantum_dist
int quantum_dist(itpp::GF2mat G_x, itpp::GF2mat G_z, int dist_expected, int debug, int flip=0)
Definition: dist.cpp:228
common::getC
itpp::GF2mat getC(itpp::GF2mat G_x, itpp::GF2mat G_z, int flip=0)
Definition: dist.cpp:143
common::min_wt_decoding
int min_wt_decoding(itpp::GF2mat C)
Definition: dist.cpp:12
common
common function shared by many program
Definition: dist.h:15