Estimating the cost of the device
The following code shows how to estimate the cost of the different devices. Because we assigned the device in the last section, we can further use the device to determine the cost. The estimate_cost
function has the appropriate calculations to estimate the cost of the device that is passed through along with the number of shots. The default number of shots is 1000
.
Let’s get started! Perform the following steps:
- The following function calculates the costs of the simulators on a cost per minute basis, while the cost of the quantum devices is calculated based on the QPU rate and the number of shots. Note that this function is making some assumptions about the
cost_per_task
amount, and the available QPUs and simulators. Please update these in the code ifcost_per_task
has changed in the Amazon Braket pricing table:def estimate_cost(device,num_shots=1000): #device=set_device(Name) cost_per_task...