Before executing a quantum program, you can estimate the cost using estimate_sample_cost and estimate_sample_batch_cost. These functions return a CostEstimateResult with cost (in USD) and currency fields.
Cost estimation is supported for all quantum providers that Classiq integrates with. Each provider uses its own pricing model.
Basic Usage
Single Sample Cost
Use estimate_sample_cost to estimate the cost of sampling a quantum program with given execution preferences:
Batch Cost Estimation
Use estimate_sample_batch_cost to estimate the cost of sampling with multiple parameter sets:
Provider-Specific Usage
Cost estimation works with the same backend preferences you use for execution. Configure the backend for your target provider and pass it to the estimation functions.
Classiq Simulators
Classiq simulators support cost estimation without provider credentials.
Amazon Braket
Cost estimation supports both Braket simulators (SV1, TN1, dm1) and QPUs (e.g., Aspen-11, Lucy).
When using your own AWS credentials, omit run_via_classiq and provide aws_access_key_id, aws_secret_access_key, s3_bucket_name, and s3_folder.
IonQ
Azure Quantum
When using run_via_classiq, omit credentials. Otherwise, provide Azure credentials.
Summary by Provider
Use run_via_classiq=True when available to estimate costs without providing provider credentials. Your allocated budget is used for execution.
API Reference
See the execution SDK reference for full details on estimate_sample_cost, estimate_sample_batch_cost, and CostEstimateResult.