-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfileReader.h
52 lines (45 loc) · 1.5 KB
/
fileReader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// Created by sisi on 4/20/23.
//
#ifndef NBP_JUPYTER_FILEREADER_H
#define NBP_JUPYTER_FILEREADER_H
#endif // NBP_JUPYTER_FILEREADER_H
#include <filesystem>
#include <string>
#include <string_view>
#include <vector>
enum class stabilizerCodesType { GeneralizedBicycle = 0, HypergraphProduct = 1, toric = 3 };
class fileReader {
public:
fileReader(unsigned n, unsigned k, unsigned m, stabilizerCodesType codeType, bool trained = false);
std::string code_type_string() const;
std::filesystem::path construct_weights_path(std::string_view filename) const;
void load_cn_weights();
void load_vn_weights();
void load_llr_weights();
void read_H();
void read_G();
bool check_symplectic();
static inline bool trace_inner_product(unsigned a, unsigned b);
stabilizerCodesType mycodetype;
unsigned N;
unsigned K;
unsigned M;
unsigned G_rows;
bool mTrained;
unsigned trained_iter;
unsigned maxDc;
unsigned maxDv;
std::vector<unsigned> dv;
std::vector<unsigned> dc;
std::vector<std::vector<unsigned>> Nv;
std::vector<std::vector<unsigned>> Mc;
std::vector<std::vector<unsigned>> checkVal;
std::vector<std::vector<unsigned>> varVal;
std::vector<std::vector<unsigned>> Nvk;
std::vector<std::vector<unsigned>> Mck;
std::vector<std::vector<unsigned>> G;
std::vector<std::vector<std::vector<double>>> weights_cn;
std::vector<std::vector<std::vector<double>>> weights_vn;
std::vector<std::vector<double>> weights_llr;
};