Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Oct 27, 2023
1 parent 00c1636 commit 39b0093
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/groover_hash_collision.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def qiskit_simulate(qc):
qc.measure_all()
print(qc.draw('text'))
print(qc.draw("text"))

simulator = Aer.get_backend("aer_simulator")
circ = transpile(qc, simulator)
Expand Down Expand Up @@ -55,5 +55,5 @@ def hash(k: Qint4) -> Qint4:
plt.show()


print(hash.circuit().export("circuit", 'qiskit').draw('text'))
print(hash.circuit().export("circuit", "qiskit").draw("text"))
# plt.show()
1 change: 0 additions & 1 deletion qlasskit/algorithms/groover.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def oracle_outer(v: {argt_name}) -> bool:
]
self.qc.h(oracle_qc["_ret_phased"])


for i in range(n_iterations):
self.qc.barrier(label=f"g{i}")
# self.qc.barrier(label=f"orac_{i}")
Expand Down
14 changes: 7 additions & 7 deletions qlasskit/algorithms/qalgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ def out_qubits(self) -> List[int]:

def interpet_counts(self, counts: Dict[str, int]) -> Dict[Any, int]:
"""Interpet data inside a circuit counts dict"""
l = [(self.interpret_outcome(e), c) for (e, c) in counts.items()]
d = {}
for (e, c) in l:
outcomes = [(self.interpret_outcome(e), c) for (e, c) in counts.items()]
int_counts: Dict[Any, int] = {}
for e, c in outcomes:
inter = self.interpret_outcome(e)
if inter in d:
d[inter] += c
if inter in int_counts:
int_counts[inter] += c
else:
d[inter] = c
return d
int_counts[inter] = c
return int_counts

def export(self, framework: SupportedFramework = "qiskit") -> Any:
"""Export the algorithm to a supported framework"""
Expand Down

0 comments on commit 39b0093

Please sign in to comment.