Skip to content

Commit

Permalink
🎨 pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Aug 24, 2024
1 parent 19230be commit 07d35fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ def create_condition_string(num_bits: int, num_counter_examples: int) -> tuple[s
counter_examples.append(str(format(num, f"0{num_bits}b"))) # appends ['0000'] for num = 0 and num_bits = 4
# The following lines add a negated letter (e.g. "~a") for each "0" and a letter (e.g. "a") for each "1" in the bitstring list.
# If the first letter is added (so i > 0), the subsequent letters are added together with a logical AND operator (e.g. "~a & ~b & ~c & ~d").
for i, char in enumerate(bitstring):
if char == "0" and i == 0:
bitstring[i] = (
"~" + alphabet[i]
)
for i, char in enumerate(bitstring):
if char == "0" and i == 0:
bitstring[i] = "~" + alphabet[i]
elif char == "1" and i == 0:
bitstring[i] = alphabet[i]
elif char == "0":
Expand Down Expand Up @@ -231,4 +229,4 @@ def try_parameter_combinations(
data.loc[i] = row
i += 1

data.to_csv(path, index=False)
data.to_csv(path, index=False)
2 changes: 1 addition & 1 deletion tests/test_equivalence_checking.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ def test_find_counter_examples() -> None:
assert found_counter_examples == counter_examples

with pytest.raises(ValueError, match="Invalid value for delta 1.2, which must be between 0 and 1."):
equivalence_checking.find_counter_examples(miter=res_string, num_bits=5, shots=shots, delta=1.2)
equivalence_checking.find_counter_examples(miter=res_string, num_bits=5, shots=shots, delta=1.2)

0 comments on commit 07d35fd

Please sign in to comment.