Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
matrix_float.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 */
23 #ifndef MATRIX_FLOAT_H
24 #define MATRIX_FLOAT_H
25 
26 #include "matrix_base.hpp"
27 #include "matrix_template.hpp"
28 #include <cmath>
29 #include <type_traits>
30 
31 extern template class Matrix_T<QGD_Complex8>;
32 
33 class Matrix;
34 
42 public:
44 
45  Matrix_float() = default;
46 
47  explicit Matrix_float(Matrix_T<QGD_Complex8>&& base) noexcept
48  : Matrix_T<QGD_Complex8>(std::move(base)) {}
49 
50  Matrix_float(const Matrix_float&) = default;
51  Matrix_float(Matrix_float&&) noexcept = default;
52  Matrix_float& operator=(const Matrix_float&) = default;
53  Matrix_float& operator=(Matrix_float&&) noexcept = default;
54  ~Matrix_float() = default;
55 
60  Matrix_float copy() const {
62  }
63 
70  Matrix to_float64() const;
71 };
72 
73 // ABI compatibility check
74 static_assert(sizeof(Matrix_float) == sizeof(Matrix_T<QGD_Complex8>),
75  "ABI: Matrix_float size mismatch");
76 
77 // Compile-time type checks
78 static_assert(sizeof(QGD_Complex8) == 8, "QGD_Complex8 must be 8 bytes");
79 static_assert(std::is_standard_layout<QGD_Complex8>::value &&
80  std::is_trivial<QGD_Complex8>::value,
81  "QGD_Complex8 must be standard layout and trivial");
82 
83 #endif // MATRIX_FLOAT_H
Structure type representing single-precision complex numbers.
Definition: QGDTypes.h:46
Matrix_float(Matrix_T< QGD_Complex8 > &&base) noexcept
Definition: matrix_float.h:47
Double-precision complex matrix (float64).
Definition: matrix.h:38
Single-precision complex matrix (float32).
Definition: matrix_float.h:41
Matrix_float copy() const
Call to create a copy of the matrix.
Definition: matrix_float.h:60