Quantum++  v0.8.6
C++11 quantum computing library
qpp.h
Go to the documentation of this file.
1 /*
2  * Quantum++
3  *
4  * Copyright (c) 2013 - 2016 Vlad Gheorghiu (vgheorgh@gmail.com)
5  *
6  * This file is part of Quantum++.
7  *
8  * Quantum++ is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * Quantum++ is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Quantum++. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 // IMPORTANT: instantiation of global singletons
23 // Init, Codes, Gates, States and RandomDevices
24 //
25 // Any additional singletons should be instantiated here
26 // Includes all necessary headers (except "matlab.h")
27 // ALWAYS include it in main.cpp
28 
34 #ifndef QPP_H_
35 #define QPP_H_
36 
37 // silence bogus warning -Wunused-variable for Singletons
38 #if (__GNUC__)
39 #pragma GCC diagnostic ignored "-Wunused-variable"
40 #endif
41 
42 #include <algorithm>
43 #include <cassert>
44 #include <chrono>
45 #include <cmath>
46 #include <complex>
47 #include <cstdlib>
48 #include <cstring>
49 #include <ctime>
50 #include <exception>
51 #include <fstream>
52 #include <functional>
53 #include <initializer_list>
54 #include <iomanip>
55 #include <iostream>
56 #include <iterator>
57 #include <limits>
58 #include <numeric>
59 #include <ostream>
60 #include <random>
61 #include <sstream>
62 #include <stdexcept>
63 #include <string>
64 #include <tuple>
65 #include <type_traits>
66 #include <utility>
67 #include <vector>
68 
69 #include <Eigen/Dense>
70 #include <Eigen/SVD>
71 
72 // pre-processor macros, make them visible to the whole library
73 #include "macros.h"
74 
75 // do not change the order in this group, inter-dependencies
76 #include "types.h"
77 #include "classes/exception.h"
78 #include "constants.h"
79 #include "traits.h"
80 #include "classes/idisplay.h"
81 #include "internal/util.h"
83 #include "input_output.h"
84 
85 // do not change the order in this group, inter-dependencies
87 #include "classes/init.h"
88 #include "functions.h"
89 #include "classes/codes.h"
90 #include "classes/gates.h"
91 #include "classes/states.h"
92 #include "classes/random_devices.h"
93 
94 // do not change the order in this group, inter-dependencies
95 #include "statistics.h"
96 #include "operations.h"
97 #include "entropies.h"
98 #include "entanglement.h"
99 
100 // the ones below can be in any order, no inter-dependencies
101 #include "random.h"
102 #include "classes/timer.h"
103 #include "instruments.h"
104 #include "number_theory.h"
105 
110 namespace qpp
111 {
112 
118 static const Init& init = Init::get_instance();
119 
125 static const Codes& codes = Codes::get_instance();
126 
132 static const Gates& gt = Gates::get_instance();
133 
139 static const States& st = States::get_instance();
140 
149 #ifdef _NO_THREAD_LOCAL
150 static RandomDevices& rdevs = RandomDevices::get_instance();
151 #else
152 thread_local static RandomDevices& rdevs =
154 #endif // _NO_THREAD_LOCAL
155 
156 } /* namespace qpp */
157 
158 #endif /* QPP_H_ */
static thread_local RandomDevices & get_thread_local_instance() noexcept(std::is_nothrow_constructible< RandomDevices >::value)
Definition: singleton.h:102
Singleton pattern via CRTP.
Type aliases.
Initialization.
Entanglement functions.
Constants.
Quantum++ main namespace.
Definition: codes.h:30
Quantum operation functions.
Number theory functions.
Quantum states.
Type traits.
Timing.
Statistics functions.
Exceptions.
Preprocessor macros.
Measurement functions.
Input/output manipulators.
Input/output functions.
Entropy functions.
Internal utility functions.
Generic quantum computing functions.
Random devices.
static const Init & get_instance() noexcept(std::is_nothrow_constructible< const Init >::value)
Definition: singleton.h:90
Quantum error correcting codes.
Randomness-related functions.
Quantum gates.
Display interface via the non-virtual interface (NVI)