Quantum Gate Decomposer  v1.3
Powerful decomposition of almost any unitary into U3 and CNOT gates
N_Qubit_Decomposition_Cost_Function.h
Go to the documentation of this file.
1 /*
2 Created on Fri Jun 26 14:13:26 2020
3 Copyright (C) 2020 Peter Rakyta, Ph.D.
4 
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see http://www.gnu.org/licenses/.
17 
18 @author: Peter Rakyta, Ph.D.
19 */
24 #ifndef N_Qubit_Decomposition_Cost_Function_H
25 #define N_Qubit_Decomposition_Cost_Function_H
26 
27 #include "qgd/common.h"
28 
29 
35 double get_cost_function(Matrix matrix);
36 
37 
38 
43 
44 protected:
45 
51  tbb::combinable<double>* partial_cost_functions;
52 
53 public:
54 
61 functor_cost_fnc( Matrix matrix_in, tbb::combinable<double>* partial_cost_functions_in );
62 
67 void operator()( tbb::blocked_range<size_t> r ) const;
68 
69 };
70 
71 
72 #endif
73 
74 
75 
76 
77 
QGD_Complex16 * data
Pointer to the data stored in the matrix.
void operator()(tbb::blocked_range< size_t > r) const
Operator to calculate the partial cost function derived from the row of the matrix labeled by row_idx...
Function operator class to calculate the partial cost function of the final optimization process.
double get_cost_function(Matrix matrix)
Call co calculate the cost function during the final optimization process.
Matrix matrix
Array stroing the matrix.
functor_cost_fnc(Matrix matrix_in, tbb::combinable< double > *partial_cost_functions_in)
Constructor of the class.
Structure type representing complex numbers in the QGD package.
Definition: QGDTypes.h:39
Class to store data of complex arrays and its properties.
Definition: matrix.h:12
Header file for commonly used functions and wrappers to CBLAS functions.
tbb::combinable< double > * partial_cost_functions
array storing the partial cost functions