Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
config_element.cpp
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 #include "config_element.h"
24 
25 
30 
31 
32 
34  name = std::string("");
35 
37  dval = 0.0;
39  bval = false;
41  ival = 0;
43  llval = 0;
45  ullval = 0;
46 
47 
48 }
49 
54 
55 
56 }
57 
58 
64 void
65 Config_Element::set_property( std::string name_, double val_ ) {
66 
67 
68 
70  name = name_;
71 
73  dval = val_;
75  bval = false;
77  ival = 0;
79  llval = 0;
81  ullval = 0;
82 
83 }
84 
85 
91 void
92 Config_Element::set_property( std::string name_, bool val_ ) {
93 
94 
96  name = name_;
97 
99  dval = 0.0;
101  bval = val_;
103  ival = 0;
105  llval = 0;
107  ullval = 0;
108 
109 }
110 
111 
117 void
118 Config_Element::set_property( std::string name_, long val_ ) {
119 
121  name = name_;
122 
124  dval = 0.0;
126  bval = false;
128  ival = val_;
130  llval = 0;
132  ullval = 0;
133 
134 }
135 
136 
142 void
143 Config_Element::set_property( std::string name_, long long val_ ) {
144 
146  name = name_;
147 
149  dval = 0.0;
151  bval = false;
153  ival = 0;
155  llval = val_;
157  ullval = 0;
158 
159 }
160 
161 
167 void
168 Config_Element::set_property( std::string name_, unsigned long long val_ ) {
169 
170 
172  name = name_;
173 
175  dval = 0.0;
177  bval = false;
179  ival = 0;
181  llval = 0;
183  ullval = val_;
184 
185 }
186 
187 
188 
189 
190 
196 void
198 
199  val_ = dval;
200 
201 }
202 
203 
204 
210 void
212 
213  val_ = bval;
214 
215 }
216 
222 void
224 
225  val_ = ival;
226 
227 }
228 
229 
235 void
236 Config_Element::get_property( long long& val_ ) {
237 
238  val_ = llval;
239 
240 }
241 
242 
248 void
249 Config_Element::get_property( unsigned long long& val_ ) {
250 
251  val_ = ullval;
252 
253 }
254 
unsigned long long ullval
variable to store unsigned long long parameter value
long long llval
variable to store long long parameter value
void get_property(double &val_)
Call to get a double value.
std::string name
The name of the configuration property.
virtual ~Config_Element()
Destructor of the class.
Header file for a class describing a universal parameter with name and value stored in a config map...
bool bval
variable to store bool parameter value
Config_Element()
Nullary constructor of the class.
long ival
variable to store int parameter value
void set_property(std::string name_, double val_)
Call to set a double value.
double dval
variable to store double parameter value