Quantum++  v0.8.2
C++11 quantum computing library
qpp.h
Go to the documentation of this file.
1 /*
2  * Quantum++
3  *
4  * Copyright (c) 2013 - 2015 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 <chrono>
44 #include <cmath>
45 #include <complex>
46 #include <cstdlib>
47 #include <cstring>
48 #include <ctime>
49 #include <exception>
50 #include <fstream>
51 #include <functional>
52 #include <initializer_list>
53 #include <iomanip>
54 #include <iostream>
55 #include <iterator>
56 #include <limits>
57 #include <numeric>
58 #include <ostream>
59 #include <random>
60 #include <sstream>
61 #include <stdexcept>
62 #include <string>
63 #include <tuple>
64 #include <type_traits>
65 #include <utility>
66 #include <vector>
67 
68 #include <Eigen/Dense>
69 #include <Eigen/SVD>
70 
71 // do not change the order in this group, inter-dependencies
72 #include "types.h"
73 #include "classes/exception.h"
74 #include "constants.h"
75 #include "traits.h"
76 #include "classes/idisplay.h"
77 #include "internal/util.h"
79 #include "input_output.h"
80 
81 // do not change the order in this group, inter-dependencies
83 #include "classes/init.h"
84 #include "functions.h"
85 #include "classes/codes.h"
86 #include "classes/gates.h"
87 #include "classes/states.h"
88 #include "classes/random_devices.h"
89 
90 // do not change the order in this group, inter-dependencies
91 #include "statistics.h"
92 #include "operations.h"
93 #include "entropies.h"
94 #include "entanglement.h"
95 
96 // the ones below can be in any order, no inter-dependencies
97 #include "random.h"
98 #include "classes/timer.h"
99 #include "instruments.h"
100 #include "number_theory.h"
101 
102 
107 namespace qpp
108 {
109 
115 static const Init& init = Init::get_instance();
116 
122 static const Codes& codes = Codes::get_instance();
123 
129 static const Gates& gt = Gates::get_instance();
130 
136 static const States& st = States::get_instance();
137 
146 #ifndef _NO_THREAD_LOCAL
147 thread_local static RandomDevices& rdevs =
149 #else
150 static RandomDevices& rdevs =
152 #endif // _NO_THREAD_LOCAL
153 
154 } /* namespace qpp */
155 
156 #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.
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)