Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
matrix_sparse.cpp
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 #include "matrix.h"
25 #include "matrix_sparse.h"
26 #include <cstring>
27 #include <iostream>
28 #include "tbb/tbb.h"
29 #include <math.h>
30 
31 
33  rows = 0;
34 
35  cols = 0;
36 
37  NNZ = 0;
38 
39  data = NULL;
40 
41  indices = NULL;
42 
43  indptr = NULL;
44 }
45 
46 Matrix_sparse::Matrix_sparse(QGD_Complex16* data_in, int rows_in, int cols_in, int NNZ_in, int* indices_in, int* indptr_in){
47 
48  rows = rows_in;
49 
50  cols = cols_in;
51 
52  NNZ = NNZ_in;
53 
54  data = data_in;
55 
56  indices = indices_in;
57 
58  indptr = indptr_in;
59 
60 }
61 
Header file of complex array storage array with automatic and thread safe reference counting...
QGD_Complex16 * data
Definition: matrix_sparse.h:47
Header file of complex array storage array with automatic and thread safe reference counting...
Structure type representing complex numbers in the SQUANDER package.
Definition: QGDTypes.h:38
Matrix_sparse()
Default constructor of the class.