Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
matrix.h
Go to the documentation of this file.
1 /*
2 Created on Fri Jun 26 14:13:26 2020
3 Copyright 2020 Peter Rakyta, Ph.D.
4 
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 
17 @author: Peter Rakyta, Ph.D.
18 */
24 #ifndef matrix_H
25 #define matrix_H
26 
27 #include "matrix_base.hpp"
28 #include "matrix_template.hpp"
29 #include <type_traits>
30 
31 extern template class Matrix_T<QGD_Complex16>;
32 
33 class Matrix_float;
34 
39 public:
41 
42  Matrix() = default;
43 
44  explicit Matrix(Matrix_T<QGD_Complex16>&& base) noexcept
45  : Matrix_T<QGD_Complex16>(std::move(base)) {}
46 
47  Matrix(const Matrix&) = default;
48  Matrix(Matrix&&) noexcept = default;
49  Matrix& operator=(const Matrix&) = default;
50  Matrix& operator=(Matrix&&) noexcept = default;
51  ~Matrix() = default;
52 
57  Matrix copy() const {
59  }
60 
67  Matrix_float to_float32() const;
68 };
69 
70 // ABI compatibility check
71 static_assert(sizeof(Matrix) == sizeof(Matrix_T<QGD_Complex16>),
72  "ABI: Matrix size mismatch");
73 
74 // Compile-time type checks
75 static_assert(sizeof(QGD_Complex16) == 16, "QGD_Complex16 must be 16 bytes");
76 static_assert(std::is_standard_layout<QGD_Complex16>::value &&
77  std::is_trivial<QGD_Complex16>::value,
78  "QGD_Complex16 must be standard layout and trivial");
79 
80 #endif // MATRIX_H
Structure type representing complex numbers in the SQUANDER package.
Definition: QGDTypes.h:38
Matrix copy() const
Call to create a copy of the matrix.
Definition: matrix.h:57
Double-precision complex matrix (float64).
Definition: matrix.h:38
Single-precision complex matrix (float32).
Definition: matrix_float.h:41
Matrix(Matrix_T< QGD_Complex16 > &&base) noexcept
Definition: matrix.h:44