Update app.py
Browse files
app.py
CHANGED
@@ -63,22 +63,25 @@ def get_qcs(srv, num_of_qubits, max_gates, g):
|
|
63 |
# run
|
64 |
|
65 |
st.title("genQC · Generative Quantum Circuits")
|
66 |
-
st.write("""
|
67 |
-
Generating quantum circuits with diffusion models. Official demo of [[paper-arxiv]](https://arxiv.org/abs/2311.02041) [[code-repo]](https://github.com/FlorianFuerrutter/genQC).
|
68 |
-
""")
|
69 |
-
st.
|
|
|
70 |
|
71 |
col1, col2 = st.columns(2)
|
72 |
|
73 |
srv = col1.text_input('SRV', "[1,1,1,2,2]")
|
74 |
num_of_qubits = col1.radio('Number of qubits (should match SRV)', [3,4,5,6,7,8], index=2)
|
75 |
-
max_gates = col1.select_slider('Max gates', options=[4,8,12,16,20,24,28], value=16)
|
76 |
-
g = col1.slider('Guidance scale', min_value=0.0, max_value=15.0, value=7.5)
|
77 |
|
78 |
srv_list = ast.literal_eval(srv)
|
79 |
-
|
80 |
if len(srv_list)!=num_of_qubits:
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
if col1.button('Generate circuits'):
|
84 |
fig = get_qcs(srv_list, num_of_qubits, max_gates, g)
|
|
|
63 |
# run
|
64 |
|
65 |
st.title("genQC · Generative Quantum Circuits")
|
66 |
+
# st.write("""
|
67 |
+
# Generating quantum circuits with diffusion models. Official demo of [[paper-arxiv]](https://arxiv.org/abs/2311.02041) [[code-repo]](https://github.com/FlorianFuerrutter/genQC).
|
68 |
+
# """)
|
69 |
+
st.subheader('Generating quantum circuits with diffusion models. Official demo of [[paper-arxiv]](https://arxiv.org/abs/2311.02041) [[code-repo]](https://github.com/FlorianFuerrutter/genQC).', divider=True)
|
70 |
+
# st.divider()
|
71 |
|
72 |
col1, col2 = st.columns(2)
|
73 |
|
74 |
srv = col1.text_input('SRV', "[1,1,1,2,2]")
|
75 |
num_of_qubits = col1.radio('Number of qubits (should match SRV)', [3,4,5,6,7,8], index=2)
|
|
|
|
|
76 |
|
77 |
srv_list = ast.literal_eval(srv)
|
|
|
78 |
if len(srv_list)!=num_of_qubits:
|
79 |
+
col1.warning(f'Number of qubits does not match with given SRV {srv_list}. This will result in error-circuits!', icon="⚠️")
|
80 |
+
else:
|
81 |
+
col1.success(f'Number of qubits match with given SRV {srv_list}.', icon="✅")
|
82 |
+
|
83 |
+
max_gates = col1.select_slider('Max gates', options=[4,8,12,16,20,24,28], value=16)
|
84 |
+
g = col1.slider('Guidance scale', min_value=0.0, max_value=15.0, value=7.5)
|
85 |
|
86 |
if col1.button('Generate circuits'):
|
87 |
fig = get_qcs(srv_list, num_of_qubits, max_gates, g)
|