Majoranapp
A C++ library for studying MZM in non-interacting systems
DefaultViewer.hpp
Go to the documentation of this file.
1 #ifndef SRC_VECTORVIEWERS_DEFAULTVIEWER_HPP
2 #define SRC_VECTORVIEWERS_DEFAULTVIEWER_HPP
3 
4 #include <iostream>
5 #include <armadillo>
6 
7 #include "../Info.hpp"
8 
13 {
14 public:
15 
16  static void View(arma::mat &vectors, int deg)
17  {
18  int rows = vectors.n_rows;
19  int cols = vectors.n_cols;
20 
21  std::cout << "# site ";
22  for (int col = 0; col < cols; col++)
23  for (int _deg = 0; _deg < deg / 2; _deg++)
24  std::cout << Info::Gamma(_deg) << "+(" << col << ") "
25  << Info::Gamma(_deg) << "-(" << col << ") ";
26  std::cout << std::endl;
27 
28  for (int row = 0,site = 0; row < rows; row += deg,site++)
29  {
30  std::cout << site << " ";
31  for (int col = 0; col < cols; col++)
32  {
33  for (int _deg = 0; _deg < deg; _deg++)
34  std::cout << vectors(row + _deg, col) << " ";
35  }
36  std::cout << std::endl;
37  }
38  }
39 
40 };
41 
42 #endif
displays vectors as unnumbered sites
Definition: DefaultViewer.hpp:12
static std::string Gamma(int deg)
selects gamma of a given degree deg
Definition: GammaASCII.hpp:52
static void View(arma::mat &vectors, int deg)
Definition: DefaultViewer.hpp:16