ProviderConfig
Provider-specific configuration data for execution, such as API keys and machine-specific parameters.ExecutionPreferences
Represents the execution settings for running a quantum program. Execution preferences for running a quantum program. For more details, refer to: ExecutionPreferences example: ExecutionPreferences.. Attributes:TranspilationOption
Transpilation optimization level for quantum circuits. Attributes:ExecutionSession
A session for executing a quantum program or OpenQASM source text.ExecutionSession allows to execute the quantum program with different parameters and operations without the need to re-synthesize the model.
The session must be closed in order to ensure resources are properly cleaned up. It’s recommended to use ExecutionSession as a context manager for this purpose. Alternatively, you can directly use the close method.
Methods:
Attributes:
close
close(
self:
) -> None
Close the session and clean up its resources.
Parameters:
get_session_id
get_session_id(
self:
) -> str
Parameters:
update_execution_preferences
update_execution_preferences(
self: ,
execution_preferences: ExecutionPreferences | None
) -> None
Update the execution preferences for the session.
Parameters:
Returns:
- Type:
None
sample
sample(
self: ,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> ExecutionDetails | list[ExecutionDetails]
Samples the quantum program with the given parameters, if any.
Parameters:
Returns:
- Type:
ExecutionDetails \| list[ExecutionDetails] - The result of the sampling, or a list of results when
parametersis a list.
submit_sample
submit_sample(
self: ,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> ExecutionJob
Initiates an execution job with the sample primitive.
This is a non-blocking version of sample: it gets the same parameters and initiates the same execution job, but instead
of waiting for the result, it returns the job object immediately.
Parameters:
Returns:
- Type:
ExecutionJob - The execution job.
calculate_state_vector
calculate_state_vector(
self: ,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
filters: dict[str, Any] | None = None,
amplitude_threshold: float = 0.0
) -> DataFrame | list[DataFrame]
Calculate the state vector of the quantum program.
The session must be configured with a Classiq simulator
("classiq/simulator", "classiq/nvidia_simulator") or
"google/cuquantum". The corresponding statevector variant is
selected automatically; callers do not need to know about the
_statevector backend names.
Parameters:
Returns:
- Type:
DataFrame \| list[DataFrame] - A dataframe containing the state vector, or a list of dataframes when
parametersis a list.
submit_calculate_state_vector
submit_calculate_state_vector(
self: ,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
filters: dict[str, Any] | None = None,
amplitude_threshold: float = 0.0
) -> ExecutionJob
Initiates an execution job with the calculate_state_vector primitive.
This is a non-blocking version of calculate_state_vector(): it gets
the same parameters and initiates the same execution job, but instead of
waiting for the result, it returns the job object immediately.
Parameters:
Returns:
- Type:
ExecutionJob - The execution job.
batch_sample
batch_sample(
self: ,
parameters: list[ExecutionParams]
) -> list[ExecutionDetails]
Samples the quantum program multiple times with the given parameters for each iteration. The number of samples is determined by the length of the parameters list.
Deprecated: Pass a list of parameter dicts to sample() instead.
Parameters:
Returns:
- Type:
list[ExecutionDetails] - List[ExecutionDetails]: The results of all the sampling iterations.
submit_batch_sample
submit_batch_sample(
self: ,
parameters: list[ExecutionParams]
) -> ExecutionJob
Initiates an execution job with the batch_sample primitive.
Deprecated: Pass a list of parameter dicts to submit_sample() instead.
Parameters:
Returns:
- Type:
ExecutionJob - The execution job.
observe
observe(
self: ,
hamiltonian: Hamiltonian,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> EstimationResult | list[EstimationResult]
Estimates the expectation value of the given Hamiltonian using the quantum program.
Parameters:
Returns:
- Type:
EstimationResult \| list[EstimationResult] - The estimation result, or a list of results when
parameters - is a list.
submit_observe
submit_observe(
self: ,
hamiltonian: Hamiltonian,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> ExecutionJob
Initiates an execution job with the observe primitive.
This is a non-blocking version of observe(): it gets the same
parameters and initiates the same execution job, but instead of waiting
for the result, it returns the job object immediately.
Parameters:
Returns:
- Type:
ExecutionJob - The execution job.
estimate
estimate(
self: ,
hamiltonian: Hamiltonian,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> EstimationResult | list[EstimationResult]
Estimates the expectation value of the given Hamiltonian using the quantum program.
Deprecated: estimate is deprecated and will no longer be supported starting on 2026-06-22. Use observe() instead.
Parameters:
submit_estimate
submit_estimate(
self: ,
hamiltonian: Hamiltonian,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> ExecutionJob
Initiates an execution job with the estimate primitive.
Deprecated: submit_estimate is deprecated and will no longer be supported starting on 2026-06-22. Use submit_observe() instead.
Parameters:
batch_estimate
batch_estimate(
self: ,
hamiltonian: Hamiltonian,
parameters: list[ExecutionParams]
) -> list[EstimationResult]
Estimates the expectation value of the given Hamiltonian multiple times using the quantum program, with the given parameters for each iteration. The number of estimations is determined by the length of the parameters list.
Deprecated: Pass a list of parameter dicts to observe() instead.
Parameters:
Returns:
- Type:
list[EstimationResult] - List[EstimationResult]: The results of all the estimation iterations.
submit_batch_estimate
submit_batch_estimate(
self: ,
hamiltonian: Hamiltonian,
parameters: list[ExecutionParams]
) -> ExecutionJob
Initiates an execution job with the batch_estimate primitive.
Deprecated: Pass a list of parameter dicts to submit_observe() instead.
Parameters:
Returns:
- Type:
ExecutionJob - The execution job.
variational_minimize
variational_minimize(
self: ,
cost_function: Hamiltonian | QmodExpressionCreator,
initial_params: ExecutionParams,
max_iteration: int,
quantile: float = 1.0,
tolerance: float | None = None,
hosted: bool = False,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> list[tuple[float, ExecutionParams]]
Variationally minimizes the given cost function using the quantum program.
Parameters:
Returns:
- Type:
list[tuple[float, ExecutionParams]] - A list of tuples, each containing the estimated cost and the corresponding parameters for that iteration.
costis a float, andparametersis a dictionary matching the execution parameter format.
minimize
minimize(
self: ,
cost_function: Hamiltonian | QmodExpressionCreator,
initial_params: ExecutionParams,
max_iteration: int,
quantile: float = 1.0,
tolerance: float | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> list[tuple[float, ExecutionParams]]
Deprecated: Use variational_minimize() instead.
This name is kept for backward compatibility and will be removed in a future release.
Parameters:
submit_variational_minimize
submit_variational_minimize(
self: ,
cost_function: Hamiltonian | QmodExpressionCreator,
initial_params: ExecutionParams,
max_iteration: int,
quantile: float = 1.0,
tolerance: float | None = None,
hosted: bool = False,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> ExecutionJob
Initiates an execution job with the variational minimization primitive.
Non-blocking counterpart of variational_minimize(): same parameters and job,
but returns the ExecutionJob immediately.
Parameters:
Returns:
- Type:
ExecutionJob - The execution job. When
hosted=Trueon an IonQ backend, the backend - worker submits and polls IonQ Hosted Hybrid while this job tracks
- progress through the standard Classiq execution API.
submit_minimize
submit_minimize(
self: ,
cost_function: Hamiltonian | QmodExpressionCreator,
initial_params: ExecutionParams,
max_iteration: int,
quantile: float = 1.0,
tolerance: float | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> ExecutionJob
Deprecated: Use submit_variational_minimize() instead.
This name is kept for backward compatibility and will be removed in a future release.
Parameters:
estimate_cost
estimate_cost(
self: ,
cost_func: Callable[[ParsedState], float],
parameters: ExecutionParams | None = None,
quantile: float = 1.0,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> float
Estimates circuit cost using a classical cost function.
Parameters:
Returns:
- Type:
float - cost estimation
set_measured_state_filter
set_measured_state_filter(
self: ,
output_name: str,
condition: Callable
) -> None
When simulating on a statevector simulator, emulate the behavior of postprocessing
by discarding amplitudes for which their states are “undesirable”.
Parameters:
sample
sample(
qprog: QuantumProgram | str,
backend: str | None = None,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
config: dict[str, Any] | ProviderConfig | None = None,
num_shots: int | None = None,
random_seed: int | None = None,
transpilation_option: TranspilationOption = TranspilationOption.DECOMPOSE,
run_via_classiq: bool = False
) -> DataFrame | list[DataFrame]
Sample a quantum program or OpenQASM circuit.
Parameters:
Returns:
- Type:
DataFrame \| list[DataFrame] - A dataframe containing the histogram, or a list of dataframes when
parametersis a list.
BraketConfig
Configuration specific to Amazon Braket. Attributes:IBMConfig
Configuration specific to IBM. Attributes:IonQConfig
Configuration specific to IonQ. Attributes: api_key (PydanticIonQApiKeyType | None): Key to access IonQ API. error_mitigation (bool): A configuration option to enable or disable error mitigation during execution. Defaults toFalse.
emulate (bool): If True, run on IonQ simulator with noise model derived from the backend name. Defaults to False.
Attributes:
AzureConfig
Configuration specific to Azure. Attributes:AQTConfig
Configuration specific to AQT (Alpine Quantum Technologies). Attributes:AliceBobConfig
Configuration specific to Alice&Bob. Attributes:ProviderConfig
Provider-specific configuration data for execution, such as API keys and machine-specific parameters.ExecutionSession
A session for executing a quantum program or OpenQASM source text.ExecutionSession allows to execute the quantum program with different parameters and operations without the need to re-synthesize the model.
The session must be closed in order to ensure resources are properly cleaned up. It’s recommended to use ExecutionSession as a context manager for this purpose. Alternatively, you can directly use the close method.
Methods:
Attributes:
close
close(
self:
) -> None
Close the session and clean up its resources.
Parameters:
get_session_id
get_session_id(
self:
) -> str
Parameters:
update_execution_preferences
update_execution_preferences(
self: ,
execution_preferences: ExecutionPreferences | None
) -> None
Update the execution preferences for the session.
Parameters:
Returns:
- Type:
None
sample
sample(
self: ,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> ExecutionDetails | list[ExecutionDetails]
Samples the quantum program with the given parameters, if any.
Parameters:
Returns:
- Type:
ExecutionDetails \| list[ExecutionDetails] - The result of the sampling, or a list of results when
parametersis a list.
submit_sample
submit_sample(
self: ,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> ExecutionJob
Initiates an execution job with the sample primitive.
This is a non-blocking version of sample: it gets the same parameters and initiates the same execution job, but instead
of waiting for the result, it returns the job object immediately.
Parameters:
Returns:
- Type:
ExecutionJob - The execution job.
calculate_state_vector
calculate_state_vector(
self: ,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
filters: dict[str, Any] | None = None,
amplitude_threshold: float = 0.0
) -> DataFrame | list[DataFrame]
Calculate the state vector of the quantum program.
The session must be configured with a Classiq simulator
("classiq/simulator", "classiq/nvidia_simulator") or
"google/cuquantum". The corresponding statevector variant is
selected automatically; callers do not need to know about the
_statevector backend names.
Parameters:
Returns:
- Type:
DataFrame \| list[DataFrame] - A dataframe containing the state vector, or a list of dataframes when
parametersis a list.
submit_calculate_state_vector
submit_calculate_state_vector(
self: ,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
filters: dict[str, Any] | None = None,
amplitude_threshold: float = 0.0
) -> ExecutionJob
Initiates an execution job with the calculate_state_vector primitive.
This is a non-blocking version of calculate_state_vector(): it gets
the same parameters and initiates the same execution job, but instead of
waiting for the result, it returns the job object immediately.
Parameters:
Returns:
- Type:
ExecutionJob - The execution job.
batch_sample
batch_sample(
self: ,
parameters: list[ExecutionParams]
) -> list[ExecutionDetails]
Samples the quantum program multiple times with the given parameters for each iteration. The number of samples is determined by the length of the parameters list.
Deprecated: Pass a list of parameter dicts to sample() instead.
Parameters:
Returns:
- Type:
list[ExecutionDetails] - List[ExecutionDetails]: The results of all the sampling iterations.
submit_batch_sample
submit_batch_sample(
self: ,
parameters: list[ExecutionParams]
) -> ExecutionJob
Initiates an execution job with the batch_sample primitive.
Deprecated: Pass a list of parameter dicts to submit_sample() instead.
Parameters:
Returns:
- Type:
ExecutionJob - The execution job.
observe
observe(
self: ,
hamiltonian: Hamiltonian,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> EstimationResult | list[EstimationResult]
Estimates the expectation value of the given Hamiltonian using the quantum program.
Parameters:
Returns:
- Type:
EstimationResult \| list[EstimationResult] - The estimation result, or a list of results when
parameters - is a list.
submit_observe
submit_observe(
self: ,
hamiltonian: Hamiltonian,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> ExecutionJob
Initiates an execution job with the observe primitive.
This is a non-blocking version of observe(): it gets the same
parameters and initiates the same execution job, but instead of waiting
for the result, it returns the job object immediately.
Parameters:
Returns:
- Type:
ExecutionJob - The execution job.
estimate
estimate(
self: ,
hamiltonian: Hamiltonian,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> EstimationResult | list[EstimationResult]
Estimates the expectation value of the given Hamiltonian using the quantum program.
Deprecated: estimate is deprecated and will no longer be supported starting on 2026-06-22. Use observe() instead.
Parameters:
submit_estimate
submit_estimate(
self: ,
hamiltonian: Hamiltonian,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> ExecutionJob
Initiates an execution job with the estimate primitive.
Deprecated: submit_estimate is deprecated and will no longer be supported starting on 2026-06-22. Use submit_observe() instead.
Parameters:
batch_estimate
batch_estimate(
self: ,
hamiltonian: Hamiltonian,
parameters: list[ExecutionParams]
) -> list[EstimationResult]
Estimates the expectation value of the given Hamiltonian multiple times using the quantum program, with the given parameters for each iteration. The number of estimations is determined by the length of the parameters list.
Deprecated: Pass a list of parameter dicts to observe() instead.
Parameters:
Returns:
- Type:
list[EstimationResult] - List[EstimationResult]: The results of all the estimation iterations.
submit_batch_estimate
submit_batch_estimate(
self: ,
hamiltonian: Hamiltonian,
parameters: list[ExecutionParams]
) -> ExecutionJob
Initiates an execution job with the batch_estimate primitive.
Deprecated: Pass a list of parameter dicts to submit_observe() instead.
Parameters:
Returns:
- Type:
ExecutionJob - The execution job.
variational_minimize
variational_minimize(
self: ,
cost_function: Hamiltonian | QmodExpressionCreator,
initial_params: ExecutionParams,
max_iteration: int,
quantile: float = 1.0,
tolerance: float | None = None,
hosted: bool = False,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> list[tuple[float, ExecutionParams]]
Variationally minimizes the given cost function using the quantum program.
Parameters:
Returns:
- Type:
list[tuple[float, ExecutionParams]] - A list of tuples, each containing the estimated cost and the corresponding parameters for that iteration.
costis a float, andparametersis a dictionary matching the execution parameter format.
minimize
minimize(
self: ,
cost_function: Hamiltonian | QmodExpressionCreator,
initial_params: ExecutionParams,
max_iteration: int,
quantile: float = 1.0,
tolerance: float | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> list[tuple[float, ExecutionParams]]
Deprecated: Use variational_minimize() instead.
This name is kept for backward compatibility and will be removed in a future release.
Parameters:
submit_variational_minimize
submit_variational_minimize(
self: ,
cost_function: Hamiltonian | QmodExpressionCreator,
initial_params: ExecutionParams,
max_iteration: int,
quantile: float = 1.0,
tolerance: float | None = None,
hosted: bool = False,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> ExecutionJob
Initiates an execution job with the variational minimization primitive.
Non-blocking counterpart of variational_minimize(): same parameters and job,
but returns the ExecutionJob immediately.
Parameters:
Returns:
- Type:
ExecutionJob - The execution job. When
hosted=Trueon an IonQ backend, the backend - worker submits and polls IonQ Hosted Hybrid while this job tracks
- progress through the standard Classiq execution API.
submit_minimize
submit_minimize(
self: ,
cost_function: Hamiltonian | QmodExpressionCreator,
initial_params: ExecutionParams,
max_iteration: int,
quantile: float = 1.0,
tolerance: float | None = None,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> ExecutionJob
Deprecated: Use submit_variational_minimize() instead.
This name is kept for backward compatibility and will be removed in a future release.
Parameters:
estimate_cost
estimate_cost(
self: ,
cost_func: Callable[[ParsedState], float],
parameters: ExecutionParams | None = None,
quantile: float = 1.0,
num_shots: int | None = None,
run_via_classiq: bool | None = None
) -> float
Estimates circuit cost using a classical cost function.
Parameters:
Returns:
- Type:
float - cost estimation
set_measured_state_filter
set_measured_state_filter(
self: ,
output_name: str,
condition: Callable
) -> None
When simulating on a statevector simulator, emulate the behavior of postprocessing
by discarding amplitudes for which their states are “undesirable”.
Parameters:
ExecutionPreferences
Represents the execution settings for running a quantum program. Execution preferences for running a quantum program. For more details, refer to: ExecutionPreferences example: ExecutionPreferences.. Attributes:CostEstimateResult
Result of sample cost estimation. Attributes:BackendPreferences
Preferences for the execution of the quantum program. Methods:
Attributes:
batch_preferences
batch_preferences(
cls: ,
backend_names: Iterable[str],
kwargs: Any =
) -> list[BackendPreferences]
Parameters:
is_nvidia_backend
is_nvidia_backend(
self:
) -> bool
Parameters:
program_id_scope
program_id_scope(
program_id: str | None
) -> Generator[None, None, None]
Within the scope, HTTP spans emitted by Client.request stamp
classiq.program.id. None = no-op, leaves any outer scope intact.
Parameters:
ExecutionJobResults
Results fromExecutionJob.result(): list-like with job-level metadata.
Attributes:
SubmittedCircuit
A quantum circuit that was submitted to the provider. Wraps the circuit in QASM format. Use to_qasm() for the text representation or to_qiskit() for a Qiskit QuantumCircuit (requires qiskit). Methods:to_qasm
to_qasm(
self:
) -> str
Return the circuit as a QASM string (OpenQASM 2.0 or 3.0).
Parameters:
to_qiskit
to_qiskit(
self:
) -> Any
Return the circuit as a Qiskit QuantumCircuit. Requires qiskit.
Parameters:
ExecutionJobFilters
Filter parameters for querying execution jobs. All filters are combined using AND logic: only jobs matching all specified filters are returned. Range filters (with _min/_max suffixes) are inclusive. Datetime filters are compared against the job’s timestamps. Methods:
Attributes:
format_filters
format_filters(
self:
) -> dict[str, Any]
Convert filter fields to API kwargs, excluding None values and converting datetimes.
Parameters:
get_execution_jobs
get_execution_jobs(
offset: int = 0,
limit: int = 50
) -> list[ExecutionJob]
Query execution jobs.
Parameters:
Returns:
- Type:
list[ExecutionJob] - List of ExecutionJob objects.
get_execution_actions
get_execution_actions(
offset: int = 0,
limit: int = 50,
filters: ExecutionJobFilters | None = None
) -> pd.DataFrame
Query execution jobs with optional filters.
Parameters:
Returns:
- Type:
pd.DataFrame - pandas.DataFrame containing execution job information with columns:
- id, name, start_time, end_time, provider, backend_name, status,
- num_shots, program_id, error, total_cost, currency_code, runtime_ms
- (provider-reported hardware execution duration in milliseconds when available).
BenchmarkClass
Benchmark problem classes supported by the Classiq platform. Attributes:BenchmarkRequest
Request body forrun_benchmark.
Submits one benchmark class across multiple problem_sizes and backend
targets in a single asynchronous session.
Attributes:
BackendExecutionDetails
Execution configuration for a benchmark backend target. The object defines how all requestedproblem_sizes should run on a
specific backend.
Attributes:
BenchmarkSession
A handle to a submitted benchmark run. This is the same serializable session object the API returns from the submit endpoint (so SDK users and other services share the contract), extended with convenience methods for fetching results from Python.run_benchmark returns the session immediately, without waiting for
the executions to finish. Use fetch_results (or
fetch_results_async) to retrieve the current status and result of
every submitted job; results that reached a final status are cached and not
re-fetched.
Methods:
fetch_results_async
fetch_results_async(
self: ,
_http_client: httpx.AsyncClient | None = None
) -> list[BackendBenchmarkResult]
Fetch the current status and result of every submitted job.
Parameters:
Returns:
- Type: list[BackendBenchmarkResult]
- Latest per-job results for all successfully submitted targets in this session.
fetch_results
fetch_results(
self: ,
_http_client: httpx.AsyncClient | None = None
) -> list[BackendBenchmarkResult]
Synchronous wrapper for fetch_results_async.
Parameters:
Returns:
- Type: list[BackendBenchmarkResult]
- Latest per-job results for all successfully submitted targets in this session.
cancel_async
cancel_async(
self: ,
_http_client: httpx.AsyncClient | None = None
) -> None
Request cancellation of all incomplete jobs in this benchmark session.
Parameters:
cancel
cancel(
self: ,
_http_client: httpx.AsyncClient | None = None
) -> None
Synchronous wrapper for cancel_async.
Request cancellation of all incomplete jobs in this benchmark session
Parameters:
to_dataframe
to_dataframe(
self:
) -> BenchmarkResponse
Per-target benchmark table built from the results fetched so far.
Columns: problem_size, success, error, run_via_classiq,
transpilation_option, score, cost, submission_date.
Targets whose result has not been fetched (or is still pending) appear as
unsuccessful rows with a missing score.
Parameters:
BenchmarkSessionTarget
A single execution target within a benchmark session.job_id is the internal handle used to fetch this target’s result; it is
None when the submission itself failed (submission_error is then
populated). execution_job_id is the actual execution job id when it is
known.
Attributes:
BenchmarkSessionsQueryResults
List response payload for benchmark session queries. Attributes:BenchmarkJobStatus
Status of an asynchronously tracked benchmark job.PENDING means the job is still in progress.
COMPLETED means execution and scoring succeeded.
FAILED means execution or scoring failed.
CANCELLED means the job was cancelled before completion.
Attributes:
BackendBenchmarkResult
Asynchronously-fetched result for a previously submitted benchmark job. Attributes:BackendBenchmarkResponse
Benchmark execution outcome for a single backend target. Attributes:BenchmarkResponse
Tabular benchmark response wrapper returned byBenchmarkSession.to_dataframe.
Attributes:
BenchmarkTargetError
Structured error details for a benchmark target failure. Attributes:BackendBenchmark
Benchmark score payload for a completed backend run. Attributes:BenchmarkMetadata
Metadata captured for a completed benchmark target run. Attributes:BackendExecutionDetailsResponse
Backend execution settings recorded in benchmark result metadata. Attributes:BenchmarkClassMetadata
Metadata associated with a benchmark class. Attributes:ProblemSizeLimits
Optional lower/upper bounds for valid problem sizes of a class. Attributes:Functions
calculate_state_vector
calculate_state_vector(
qprog: QuantumProgram,
backend: str | None = None,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
filters: dict[str, Any] | None = None,
random_seed: int | None = None,
transpilation_option: TranspilationOption = TranspilationOption.DECOMPOSE,
amplitude_threshold: float = 0.0
) -> DataFrame | list[DataFrame]
Calculate the state vector of a quantum program.
This function is only available for Classiq simulators
(e.g. "classiq/simulator").
Parameters:
Returns:
- Type:
DataFrame \| list[DataFrame] - A dataframe containing the state vector, or a list of dataframes when
parametersis a list.
observe
observe(
qprog: QuantumProgram,
observable: SparsePauliOp,
backend: str | None = None,
estimate: bool = True,
parameters: ExecutionParams | list[ExecutionParams] | None = None,
config: dict[str, Any] | ProviderConfig | None = None,
num_shots: int | None = None,
random_seed: int | None = None,
transpilation_option: TranspilationOption = TranspilationOption.DECOMPOSE,
run_via_classiq: bool = False
) -> float | list[float]
Get the expectation value of the observable O with respect to the state
\|psi>, which is prepared by the provided quantum program.
Parameters:
Returns:
- Type:
float \| list[float] - The expectation value as a float, or a list of floats when
parametersis a list.
variational_minimize
variational_minimize(
qprog: QuantumProgram,
cost_function: SparsePauliOp | QmodExpressionCreator,
initial_params: ExecutionParams,
max_iteration: int,
backend: str | None = None,
quantile: float = 1.0,
tolerance: float | None = None,
hosted: bool = False,
config: dict[str, Any] | ProviderConfig | None = None,
random_seed: int | None = None,
transpilation_option: TranspilationOption = TranspilationOption.DECOMPOSE,
run_via_classiq: bool = False
) -> list[tuple[float, ExecutionParams]]
Minimize the given cost function over the parameter values of the provided
quantum program.
Parameters:
Returns:
- Type:
list[tuple[float, ExecutionParams]] - A list of tuples, each containing the estimated cost and the
- corresponding parameters for that iteration.
costis a float, - and
parametersis a dictionary matching the execution parameter - format.
execute
execute(
quantum_program: QuantumProgram
) -> ExecutionJob
Execute a quantum program. The preferences for execution are set on the quantum program using the method set_execution_preferences.
Parameters:
Returns:
- Type:
ExecutionJob - The result of the execution.
estimate_sample_cost
estimate_sample_cost(
quantum_program: QuantumProgram,
execution_options: ExecutionPreferences | str,
config: dict[str, Any] | None = None,
num_shots: int | None = None,
transpilation_option: TranspilationOption = TranspilationOption.DECOMPOSE
) -> CostEstimateResult
Estimate the cost for sampling a quantum program.
execution_options may be a full ExecutionPreferences object, or the same
backend specifier string used by sample() (for example "braket/SV1" or
"azure/ionq.simulator"). When it is a string, optional config,
num_shots, and transpilation_option are applied like the sample() helpers.
String backends are always resolved with run via Classiq when the provider supports
it (no user cloud credentials required for cost estimation).
Parameters:
Returns:
- Type: CostEstimateResult
- CostEstimateResult with cost and currency.
estimate_sample_batch_cost
estimate_sample_batch_cost(
quantum_program: QuantumProgram,
execution_backend: BackendPreferencesTypes | str,
transpilation_level: TranspilationOption = TranspilationOption.DECOMPOSE,
shots: int = 1000,
params: list[dict] | None = None,
config: dict[str, Any] | None = None
) -> CostEstimateResult
Estimate the cost for batch sampling a quantum program.
execution_backend may be backend preferences or a sample()-style specifier string.
With a string backend, pass non-credential options in config; resolution uses run via
Classiq whenever the provider supports it (same rule as estimate_sample_cost).
Parameters:
Returns:
- Type: CostEstimateResult
- CostEstimateResult with cost and currency.
assign_parameters
assign_parameters(
quantum_program: QuantumProgram,
parameters: ExecutionParams
) -> QuantumProgram
Assign parameters to a parametric quantum program.
Parameters:
Returns:
- Type:
QuantumProgram - The quantum program after assigning parameters.
transpile
transpile(
quantum_program: QuantumProgram,
preferences: Preferences | None = None
) -> QuantumProgram
Transpiles a quantum program.
Parameters:
Returns:
- Type:
QuantumProgram - The result of the transpilation (Optional).
get_budget
get_budget(
provider: ProviderVendor | None = None
) -> UserBudgets
Retrieve the user’s budget information for quantum computing resources.
Parameters:
Returns:
- Type:
UserBudgets - An object containing the user’s budget information.
set_budget_limit
set_budget_limit(
provider: ProviderVendor,
limit: float
) -> UserBudgets
Set a budget limit for a specific quantum backend provider.
Parameters:
Returns:
- Type:
UserBudgets - An object containing the updated budget information.
clear_budget_limit
clear_budget_limit(
provider: ProviderVendor
) -> UserBudgets
Clear the budget limit for a specific quantum backend provider.
Parameters:
Returns:
- Type:
UserBudgets - An object containing the updated budget information.
run_benchmark
run_benchmark(
request: BenchmarkRequest
) -> BenchmarkSession
Submit a benchmark class across problem sizes and execution targets.
Every backend in request.backends is paired with every value in
request.problem_sizes and submitted up front. The call returns
immediately with a BenchmarkSession and does not wait for
executions to complete.
Use BenchmarkSession.fetch_results or BenchmarkSession.fetch_results_async
to poll statuses and fetch
results. Targets that fail during submission are still included in the
session with submission_error populated and no job_id.
Parameters:
Returns:
- Type: BenchmarkSession
- A
BenchmarkSessioncontaining session metadata, per-target submission handles, and any fetched results.
get_benchmark_sessions
get_benchmark_sessions() -> list[BenchmarkSession]
Return all benchmark sessions stored for the user.
Returns:
- Type: list[BenchmarkSession]
- Benchmark sessions for the current user, including session ids and any
- results fetched so far. Use this after reconnecting to resume in-flight runs.
get_benchmark_classes
get_benchmark_classes() -> dict[BenchmarkClass, BenchmarkClassMetadata]
Return benchmark classes supported by the platform.
Returns:
- Type: dict[BenchmarkClass, BenchmarkClassMetadata]
- Mapping from each supported
BenchmarkClasstoBenchmarkClassMetadata, including any known problem-size limits.