Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ This project adheres to [Semantic Versioning], with the exception that minor rel

## [Unreleased]

## [3.1.3] - 2025-05-28

### Fixed

- 馃悰 Fix the CD pipeline by changing the statistics struct in the zoned neutral atom compiler ([#661]) ([**@ystade**])

## [3.1.2] - 2025-05-27

### Fixed
Expand Down Expand Up @@ -63,7 +69,8 @@ _馃摎 Refer to the [GitHub Release Notes] for previous changelogs._

<!-- Version links -->

[unreleased]: https://github.com/munich-quantum-toolkit/qmap/compare/v3.1.2...HEAD
[unreleased]: https://github.com/munich-quantum-toolkit/qmap/compare/v3.1.3...HEAD
[3.1.3]: https://github.com/munich-quantum-toolkit/qmap/compare/v3.1.2...v3.1.3
[3.1.2]: https://github.com/munich-quantum-toolkit/qmap/compare/v3.1.1...v3.1.2
[3.1.1]: https://github.com/munich-quantum-toolkit/qmap/compare/v3.1.0...v3.1.1
[3.1.0]: https://github.com/munich-quantum-toolkit/qmap/compare/v3.0.0...v3.1.0
Expand All @@ -72,6 +79,7 @@ _馃摎 Refer to the [GitHub Release Notes] for previous changelogs._

<!-- PR links -->

[#661]: https://github.com/munich-quantum-toolkit/qmap/pulls/661
[#660]: https://github.com/munich-quantum-toolkit/qmap/pulls/660
[#659]: https://github.com/munich-quantum-toolkit/qmap/pulls/659
[#624]: https://github.com/munich-quantum-toolkit/qmap/pulls/624
Expand Down
58 changes: 30 additions & 28 deletions include/na/zoned/Compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@ class Compiler : protected Scheduler,
* of the compiler.
*/
struct Config {
/// Configuration for the scheduler
typename Scheduler::Config schedulerConfig{};
/// Configuration for the reuse analyzer
typename ReuseAnalyzer::Config reuseAnalyzerConfig{};
/// Configuration for the placer
typename Placer::Config placerConfig{};
/// Configuration for the router
typename Router::Config routerConfig{};
/// Configuration for the code generator
typename CodeGenerator::Config codeGeneratorConfig{};
/// Log level for the compiler
spdlog::level::level_enum logLevel = spdlog::level::info;
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Config, schedulerConfig,
reuseAnalyzerConfig,
Expand All @@ -73,12 +79,12 @@ class Compiler : protected Scheduler,
* different components.
*/
struct Statistics {
std::chrono::microseconds schedulingTime;
std::chrono::microseconds reuseAnalysisTime;
std::chrono::microseconds placementTime;
std::chrono::microseconds routingTime;
std::chrono::microseconds codeGenerationTime;
std::chrono::microseconds totalTime;
int64_t schedulingTime; ///< Time taken for scheduling in us
int64_t reuseAnalysisTime; ///< Time taken for reuse analysis in us
int64_t placementTime; ///< Time taken for placement in us
int64_t routingTime; ///< Time taken for routing in us
int64_t codeGenerationTime; ///< Time taken for code generation in us
int64_t totalTime; ///< Total time taken for the compilation in us
NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE(Statistics, schedulingTime,
reuseAnalysisTime,
placementTime, routingTime,
Expand Down Expand Up @@ -162,9 +168,9 @@ class Compiler : protected Scheduler,
const auto& twoQubitGateLayers = schedule.second;
statistics_.schedulingTime =
std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now() - schedulingStart);
SPDLOG_INFO("Time for scheduling: {}us",
statistics_.schedulingTime.count());
std::chrono::system_clock::now() - schedulingStart)
.count();
SPDLOG_INFO("Time for scheduling: {}us", statistics_.schedulingTime);
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_DEBUG
SPDLOG_DEBUG("Number of single-qubit gate layers: {}",
singleQubitGateLayers.size());
Expand Down Expand Up @@ -192,39 +198,43 @@ class Compiler : protected Scheduler,
const auto& reuseQubits = SELF.analyzeReuse(twoQubitGateLayers);
statistics_.reuseAnalysisTime =
std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now() - reuseAnalysisStart);
SPDLOG_INFO("Time for reuse analysis: {}us",
statistics_.reuseAnalysisTime.count());
std::chrono::system_clock::now() - reuseAnalysisStart)
.count();
SPDLOG_INFO("Time for reuse analysis: {}us", statistics_.reuseAnalysisTime);

const auto& placementStart = std::chrono::system_clock::now();
const auto& placement =
SELF.place(qComp.getNqubits(), twoQubitGateLayers, reuseQubits);
statistics_.placementTime =
std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now() - placementStart);
SPDLOG_INFO("Time for placement: {}us", statistics_.placementTime.count());
std::chrono::system_clock::now() - placementStart)
.count();
SPDLOG_INFO("Time for placement: {}us", statistics_.placementTime);

const auto& routingStart = std::chrono::system_clock::now();
const auto& routing = SELF.route(placement);
statistics_.routingTime =
std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now() - routingStart);
SPDLOG_INFO("Time for routing: {}us", statistics_.routingTime.count());
std::chrono::system_clock::now() - routingStart)
.count();
SPDLOG_INFO("Time for routing: {}us", statistics_.routingTime);

const auto& codeGenerationStart = std::chrono::system_clock::now();
NAComputation code =
SELF.generate(singleQubitGateLayers, placement, routing);
assert(code.validate().first);
statistics_.codeGenerationTime =
std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now() - codeGenerationStart);
std::chrono::system_clock::now() - codeGenerationStart)
.count();
SPDLOG_INFO("Time for code generation: {}us",
statistics_.codeGenerationTime.count());
statistics_.codeGenerationTime);

statistics_.totalTime =
std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now() - schedulingStart);
SPDLOG_INFO("Total time: {}us", statistics_.totalTime.count());
std::chrono::system_clock::now() - schedulingStart)
.count();
SPDLOG_INFO("Total time: {}us", statistics_.totalTime);
return code;
}
/// @return the statistics collected during the compilation process.
Expand Down Expand Up @@ -256,11 +266,3 @@ class RoutingAwareCompiler final
: Compiler(architecture) {}
};
} // namespace na::zoned

NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<std::chrono::microseconds> {
static void to_json(json& j, const std::chrono::microseconds& ms) {
j = ms.count();
}
};
NLOHMANN_JSON_NAMESPACE_END
5 changes: 2 additions & 3 deletions src/na/zoned/reuse_analyzer/VertexMatchingReuseAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
#include <cassert>
#include <cstddef>
#include <deque>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
Expand Down Expand Up @@ -166,7 +164,8 @@ auto VertexMatchingReuseAnalyzer::maximumBipartiteMatching(
for (std::size_t freeSource = 0; freeSource < freeSources.size();
++freeSource) {
if (freeSources[freeSource]) {
std::stack stack(std::deque{freeSource});
std::stack<std::size_t, std::deque<std::size_t>> stack(
std::deque<std::size_t>{freeSource});
// this vector tracks the predecessors of each source, i.e., the sink
// AND the source coming before the source in the augmenting path
std::vector<std::optional<std::pair<std::size_t, std::size_t>>> parents(
Expand Down