Skip to content

converged-computing/quantum-braket

Repository files navigation

quantum-braket

Hybrid quantum-classical workflow experiments using AWS Braket as the quantum backend. These experiments implement a Quantum Approximate Optimization Algorithm (QAOA) for graph max-cut, structured as a pipeline of four Kubernetes pods that can be scheduled independently or as a group.

The experiments are designed to run with the Fluence scheduler plugin for Kubernetes, which uses the Fluxion graph-based scheduler to do informed pod placement. However, the pods themselves have no dependency on Fluence and can run under any Kubernetes scheduler or directly via docker run.

All quantum execution uses the AWS Braket SV1 state vector simulator, which is deterministic and reproducible — suitable for paper experiments. No real QPU access or QPU credits are required.

Pipelines

Two workload types, each a separate pod pipeline sharing the same emptyDir workspace:

Gate-based QAOA (max-cut on k-regular graphs)

problem-generator → transpiler → gateway → optimizer

Backends: SV1 (default), TN1, IonQ Forte, Rigetti Ankaa-3 / Cepheus. Fluence resource type: gate-simulator or gate-qpu.

Analog Hamiltonian Simulation (MIS on unit disk graphs)

ahs-problem-generator → ahs-gateway → mis-postprocessor

Backends: local AHS simulator (default), QuEra Aquila. Fluence resource type: ahs.

These pipelines are mutually incompatible at the backend level. Submitting a gate circuit to an AHS backend (or vice versa) fails at the AWS API. Fluence enforces correct routing at schedule time via typed QPU resource requests — a pod requesting fluxion.flux-framework.org/ahs will never be matched to a gate-simulator or gate-qpu backend, and vice versa.

Prerequisites

  • kind (for local dev) or an existing Kubernetes cluster
  • AWS account with Braket enabled in us-east-1 (SV1 is available in all Braket regions)
  • AWS credentials available as a Kubernetes Secret (see below)
  • kubectl configured to point at your cluster
  • Docker (to build images) or access to the pre-built images at ghcr.io/converged-computing/quantum-braket-*

Cluster setup with Fluence

These experiments are designed to run with Fluence, the Kubernetes scheduler plugin that uses the Fluxion graph-based scheduler. The pods work with any Kubernetes scheduler, but the scheduling experiments (experiment 1) require Fluence.

1. Create a kind cluster with gang scheduling feature gates

Fluence requires GangScheduling and GenericWorkload feature gates. Download the latest kind config directly from the Fluence repo:

wget https://raw.githubusercontent.com/converged-computing/fluence/main/deploy/kind-config.yaml
kind create cluster --image kindest/node:v1.36.1 --config kind-config.yaml

2. Install Fluence

docker pull ghcr.io/converged-computing/fluence:latest
kind load docker-image ghcr.io/converged-computing/fluence:latest

3. Install the quantum resources add-on

This registers QPU backends in the Fluxion graph and advertises them via a device plugin so the scheduler can match quantum resource requests:

# Use our AWS Braket-specific resources config
kubectl apply -f hack/fluence-resources.yaml
kubectl apply -f https://raw.githubusercontent.com/converged-computing/fluence/main/deploy/device-plugin.yaml

# deploy and verify
kubectl apply -f https://raw.githubusercontent.com/converged-computing/fluence/main/deploy/fluence.yaml
kubectl get pods -n kube-system | grep fluence
fluence-78d455fb5c-lkts7                     1/1     Running   0          39s
fluence-deviceplugin-7lkns                   1/1     Running   0          46s
fluence-deviceplugin-9qvrw                   1/1     Running   0          46s
fluence-deviceplugin-k69kw                   1/1     Running   0          46s
fluence-webhook-59f848df6-m82hj              1/1     Running   0          39s

Note that webhooks are not always immediate to be ready.

# if you had previously deployed and need to restart
kubectl rollout restart deployment/fluence -n kube-system

# Confirm QPU resources are visible on nodes
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.allocatable}{"\n"}{end}' \
  | grep fluxion.flux-framework.org
