Skip to content

Commit

Permalink
Update/clean headers
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Sep 4, 2023
1 parent aefba6d commit ebc7265
Show file tree
Hide file tree
Showing 65 changed files with 90 additions and 135 deletions.
2 changes: 1 addition & 1 deletion include/common/complex16x2simd.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a SIMD implementation of the double precision complex type.
// The API is designed to (almost entirely) mirror that of the C++ standard library
Expand Down
2 changes: 1 addition & 1 deletion include/common/complex8x2simd.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a SIMD implementation of the float precision complex type.
// The API is designed to (almost entirely) mirror that of the C++ standard library
Expand Down
2 changes: 1 addition & 1 deletion include/common/cuda_kernels.cuh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand Down
5 changes: 1 addition & 4 deletions include/common/cudaengine.cuh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand All @@ -12,8 +12,6 @@

#pragma once

#define _USE_MATH_DEFINES

#include "oclapi.hpp"

#if !ENABLE_CUDA
Expand All @@ -22,7 +20,6 @@

#include <cuda_runtime.h>

#include <map>
#include <memory>
#include <mutex>
#include <vector>
Expand Down
4 changes: 1 addition & 3 deletions include/common/dispatchqueue.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand All @@ -20,8 +20,6 @@
#error PTHREAD or QUNIT_CPU_PARALLEL has not been enabled
#endif

#define _USE_MATH_DEFINES

#include <condition_variable>
#include <functional>
#include <future>
Expand Down
2 changes: 1 addition & 1 deletion include/common/oclapi.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand Down
6 changes: 2 additions & 4 deletions include/common/oclengine.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand All @@ -12,8 +12,6 @@

#pragma once

#define _USE_MATH_DEFINES

#include "oclapi.hpp"

#if !ENABLE_OPENCL
Expand All @@ -24,12 +22,12 @@
#include <direct.h>
#endif

#include <cstdint>
#include <map>
#include <memory>
#include <mutex>
#include <string>
#include <sys/stat.h>
#include <sys/types.h>

#if defined(__APPLE__)
#define CL_SILENCE_DEPRECATION
Expand Down
5 changes: 1 addition & 4 deletions include/common/parallel_for.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand All @@ -14,9 +14,6 @@

#include "qrack_functions.hpp"

#include <set>
#include <vector>

namespace Qrack {

class ParallelFor {
Expand Down
2 changes: 1 addition & 1 deletion include/common/qrack_functions.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand Down
11 changes: 2 additions & 9 deletions include/common/qrack_types.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand Down Expand Up @@ -63,21 +63,18 @@ typedef half_float::half real1;
typedef float real1_f;
typedef float real1_s;
#endif
} // namespace Qrack
#elif FPPOW < 6
namespace Qrack {
typedef std::complex<float> complex;
typedef float real1;
typedef float real1_f;
typedef float real1_s;
} // namespace Qrack
#elif FPPOW < 7
namespace Qrack {
typedef std::complex<double> complex;
typedef double real1;
typedef double real1_f;
typedef double real1_s;
} // namespace Qrack
#else
#include <boost/multiprecision/float128.hpp>
#include <quadmath.h>
Expand All @@ -86,12 +83,8 @@ typedef std::complex<boost::multiprecision::float128> complex;
typedef boost::multiprecision::float128 real1;
typedef boost::multiprecision::float128 real1_f;
typedef double real1_s;
// Minimum representable difference from 1
} // namespace Qrack
#endif

namespace Qrack {

#if UINTPOW < 4
constexpr uint8_t ONE_BCI = 1U;
#define bitCapIntOcl uint8_t
Expand Down Expand Up @@ -128,7 +121,7 @@ constexpr bitLenInt bitsInCap = ((bitLenInt)1U) << (QBCAPPOW + 3U);

typedef std::shared_ptr<complex> BitOp;

/** Called once per value between begin and end. */
// Called once per value between begin and end.
typedef std::function<void(const bitCapIntOcl&, const unsigned& cpu)> ParallelFunc;
typedef std::function<bitCapIntOcl(const bitCapIntOcl&)> IncrementFunc;
typedef std::function<bitCapInt(const bitCapInt&)> BdtFunc;
Expand Down
2 changes: 1 addition & 1 deletion include/common/rdrandwrapper.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This class allows access to on-chip RNG capabilities. The class is adapted from these two sources:
// https://codereview.stackexchange.com/questions/147656/checking-if-cpu-supports-rdrand/150230
Expand Down
4 changes: 1 addition & 3 deletions include/hamiltonian.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand All @@ -13,8 +13,6 @@

#include "common/qrack_types.hpp"

#include <vector>

struct _QrackTimeEvolveOpHeader {
unsigned target;
unsigned controlLen;
Expand Down
12 changes: 12 additions & 0 deletions include/mpsshard.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
// phase, to leverage what advantages classical emulation of qubits can have.
//
// Licensed under the GNU Lesser General Public License V3.
// See LICENSE.md in the project root or https://www.gnu.org/licenses/lgpl-3.0.en.html
// for details.

#pragma once
#include "common/qrack_functions.hpp"

Expand Down
2 changes: 1 addition & 1 deletion include/qalu.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2022. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand Down
2 changes: 1 addition & 1 deletion include/qbdt.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// QBinaryDecision tree is an alternative approach to quantum state representation, as
// opposed to state vector representation. This is a compressed form that can be
Expand Down
2 changes: 1 addition & 1 deletion include/qbdt_node.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// QBinaryDecision tree is an alternative approach to quantum state representation, as
// opposed to state vector representation. This is a compressed form that can be
Expand Down
2 changes: 1 addition & 1 deletion include/qbdt_node_interface.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// QBinaryDecision tree is an alternative approach to quantum state representation, as
// opposed to state vector representation. This is a compressed form that can be
Expand Down
2 changes: 1 addition & 1 deletion include/qengine_cpu.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand Down
8 changes: 3 additions & 5 deletions include/qengine_cuda.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand All @@ -12,17 +12,15 @@

#pragma once

#include "common/cudaengine.cuh"
#include "qengine.hpp"
#include "qengine_gpu_util.hpp"

#if !ENABLE_CUDA
#error CUDA has not been enabled
#endif

#include "common/cudaengine.cuh"
#include "qengine.hpp"

#include <list>
#include <mutex>

#define BCI_ARG_LEN 10
#define CMPLX_NORM_LEN 6
Expand Down
2 changes: 1 addition & 1 deletion include/qengine_gpu_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#pragma once

#include "common/qrack_types.hpp"
#include <string>

namespace Qrack {

Expand Down
7 changes: 3 additions & 4 deletions include/qengine_opencl.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand All @@ -12,15 +12,14 @@

#pragma once

#include "common/oclengine.hpp"
#include "qengine.hpp"
#include "qengine_gpu_util.hpp"

#if !ENABLE_OPENCL
#error OpenCL has not been enabled
#endif

#include "common/oclengine.hpp"
#include "qengine.hpp"

#include <list>
#include <mutex>

Expand Down
2 changes: 1 addition & 1 deletion include/qengineshard.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// QEngineShard is the atomic qubit unit of the QUnit mapper. "PhaseShard" optimizations are basically just a very
// specific "gate fusion" type optimization, where multiple gates are composed into single product gates before
Expand Down
2 changes: 1 addition & 1 deletion include/qfactory.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand Down
2 changes: 1 addition & 1 deletion include/qhybrid.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand Down
3 changes: 1 addition & 2 deletions include/qinterface.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2022. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand All @@ -18,7 +18,6 @@

#include <map>
#include <random>
#include <vector>

#if ENABLE_UINT128
#include <ostream>
Expand Down
2 changes: 1 addition & 1 deletion include/qpager.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2022. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand Down
2 changes: 1 addition & 1 deletion include/qparity.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2022. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// This is a multithreaded, universal quantum register simulation, allowing
// (nonphysical) register cloning and direct measurement of probability and
Expand Down
4 changes: 1 addition & 3 deletions include/qstabilizer.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////////////
//
// (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
// (C) Daniel Strano and the Qrack contributors 2017-2023. All rights reserved.
//
// Adapted from:
//
Expand All @@ -26,8 +26,6 @@

#include "qinterface.hpp"

#include <cstdint>

namespace Qrack {

struct AmplitudeEntry {
Expand Down
Loading

0 comments on commit ebc7265

Please sign in to comment.