Build and debug a hybrid job with local mode - Amazon Braket

Build and debug a hybrid job with local mode

If you are building a new hybrid algorithm, local mode helps you to debug and test your algorithm script. Local mode is a feature that allows you to run code you plan to use in Amazon Braket Hybrid Jobs, but without needing Braket to manage the infrastructure for running the hybrid job. Instead, you run hybrid jobs locally on your Braket Notebook instance or on a preferred client such as a laptop or desktop computer. In local mode, you can still send quantum tasks to actual devices, but you do not get the performance benefits when running against an actual QPU while in local mode.

To use local mode, modify AwsQuantumJob to LocalQuantumJob wherever it occurs. For instance, to run the example from Create your first hybrid job, edit the hybrid job script as follows.

from import LocalQuantumJob job = LocalQuantumJob.create( device="arn:aws:braket:::device/quantum-simulator/amazon/sv1", source_module="", entry_point="algorithm_script:start_here", )

Docker, which is already pre-installed in the Amazon Braket notebooks, needs to be installed in your local environment to use this feature. Instructions for installing Docker can be found here. In addition, not all parameters are supported in local mode.