CSS product code  0.1
C++ library to estimate distance of CSS codes. Some particular construction of CSS codes are implemented.
lib.h
Go to the documentation of this file.
1 
5 #ifndef LIB_H
6 #define LIB_H
7 #include <string> //string is already included in itpp
8 //#include <iostream>
9 //#include<fstream>
10 //#include <stdio.h>
11 #include <itpp/itbase.h>
12 
13 //#include "weilei_lib.h"
14 
18 namespace common{
19  //general cpp util functions
20 
22  std::string color_text(std::string str);
23 
24  std::string red_text(std::string str);
26  std::string blue_text(std::string str);
28  int get_time(int mode = 1);
30  //itpp based functions
31 
36  bool is_quantum_code(itpp::GF2mat & G_x, itpp::GF2mat & G_z);
37  //check if the code is quantum or not
38  //this function is also defined elsewhere
39 
40  //moved from product.h
47  bool is_quantum_code(itpp::GF2mat &Gx,itpp::GF2mat &Gz, itpp::GF2mat &Cx,itpp::GF2mat &Cz);
48 
53  itpp::GF2mat make_it_full_rank(itpp::GF2mat fat);
54 
55 
56  //int itpp::GF2matPrint(itpp::GF2mat &G, char * name = (char *) " ");
61  int GF2matPrint(itpp::GF2mat &G, std::string name);
62 
67  int matPrint(itpp::mat G, char * name = (char *) " ");//print brief infomation of G
68 
74  itpp::GF2mat kron(itpp::GF2mat A, itpp::GF2mat B);//not sure how this kron is defined, maybe inversed
75 
79  std::string NumberToString(int pNumber);//Convert number to std::string. //because the build in function is not supported in C++ 11
80 
84  itpp::GF2mat append_vector(itpp::GF2mat G, itpp::bvec b);
85 
89  itpp::GF2mat get_GF2mat(char * filename_prefix, char * filename_suffix);
90 
94  itpp::GF2mat get_GF2mat(char * parent_folder, char * folder, char * filename);
95 
99  double get_error_density(itpp::GF2mat E);
100 
101 
103  int mat2gnudata(itpp::mat data, std::string filename, std::string header);
104 
105 
106 }
107 
108 #endif
common::matPrint
int matPrint(itpp::mat G, char *name=(char *) " ")
Definition: lib.cpp:153
common::get_time
int get_time(int mode=1)
Definition: lib.cpp:53
common::get_GF2mat
itpp::GF2mat get_GF2mat(char *filename_prefix, char *filename_suffix)
Definition: lib.cpp:210
common::blue_text
std::string blue_text(std::string str)
Definition: lib.cpp:42
common::red_text
std::string red_text(std::string str)
Definition: lib.cpp:37
common::kron
itpp::GF2mat kron(itpp::GF2mat A, itpp::GF2mat B)
Definition: lib.cpp:162
common::mat2gnudata
int mat2gnudata(itpp::mat data, std::string filename, std::string header)
Definition: lib.cpp:237
common::NumberToString
std::string NumberToString(int pNumber)
Definition: lib.cpp:195
common::make_it_full_rank
itpp::GF2mat make_it_full_rank(itpp::GF2mat fat)
Definition: lib.cpp:123
common::color_text
std::string color_text(std::string str)
Definition: lib.cpp:32
common::append_vector
itpp::GF2mat append_vector(itpp::GF2mat G, itpp::bvec b)
Definition: lib.cpp:202
common::get_error_density
double get_error_density(itpp::GF2mat E)
Definition: lib.cpp:224
common
common function shared by many program
Definition: dist.h:15
common::GF2matPrint
int GF2matPrint(itpp::GF2mat &G, std::string name)
Definition: lib.cpp:144
common::is_quantum_code
bool is_quantum_code(itpp::GF2mat &G_x, itpp::GF2mat &G_z)
Definition: lib.cpp:77