Hasarindu Perera commited on
redesign: circuit+cost top row, input+encoded bottom row
Browse files
app.py
CHANGED
|
@@ -356,8 +356,7 @@ Framework-agnostic: export to Qiskit, PennyLane, Cirq, TKET, Braket, Q#, IQM, or
|
|
| 356 |
with gr.Row():
|
| 357 |
|
| 358 |
# ── Left: controls ──────────────────────────────────────────
|
| 359 |
-
with gr.Column(scale=1, min_width=
|
| 360 |
-
gr.Markdown("### ⚙️ Settings")
|
| 361 |
enc_dd = gr.Dropdown(
|
| 362 |
choices=ENCODINGS, value="angle", label="Encoding",
|
| 363 |
)
|
|
@@ -378,30 +377,33 @@ Framework-agnostic: export to Qiskit, PennyLane, Cirq, TKET, Braket, Q#, IQM, or
|
|
| 378 |
convert_btn = gr.Button("Convert →", variant="primary", size="lg")
|
| 379 |
|
| 380 |
# ── Right: results ──────────────────────────────────────────
|
| 381 |
-
with gr.Column(scale=
|
| 382 |
status_out = gr.Textbox(
|
| 383 |
label="", lines=1, max_lines=1,
|
| 384 |
interactive=False, show_label=False,
|
| 385 |
placeholder="Press Convert → to run",
|
| 386 |
)
|
| 387 |
|
| 388 |
-
#
|
| 389 |
-
circuit_out = gr.Code(
|
| 390 |
-
label="Circuit output (sample 0)",
|
| 391 |
-
language="python", lines=18,
|
| 392 |
-
)
|
| 393 |
-
|
| 394 |
-
# secondary info — side by side
|
| 395 |
with gr.Row(equal_height=True):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 396 |
with gr.Column(scale=1):
|
| 397 |
cost_out = gr.HTML(label="Cost estimate")
|
| 398 |
-
with gr.Column(scale=1):
|
| 399 |
-
with gr.Accordion("Input data (first 5 rows)", open=True):
|
| 400 |
-
input_table = gr.Dataframe(interactive=False)
|
| 401 |
|
| 402 |
-
#
|
| 403 |
-
with gr.
|
| 404 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 405 |
|
| 406 |
enc_dd.change(
|
| 407 |
fn=lambda e: f"<small><i>{ENCODING_DESC.get(e, '')}</i></small>",
|
|
|
|
| 356 |
with gr.Row():
|
| 357 |
|
| 358 |
# ── Left: controls ──────────────────────────────────────────
|
| 359 |
+
with gr.Column(scale=1, min_width=200):
|
|
|
|
| 360 |
enc_dd = gr.Dropdown(
|
| 361 |
choices=ENCODINGS, value="angle", label="Encoding",
|
| 362 |
)
|
|
|
|
| 377 |
convert_btn = gr.Button("Convert →", variant="primary", size="lg")
|
| 378 |
|
| 379 |
# ── Right: results ──────────────────────────────────────────
|
| 380 |
+
with gr.Column(scale=4):
|
| 381 |
status_out = gr.Textbox(
|
| 382 |
label="", lines=1, max_lines=1,
|
| 383 |
interactive=False, show_label=False,
|
| 384 |
placeholder="Press Convert → to run",
|
| 385 |
)
|
| 386 |
|
| 387 |
+
# top row — circuit + cost side by side
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 388 |
with gr.Row(equal_height=True):
|
| 389 |
+
with gr.Column(scale=3):
|
| 390 |
+
circuit_out = gr.Code(
|
| 391 |
+
label="Circuit output (sample 0)",
|
| 392 |
+
language="python", lines=18,
|
| 393 |
+
)
|
| 394 |
with gr.Column(scale=1):
|
| 395 |
cost_out = gr.HTML(label="Cost estimate")
|
|
|
|
|
|
|
|
|
|
| 396 |
|
| 397 |
+
# bottom row — input data + encoded parameters side by side
|
| 398 |
+
with gr.Row(equal_height=True):
|
| 399 |
+
with gr.Column(scale=1):
|
| 400 |
+
input_table = gr.Dataframe(
|
| 401 |
+
label="Input data (first 5 rows)", interactive=False,
|
| 402 |
+
)
|
| 403 |
+
with gr.Column(scale=1):
|
| 404 |
+
encoded_table = gr.Dataframe(
|
| 405 |
+
label="Encoded parameters (first 5 rows)", interactive=False,
|
| 406 |
+
)
|
| 407 |
|
| 408 |
enc_dd.change(
|
| 409 |
fn=lambda e: f"<small><i>{ENCODING_DESC.get(e, '')}</i></small>",
|