Quantum++  v0.7
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 g++ 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 "internal/util.h"
77 #include "input_output.h"
78 
79 // do not change the order in this group, inter-dependencies
81 #include "classes/init.h"
82 #include "functions.h"
83 #include "classes/codes.h"
84 #include "classes/gates.h"
85 #include "classes/states.h"
86 #include "classes/random_devices.h"
87 
88 // do not change the order in this group, inter-dependencies
89 #include "operations.h"
90 #include "entropies.h"
91 #include "entanglement.h"
92 
93 // the ones below can be in any order, no inter-dependencies
94 #include "random.h"
95 #include "classes/timer.h"
96 #include "instruments.h"
97 #include "number_theory.h"
98 
99 
104 namespace qpp
105 {
106 
112 static const Init& init = Init::get_instance();
113 
119 static const Codes& codes = Codes::get_instance();
120 
126 static const Gates& gt = Gates::get_instance();
127 
133 static const States& st = States::get_instance();
134 
143 static thread_local RandomDevices& rdevs =
145 
146 } /* namespace qpp */
147 
148 #endif /* QPP_H_ */
static thread_local RandomDevices & get_thread_local_instance() noexcept(std::is_nothrow_constructible< RandomDevices >::value)
Definition: singleton.h:100
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.
Timing.
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.