Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -158,56 +158,6 @@ result = simulator.run(compiled_circuit, shots=1024).result()
|
|
| 158 |
# Retrieve and print the counts
|
| 159 |
counts = result.get_counts()
|
| 160 |
print(counts)
|
| 161 |
-
""",
|
| 162 |
-
"9. Genetic Variant Interaction": """
|
| 163 |
-
from qiskit import QuantumCircuit, Aer
|
| 164 |
-
from qiskit_aer import AerSimulator
|
| 165 |
-
|
| 166 |
-
# Genetic variants as entangled qubits
|
| 167 |
-
qc = QuantumCircuit(2, 2)
|
| 168 |
-
qc.h(0) # Variant 1 in superposition
|
| 169 |
-
qc.cx(0, 1) # Entangle with Variant 2
|
| 170 |
-
qc.measure([0, 1], [0, 1])
|
| 171 |
-
|
| 172 |
-
simulator = AerSimulator()
|
| 173 |
-
compiled_circuit = transpile(qc, simulator)
|
| 174 |
-
result = simulator.run(compiled_circuit, shots=1024).result()
|
| 175 |
-
counts = result.get_counts()
|
| 176 |
-
print(counts)
|
| 177 |
-
""",
|
| 178 |
-
"10. DNA Alignment Scoring": """
|
| 179 |
-
from qiskit import QuantumCircuit, Aer
|
| 180 |
-
from qiskit_aer import AerSimulator
|
| 181 |
-
|
| 182 |
-
# Create a Quantum Circuit for DNA alignment
|
| 183 |
-
qc = QuantumCircuit(3, 3)
|
| 184 |
-
|
| 185 |
-
# Simulate possible alignments with superposition
|
| 186 |
-
qc.h([0, 1, 2]) # 3 alignments in parallel
|
| 187 |
-
qc.measure([0, 1, 2], [0, 1, 2])
|
| 188 |
-
|
| 189 |
-
simulator = AerSimulator()
|
| 190 |
-
compiled_circuit = transpile(qc, simulator)
|
| 191 |
-
result = simulator.run(compiled_circuit, shots=1024).result()
|
| 192 |
-
counts = result.get_counts()
|
| 193 |
-
print(counts)
|
| 194 |
-
""",
|
| 195 |
-
"11. Protein Folding Simulation with QAOA": """
|
| 196 |
-
from qiskit import Aer, QuantumCircuit
|
| 197 |
-
from qiskit.algorithms.optimizers import COBYLA
|
| 198 |
-
from qiskit_aer import AerSimulator
|
| 199 |
-
from qiskit.algorithms.minimum_eigensolvers import QAOA
|
| 200 |
-
from qiskit.circuit.library import TwoLocal
|
| 201 |
-
|
| 202 |
-
# Build a QAOA circuit for protein folding
|
| 203 |
-
p = 1
|
| 204 |
-
ansatz = TwoLocal(2, "ry", "cz", reps=p)
|
| 205 |
-
qaoa = QAOA(ansatz=ansatz, optimizer=COBYLA())
|
| 206 |
-
|
| 207 |
-
# Simulate energy minimization
|
| 208 |
-
simulator = AerSimulator()
|
| 209 |
-
qaoa_result = qaoa.compute_minimum_eigenvalue(operator=None)
|
| 210 |
-
print(qaoa_result)
|
| 211 |
"""
|
| 212 |
}
|
| 213 |
|
|
|
|
| 158 |
# Retrieve and print the counts
|
| 159 |
counts = result.get_counts()
|
| 160 |
print(counts)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
"""
|
| 162 |
}
|
| 163 |
|