Skip to content

Commit

Permalink
[feature/feature_buildout] Problems with GCC builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesETsmith committed Jun 28, 2024
1 parent 69e7c9a commit 27d3255
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions include/__factory.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef __FAST_PAULI_FACTORY_HPP
#define __FAST_PAULI_FACTORY_HPP

#include <algorithm>
#include <array>
#include <complex>
#include <experimental/mdspan>
Expand Down Expand Up @@ -85,11 +86,13 @@ auto rand(std::vector<T> &blob, std::array<size_t, n_dim> extents) {
if constexpr (is_complex<T>::value) {
std::uniform_real_distribution<typename T::value_type> dis(0, 1.0);

std::ranges::generate(blob, [&]() { return T{dis(gen), dis(gen)}; });
std::generate(blob.begin(), blob.end(), [&]() {
return T{dis(gen), dis(gen)};
});
} else {
std::uniform_real_distribution<T> dis(0, 1.0);

std::ranges::generate(blob, [&]() { return T{dis(gen)}; });
std::generate(blob.begin(), blob.end(), [&]() { return T{dis(gen)}; });
}

return std::mdspan<T, std::dextents<size_t, n_dim>>(blob.data(), extents);
Expand Down
4 changes: 2 additions & 2 deletions include/__pauli.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ struct Pauli {

// Adding specialization to the fmt library so we can easily print Pauli
namespace fmt {
template <> struct fmt::formatter<fast_pauli::Pauli> {
template <> struct formatter<fast_pauli::Pauli> {
constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); }

template <typename FormatContext>
Expand Down Expand Up @@ -190,7 +190,7 @@ template <> struct fmt::formatter<fast_pauli::Pauli> {

// Add complex numbers because they aren't in there already, TODO __pauli.hpp
// may not be the best place for these
template <> struct fmt::formatter<std::complex<double>> {
template <> struct formatter<std::complex<double>> {
constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); }

template <typename FormatContext>
Expand Down
2 changes: 1 addition & 1 deletion include/__pauli_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ std::vector<PauliString> calculate_pauli_strings_max_weight(size_t n_qubits,

namespace fmt {
//
template <> struct fmt::formatter<fast_pauli::PauliString> {
template <> struct formatter<fast_pauli::PauliString> {
constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); }

template <typename FormatContext>
Expand Down

0 comments on commit 27d3255

Please sign in to comment.