Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
matrix_template.hpp
Go to the documentation of this file.
1 #ifndef MATRIX_TEMPLATE_HPP
2 #define MATRIX_TEMPLATE_HPP
3 
4 #include "matrix_base.hpp"
5 #include <utility>
6 
7 template<typename ComplexType>
8 class Matrix_T : public matrix_base<ComplexType> {
9 private:
10  static constexpr size_t base_size = sizeof(matrix_base<ComplexType>);
11  static constexpr size_t padding_size =
12  (CACHELINE - (base_size % CACHELINE)) % CACHELINE;
13 
14  static_assert(base_size <= CACHELINE, "matrix_base exceeds CACHELINE");
15 
16  char padding_[padding_size];
17 
18 public:
19  Matrix_T();
20  Matrix_T(ComplexType* data_in, int rows_in, int cols_in);
21  Matrix_T(ComplexType* data_in, int rows_in, int cols_in, int stride_in);
22  Matrix_T(int rows_in, int cols_in);
23  Matrix_T(int rows_in, int cols_in, int stride_in);
24 
25  Matrix_T(const Matrix_T &other);
26  Matrix_T(Matrix_T &&other) noexcept;
27  Matrix_T& operator=(const Matrix_T &other);
28  Matrix_T& operator=(Matrix_T &&other) noexcept;
29  ~Matrix_T() = default;
30 
31  Matrix_T copy() const;
32  bool isnan();
33  void print_matrix() const;
34 };
35 
36 #endif // MATRIX_TEMPLATE_HPP
void print_matrix() const
static constexpr size_t base_size
#define CACHELINE
Definition: QGDTypes.h:33
Base Class to store data of arrays and its properties.
Definition: matrix_base.hpp:38
Matrix_T copy() const
char padding_[padding_size]
static constexpr size_t padding_size
~Matrix_T()=default
Matrix_T & operator=(const Matrix_T &other)