Skip to content

Commit 7663c04

Browse files
committed
reformat
1 parent f8f32c8 commit 7663c04

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

lindbladmpo/LindbladMPOSolver.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,11 @@ def verify_parameters(
955955
"Error 410: " + key + " must be a non-negative integer\n"
956956
)
957957
continue
958-
elif (key == "cut_off") or (key == "cut_off_rho") or (key == "cut_off_observable"):
958+
elif (
959+
(key == "cut_off")
960+
or (key == "cut_off_rho")
961+
or (key == "cut_off_observable")
962+
):
959963
if not LindbladMPOSolver.is_float(parameters[key]):
960964
check_msg += "Error 420: " + key + " is not a float\n"
961965
continue

lindbladmpo/examples/simulation_building/LindbladMatrixSolver.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def solve(self):
394394

395395
if parameters.get("b_save_final_state", False): # Write final state
396396
np.save(self.s_output_path + ".state", sol.y[-1])
397-
cut_off_observable = parameters.get("cut_off_observable", .0)
397+
cut_off_observable = parameters.get("cut_off_observable", 0.0)
398398

399399
file_1q = open(self.s_output_path + ".obs-1q.dat", "w")
400400
file_2q = open(self.s_output_path + ".obs-2q.dat", "w")
@@ -421,7 +421,7 @@ def solve(self):
421421
f"{key[0].upper()}, qubit {key[1] + 1}.\n"
422422
)
423423
if cut_off_observable and (abs(val) < cut_off_observable):
424-
val = .0
424+
val = 0.0
425425
file_1q.write(f"{t}\t{key[0].upper()}\t{key[1] + 1}\t{val.real}\n")
426426
file_1q.write("\n")
427427
file_1q.flush()
@@ -435,7 +435,7 @@ def solve(self):
435435
f"{key[0].upper()}, qubits ({key[1] + 1}, {key[2] + 1}).\n"
436436
)
437437
if cut_off_observable and (abs(val) < cut_off_observable):
438-
val = .0
438+
val = 0.0
439439
file_2q.write(
440440
f"{t}\t{key[0].upper()}\t{key[1] + 1}\t{key[2] + 1}\t{val.real}\n"
441441
)
@@ -452,7 +452,7 @@ def solve(self):
452452
f"{key[3] + 1}).\n"
453453
)
454454
if cut_off_observable and (abs(val) < cut_off_observable):
455-
val = .0
455+
val = 0.0
456456
file_3q.write(
457457
f"{t}\t{key[0].upper()}\t{key[1] + 1}\t{key[2] + 1}\t{key[3] + 1}\t{val.real}\n"
458458
)
@@ -467,7 +467,7 @@ def solve(self):
467467
f"{obs_cu_name}.\n"
468468
)
469469
if cut_off_observable and (abs(val) < cut_off_observable):
470-
val = .0
470+
val = 0.0
471471
file_cu.write(f"{t}\t{obs_cu_name}\t{val.real}\n")
472472
# print(f"{t}\t{obs_cu_name}\t{val.real}")
473473
file_cu.write("\n")

0 commit comments

Comments
 (0)