QClojure Braket contains a backend to run QClojure quantum algorithms with Amazon Braket.
It provides access to the simulators and to quantum hardware (QPUs) supported by Amazon Braket.
⚠️ Important: AWS Braket requires an S3 bucket to store quantum task results. See S3 SETUP for configuration details.
Disclaimers:
The qclojure-braket provides an Amazon Braket backend for QClojure algorithms. To use it in your code, you need both the qclojure and the qclojure-braket dependency in your project definition.
(require '[org.soulspace.qclojure.application.algorithm.bernstein-vazirani :as bv])
(require '[org.soulspace.qclojure.adapter.backend.braket :as braket])
; Define the Amazon Braket simulation backend.
;
; IMPORTANT: You must provide an S3 bucket for storing quantum task results.
; AWS Braket requires this for all quantum task executions.
;
; Ensure you have:
; 1. AWS credentials configured (via environment variables, CLI, or IAM roles)
; 2. An S3 bucket created with appropriate permissions
; 3. The AWS region matches your bucket's region
(def braket-backend
(braket/create-braket-simulator {:s3-bucket "my-braket-results-bucket"
:s3-key-prefix "simulations/"
:region "us-east-1"}))
; Run Bernstein-Vazirani algorithm on Amazon Braket
; with a specific secret string [1 0 1 0] and 1000 shots.
; The result will be a map with the counts of the measured results.
(bv/bernstein-vazirani-algorithm braket-backend [1 0 1 0] {:shots 1000})
The enhanced Braket backend includes:
📚 Documentation - Setup guides, tutorials, and device information
See examples/enhanced_braket_usage.clj for code examples.
© 2025 Ludger Solbach
Eclipse Public License 1.0 (EPL1.0)
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |