Skip to Content
DocsPlatform GuideManaging Scripts

Managing Scripts

Scripts are reusable quantum programs stored in your team’s library. They can be run interactively in the playground, submitted as jobs, or used as building blocks for capsules.

Browsing scripts

Navigate to the Scripts page to see two sections:

Platform benchmarks

Pre-built scripts provided by Marqov. These include common quantum algorithms like Bell State circuits, VQE for H2, and QAOA for MaxCut. Platform scripts are available to all users and cannot be modified or deleted. Each card shows the script name, description, category badge, qubit count, and type.

Your custom scripts

Scripts uploaded by you or your team members. Each card shows the script name, description, type, and upload date. Click any script card to open it in the playground.

Script lists update in real time — if a teammate uploads or deletes a script, the change appears immediately without refreshing.

Creating scripts

There are three ways to create a script:

1. Save from the playground

Write code in the playground and click Save. Provide a name and optional description. The script is saved to your team’s library and linked to the playground session.

2. Upload via API

Send a POST request to /api/scripts/upload with your script content:

{ "name": "My VQE Script", "description": "VQE optimization for LiH molecule", "script_content": "from marqov import workflow, task...", "requirements": "numpy==1.24.0\nscipy>=1.10.0", "script_type": "workflow" }

3. Save from a completed job

If a job was submitted with inline code, you can save it as a reusable script via POST /api/scripts with the job_id.

Script validation

When uploading a script, the platform validates it for security and correctness:

Script type detection

Scripts must be either a workflow or task. If you do not specify the type, the platform auto-detects it by looking for @workflow or @task decorators in the code. If neither is found, the upload is rejected with a message asking you to add decorators or specify the type explicitly.

Blocked imports

For security, the following Python modules are blocked in uploaded scripts:

  • subprocess, socket — process/network access
  • requests, urllib, http — HTTP requests (use approved quantum backends instead)
  • ctypes — low-level C interfacing
  • multiprocessing, threading — uncontrolled process/thread creation
  • importlib — dynamic imports
  • eval, exec, compile, builtins — arbitrary code execution

Note: os, json, sys, and open are allowed because they are needed for parameter injection and are commonly used by quantum SDKs.

Requirements validation

If you include a requirements.txt, the platform validates:

  • Package names are well-formed
  • No blocked packages
  • Version specifiers are valid

Warnings are returned for potential issues but do not block the upload.

Editing scripts

Open a saved script in the playground via its card or URL (/run?script_id=<uuid>). If you are the script owner:

  • Save — Updates the script in place (PATCH request)
  • Save As… — Creates a new copy under your account

If you are viewing someone else’s script and make changes, only Save As… is available.

Dependencies

Saved scripts can include pip dependencies in the Dependencies tab. Enter packages in requirements.txt format:

numpy==1.24.0 scipy>=1.10.0 qiskit-aer~=0.13

Dependencies are installed automatically when the script runs as a job.

Deleting scripts

You can delete scripts you own by clicking the trash icon on the script card. This performs a soft delete (sets is_active = false). Deleted scripts no longer appear in the list but existing jobs that reference them are not affected.

Only the script owner can delete a script. Platform benchmark scripts cannot be deleted.

Rate limits

Script uploads are limited to 5 per minute per user.

Last updated on