kind-control-plane	{"cpu":"16","ephemeral-storage":"982292956Ki","fluxion.flux-framework.org/qdevice":"1k","fluxion.flux-framework.org/qpu":"1k","fluxion.flux-framework.org/qubit":"1k","hugepages-1Gi":"0","hugepages-2Mi":"0","memory":"61400752Ki","pods":"110"}
kind-worker	{"cpu":"16","ephemeral-storage":"982292956Ki","fluxion.flux-framework.org/qdevice":"1k","fluxion.flux-framework.org/qpu":"1k","fluxion.flux-framework.org/qubit":"1k","hugepages-1Gi":"0","hugepages-2Mi":"0","memory":"61400752Ki","pods":"110"}
kind-worker2	{"cpu":"16","ephemeral-storage":"982292956Ki","fluxion.flux-framework.org/qdevice":"1k","fluxion.flux-framework.org/qpu":"1k","fluxion.flux-framework.org/qubit":"1k","hugepages-1Gi":"0","hugepages-2Mi":"0","memory":"61400752Ki","pods":"110"}

The hack/fluence-resources.yaml in this repo registers the AWS Braket simulators and real QPU backends as QPU vertices.

4. Enable the Braket service-linked IAM role

This is a one-time step per AWS account. If you have never used Braket before, the required IAM service role won't exist yet:

aws iam create-service-linked-role --aws-service-name braket.amazonaws.com

If the role already exists you will get a harmless error saying so — safe to ignore.

5. Create the AWS credentials secret

kubectl create secret generic aws-braket-credentials \
  --from-literal=AWS_ACCESS_KEY_ID=<your-key-id> \
  --from-literal=AWS_SECRET_ACCESS_KEY=<your-secret-key> \
  --from-literal=AWS_DEFAULT_REGION=us-east-1

Experiments

Each experiment directory contains a README.md with the hypothesis, method, and expected metrics, plus the YAML manifests and any analysis scripts needed.

Experiment What it measures
1-scheduling Scheduler overhead; pod placement quality under Fluence vs. default
2-routing Adaptive SV1 vs. QPU routing based on queue depth
3-colocation Classical pod co-location effect on hybrid loop latency
4-scaling Makespan and energy ratio across 5–50 qubit problem sizes

Building images

docker build -t ghcr.io/converged-computing/quantum-braket-problem-generator:latest docker/problem-generator/
docker build -t ghcr.io/converged-computing/quantum-braket-transpiler:latest docker/transpiler/
docker build -t ghcr.io/converged-computing/quantum-braket-gateway:latest docker/gateway/
docker build -t ghcr.io/converged-computing/quantum-braket-optimizer:latest docker/optimizer/
docker build -t ghcr.io/converged-computing/quantum-braket-ahs-gateway:latest docker/ahs-gateway/
docker build -t ghcr.io/converged-computing/quantum-braket-ahs-problem-generator:latest docker/ahs-problem-generator/
docker build -t ghcr.io/converged-computing/quantum-braket-mis-postprocessor:latest docker/mis-postprocessor/
docker push ghcr.io/converged-computing/quantum-braket-problem-generator:latest
docker push ghcr.io/converged-computing/quantum-braket-transpiler:latest
docker push ghcr.io/converged-computing/quantum-braket-gateway:latest
docker push ghcr.io/converged-computing/quantum-braket-optimizer:latest
docker push ghcr.io/converged-computing/quantum-braket-ahs-gateway:latest
docker push ghcr.io/converged-computing/quantum-braket-ahs-problem-generator:latest
docker push ghcr.io/converged-computing/quantum-braket-mis-postprocessor:latest

AWS Braket costs

SV1 charges per task-second of simulation time. For the circuit sizes used in these experiments (≤ 20 qubits, ≤ 100 shots), costs are minimal (typically < $0.01 per full pipeline run). See Braket pricing for details.

Related projects

License

DevTools is distributed under the terms of the MIT license. All new contributions must be made under this license.

See LICENSE, COPYRIGHT, and NOTICE for details.

SPDX-License-Identifier: MIT

LLNL-CODE-842614

About

Hybrid quantum-classical workflow experiments using AWS Braket

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors