Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏁 Windows Support #266

Merged
merged 15 commits into from
Sep 10, 2024
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
8 changes: 7 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ on:
paths:
- .github/workflows/cd.yml

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
python-packaging:
name: 🐍 Packaging
uses: ./.github/workflows/reusable-python-packaging.yml
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.3

deploy:
if: github.event_name == 'release' && github.event.action == 'published'
Expand All @@ -35,3 +39,5 @@ jobs:
with:
subject-path: "dist/*"
- uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: 🇨‌ Test
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
uses: ./.github/workflows/reusable-cpp-ci.yml
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.3

cpp-linter:
name: 🇨‌ Lint
Expand All @@ -32,7 +32,9 @@ jobs:
name: 🐍 Test
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-python-tests)
uses: ./.github/workflows/reusable-python-ci.yml
uses: cda-tum/mqt-workflows/.github/workflows/[email protected]
with:
skip-testing-latest-python: true

code-ql:
name: 📝 CodeQL
Expand Down
75 changes: 0 additions & 75 deletions .github/workflows/reusable-cpp-ci.yml

This file was deleted.

105 changes: 0 additions & 105 deletions .github/workflows/reusable-python-ci.yml

This file was deleted.

59 changes: 0 additions & 59 deletions .github/workflows/reusable-python-packaging.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ repos:
rev: v1.11.2
hooks:
- id: mypy
files: ^(src/mqt|test/python)
exclude: "code_construction* | ^data_utils\\.py$"
files: ^(src/mqt|test/python|noxfile.py)
args: []
additional_dependencies:
- nox
- numpy
- pytest
- pytest-mock
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ if(BUILD_MQT_QECC_BINDINGS)
ON
CACHE BOOL "Prevent multiple searches for Python and instead cache the results.")

if(DISABLE_GIL)
message(STATUS "Disabling Python GIL")
add_compile_definitions(Py_GIL_DISABLED)
endif()

# top-level call to find Python
find_package(
Python 3.8 REQUIRED
Python 3.9 REQUIRED
COMPONENTS Interpreter Development.Module
OPTIONAL_COMPONENTS Development.SABIModule)
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/ExternalDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if(BUILD_MQT_QECC_BINDINGS)
endif()

# add pybind11 library
find_package(pybind11 2.13 CONFIG REQUIRED)
find_package(pybind11 2.13.5 CONFIG REQUIRED)
endif()

# cmake-format: off
Expand Down
16 changes: 8 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"typing_extensions": ("https://typing-extensions.readthedocs.io/en/latest/", None),
"qiskit": ("https://qiskit.org/documentation/", None),
"mqt": ("https://mqt.readthedocs.io/en/latest/", None),
"core": ("https://mqt.readthedocs.io/projects/core/en/latest/", None),
"ddsim": ("https://mqt.readthedocs.io/projects/ddsim/en/latest/", None),
"qcec": ("https://mqt.readthedocs.io/projects/qcec/en/latest/", None),
"qmap": ("https://mqt.readthedocs.io/projects/qmap/en/latest/", None),
"syrec": ("https://mqt.readthedocs.io/projects/syrec/en/latest/", None),
"typing_extensions": ("https://typing-extensions.readthedocs.io/en/latest", None),
"qiskit": ("https://qiskit.org/documentation", None),
"mqt": ("https://mqt.readthedocs.io/en/latest", None),
"core": ("https://mqt.readthedocs.io/projects/core/en/latest", None),
"ddsim": ("https://mqt.readthedocs.io/projects/ddsim/en/latest", None),
"qcec": ("https://mqt.readthedocs.io/projects/qcec/en/latest", None),
"qmap": ("https://mqt.readthedocs.io/projects/qmap/en/latest", None),
"syrec": ("https://mqt.readthedocs.io/projects/syrec/en/latest", None),
}

nbsphinx_execute = "auto"
Expand Down
43 changes: 20 additions & 23 deletions include/Code.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,34 +71,31 @@ struct ParityCheckMatrix {
* @return a list of node indices of adjacent nodes
*/
std::vector<std::size_t> getNbrs(const std::size_t& nodeIdx) {
std::vector<std::size_t> result;
if (auto it = nbrCache.find(nodeIdx); it != nbrCache.end()) {
result = it->second;
} else {
if (pcm->empty() || pcm->front().empty()) {
std::cerr << "error getting nbrs for node " << nodeIdx << '\n';
throw QeccException("Cannot return neighbours, pcm empty");
}
const auto nrChecks = pcm->size();
const auto nrBits = pcm->front().size();
std::vector<std::size_t> res;
if (nodeIdx < nrBits) {
for (std::size_t i = 0; i < nrChecks; i++) {
if (pcm->at(i).at(nodeIdx)) {
res.emplace_back(nrBits + i);
}
return it->second;
}
if (pcm->empty() || pcm->front().empty()) {
std::cerr << "error getting nbrs for node " << nodeIdx << '\n';
throw QeccException("Cannot return neighbours, pcm empty");
}
const auto nrChecks = pcm->size();
const auto nrBits = pcm->front().size();
std::vector<std::size_t> res;
if (nodeIdx < nrBits) {
for (std::size_t i = 0; i < nrChecks; i++) {
if (pcm->at(i).at(nodeIdx)) {
res.emplace_back(nrBits + i);
}
} else {
for (std::size_t i = 0; i < nrBits; i++) {
if (pcm->at(nodeIdx - nrBits).at(i)) {
res.emplace_back(i);
}
}
} else {
for (std::size_t i = 0; i < nrBits; i++) {
if (pcm->at(nodeIdx - nrBits).at(i)) {
res.emplace_back(i);
}
}
const auto ins = nbrCache.try_emplace(nodeIdx, res);
result = ins.first->second;
}
return result;
const auto& ins = nbrCache.try_emplace(nodeIdx, res);
return ins.first->second;
}
[[nodiscard]] json to_json() const { // NOLINT(readability-identifier-naming)
return json{
Expand Down
Loading
Loading