Skip to content
Open
Show file tree
Hide file tree
Changes from 105 commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
6fd5af1
qubit size adjustment
svenjeschmitt-ops Nov 3, 2025
8accf50
removing runtime error
svenjeschmitt-ops Nov 10, 2025
f4b0038
change classical varaible
svenjeschmitt-ops Nov 19, 2025
f7f27bd
new adjustments
svenjeschmitt-ops Nov 19, 2025
0cca5ca
adjustment
svenjeschmitt-ops Nov 19, 2025
a5c3eca
adjustment
svenjeschmitt-ops Nov 19, 2025
5222682
work and progress
svenjeschmitt-ops Nov 19, 2025
7e82180
work and progress
svenjeschmitt-ops Nov 19, 2025
e4155c4
amplitude adjustments
svenjeschmitt-ops Nov 24, 2025
64de683
License text
svenjeschmitt-ops Dec 1, 2025
732ca9b
:rocket: new files
svenjeschmitt-ops Dec 1, 2025
1e99c96
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 1, 2025
88de5e5
docstrings
svenjeschmitt-ops Dec 2, 2025
057b5dd
_normalize_value updated
svenjeschmitt-ops Dec 2, 2025
1bed4cc
solving issue
svenjeschmitt-ops Dec 2, 2025
cc2c09b
solved DDSimDebug.cpp
svenjeschmitt-ops Dec 2, 2025
ad1fe09
next problem solved
svenjeschmitt-ops Dec 2, 2025
cd4dba9
last issue solved
svenjeschmitt-ops Dec 2, 2025
c3ca4b9
changement -Any-
svenjeschmitt-ops Dec 2, 2025
e43e740
last adjustment
svenjeschmitt-ops Dec 2, 2025
36fdd37
change_bit
svenjeschmitt-ops Dec 2, 2025
aa92b5f
DDSimDebug changement
svenjeschmitt-ops Dec 2, 2025
051fd1e
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 2, 2025
261d3b0
first CI issue solved
svenjeschmitt-ops Dec 3, 2025
f6a5878
second issue solved
svenjeschmitt-ops Dec 3, 2025
8018667
last adjustments
svenjeschmitt-ops Dec 3, 2025
3dbd364
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 3, 2025
2cd3395
fixed bug
svenjeschmitt-ops Dec 3, 2025
135fd94
adjustements
svenjeschmitt-ops Dec 3, 2025
b50cab1
adjustment checkorthrow
svenjeschmitt-ops Dec 3, 2025
bbc0cbb
Merge branch 'new_adjustments'
svenjeschmitt-ops Dec 3, 2025
ec901ce
linter issue
svenjeschmitt-ops Dec 3, 2025
1d1d848
Merge branch 'new_adjustments'
svenjeschmitt-ops Dec 3, 2025
ebe4cec
fix ci
svenjeschmitt-ops Dec 3, 2025
4b50146
fix lint
svenjeschmitt-ops Dec 3, 2025
465d447
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 3, 2025
50da634
remove permissions workflow
svenjeschmitt-ops Dec 4, 2025
7398f50
non toggle function
svenjeschmitt-ops Dec 4, 2025
ea89e07
bool text adjusted
svenjeschmitt-ops Dec 4, 2025
5d3f383
function names
svenjeschmitt-ops Dec 4, 2025
e8e9f40
dotstrings
svenjeschmitt-ops Dec 4, 2025
ffe1a38
new version
svenjeschmitt-ops Dec 8, 2025
817e49e
github review changes
svenjeschmitt-ops Dec 8, 2025
c6b102f
fix linter
svenjeschmitt-ops Dec 8, 2025
1cefe3e
workflow file, not changed
svenjeschmitt-ops Dec 8, 2025
e10b1a0
highlight error
svenjeschmitt-ops Dec 8, 2025
ceaedcf
highlight error v2
svenjeschmitt-ops Dec 8, 2025
52ad47a
highlight error v3
svenjeschmitt-ops Dec 8, 2025
84c38f1
highlight error v4
svenjeschmitt-ops Dec 8, 2025
0d12f43
higlight error v4
svenjeschmitt-ops Dec 8, 2025
3ca8940
highlight_error
svenjeschmitt-ops Dec 9, 2025
543bd22
big fix
svenjeschmitt-ops Dec 9, 2025
9f13bd2
bug fix
svenjeschmitt-ops Dec 9, 2025
4ff44db
bug fix 2
svenjeschmitt-ops Dec 9, 2025
8e3b801
shows issue
svenjeschmitt-ops Dec 9, 2025
d1c343e
entire row
svenjeschmitt-ops Dec 9, 2025
59680cb
bug fix
svenjeschmitt-ops Dec 9, 2025
5532817
fix bug
svenjeschmitt-ops Dec 10, 2025
b6e4152
linter fix
svenjeschmitt-ops Dec 10, 2025
ac21598
Merge remote-tracking branch 'upstream/main'
svenjeschmitt-ops Dec 13, 2025
3e02a97
work and progress
svenjeschmitt-ops Dec 13, 2025
a7b5ce1
work and progress
svenjeschmitt-ops Dec 13, 2025
c8b03ee
work and progress
svenjeschmitt-ops Dec 13, 2025
59af8a0
Merge branch 'main' into highlight_error
svenjeschmitt-ops Dec 13, 2025
687bc9b
Merge remote-tracking branch 'upstream/main'
svenjeschmitt-ops Dec 16, 2025
ddc8b45
adjusted dotstrings
svenjeschmitt-ops Dec 16, 2025
4e67409
adjusted test_data_retrieval
svenjeschmitt-ops Dec 16, 2025
7308dab
adjusted test_python_bindings
svenjeschmitt-ops Dec 16, 2025
42a4bcf
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 16, 2025
86cc5c9
work and progress
svenjeschmitt-ops Dec 16, 2025
5160144
adjusted test_data_retrieval
svenjeschmitt-ops Dec 16, 2025
7e0c3df
Merge remote-tracking branch 'origin/main' into highlight_error
svenjeschmitt-ops Dec 18, 2025
68a8ffe
highlight issue
svenjeschmitt-ops Dec 18, 2025
a7c6b72
assertion issue solved
svenjeschmitt-ops Dec 18, 2025
8ef979f
assertation issue solved
svenjeschmitt-ops Dec 18, 2025
83e928a
Merge branch 'main' into highlight_error
svenjeschmitt-ops Dec 18, 2025
47edfc0
highlight issue fix bug
svenjeschmitt-ops Dec 22, 2025
7b8fa09
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 23, 2025
ec64afd
⬆️👨‍💻 Update actions/attest-build-provenance action to v3.1.0 (#234)
renovate[bot] Dec 20, 2025
32d14d8
⬆️🔒️ Lock file maintenance (#236)
renovate[bot] Dec 22, 2025
b734fc1
Merge remote-tracking branch 'upstream/main'
svenjeschmitt-ops Dec 24, 2025
92f4b4b
Revert "Merge branch 'main' into highlight_error"
svenjeschmitt-ops Dec 24, 2025
81801fa
Merge remote-tracking branch 'upstream'
svenjeschmitt-ops Dec 30, 2025
e151e5d
cc fix
svenjeschmitt-ops Dec 30, 2025
d5cd2e7
cc fix 2
svenjeschmitt-ops Dec 30, 2025
ff0e4b3
cc fix 3
svenjeschmitt-ops Dec 30, 2025
f2d9c9d
cc fix 4
svenjeschmitt-ops Dec 30, 2025
8d6d7f0
cc fix 5
svenjeschmitt-ops Dec 30, 2025
fbb9bd1
cc fix 6
svenjeschmitt-ops Dec 30, 2025
3653c60
more docstrings
svenjeschmitt-ops Dec 31, 2025
4bb141e
adjustemnts - coderabbit
svenjeschmitt-ops Jan 10, 2026
62ea2cc
solution without STDERR
svenjeschmitt-ops Jan 10, 2026
9563c25
adjustments ddSimAll
svenjeschmitt-ops Jan 10, 2026
4c34277
removed unused methods
svenjeschmitt-ops Jan 10, 2026
ccfd5bb
docstring CodePreprocessing
svenjeschmitt-ops Jan 10, 2026
8663fbe
merge newest version
svenjeschmitt-ops Jan 11, 2026
c256690
🎨 pre-commit fixes
pre-commit-ci[bot] Jan 11, 2026
cf270eb
launch,restart, LoadResult
svenjeschmitt-ops Jan 11, 2026
489592b
Revert "launch,restart, LoadResult"
svenjeschmitt-ops Jan 11, 2026
4de1403
fix launch and restart
svenjeschmitt-ops Jan 11, 2026
29607af
Revert "qubit size adjustment"
svenjeschmitt-ops Jan 11, 2026
5a7413f
_end_before_start
svenjeschmitt-ops Jan 11, 2026
9d98879
enum implemented
svenjeschmitt-ops Jan 11, 2026
a8c25e2
Reapply "qubit size adjustment"
svenjeschmitt-ops Jan 11, 2026
15bb5d9
LoadResult
svenjeschmitt-ops Jan 11, 2026
175bb08
Revert "LoadResult"
svenjeschmitt-ops Jan 11, 2026
f53a848
adjustments LoadResult
svenjeschmitt-ops Jan 14, 2026
d406d13
fix cl
svenjeschmitt-ops Jan 14, 2026
65f230c
adjustments
svenjeschmitt-ops Jan 14, 2026
55ad6b9
Merge remote-tracking branch 'upstream'
svenjeschmitt-ops Jan 14, 2026
3169e22
cl bug fix
svenjeschmitt-ops Jan 14, 2026
090de19
🎨 pre-commit fixes
pre-commit-ci[bot] Jan 14, 2026
c6faa23
fix but
svenjeschmitt-ops Jan 14, 2026
b2c0b2b
Merge remote-tracking branch 'upstream/main'
svenjeschmitt-ops Jan 15, 2026
6b15941
assortation fix + classical issue
svenjeschmitt-ops Jan 15, 2026
6fec6a9
pre- commit fix
svenjeschmitt-ops Jan 15, 2026
af49c19
♻️ Replace `pybind11` with `nanobind` (#248)
denialhaag Jan 15, 2026
03920d7
fix issue
svenjeschmitt-ops Jan 15, 2026
efbcd5c
Cl issue fix
svenjeschmitt-ops Jan 15, 2026
160c294
Code rabbit issue
svenjeschmitt-ops Jan 15, 2026
70897c1
Cl fix bug
svenjeschmitt-ops Jan 15, 2026
4695b89
Cl fix bug 2
svenjeschmitt-ops Jan 15, 2026
7e40ed9
Merge remote-tracking branch 'upstream'
svenjeschmitt-ops Jan 19, 2026
9349194
fix loadResult
svenjeschmitt-ops Jan 21, 2026
2f77e27
categorizing different errors
svenjeschmitt-ops Jan 21, 2026
6b9c1d7
improvement doctring and cleaner version
svenjeschmitt-ops Jan 21, 2026
c1eaccd
improvement launch dap
svenjeschmitt-ops Jan 21, 2026
fa522a6
fix Cl
svenjeschmitt-ops Jan 21, 2026
1f5e0ca
cl fix 2
svenjeschmitt-ops Jan 21, 2026
0e6bfa8
cl fix 3
svenjeschmitt-ops Jan 21, 2026
09f5ace
cl fix 4
svenjeschmitt-ops Jan 21, 2026
4f3e00d
remove file
svenjeschmitt-ops Jan 21, 2026
f2d905c
fix cl
svenjeschmitt-ops Jan 22, 2026
819d0f4
remove destroyDDSimulationState
svenjeschmitt-ops Jan 22, 2026
a70891c
Merge remote-tracking branch 'upstream/main'
svenjeschmitt-ops Jan 22, 2026
dd89f76
fix pre-commit
svenjeschmitt-ops Jan 22, 2026
5822fbd
cl fix 5
svenjeschmitt-ops Jan 22, 2026
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
61 changes: 60 additions & 1 deletion bindings/InterfaceBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ void bindFramework(py::module& m) {
.export_values()
.finalize();

// Bind the Result enum
py::native_enum<Result>(m, "Result", "enum.Enum",
"The result of an operation.")
.value("OK", OK, "Indicates that the operation was successful.")
.value("ERROR", ERROR, "Indicates that an error occurred.")
.export_values()
.finalize();

// Bind the VariableValue union
py::class_<VariableValue>(m, "VariableValue")
.def(py::init<>())
Expand Down Expand Up @@ -166,6 +174,35 @@ Contains one element for each of the `num_states` states in the state vector.)")
.doc() =
"The settings that should be used to compile an assertion program.";

py::class_<LoadResult>(m, "LoadResult")
.def_readonly("result", &LoadResult::result,
"The result of the load operation.")
.def_readonly(
"line", &LoadResult::line,
"The 1-based line of the error location, or 0 if unavailable.")
.def_readonly(
"column", &LoadResult::column,
"The 1-based column of the error location, or 0 if unavailable.")
.def_property_readonly(
"detail",
[](const LoadResult& result) -> py::object {
if (result.detail == nullptr) {
return py::none();
}
return py::str(result.detail);
},
"The error detail text, or None if unavailable.")
.def_property_readonly(
"message",
[](const LoadResult& result) -> py::object {
if (result.message == nullptr) {
return py::none();
}
return py::str(result.message);
},
"The full error message, or None if unavailable.")
.doc() = "Represents the structured result of a load operation.";

py::class_<SimulationState>(m, "SimulationState")
.def(py::init<>(), "Creates a new `SimulationState` instance.")
.def(
Expand All @@ -174,12 +211,34 @@ Contains one element for each of the `num_states` states in the state vector.)")
.def(
"load_code",
[](SimulationState* self, const char* code) {
checkOrThrow(self->loadCode(self, code));
const Result result = self->loadCode(self, code);
if (result != OK) {
const char* messagePtr = self->getLastErrorMessage
? self->getLastErrorMessage(self)
: nullptr;
std::string message = messagePtr ? messagePtr : "";
if (message.empty()) {
message = "An error occurred while executing the operation";
}
throw std::runtime_error(message);
}
},
R"(Loads the given code into the simulation state.

Args:
code (str): The code to load.)")
.def(
"load_code_with_result",
[](SimulationState* self, const char* code) {
return self->loadCodeWithResult(self, code);
},
R"(Loads the given code into the simulation state and returns details.

Args:
code (str): The code to load.

Returns:
LoadResult: The structured load result.)")
.def(
"step_forward",
[](SimulationState* self) { checkOrThrow(self->stepForward(self)); },
Expand Down
24 changes: 24 additions & 0 deletions include/backend/dd/DDSimDebug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,22 @@ struct DDSimulationState {
* @brief The code being executed, after preprocessing.
*/
std::string processedCode;
/**
* @brief The last error message produced by the interface.
*/
std::string lastErrorMessage;
/**
* @brief The last error detail produced by the interface.
*/
std::string lastErrorDetail;
/**
* @brief The 1-based line of the last error, or 0 if unavailable.
*/
size_t lastErrorLine = 0;
/**
* @brief The 1-based column of the last error, or 0 if unavailable.
*/
size_t lastErrorColumn = 0;
/**
* @brief Indicates whether the debugger is ready to start simulation.
*/
Expand Down Expand Up @@ -280,6 +296,14 @@ Result ddsimInit(SimulationState* self);
* @return The result of the operation.
*/
Result ddsimLoadCode(SimulationState* self, const char* code);

/**
* @brief Loads the given code into the simulation state and returns details.
* @param self The instance to load the code into.
* @param code The code to load.
* @return The structured load result.
*/
LoadResult ddsimLoadCodeWithResult(SimulationState* self, const char* code);
/**
* @brief Steps the simulation forward by one instruction.
* @param self The instance to step forward.
Expand Down
45 changes: 45 additions & 0 deletions include/backend/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,32 @@ extern "C" {
*/
typedef struct SimulationStateStruct SimulationState;

/**
* @brief Represents the structured result of a load operation.
*/
typedef struct {
/**
* @brief The result of the load operation.
*/
Result result;
/**
* @brief The 1-based line of the error location, or 0 if unavailable.
*/
size_t line;
/**
* @brief The 1-based column of the error location, or 0 if unavailable.
*/
size_t column;
/**
* @brief The error detail text, or nullptr if unavailable.
*/
const char* detail;
/**
* @brief The full error message, or nullptr if unavailable.
*/
const char* message;
} LoadResult;

struct SimulationStateStruct {
/**
* @brief Initializes the simulation state.
Expand All @@ -54,6 +80,25 @@ struct SimulationStateStruct {
*/
Result (*loadCode)(SimulationState* self, const char* code);

/**
* @brief Loads the given code into the simulation state and returns details.
* @param self The instance to load the code into.
* @param code The code to load.
* @return The structured load result.
*/
LoadResult (*loadCodeWithResult)(SimulationState* self, const char* code);

/**
* @brief Gets the last error message from the interface.
*
* The returned pointer is owned by the implementation and remains valid
* until the next interface call that modifies the error state.
*
* @param self The instance to query.
* @return A null-terminated error message, or nullptr if none is available.
*/
const char* (*getLastErrorMessage)(SimulationState* self);

/**
* @brief Steps the simulation forward by one instruction.
* @param self The instance to step forward.
Expand Down
25 changes: 25 additions & 0 deletions include/common/parsing/ParsingError.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#pragma once

#include <cstddef>
#include <optional>
#include <stdexcept>
#include <string>

Expand All @@ -23,13 +25,36 @@ namespace mqt::debugger {
/**
* @brief Represents an error that occurred during parsing.
*/
struct ParsingErrorLocation {
size_t line;
size_t column;
std::string detail;
};

class ParsingError : public std::runtime_error {
public:
/**
* @brief Constructs a new ParsingError with the given message.
* @param msg The error message.
*/
explicit ParsingError(const std::string& msg);

/**
* @brief Constructs a new ParsingError with a structured location.
* @param line The 1-based line number.
* @param column The 1-based column number.
* @param detail The error detail text.
*/
ParsingError(size_t line, size_t column, std::string detail);

/**
* @brief Returns the location information if available.
* @return Pointer to the location info, or nullptr if absent.
*/
const ParsingErrorLocation* location() const noexcept;

private:
std::optional<ParsingErrorLocation> location_;
};

} // namespace mqt::debugger
4 changes: 4 additions & 0 deletions python/mqt/debugger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
Diagnostics,
ErrorCause,
ErrorCauseType,
LoadResult,
Result,
Comment on lines 21 to 23
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, let's look at the __init__.py file to see the imports and __all__ list
cat -n python/mqt/debugger/__init__.py | head -50

Repository: munich-quantum-toolkit/debugger

Length of output: 1518


🏁 Script executed:

#!/bin/bash
# Check if check/result_checker.py exists and contains a Result class
find . -name "result_checker.py" -type f

Repository: munich-quantum-toolkit/debugger

Length of output: 120


🏁 Script executed:

#!/bin/bash
# Search for Result definitions in the codebase
rg -n "class Result" --type py -g '!__pycache__'

Repository: munich-quantum-toolkit/debugger

Length of output: 135


🏁 Script executed:

#!/bin/bash
# Search for Result enum definitions
rg -n "class Result.*Enum|Result.*=.*Enum" --type py -g '!__pycache__'

Repository: munich-quantum-toolkit/debugger

Length of output: 57


🏁 Script executed:

#!/bin/bash
# Find pydebugger module/binding to see Result definition
find . -name "pydebugger*" -type f | grep -E "\.(py|pyi|pyx)$"

Repository: munich-quantum-toolkit/debugger

Length of output: 111


🏁 Script executed:

#!/bin/bash
# Check if pydebugger is a compiled module binding - look for .pyi stubs
find . -name "*.pyi" | head -20

Repository: munich-quantum-toolkit/debugger

Length of output: 146


🏁 Script executed:

#!/bin/bash
# Read the result_checker.py to understand the Result class
cat -n python/mqt/debugger/check/result_checker.py | head -80

Repository: munich-quantum-toolkit/debugger

Length of output: 3164


🏁 Script executed:

#!/bin/bash
# Search for actual usage of "from mqt.debugger import Result"
rg -n "from mqt.debugger import.*Result" --type py -g '!__pycache__'

Repository: munich-quantum-toolkit/debugger

Length of output: 57


🏁 Script executed:

#!/bin/bash
# Search for mqt.debugger.Result usage
rg -n "mqt\.debugger\.Result" --type py -g '!__pycache__'

Repository: munich-quantum-toolkit/debugger

Length of output: 305


🏁 Script executed:

#!/bin/bash
# Check the pydebugger.pyi stub file to see Result definition
cat -n python/mqt/debugger/pydebugger.pyi | grep -A 20 "class Result"

Repository: munich-quantum-toolkit/debugger

Length of output: 842


🏁 Script executed:

#!/antml:thinking]
This will show me the actual Result definition from the type stub file, which should clarify whether it's an Enum or similar and what properties it has.

Repository: munich-quantum-toolkit/debugger

Length of output: 143


🏁 Script executed:

#!/bin/bash
# Look for the full Result definition in pydebugger.pyi
cat python/mqt/debugger/pydebugger.pyi | grep -A 30 "class Result"

Repository: munich-quantum-toolkit/debugger

Length of output: 1012


🏁 Script executed:

#!/bin/bash
# Check if Result enum and Result class are imported together anywhere
rg -n "from.*Result|import.*Result" --type py -g '!__pycache__' | head -30

Repository: munich-quantum-toolkit/debugger

Length of output: 164


🏁 Script executed:

#!/antml:thinking]
I want to see if anywhere in the codebase both Result types are used in the same file, which would indicate a real conflict.

Repository: munich-quantum-toolkit/debugger

Length of output: 116


🏁 Script executed:

#!/bin/bash
# Check what LoadResult is (since it's also exported)
cat python/mqt/debugger/pydebugger.pyi | grep -A 15 "class LoadResult"

Repository: munich-quantum-toolkit/debugger

Length of output: 576


🏁 Script executed:

#!/an/bash
# Look for any type hints or usage that shows both Result types in same context
rg -B 5 -A 5 "check\.Result|result_checker\.Result" --type py -g '!__pycache__'

Repository: munich-quantum-toolkit/debugger

Length of output: 57


🏁 Script executed:

#!/bin/bash
# Check if check/__init__.py exports Result and if it would create confusion
cat python/mqt/debugger/check/__init__.py

Repository: munich-quantum-toolkit/debugger

Length of output: 756


🏁 Script executed:

#!/an/bash
# Look for any imports that combine both Result types in one file
rg -l "from.*pydebugger.*Result|from.*result_checker.*Result" --type py | while read f; do
  echo "=== $f ==="
  grep -n "import.*Result" "$f"
done

Repository: munich-quantum-toolkit/debugger

Length of output: 172


🏁 Script executed:

#!/bin/bash
# Verify if any code imports both Result types in the same file
find python -name "*.py" -type f -exec grep -l "from mqt.debugger import" {} \; | while read f; do
  if grep -q "LoadResult\|Result" "$f" && grep -q "from.*check.*Result" "$f"; then
    echo "=== $f ==="
    grep -n "import\|from" "$f" | grep -E "LoadResult|Result"
  fi
done

Repository: munich-quantum-toolkit/debugger

Length of output: 161


🏁 Script executed:

#!/bin/bash
# Check the actual imports in launch_dap_message.py and restart_dap_message.py where Result.OK is used
head -30 python/mqt/debugger/dap/messages/launch_dap_message.py | grep -E "^from|^import"

Repository: munich-quantum-toolkit/debugger

Length of output: 260


🏁 Script executed:

#!/bin/bash
# Check LoadResult to see if it provides context about Result enum usage
head -80 python/mqt/debugger/pydebugger.pyi | grep -A 10 "LoadResult"

Repository: munich-quantum-toolkit/debugger

Length of output: 57


🏁 Script executed:

#!/antml:thinking]
I want to understand the relationship between LoadResult and Result to see if the naming is intentional and if renaming would cause issues.

Repository: munich-quantum-toolkit/debugger

Length of output: 116


🏁 Script executed:

#!/bin/bash
# Check if there are any type hints or documentation that explain why Result is exported at top level
grep -r "LoadResult\|Result" python/mqt/debugger/__init__.py -B 2 -A 2

Repository: munich-quantum-toolkit/debugger

Length of output: 293


Consider renaming Result enum to clarify its purpose as an operation status indicator.

The new Result enum (with OK/ERROR values) represents operation status and is used by LoadResult.status. While a Result class also exists in mqt.debugger.check.result_checker (representing quantum execution results), they serve distinct purposes and are properly namespaced. However, both being exposed at the top-level package namespace with the same name may reduce clarity for maintainability.

Renaming the enum to LoadStatus, OperationResult, or similar would make its purpose immediately obvious without requiring context about LoadResult.

🤖 Prompt for AI Agents
In `@python/mqt/debugger/__init__.py` around lines 21 - 22, Rename the top-level
enum named Result (the one used as the type of LoadResult.status) to a clearer
name like LoadStatus or OperationResult; update the enum declaration (formerly
Result) and all references to it (e.g., the type annotation on LoadResult.status
and any imports) and adjust the package export in __init__.py to expose the new
name instead of Result so it no longer collides conceptually with
mqt.debugger.check.result_checker.Result; also update any tests, type hints, and
import sites that reference the old Result symbol to use the new
LoadStatus/OperationResult name.

SimulationState,
Statevector,
Variable,
Expand All @@ -33,6 +35,8 @@
"Diagnostics",
"ErrorCause",
"ErrorCauseType",
"LoadResult",
"Result",
"SimulationState",
"Statevector",
"Variable",
Expand Down
Loading
Loading