Sequential Quantum Gate Decomposer
v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
tmp2db82vtv
squander
src-cpp
common
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
32
Matrix_sparse::Matrix_sparse
(){
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
matrix_sparse.h
Header file of complex array storage array with automatic and thread safe reference counting...
Matrix_sparse::indptr
int * indptr
Definition:
matrix_sparse.h:51
Matrix_sparse::data
QGD_Complex16 * data
Definition:
matrix_sparse.h:47
Matrix_sparse::rows
int rows
Definition:
matrix_sparse.h:41
Matrix_sparse::NNZ
int NNZ
Definition:
matrix_sparse.h:45
Matrix_sparse::cols
int cols
Definition:
matrix_sparse.h:43
Matrix_sparse::indices
int * indices
Definition:
matrix_sparse.h:49
matrix.h
Header file of complex array storage array with automatic and thread safe reference counting...
QGD_Complex16
Structure type representing complex numbers in the SQUANDER package.
Definition:
QGDTypes.h:38
Matrix_sparse::Matrix_sparse
Matrix_sparse()
Default constructor of the class.
Definition:
matrix_sparse.cpp:32
Generated on Sat Jul 12 2025 07:28:11 for Sequential Quantum Gate Decomposer by
1.8.13