question

pmartin-5416 avatar image
1 Vote"
pmartin-5416 asked pmartin-5416 edited

Azure Quantum workspace charges

I seem to have racked up quite a big bill in a few short weeks on Azure Quantum. I am unable to tell what caused this. Are there charges each time I run something at IONQ? I guess I thought a small amount of usage would be free for running some small circuits. I am just unable to tell what the charges are for... Is there a way to get a credit for small business or R&D? Thanks!

azure-quantum
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@pmartin-5416 , I'm working with @HarshitaSingh-MSFT to look into this. IONQ, along with Honeywell and QCI are third party quantum computing providers so it may take us a little longer than usual to get a detailed answer to you.

For the time being, do the charges that you are seeing seem to match what is described on the pricing calculator or is it more that it's difficult to track what resources have been used?

https://azure.microsoft.com/en-us/pricing/details/azure-quantum/

0 Votes 0 ·

Thank you. So I took a look at the pricing calculator, and it only appears to be for the MS Optimizer stuff, not for running on IONQ qpu hardware. I have submitted about 80-100 jobs to ION q- most of which took 1-10sec to run after waiting in the queue. I would expect this to be free like it is on IBM for just doing small 2-3 qubit 2-8 gate operations for learning purposes. It seems to be running about $2 a call. Obviously I can use the simulator, but my particular learning task was to map out where the simulator and the actual hardware differ for a specific circuit. This is fairly common, so I think this is a glitch or something. I realize this is all new and you are working out the bugs, so my intent is to be helpful. This would definitely be a barrier for many folks. Also the cost analyzer does not let you drill down past azure-ionq to see what the charges are for... So they kind of grow quickly (past budget) and you don't know why.

0 Votes 0 ·

Thank you very much for the detailed information, @pmartin-5416 . That is very helpful and much appreciated! I agree, we want to make this as clear and straightforward as possible. I'm going to follow up on my end and may reach out for additional specific information.

0 Votes 0 ·
pmartin-5416 avatar image
1 Vote"
pmartin-5416 answered pmartin-5416 published

I did make some progress that might be helpful to others:

Within Azure Portal:

 Click on <Cost Analysis>  (not the preview one, but the second one)
 Under "Scope" select your Azure Subscription
 Next to that under "View" select <Cost by Resource>

Next over to the right,

 set <Group by:> to "Resource"
 set <Granularity> to "Daily"

Click on a specific day and you will see:

 "Azure applications" under the service name and to the right will be
  `"ionq quantum computer - pay as you go - 1 (or 2) q gate shot"  

and then the cost $x.xx`will be listed.

For about 30 jobs in a day over the course of the day 3 qubits, 8 gates, 1000 shots per job, the daily cost was $84.00 just to give an idea. But most of that cost was because I had a 2 qubit CCNOT gate. There is a nifty little calculator at (which predicts lower costs):

https://ionq.com/programs/research-credits/resource-estimator/

And lastly in the very fine print, there is a minimum cost per run of $1.00 so that explains it...


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

kobulloc-MSFT avatar image
0 Votes"
kobulloc-MSFT answered kobulloc-MSFT commented

Adding to the example given by @pmartin-5416 (thank you!), there is a Quantum computing foundations course on Microsoft Learn. When we ran the module, "Run algorithms on quantum hardware by using Azure Quantum" on IonQ, the cost was roughly $9.

We are working on creating more examples as well as making it easier to better understand job costs and resource consumption. If there's anything that you think would be particularly useful, please let us know!


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Excellent! So just a note for others who might be just getting started in Azure Quantum, working with tech support in Azure and especially Azure Quantum is a great experience. I was able to work through this issue with billing and get it all fair. Thank you folks for all the help - you rock! You've earned a loyal customer. The results I am getting on IONQ are pretty cool and worth the cost now that I can track what I am doing- and the simulator is free to get it all setup. I think it might be helpful to have a small quota of free runs for newbies to actually play around on the real hardware and see the differences between the simulator and the real deal. After that, it is important to be sure folks know to establish a budget and enable some notifications of your Azure costs - just like using the other cloud services there. Hope this is helpful to someone. It would be cool in q# if after a job if it printed the cost of the job....Thanks again!!

1 Vote 1 ·

@pmartin-5416 Thank you for the feedback! It's great to hear that everything got resolved and I know that your experience will be useful for others as they start to explore Azure Quantum. I've made a note of the request for a small quota of free runs for newbies and we're working on improving our documentation for monitoring budgets and expenses for different resources (I'd also love to see a post job expense update as well). We hope you continue to enjoy working with Azure Quantum!

0 Votes 0 ·
pmartin-5416 avatar image
1 Vote"
pmartin-5416 answered pmartin-5416 edited

@kobulloc-MSFT

Python:
I call the following using something like this where a circuit is a class:

 print(f" Approximate actual cost for this run = $ {ionq_cost(circuit.q1_gates,circuit.q2_gates,circuit.shots)} ")

IONq qpu cost estimate function:

 def ionq_cost(q1_gates, q2_gates, shots=500):
  #Function to calculate the cost of running a 
  #circuit on the IONQ qpu hardware (not simulator)
  #q1_gates = number of 1Q Gate 
  #q2_gates = number of 2Q Gate 
  #number of shots requested (500 is the default if not specified)
    
  #Rates available in Azure under provider tab (modify) and subject to change
  #These rates are good as of 5/23/2021
    
  q1_rate = 0.00003 #1q gate shot
  q2_rate = 0.0003  #2q gate shot (ouch)
  flat_fee = 1.00   #flat fee for job
    
  cost = (q1_rate*q1_gates + q2_rate*q2_gates)*shots
    
  total_cost = cost + flat_fee
    
  return total_cost 
    
 #COPYRIGHT (C) 2021 JOAB.AI
 # ALL RIGHTS RESERVED

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.