Skip to content

Commit f11e051

Browse files
⬆️🔒️ Lock file maintenance (#617)
This PR contains the following updates: | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed | 🔧 This Pull Request updates lock files to use the latest dependency versions. --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/munich-quantum-toolkit/predictor). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni40IiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicHl0aG9uIl19--> --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com>
1 parent 86a83e1 commit f11e051

5 files changed

Lines changed: 526 additions & 491 deletions

File tree

src/mqt/predictor/ml/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def create_feature_vector(qc: QuantumCircuit) -> list[int | float]:
119119
The feature dictionary of the given quantum circuit.
120120
"""
121121
ops_list = qc.count_ops()
122-
ops_list_dict = dict_to_featurevector(ops_list) # ty: ignore[invalid-argument-type]
122+
ops_list_dict = dict_to_featurevector(ops_list)
123123

124124
feature_dict = {}
125125
for key in ops_list_dict:

src/mqt/predictor/ml/predictor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def _compile_all_circuits_devicewise(
177177
for filename in path_uncompiled_circuits.iterdir():
178178
if filename.suffix != ".qasm":
179179
continue
180-
qc = QuantumCircuit.from_qasm_file(filename) # ty: ignore[invalid-argument-type]
180+
qc = QuantumCircuit.from_qasm_file(filename)
181181
if qc.num_qubits > dev_max_qubits:
182182
continue
183183

@@ -354,7 +354,7 @@ def _generate_training_sample(
354354
scores_list = list(scores.values())
355355
target_label = max(scores, key=lambda k: scores[k])
356356

357-
qc = QuantumCircuit.from_qasm_file(path_uncompiled_circuit / file) # ty: ignore[invalid-argument-type]
357+
qc = QuantumCircuit.from_qasm_file(path_uncompiled_circuit / file)
358358
feature_vec = create_feature_vector(qc)
359359
training_sample = (feature_vec, target_label)
360360
circuit_name = str(file).split(".")[0]
@@ -465,7 +465,7 @@ def predict_device_for_figure_of_merit(
465465
ValueError: If no suitable device is found for the given quantum circuit.
466466
"""
467467
if isinstance(qc, Path) and qc.exists():
468-
qc = QuantumCircuit.from_qasm_file(qc) # ty: ignore[invalid-argument-type]
468+
qc = QuantumCircuit.from_qasm_file(qc)
469469
assert isinstance(qc, QuantumCircuit)
470470

471471
path = get_path_trained_model(figure_of_merit)

src/mqt/predictor/rl/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def get_state_sample(max_qubits: int, path_training_circuits: Path, rng: Generat
6262
found_suitable_qc = True
6363

6464
try:
65-
qc = QuantumCircuit.from_qasm_file(file_list[random_index]) # ty: ignore[invalid-argument-type]
65+
qc = QuantumCircuit.from_qasm_file(file_list[random_index])
6666
except Exception as e:
6767
msg = f"Could not read QuantumCircuit from: {file_list[random_index]}"
6868
raise RuntimeError(msg) from e

src/mqt/predictor/rl/predictorenv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def step(self, action: int) -> tuple[dict[str, Any], float, bool, bool, dict[Any
203203
done = False
204204

205205
# in case the Qiskit.QuantumCircuit has unitary or u gates in it, decompose them (because otherwise qiskit will throw an error when applying the BasisTranslator
206-
if self.state.count_ops().get("unitary"): # ty: ignore[invalid-argument-type]
206+
if self.state.count_ops().get("unitary"):
207207
self.state = self.state.decompose(gates_to_decompose="unitary")
208208

209209
self.state._layout = self.layout # noqa: SLF001
@@ -247,7 +247,7 @@ def reset(
247247
if isinstance(qc, QuantumCircuit):
248248
self.state = qc
249249
elif qc:
250-
self.state = QuantumCircuit.from_qasm_file(qc) # ty: ignore[invalid-argument-type]
250+
self.state = QuantumCircuit.from_qasm_file(qc)
251251
else:
252252
self.state, self.filename = get_state_sample(self.device.num_qubits, self.path_training_circuits, self.rng)
253253

0 commit comments

Comments
 (0)