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: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ repos:

# Python linting using ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.9
rev: v0.9.10
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down Expand Up @@ -86,11 +86,11 @@ repos:
- pytest
- rustworkx
- mqt.qcec
- mqt.core>=3.0.0b5
- mqt.core>=3.0.0b7

# Check for spelling
- repo: https://github.com/crate-ci/typos
rev: v1.30.0
rev: v1.30.2
hooks:
- id: typos

Expand Down Expand Up @@ -135,14 +135,14 @@ repos:

# Check JSON schemata
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.31.2
rev: 0.31.3
hooks:
- id: check-dependabot
- id: check-github-workflows
- id: check-readthedocs

# Check the pyproject.toml file
- repo: https://github.com/henryiii/validate-pyproject-schema-store
rev: 2025.02.24
rev: 2025.03.10
hooks:
- id: validate-pyproject
18 changes: 1 addition & 17 deletions cmake/ExternalDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ endif()
# cmake-format: off
set(MQT_CORE_VERSION 3.0.0
CACHE STRING "MQT Core version")
set(MQT_CORE_REV "c2701a0747781eeca43b71dec43ffb0531022a51"
set(MQT_CORE_REV "b7c3cfc9b94df6a7a5f9ba217ffcbf58e56dbc67"
CACHE STRING "MQT Core identifier (tag, branch or commit hash)")
set(MQT_CORE_REPO_OWNER "cda-tum"
CACHE STRING "MQT Core repository owner (change when using a fork)")
Expand Down Expand Up @@ -135,21 +135,5 @@ if(BUILD_MQT_QMAP_BINDINGS)
endif()
endif()

# Add YAML-CPP as a dependency.
set(YAML_VERSION
0.8.0
CACHE STRING "YAML-CPP version")
set(YAML_URL https://github.com/jbeder/yaml-cpp/archive/refs/tags/${YAML_VERSION}.tar.gz)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
FetchContent_Declare(yaml-cpp URL ${YAML_URL} FIND_PACKAGE_ARGS ${YAML_VERSION})
list(APPEND FETCH_PACKAGES yaml-cpp)
else()
find_package(yaml-cpp ${YAML_VERSION} QUIET)
if(NOT yaml-cpp_FOUND)
FetchContent_Declare(yaml-cpp URL ${YAML_URL})
list(APPEND FETCH_PACKAGES yaml-cpp)
endif()
endif()

# Make all declared dependencies available.
FetchContent_MakeAvailable(${FETCH_PACKAGES})
9 changes: 5 additions & 4 deletions include/hybridmap/MoveToAodConverter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "ir/QuantumComputation.hpp"
#include "ir/operations/AodOperation.hpp"
#include "ir/operations/OpType.hpp"
#include "na/NADefinitions.hpp"
#include "na/entities/Location.hpp"

#include <cstdint>
#include <memory>
Expand Down Expand Up @@ -137,7 +137,7 @@ class MoveToAodConverter {
*/
void
addActivation(std::pair<ActivationMergeType, ActivationMergeType> merge,
const Point& origin, const AtomMove& move, MoveVector v);
const Location& origin, const AtomMove& move, MoveVector v);
/**
* @brief Merges the given activation into the current activations
* @param dim The dimension/direction of the activation
Expand Down Expand Up @@ -202,8 +202,9 @@ class MoveToAodConverter {
[[nodiscard]] static std::pair<ActivationMergeType, ActivationMergeType>
canAddActivation(const AodActivationHelper& activationHelper,
const AodActivationHelper& deactivationHelper,
const Point& origin, const MoveVector& v, const Point& final,
const MoveVector& vReverse, Dimension dim);
const Location& origin, const MoveVector& v,
const Location& final, const MoveVector& vReverse,
Dimension dim);

/**
* @brief Move operations within a move group can be executed in parallel
Expand Down
35 changes: 16 additions & 19 deletions include/hybridmap/NeutralAtomArchitecture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include "hybridmap/NeutralAtomDefinitions.hpp"
#include "hybridmap/NeutralAtomUtils.hpp"
#include "ir/operations/OpType.hpp"
#include "ir/operations/Operation.hpp"
#include "na/NADefinitions.hpp"
#include "na/entities/Location.hpp"

#include <cstddef>
#include <cstdint>
Expand Down Expand Up @@ -145,7 +144,7 @@ class NeutralAtomArchitecture {
Properties properties{};
Parameters parameters;

std::vector<Point> coordinates;
std::vector<Location> coordinates;
qc::SymmetricMatrix<SwapDistance> swapDistances;
std::vector<std::set<CoordIndex>> nearbyCoordinates;

Expand Down Expand Up @@ -265,8 +264,8 @@ class NeutralAtomArchitecture {
* @param c2 The second coordinate
* @return The swap distance between the two coordinates
*/
[[nodiscard]] SwapDistance getSwapDistance(const Point& c1,
const Point& c2) const {
[[nodiscard]] SwapDistance getSwapDistance(const Location& c1,
const Location& c2) const {
return swapDistances(
static_cast<size_t>(c1.x + c1.y) * properties.getNcolumns(),
static_cast<size_t>(c2.x + c2.y) * properties.getNcolumns());
Expand Down Expand Up @@ -363,15 +362,15 @@ class NeutralAtomArchitecture {
* @param idx The index
* @return The coordinate corresponding to the index
*/
[[nodiscard]] Point getCoordinate(CoordIndex idx) const {
[[nodiscard]] Location getCoordinate(CoordIndex idx) const {
return coordinates[idx];
}
/**
* @brief Get the index corresponding to a coordinate
* @param c The coordinate
* @return The index corresponding to the coordinate
*/
[[nodiscard]] [[maybe_unused]] CoordIndex getIndex(const Point& c) {
[[nodiscard]] [[maybe_unused]] CoordIndex getIndex(const Location& c) {
return static_cast<CoordIndex>(c.x + c.y * properties.getNcolumns());
}

Expand All @@ -384,27 +383,26 @@ class NeutralAtomArchitecture {
*/
[[nodiscard]] qc::fp getEuclideanDistance(const CoordIndex idx1,
const CoordIndex idx2) const {
return static_cast<qc::fp>(this->coordinates.at(idx1).getEuclideanDistance(
this->coordinates.at(idx2)));
return coordinates.at(idx1).getEuclideanDistance(coordinates.at(idx2));
}
/**
* @brief Get the Euclidean distance between two coordinates
* @param c1 The first coordinate
* @param c2 The second coordinate
* @return The Euclidean distance between the two coordinates
*/
[[nodiscard]] static qc::fp getEuclideanDistance(const Point& c1,
const Point& c2) {
return static_cast<qc::fp>(c1.getEuclideanDistance(c2));
[[nodiscard]] static qc::fp getEuclideanDistance(const Location& c1,
const Location& c2) {
return c1.getEuclideanDistance(c2);
}
/**
* @brief Get the Manhattan distance between two coordinate indices
* @param idx1 The index of the first coordinate
* @param idx2 The index of the second coordinate
* @return The Manhattan distance between the two coordinate indices
*/
[[nodiscard]] CoordIndex getManhattanDistanceX(CoordIndex idx1,
CoordIndex idx2) const {
[[nodiscard]] CoordIndex getManhattanDistanceX(const CoordIndex idx1,
const CoordIndex idx2) const {
return static_cast<CoordIndex>(
this->coordinates.at(idx1).getManhattanDistanceX(
this->coordinates.at(idx2)));
Expand All @@ -415,11 +413,10 @@ class NeutralAtomArchitecture {
* @param idx2 The index of the second coordinate
* @return The Manhattan distance between the two coordinate indices
*/
[[nodiscard]] CoordIndex getManhattanDistanceY(CoordIndex idx1,
CoordIndex idx2) const {
[[nodiscard]] CoordIndex getManhattanDistanceY(const CoordIndex idx1,
const CoordIndex idx2) const {
return static_cast<CoordIndex>(
this->coordinates.at(idx1).getManhattanDistanceY(
this->coordinates.at(idx2)));
coordinates.at(idx1).getManhattanDistanceY(coordinates.at(idx2)));
}

// Nearby coordinates
Expand All @@ -429,7 +426,7 @@ class NeutralAtomArchitecture {
* @return The precomputed nearby coordinates for the coordinate index
*/
[[nodiscard]] std::set<CoordIndex>
getNearbyCoordinates(CoordIndex idx) const {
getNearbyCoordinates(const CoordIndex idx) const {
return nearbyCoordinates[idx];
}
/**
Expand Down
2 changes: 2 additions & 0 deletions include/na/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Checks: |
modernize-use-trailing-return-type
4 changes: 2 additions & 2 deletions include/na/nalac/NAGraphAlgorithms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <utility>
#include <vector>

namespace na {
namespace na::nalac {

using Color = std::uint16_t;
using Edge = std::pair<qc::Qubit, qc::Qubit>;
Expand Down Expand Up @@ -159,4 +159,4 @@ class NAGraphAlgorithms {
-> std::pair<std::vector<std::unordered_map<qc::Qubit, std::int64_t>>,
std::unordered_map<qc::Qubit, std::int64_t>>;
};
} // namespace na
} // namespace na::nalac
21 changes: 11 additions & 10 deletions include/na/nalac/NAMapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "Definitions.hpp"
#include "ir/QuantumComputation.hpp"
#include "ir/operations/Operation.hpp"
#include "na/Architecture.hpp"
#include "na/Configuration.hpp"
#include "na/NAComputation.hpp"
#include "na/NADefinitions.hpp"
#include "na/nalac/datastructures/Architecture.hpp"
#include "na/nalac/datastructures/Configuration.hpp"
#include "na/nalac/datastructures/NAComputation.hpp"
#include "na/nalac/datastructures/NADefinitions.hpp"

#include <cstddef>
#include <cstdint>
Expand All @@ -25,7 +25,7 @@
#include <utility>
#include <vector>

namespace na {
namespace na::nalac {

class NAMapper {
public:
Expand Down Expand Up @@ -73,8 +73,8 @@ class NAMapper {
PositionStatus positionStatus = PositionStatus::UNDEFINED;
std::shared_ptr<Point> initialPosition = std::make_shared<Point>(0, 0);
std::shared_ptr<Point> currentPosition = initialPosition;
std::vector<Zone> zones;
explicit Atom(const std::vector<Zone>& z = {}) : zones(z) {};
std::vector<std::size_t> zones;
explicit Atom(const std::vector<std::size_t>& z = {}) : zones(z) {};
};
auto preprocess() -> void { validateCircuit(); }
auto validateCircuit() -> void;
Expand Down Expand Up @@ -107,7 +107,8 @@ class NAMapper {
auto store(std::vector<bool>& initialFreeSites,
std::vector<bool>& currentFreeSites, std::vector<Atom>& placement,
std::unordered_set<qc::Qubit>& currentlyShuttling,
const std::vector<qc::Qubit>& qubits, Zone destination) -> void;
const std::vector<qc::Qubit>& qubits, std::size_t destination)
-> void;
/**
* @brief Picks up atom in the initial zone as a preparation for moving it to
* the entangling zone.
Expand Down Expand Up @@ -137,11 +138,11 @@ class NAMapper {
}
return mappedQc;
}
[[nodiscard]] auto getStats() const -> const na::NAMapper::Statistics& {
[[nodiscard]] auto getStats() const -> const Statistics& {
if (!done) {
throw std::logic_error("No statistics available.");
}
return stats;
}
};
} // namespace na
} // namespace na::nalac
Loading
Loading