You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importcovalentasctimportos# AWS resources to pass to the executorbraket_job_execution_role_name="<obtained from tf deployment>"ecr_image_uri="<obtained from tf deployment>"s3_bucket_name="<obtained from tf deployment>"# Instantiate the executorex=ct.executor.BraketExecutor(
s3_bucket_name=s3_bucket_name,
ecr_image_uri=ecr_image_uri,
braket_job_execution_role_name=braket_job_execution_role_name,
)
# Execute the following circuit:# |0> - H - Measure@ct.electron(executor=ex)defsimple_quantum_task(num_qubits: int):
importpennylaneasqml# These are passed to the Hybrid Jobs container at runtimedevice_arn=os.environ["AMZN_BRAKET_DEVICE_ARN"]
s3_bucket=os.environ["AMZN_BRAKET_OUT_S3_BUCKET"]
s3_task_dir=os.environ["AMZN_BRAKET_TASK_RESULTS_S3_URI"].split(s3_bucket)[1]
device=qml.device(
"braket.aws.qubit",
device_arn=device_arn,
s3_destination_folder=(s3_bucket, s3_task_dir),
wires=num_qubits,
)
@qml.qnode(device=device)defsimple_circuit():
qml.Hadamard(wires=[0])
returnqml.expval(qml.PauliZ(wires=[0]))
res=simple_circuit().numpy()
returnres@ct.latticedefsimple_quantum_workflow(num_qubits: int):
returnsimple_quantum_task(num_qubits=num_qubits)
dispatch_id=ct.dispatch(simple_quantum_workflow)(1)
print(dispatch_id)
The text was updated successfully, but these errors were encountered:
Covalent version: 0.220.0.post2
Python version: 3.8
Following error is raised when we try to run with the latest braket image:
The workflow was used to test is:
The text was updated successfully, but these errors were encountered: