From bd533ee4523426c3050bec657ec658339d2c29cd Mon Sep 17 00:00:00 2001 From: Alex McCaskey Date: Thu, 25 Jul 2024 18:22:40 +0000 Subject: [PATCH] clang format Signed-off-by: Alex McCaskey --- cudaqlib/gse.h | 5 ++--- cudaqlib/gse/adapt/adapt.h | 7 ++++--- cudaqlib/gse/utils/pools/spin_complement_gsd.cpp | 1 - cudaqlib/operators/chemistry/MoleculePackageDriver.h | 2 +- cudaqlib/operators/chemistry/molecule.h | 4 ++-- cudaqlib/operators/fermion/fermion_to_spin.h | 1 - cudaqlib/optim/optimizer.h | 2 +- cudaqlib/utils/extension_point.h | 2 +- cudaqlib/utils/library_utils.h | 2 +- tests/gse/AdaptTester.cpp | 2 +- tests/gse/VQETester.cpp | 2 +- tests/optim/OptimTester.cpp | 2 +- 12 files changed, 15 insertions(+), 17 deletions(-) diff --git a/cudaqlib/gse.h b/cudaqlib/gse.h index 774b76b..6a35bda 100644 --- a/cudaqlib/gse.h +++ b/cudaqlib/gse.h @@ -9,8 +9,7 @@ #pragma once #include "gse/adapt/adapt.h" -#include "gse/vqe/vqe.h" #include "gse/utils/operator_pool.h" -#include "gse/utils/pools/uccsd_pool.h" #include "gse/utils/pools/spin_complement_gsd.h" - +#include "gse/utils/pools/uccsd_pool.h" +#include "gse/vqe/vqe.h" diff --git a/cudaqlib/gse/adapt/adapt.h b/cudaqlib/gse/adapt/adapt.h index 51d9f40..25d93fb 100644 --- a/cudaqlib/gse/adapt/adapt.h +++ b/cudaqlib/gse/adapt/adapt.h @@ -35,8 +35,8 @@ struct AdaptKernel { template auto adapt_vqe(const InitialState &initialState, const spin_op &H, - const std::vector &poolList, optim::optimizer &optimizer, - observe_gradient *gradient, + const std::vector &poolList, + optim::optimizer &optimizer, observe_gradient *gradient, const adapt_options options = adapt_options()) { AdaptKernel kernel; @@ -112,7 +112,8 @@ auto adapt_vqe(const InitialState &initialState, const spin_op &H, template auto adapt_vqe(const InitialState &initialState, const spin_op &H, - const std::vector &operatorPool, optim::optimizer &optimizer, + const std::vector &operatorPool, + optim::optimizer &optimizer, const adapt_options options = adapt_options()) { return adapt_vqe(initialState, H, operatorPool, optimizer, nullptr, options); } diff --git a/cudaqlib/gse/utils/pools/spin_complement_gsd.cpp b/cudaqlib/gse/utils/pools/spin_complement_gsd.cpp index 144dc50..6a5d10e 100644 --- a/cudaqlib/gse/utils/pools/spin_complement_gsd.cpp +++ b/cudaqlib/gse/utils/pools/spin_complement_gsd.cpp @@ -19,7 +19,6 @@ std::vector spin_complement_gsd::generate( auto numOrbitals = std::any_cast(iter->second); - std::vector pool; auto numQubits = 2 * numOrbitals; std::vector alphaOrbs, betaOrbs; diff --git a/cudaqlib/operators/chemistry/MoleculePackageDriver.h b/cudaqlib/operators/chemistry/MoleculePackageDriver.h index 181d176..d0f9735 100644 --- a/cudaqlib/operators/chemistry/MoleculePackageDriver.h +++ b/cudaqlib/operators/chemistry/MoleculePackageDriver.h @@ -33,7 +33,7 @@ class MoleculePackageDriver : public extension_point { CUDAQ_DEFINE_EXTENSION_IMPL(MoleculePackageDriver) -#define CUDAQ_REGISTER_MOLECULEPACKAGEDRIVER(TYPE) \ +#define CUDAQ_REGISTER_MOLECULEPACKAGEDRIVER(TYPE) \ static inline const std::string class_identifier = #TYPE; \ static std::unique_ptr create() { \ return std::make_unique(); \ diff --git a/cudaqlib/operators/chemistry/molecule.h b/cudaqlib/operators/chemistry/molecule.h index 396b394..1b72c5f 100644 --- a/cudaqlib/operators/chemistry/molecule.h +++ b/cudaqlib/operators/chemistry/molecule.h @@ -8,8 +8,8 @@ #pragma once -#include "cudaqlib/operators/fermion/fermion_op.h" #include "cudaq/spin_op.h" +#include "cudaqlib/operators/fermion/fermion_op.h" #include @@ -39,7 +39,7 @@ class molecular_geometry { auto begin() const { return atoms.cbegin(); }; auto end() const { return atoms.cend(); } std::string name() const; - static molecular_geometry from_xyz(const std::string& xyzFile); + static molecular_geometry from_xyz(const std::string &xyzFile); }; /// @brief The `molecular_hamiltonian` type holds all the pertinent diff --git a/cudaqlib/operators/fermion/fermion_to_spin.h b/cudaqlib/operators/fermion/fermion_to_spin.h index dd90262..8b1d1a4 100644 --- a/cudaqlib/operators/fermion/fermion_to_spin.h +++ b/cudaqlib/operators/fermion/fermion_to_spin.h @@ -23,7 +23,6 @@ class fermion_to_spin : public extension_point { /// generate an equivalent operator on spins. virtual spin_op generate(const fermion_op &fermionOp) = 0; virtual ~fermion_to_spin() {} - }; CUDAQ_DEFINE_EXTENSION_IMPL(fermion_to_spin) diff --git a/cudaqlib/optim/optimizer.h b/cudaqlib/optim/optimizer.h index e0ed1c9..8d80f0b 100644 --- a/cudaqlib/optim/optimizer.h +++ b/cudaqlib/optim/optimizer.h @@ -139,7 +139,7 @@ class optimizer : public extension_point { CUDAQ_DEFINE_EXTENSION_IMPL(optimizer) -#define CUDAQ_REGISTER_OPTIMIZER(TYPE) \ +#define CUDAQ_REGISTER_OPTIMIZER(TYPE) \ static inline const std::string class_identifier = #TYPE; \ static std::unique_ptr create() { \ return std::make_unique(); \ diff --git a/cudaqlib/utils/extension_point.h b/cudaqlib/utils/extension_point.h index e4a9d41..d921092 100644 --- a/cudaqlib/utils/extension_point.h +++ b/cudaqlib/utils/extension_point.h @@ -48,7 +48,7 @@ class extension_point { #define CONCAT(a, b) CONCAT_INNER(a, b) #define CONCAT_INNER(a, b) a##b -#define CUDAQ_DEFINE_EXTENSION_IMPL(TYPE) \ +#define CUDAQ_DEFINE_EXTENSION_IMPL(TYPE) \ namespace details { \ template \ class CONCAT(TYPE, _impl) : public TYPE { \ diff --git a/cudaqlib/utils/library_utils.h b/cudaqlib/utils/library_utils.h index 86151cf..1319a86 100644 --- a/cudaqlib/utils/library_utils.h +++ b/cudaqlib/utils/library_utils.h @@ -56,4 +56,4 @@ inline static std::string getCUDAQLibraryPath() { return data.path; } -} // namespace cudaq::__internal__ +} // namespace cudaqlib::__internal__ diff --git a/tests/gse/AdaptTester.cpp b/tests/gse/AdaptTester.cpp index 62d421f..8c94aca 100644 --- a/tests/gse/AdaptTester.cpp +++ b/tests/gse/AdaptTester.cpp @@ -9,8 +9,8 @@ #include #include -#include "cudaqlib/gse.h" #include "cudaq.h" +#include "cudaqlib/gse.h" TEST(GSETester, checkSimpleAdapt) { diff --git a/tests/gse/VQETester.cpp b/tests/gse/VQETester.cpp index 4270489..4a3b8a7 100644 --- a/tests/gse/VQETester.cpp +++ b/tests/gse/VQETester.cpp @@ -9,8 +9,8 @@ #include #include -#include "cudaqlib/gse.h" #include "cudaq.h" +#include "cudaqlib/gse.h" TEST(GSETester, checkVqe) { diff --git a/tests/optim/OptimTester.cpp b/tests/optim/OptimTester.cpp index ed07354..a49855f 100644 --- a/tests/optim/OptimTester.cpp +++ b/tests/optim/OptimTester.cpp @@ -9,8 +9,8 @@ #include #include -#include "cudaqlib/optim.h" #include "cudaq.h" +#include "cudaqlib/optim.h" TEST(OptimTester, checkLBFGS) {