Skip to content

Commit fcc599c

Browse files
Apply Ruff formatting to app.py
1 parent 91c916f commit fcc599c

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

app.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ def run_quantum_teleport():
4343
circuit = build_teleport_circuit()
4444
result = engine.run(circuit)
4545
return (
46-
"Teleportation circuit executed successfully!\n\n"
47-
f"Counts: {result.counts}"
46+
f"Teleportation circuit executed successfully!\n\nCounts: {result.counts}"
4847
)
4948
except Exception as e:
5049
return f"Error: {str(e)}"
@@ -63,6 +62,7 @@ def run_qec_demo(code_type="Shor"):
6362
return run_steane_qec_demo()
6463
else: # Surface
6564
from quantumpytho.modules.qec_surface import run_surface_code_demo
65+
6666
return run_surface_code_demo()
6767
except Exception as e:
6868
return f"Error: {str(e)}"
@@ -136,14 +136,14 @@ def run_noisy_simulation(backend_profile="IBM", noise_level=0.01):
136136
profile_info = get_backend_info(profile_name) if profile_name else None
137137

138138
output = f"""Noisy Simulation Results:
139-
Backend Profile: {profile_name or 'simulator'}
139+
Backend Profile: {profile_name or "simulator"}
140140
Noise Level: {noise_level}
141141
142142
Measurement Counts:
143143
{json.dumps(result.counts, indent=2)}
144144
145145
Profile Info:
146-
{json.dumps(profile_info or {'noise_model': 'none'}, indent=2)}
146+
{json.dumps(profile_info or {"noise_model": "none"}, indent=2)}
147147
"""
148148
return output
149149
except Exception as e:
@@ -171,7 +171,7 @@ def explore_dna_circuits(sequence_name="ATCG"):
171171
output = f"""DNA Circuit Exploration:
172172
Sequence: {sequence_name}
173173
174-
Available Sequences: {', '.join(available[:10])}...
174+
Available Sequences: {", ".join(available[:10])}...
175175
176176
Sequence Data:
177177
{json.dumps(sequence_data, indent=2)}
@@ -194,16 +194,16 @@ def run_tmt_sierpinski():
194194
result = run_tmt_demo(engine)
195195

196196
output = f"""TMT Sierpinski Circuit (Sacred Geometry):
197-
Qubits: {result['qubits']}
198-
Circuit Type: {result['circuit']}
197+
Qubits: {result["qubits"]}
198+
Circuit Type: {result["circuit"]}
199199
200200
Measurement Counts:
201-
{json.dumps(result['counts'], indent=2)}
201+
{json.dumps(result["counts"], indent=2)}
202202
203203
Circuit Metadata:
204-
Depth: {result['depth']}
205-
Shots: {result['shots']}
206-
Most Common: {result['most_common']}
204+
Depth: {result["depth"]}
205+
Shots: {result["shots"]}
206+
Most Common: {result["most_common"]}
207207
"""
208208
return output
209209
except Exception as e:
@@ -227,9 +227,7 @@ def run_benchmark():
227227
default_shots=1024,
228228
)
229229
results = run_benchmark_suite(benchmarks, executor, executor, config)
230-
mean_match_score = sum(
231-
record.mean_metric for record in results
232-
) / len(results)
230+
mean_match_score = sum(record.mean_metric for record in results) / len(results)
233231

234232
output = f"""QPyth Benchmark Results:
235233

0 commit comments

Comments
 (0)