CSS product code  0.1
C++ library to estimate distance of CSS codes. Some particular construction of CSS codes are implemented.
test_lib.cpp
Go to the documentation of this file.
1 #include "weilei_lib.h"
2 
3 
5  std::cout<<"begin test for ClassicalCode"<<std::endl;
6  ClassicalCode code;
7 
8  if ( code.is_defined ){
9  std::cout<<"code is_defined"<<std::endl;
10  }else{
11  std::cout<<"code is_defined"<<std::endl;
12  }
13 
14  code.n = 7;
15  code.get_743_code();
16  code.full_rank();
17  code.info();
18  code.d = code.dist();
19  std::cout<<"[7,4,3] code: d="<<code.d<<std::endl;
20 
21  code.get_repetition_code();
22  code.full_rank();
23  code.info();
24  code.d = code.dist();
25  std::cout<<"repetition code: d="<<code.d<<std::endl;
26  std::cout<<"finish test for ClassicalCode"<<std::endl;
27  return;
28 }
29 
30 
32  std::cout<<"begin test for CSSCode"<<std::endl;
33  CSSCode code;
34 
35  code.n = 7;
36  code.get_713_code();
37  // code.full_rank();
38  // code.info();
39  // code.d =
40  code.dist();
41  std::cout<<"[7,1,3] Hamming code: dx="<<code.dx<<std::endl;
42 
43  std::cout<<"finish test for CSSCode"<<std::endl;
44  return;
45 }
46 
47 
48 
49 int main(){
50  std::cout<<"begin test"<<std::endl;
51 
53  test_CSS_code();
54 
55  std::cout<<"finish test"<<std::endl;
56  return 0;
57 }
ClassicalCode
Definition: product_lib.h:20
CSSCode::get_713_code
void get_713_code()
Definition: product_lib.cpp:120
test_CSS_code
void test_CSS_code()
Definition: test_lib.cpp:31
ClassicalCode::info
void info()
Definition: product_lib.cpp:39
weilei_lib.h
this file links all other headfiles in this folder.
CSSCode::dist
void dist()
Definition: product_lib.cpp:100
ClassicalCode::full_rank
void full_rank()
Definition: product_lib.cpp:50
test_classical_code
void test_classical_code()
Definition: test_lib.cpp:4
ClassicalCode::dist
int dist()
Definition: product_lib.cpp:26
ClassicalCode::n
int n
Number of bits.
Definition: product_lib.h:24
CSSCode::n
int n
Definition: product_lib.h:61
ClassicalCode::is_defined
int is_defined
if G and H has been defined
Definition: product_lib.h:27
ClassicalCode::get_743_code
void get_743_code()
Definition: product_lib.cpp:61
CSSCode::dx
int dx
Definition: product_lib.h:65
main
int main()
Definition: test_lib.cpp:49
ClassicalCode::get_repetition_code
void get_repetition_code()
Definition: product_lib.cpp:56
ClassicalCode::d
int k int d
< number of encoded bits
Definition: product_lib.h:26
CSSCode
Definition: product_lib.h:54