# IonQ cost estimation

## Overview

When submitting jobs to IonQ devices on QuREKA, credits are calculated based on gate count after circuit compilation and deducted immediately at the time of job submission. No manual confirmation step is required.

---

## Credit Calculation

IonQ billing is calculated based on 1Q and 2Q gate counts in the compiled circuit and the number of shots.

| Item | Credit Rate |
|---|---|
| 1Q Gate unit price | 0.024675 Credit / Gate |
| 2Q Gate unit price | 0.16815 Credit / Gate |
| Minimum Floor – Debiasing OFF | 3,868.485 Credit / Job |
| Minimum Floor – Debiasing ON | 25,229.25 Credit / Job |

**Formula**

> Estimated Credit = (1Q Gate unit price × 1Q Gate count + 2Q Gate unit price × 2Q Gate count) × Shots

The minimum floor applies when the calculated amount falls below the threshold.

---

## How It Works

### 1. Cost Estimation
Before submitting a job, QuREKA automatically performs a cost estimation based on gate count after circuit compilation. No credits are deducted at this stage.

### 2. Automatic Deduction and Execution
Once estimation is complete, credits are deducted immediately and the job is submitted for execution. No manual confirmation step is required.

### 3. View Results
Once the job is complete, you can check the execution results in Quantum Jobs. A full record of credit deductions is available in your credit history.

---

## Debiasing (Error Mitigation)

Debiasing is an optional error mitigation feature provided by IonQ.

- Enabling Debiasing raises the minimum floor charge to **25,229.25 Credits / Job**.
- Debiasing is enabled by default for jobs with **500 or more shots**.
- You can toggle Debiasing manually before job submission.

---

## Estimating Credit Usage in Advance

To preview estimated credit costs before submitting a job, use the **Cost Calculator** in the right panel of the Quantum Server (Notebook) environment.

1. Open your Quantum Server.
2. Click the **Cost Calculator** icon in the right panel.
3. Select the **Gate-based QPU** tab and choose **Forte-1 (IonQ)** as the quantum resource.
4. Enter your circuit conditions: qubit count, 1Q gate count, 2Q gate count, and shots.
5. Click **Calculate estimated credits** to preview the cost.

---

## Important Notes

- Credits are deducted at the time of job submission — no separate confirmation step
- Gate count is finalized after circuit compilation; the actual deduction is based on the compiled circuit
- Job submission will be rejected if your credit balance is insufficient
- If submission fails after deduction, credits are automatically returned