You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🎨 Rename Python classes to not violate N801 (#523)
## Description
This PR renames all Python classes to not violate
[N801](https://docs.astral.sh/ruff/rules/invalid-class-name/).
## Checklist:
- [x] The pull request only contains commits that are focused and
relevant to this change.
- [x] ~I have added appropriate tests that cover the new/changed
functionality.~
- [x] ~I have updated the documentation to reflect these changes.~
- [x] The changes follow the project's style guidelines and introduce no
new warnings.
- [x] The changes are fully tested and pass the CI checks.
- [x] I have reviewed my own code changes.
.def(nb::init<>(), "Constructs an empty qubit inlining stack entry")
189
189
.def_prop_ro("line_number_of_call_of_target_module", [](const QubitInliningStack::QubitInliningStackEntry& stackEntry) { return stackEntry.lineNumberOfCallOfTargetModule; }, "Returns the line number in the source file in which the call statement variant was defined")
190
190
.def_prop_ro("is_target_module_accessed_via_call_stmt", [](const QubitInliningStack::QubitInliningStackEntry& stackEntry) { return stackEntry.isTargetModuleAccessedViaCallStmt; }, "Returns whether the target module was called using a CallStatement")
191
191
.def_prop_ro("stringified_signature_of_called_module", &QubitInliningStack::QubitInliningStackEntry::stringifySignatureOfCalledModule, "Returns the stringified target module signature");
.def(nb::init<>(), "Constructs an empty inlined qubit information container")
200
200
.def_prop_ro("user_declared_qubit_label", [](const AnnotatableQuantumComputation::InlinedQubitInformation& inlinedQubitInfo) { return inlinedQubitInfo.userDeclaredQubitLabel; }, "Get the label of the qubit as defined by the user in the SyReC program")
201
201
.def_prop_ro("inline_stack", [](const AnnotatableQuantumComputation::InlinedQubitInformation& inlinedQubitInfo) { return inlinedQubitInfo.inlineStack; }, "Get the inline stack associated with the qubit");
.value("internal", AnnotatableQuantumComputation::QubitLabelType::Internal, "Generate the qubit label using the internal qubit identifier (only available for ancillary qubits and local SyReC module variables)")
205
205
.value("user_declared", AnnotatableQuantumComputation::QubitLabelType::UserDeclared, "Generate the qubit label using the user declared variable identifier (only available for the qubits of the variables of a SyReC program [ancillary qubits are not associated with a variable and thus have no user declared label])");
.def(nb::init<>(), "Constructs an annotatable quantum computation")
209
209
.def(nb::init<bool>(), "generate_quantum_operation_annotations"_a, "Constructs an annotatable quantum computation while also specifying whether quantum operation annotations can be generated")
210
210
.def("get_qubit_label", &AnnotatableQuantumComputation::getQubitLabel, "qubit"_a, "qubit_label_type"_a, "Get either the internal or user-declared label of a qubit as a stringified SyReC variable access based on its location in the quantum register storing the qubit and, optionally, the layout of the SyReC variable stored in the register.")
@@ -213,7 +213,7 @@ NB_MODULE(MQT_SYREC_MODULE_NAME, m) {
213
213
.def("get_annotations_of_quantum_operation", &AnnotatableQuantumComputation::getAnnotationsOfQuantumOperation, "quantum_operation_index_in_quantum_operation"_a, "Get the annotations of a specific quantum operation in the quantum computation")
214
214
.def("get_inlined_qubit_information", &AnnotatableQuantumComputation::getInlinedQubitInformation, "qubit"_a, "Get the inlined information of a qubit");
.def(nb::init<>(), "Constructs an empty container of size zero.")
218
218
.def(nb::init<std::size_t>(), "n"_a, "Constructs a zero-initialized container of size n.")
219
219
.def(nb::init<std::size_t, uint64_t>(), "n"_a, "initial_line_values"_a, "Constructs a container of size n from an integer initial_line_values")
@@ -227,15 +227,15 @@ NB_MODULE(MQT_SYREC_MODULE_NAME, m) {
227
227
.def("flip", &NBitValuesContainer::flip, "n"_a, "Flip the value of the bit at position n")
228
228
.def("__str__", [](const NBitValuesContainer& container) { return container.stringify(); }, "Returns a string containing the stringified values of the stored bits.");
229
229
230
-
nb::class_<Statistics>(m, "statistics")
230
+
nb::class_<Statistics>(m, "Statistics")
231
231
.def(nb::init<>(), "Constructs an object to record collected statistics.")
232
232
.def_rw("runtime_in_milliseconds", &Statistics::runtimeInMilliseconds, "The recorded runtime in milliseconds");
.def(nb::init<>(), "Constructs a configurable options object.")
240
240
.def_rw("default_bitwidth", &ConfigurableOptions::defaultBitwidth, "Defines the default variable bitwidth used by the SyReC parser for variables whose bitwidth specification was omitted")
241
241
.def_rw("integer_constant_truncation_operation", &ConfigurableOptions::integerConstantTruncationOperation, "Defines the operation used by the SyReC parser for the truncation of integer constant values. For further details we refer to the semantics of the SyReC language")
@@ -244,7 +244,7 @@ NB_MODULE(MQT_SYREC_MODULE_NAME, m) {
244
244
.def_rw("generate_inlined_qubit_debug_information", &ConfigurableOptions::generatedInlinedQubitDebugInformation, "Should debug information for the qubits associated with the local variables of a SyReC module be generated")
245
245
.def_rw("generate_quantum_operation_annotations", &ConfigurableOptions::generateQuantumOperationAnnotations, "Should the optional quantum operation annotations be generated during the synthesis of a SyReC program, disabled by default");
246
246
247
-
nb::class_<Program>(m, "program")
247
+
nb::class_<Program>(m, "Program")
248
248
.def(nb::init<>(), "Constructs SyReC program object.")
249
249
.def("read", &Program::read, "filename"_a, "configurable_options"_a = ConfigurableOptions(), "Read and process a SyReC program from a file.")
"""Get the inline stack associated with the qubit"""
52
52
53
-
classqubit_label_type(enum.Enum):
53
+
classQubitLabelType(enum.Enum):
54
54
internal=0
55
55
"""
56
56
Generate the qubit label using the internal qubit identifier (only available for ancillary qubits and local SyReC module variables)
@@ -61,7 +61,7 @@ class qubit_label_type(enum.Enum):
61
61
Generate the qubit label using the user declared variable identifier (only available for the qubits of the variables of a SyReC program [ancillary qubits are not associated with a variable and thus have no user declared label])
Get either the internal or user-declared label of a qubit as a stringified SyReC variable access based on its location in the quantum register storing the qubit and, optionally, the layout of the SyReC variable stored in the register.
78
78
"""
@@ -88,10 +88,10 @@ class annotatable_quantum_computation(mqt.core.ir.QuantumComputation):
88
88
Get the annotations of a specific quantum operation in the quantum computation
Defines the operation used by the SyReC parser for the truncation of integer constant values. For further details we refer to the semantics of the SyReC language
0 commit comments