Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
logging.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 LOGGING_H
24 #define LOGGING_H
25 
26 #include <string>
27 #include <iostream>
28 #include <sstream>
29 #include <fstream>
30 
31 
32 #ifdef __MPI__
33 #include "mpi_base.h"
34 #endif
35 
36 
40 #ifdef __MPI__
41 class logging : public mpi_base {
42 #else
43 class logging {
44 #endif
45 
46 public:
47 
48 
50  int verbose;
51 
53  bool debug;
54 
56  std::string debugfile_name;
57 
58 
62  logging();
63 
69  void print(const std::stringstream& sstream, int verbose_level=1) const;
70 
71 
72 
73 
78  void set_verbose( int verbose_in );
79 
80 
85  void set_debugfile( std::string debugfile );
86 
87 
88 
89 };
90 
91 
92 
93 
94 
95 #endif
void print(const std::stringstream &sstream, int verbose_level=1) const
Call to print output messages in the function of the verbosity level.
Definition: logging.cpp:55
bool debug
Logical variable. Set true to write output messages to the &#39;debug.txt&#39; file.
Definition: logging.h:53
A class containing basic methods for setting up the verbosity level.
Definition: logging.h:43
void set_debugfile(std::string debugfile)
Call to set the debugfile name.
Definition: logging.cpp:95
int verbose
Set the verbosity level of the output messages.
Definition: logging.h:50
A class containing data on the current MPI process.
Definition: mpi_base.h:37
Header file for a class containing data on the current MPI process.
std::string debugfile_name
String variable. Set the debug file name.
Definition: logging.h:56
void set_verbose(int verbose_in)
Call to set the verbose attribute.
Definition: logging.cpp:85
logging()
Nullary constructor of the class.
Definition: logging.cpp:34