Spaces:
Sleeping
Sleeping
aishani-s20 commited on
Commit ·
83d8330
1
Parent(s): f7d5587
updated toml
Browse files- .gitignore +1 -1
- __init__.py +3 -3
- graders.py +1 -1
- openenv.yaml +4 -4
- pyproject.toml +6 -5
- server/__init__.py +1 -1
- server/app.py +2 -6
- server/quantum_openenv_env_environment.py +3 -5
.gitignore
CHANGED
|
@@ -3,4 +3,4 @@ __pycache__
|
|
| 3 |
quantum_env
|
| 4 |
*.pyc
|
| 5 |
.env
|
| 6 |
-
|
|
|
|
| 3 |
quantum_env
|
| 4 |
*.pyc
|
| 5 |
.env
|
| 6 |
+
*.egg-info/
|
__init__.py
CHANGED
|
@@ -6,9 +6,9 @@
|
|
| 6 |
|
| 7 |
"""Quantum Openenv Env Environment."""
|
| 8 |
|
| 9 |
-
from
|
| 10 |
-
from
|
| 11 |
-
from
|
| 12 |
|
| 13 |
__all__ = [
|
| 14 |
"QuantumAction",
|
|
|
|
| 6 |
|
| 7 |
"""Quantum Openenv Env Environment."""
|
| 8 |
|
| 9 |
+
from client import QuantumOpenenvEnv
|
| 10 |
+
from models import QuantumAction, QuantumObservation
|
| 11 |
+
from graders import grade_easy, grade_medium, grade_hard
|
| 12 |
|
| 13 |
__all__ = [
|
| 14 |
"QuantumAction",
|
graders.py
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
Standalone graders for the Quantum Circuit Optimization Environment.
|
| 9 |
"""
|
| 10 |
|
| 11 |
-
from
|
| 12 |
|
| 13 |
|
| 14 |
def grade_easy(observation: QuantumObservation) -> float:
|
|
|
|
| 8 |
Standalone graders for the Quantum Circuit Optimization Environment.
|
| 9 |
"""
|
| 10 |
|
| 11 |
+
from models import QuantumObservation
|
| 12 |
|
| 13 |
|
| 14 |
def grade_easy(observation: QuantumObservation) -> float:
|
openenv.yaml
CHANGED
|
@@ -1,22 +1,22 @@
|
|
| 1 |
name: "quantum_circuit_optimizer"
|
| 2 |
version: "0.1.0"
|
| 3 |
description: "An OpenEnv environment for optimizing multi-qubit quantum circuits using RL/LLM agents."
|
| 4 |
-
entrypoint: "
|
| 5 |
tasks:
|
| 6 |
- id: "easy"
|
| 7 |
name: "Easy Circuit Optimization"
|
| 8 |
description: "2 qubits, single-qubit gates only."
|
| 9 |
difficulty: "easy"
|
| 10 |
-
grader: "
|
| 11 |
|
| 12 |
- id: "medium"
|
| 13 |
name: "Medium Circuit Optimization"
|
| 14 |
description: "4 qubits with basic CNOT/SWAP entanglement."
|
| 15 |
difficulty: "medium"
|
| 16 |
-
grader: "
|
| 17 |
|
| 18 |
- id: "hard"
|
| 19 |
name: "Hard Circuit Optimization"
|
| 20 |
description: "6 qubits with deep entanglement and complex blockades."
|
| 21 |
difficulty: "hard"
|
| 22 |
-
grader: "
|
|
|
|
| 1 |
name: "quantum_circuit_optimizer"
|
| 2 |
version: "0.1.0"
|
| 3 |
description: "An OpenEnv environment for optimizing multi-qubit quantum circuits using RL/LLM agents."
|
| 4 |
+
entrypoint: "server.quantum_openenv_env_environment:QuantumCircuitOptimizationEnvironment"
|
| 5 |
tasks:
|
| 6 |
- id: "easy"
|
| 7 |
name: "Easy Circuit Optimization"
|
| 8 |
description: "2 qubits, single-qubit gates only."
|
| 9 |
difficulty: "easy"
|
| 10 |
+
grader: "graders:grade_easy"
|
| 11 |
|
| 12 |
- id: "medium"
|
| 13 |
name: "Medium Circuit Optimization"
|
| 14 |
description: "4 qubits with basic CNOT/SWAP entanglement."
|
| 15 |
difficulty: "medium"
|
| 16 |
+
grader: "graders:grade_medium"
|
| 17 |
|
| 18 |
- id: "hard"
|
| 19 |
name: "Hard Circuit Optimization"
|
| 20 |
description: "6 qubits with deep entanglement and complex blockades."
|
| 21 |
difficulty: "hard"
|
| 22 |
+
grader: "graders:grade_hard"
|
pyproject.toml
CHANGED
|
@@ -31,11 +31,12 @@ dev = [
|
|
| 31 |
]
|
| 32 |
|
| 33 |
[project.scripts]
|
| 34 |
-
# Server entry point
|
| 35 |
-
|
| 36 |
-
server = "quantum_openenv_env.server.app:main"
|
| 37 |
|
| 38 |
[tool.setuptools]
|
| 39 |
include-package-data = true
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
| 31 |
]
|
| 32 |
|
| 33 |
[project.scripts]
|
| 34 |
+
# Server entry point updated to match the standard layout
|
| 35 |
+
server = "server.app:main"
|
|
|
|
| 36 |
|
| 37 |
[tool.setuptools]
|
| 38 |
include-package-data = true
|
| 39 |
+
# We explicitly tell setuptools to package the 'server' folder
|
| 40 |
+
# and the standalone python scripts at the root level, without aliases.
|
| 41 |
+
packages = ["server"]
|
| 42 |
+
py-modules = ["client", "graders", "inference", "models"]
|
server/__init__.py
CHANGED
|
@@ -7,7 +7,7 @@
|
|
| 7 |
"""Quantum Openenv Env environment server components."""
|
| 8 |
|
| 9 |
from .quantum_openenv_env_environment import QuantumCircuitOptimizationEnvironment
|
| 10 |
-
from
|
| 11 |
|
| 12 |
__all__ = [
|
| 13 |
"QuantumCircuitOptimizationEnvironment",
|
|
|
|
| 7 |
"""Quantum Openenv Env environment server components."""
|
| 8 |
|
| 9 |
from .quantum_openenv_env_environment import QuantumCircuitOptimizationEnvironment
|
| 10 |
+
from graders import grade_easy, grade_medium, grade_hard
|
| 11 |
|
| 12 |
__all__ = [
|
| 13 |
"QuantumCircuitOptimizationEnvironment",
|
server/app.py
CHANGED
|
@@ -35,12 +35,8 @@ except Exception as e: # pragma: no cover
|
|
| 35 |
"openenv is required for the web interface. Install dependencies with '\n uv sync\n'"
|
| 36 |
) from e
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
from .quantum_openenv_env_environment import QuantumCircuitOptimizationEnvironment
|
| 41 |
-
except ModuleNotFoundError:
|
| 42 |
-
from models import QuantumAction, QuantumObservation
|
| 43 |
-
from server.quantum_openenv_env_environment import QuantumCircuitOptimizationEnvironment
|
| 44 |
|
| 45 |
|
| 46 |
# Create the app with web interface and README integration
|
|
|
|
| 35 |
"openenv is required for the web interface. Install dependencies with '\n uv sync\n'"
|
| 36 |
) from e
|
| 37 |
|
| 38 |
+
from models import QuantumAction, QuantumObservation
|
| 39 |
+
from server.quantum_openenv_env_environment import QuantumCircuitOptimizationEnvironment
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
|
| 42 |
# Create the app with web interface and README integration
|
server/quantum_openenv_env_environment.py
CHANGED
|
@@ -20,10 +20,8 @@ from uuid import uuid4
|
|
| 20 |
from openenv.core.env_server.interfaces import Environment
|
| 21 |
from openenv.core.env_server.types import State
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
except ImportError:
|
| 26 |
-
from models import QuantumAction, QuantumGate, QuantumObservation
|
| 27 |
|
| 28 |
|
| 29 |
# ============================================================================
|
|
@@ -83,7 +81,7 @@ TASK_CONFIGS = {
|
|
| 83 |
# Graders are now defined in ../graders.py
|
| 84 |
|
| 85 |
# Exporting for inference.py and Hackathon Platform
|
| 86 |
-
from
|
| 87 |
|
| 88 |
GRADERS = {
|
| 89 |
"easy": grade_easy,
|
|
|
|
| 20 |
from openenv.core.env_server.interfaces import Environment
|
| 21 |
from openenv.core.env_server.types import State
|
| 22 |
|
| 23 |
+
|
| 24 |
+
from models import QuantumAction, QuantumGate, QuantumObservation
|
|
|
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
# ============================================================================
|
|
|
|
| 81 |
# Graders are now defined in ../graders.py
|
| 82 |
|
| 83 |
# Exporting for inference.py and Hackathon Platform
|
| 84 |
+
from graders import grade_easy, grade_medium, grade_hard
|
| 85 |
|
| 86 |
GRADERS = {
|
| 87 |
"easy": grade_easy,
|