Quickstart
Write and run a quantum workflow in under 5 minutes.
Install Marqov
pip install marqovWrite a Bell State workflow
Create a file called bell_state.py:
from marqov import task, workflow, Circuit, get_device
@task
def create_bell_pair():
"""Build a Bell State circuit: (|00> + |11>) / sqrt(2)."""
return Circuit().h(0).cnot(0, 1)
@task
def measure(circuit):
"""Run the circuit on a simulator and return measurement counts."""
device = get_device({"backend": "local"})
return device.run(circuit, shots=1000)
@workflow(name="Bell-State")
def bell_state():
circuit = create_bell_pair()
counts = measure(circuit)
return {
"counts": counts,
"_summary": {
"Circuit": "Bell State",
"Shots": "1000",
}
}This script defines two tasks and one workflow. Marqov builds a dependency graph automatically: create_bell_pair runs first, then measure uses its output.
Run it
Option 1: On the Marqov platform
- Go to the Playground
- Paste the script above
- Click Run on Server
- View results — you’ll see measurement counts (
{"00": ~500, "11": ~500}) and the execution dashboard
Option 2: With Temporal locally
import asyncio
from temporalio.client import Client
async def main():
client = await Client.connect("localhost:7233")
dispatch = bell_state()
result = await dispatch.run(client)
print(result)
asyncio.run(main())What happened?
@taskmarkscreate_bell_pairandmeasureas parallelizable units of work@workflowcomposes them into a dependency graph- Marqov dispatches the workflow to Temporal, which executes tasks in the correct order
- The
_summarydict produces dashboard cards in the Marqov UI
Next steps
- Key Concepts — Understand the building blocks
- Building a VQE — A more complex example with parallel tasks
- Supported Frameworks — Use Qiskit, Braket, PennyLane, or Cirq
Last updated on