Index
create_model
create_model(
entry_point: Union[QFunc, GenerativeQFunc],
constraints: Optional[Constraints] = None,
execution_preferences: Optional[
ExecutionPreferences
] = None,
preferences: Optional[Preferences] = None,
classical_execution_function: Optional[CFunc] = None,
out_file: Optional[str] = None,
) -> SerializedModel
Create a serialized model from a given Qmod entry function and additional parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entry_point
|
Union[QFunc, GenerativeQFunc]
|
The entry point function for the model, which must be a QFunc named 'main'. |
required |
constraints
|
Optional[Constraints]
|
Constraints for the synthesis of the model. See Constraints (Optional). |
None
|
execution_preferences
|
Optional[ExecutionPreferences]
|
Preferences for the execution of the model. See ExecutionPreferences (Optional). |
None
|
preferences
|
Optional[Preferences]
|
Preferences for the synthesis of the model. See Preferences (Optional). |
None
|
classical_execution_function
|
Optional[CFunc]
|
A function for the classical execution logic, which must be a CFunc (Optional). |
None
|
out_file
|
Optional[str]
|
File path to write the Qmod model in native Qmod representation to (Optional). |
None
|
Returns:
Name | Type | Description |
---|---|---|
SerializedModel |
SerializedModel
|
A serialized model. |
Raises:
Type | Description |
---|---|
ClassiqError
|
If the entry point function is not named 'main'. |
synthesize
synthesize(
serialized_model: SerializedModel,
auto_show: bool = False,
) -> SerializedQuantumProgram
Synthesize a model with the Classiq engine to receive a quantum program. More details
Parameters:
Name | Type | Description | Default |
---|---|---|---|
serialized_model
|
SerializedModel
|
A model object serialized as a string. |
required |
auto_show
|
bool
|
boolean. whether to call |
False
|
Returns:
Name | Type | Description |
---|---|---|
SerializedQuantumProgram |
SerializedQuantumProgram
|
Quantum program serialized as a string. (See: QuantumProgram) |
show
show(
quantum_program: SerializedQuantumProgram,
display_url: bool = True,
) -> None
Displays the interactive representation of the quantum program in the Classiq IDE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
quantum_program
|
SerializedQuantumProgram
|
The serialized quantum program to be displayed. |
required |
display_url
|
bool
|
Whether to print the url |
True
|
Links
execute
execute(
quantum_program: SerializedQuantumProgram,
) -> ExecutionJob
Execute a quantum program. The preferences for execution are set on the quantum program using the method set_execution_preferences
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
quantum_program
|
SerializedQuantumProgram
|
The quantum program to execute. This is the result of the synthesize method. |
required |
Returns:
Name | Type | Description |
---|---|---|
ExecutionJob |
ExecutionJob
|
The result of the execution. |
For examples please see Execution Documentation
ExecutionSession
ExecutionSession(
quantum_program: Program,
execution_preferences: Optional[
ExecutionPreferences
] = None,
)
A session for executing a quantum program.
ExecutionSession
allows to execute the quantum program with different parameters and operations without the need to re-synthesize the model.
Attributes:
Name | Type | Description |
---|---|---|
quantum_program |
Union[SerializedQuantumProgram, QuantumProgram]
|
The quantum program to execute. |
execution_preferences |
Optional[ExecutionPreferences]
|
Execution preferences for the Quantum Program. |
Methods:
Name | Description |
---|---|
batch_estimate |
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. |
batch_sample |
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. |
estimate |
Estimates the expectation value of the given Hamiltonian using the quantum program. |
estimate_cost |
Estimates circuit cost using a classical cost function. |
sample |
Samples the quantum program with the given parameters, if any. |
submit_batch_estimate |
Initiates an execution job with the |
submit_batch_sample |
Initiates an execution job with the |
submit_estimate |
Initiates an execution job with the |
submit_sample |
Initiates an execution job with the |
update_execution_preferences |
Update the execution preferences for the session. |
Attributes:
Name | Type | Description |
---|---|---|
program |
QuantumProgram
|
|
qprog |
SerializedQuantumProgram
|
Returns: |
qprog
qprog: SerializedQuantumProgram
Returns:
Name | Type | Description |
---|---|---|
SerializedQuantumProgram |
SerializedQuantumProgram
|
The serialized quantum program (str). See |
batch_estimate
batch_estimate(
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.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hamiltonian
|
Hamiltonian
|
The Hamiltonian to estimate the expectation value of. |
required |
parameters
|
list[ExecutionParams]
|
A list of the parameters for each iteration. Each item is a dictionary where each key should be the name of a parameter in the quantum program (parameters of the main function), and the value should be the value to set for that parameter. |
required |
Returns:
Type | Description |
---|---|
list[EstimationResult]
|
List[EstimationResult]: The results of all the estimation iterations. |
batch_sample
batch_sample(
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.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameters
|
list[ExecutionParams]
|
A list of the parameters for each iteration. Each item is a dictionary where each key should be the name of a parameter in the quantum program (parameters of the main function), and the value should be the value to set for that parameter. |
required |
Returns:
Type | Description |
---|---|
list[ExecutionDetails]
|
List[ExecutionDetails]: The results of all the sampling iterations. |
estimate
estimate(
hamiltonian: Hamiltonian,
parameters: Optional[ExecutionParams] = None,
) -> EstimationResult
Estimates the expectation value of the given Hamiltonian using the quantum program.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hamiltonian
|
Hamiltonian
|
The Hamiltonian to estimate the expectation value of. |
required |
parameters
|
Optional[ExecutionParams]
|
The values to set for the parameters of the quantum program when estimating. Each key should be the name of a parameter in the quantum program (parameters of the main function), and the value should be the value to set for that parameter. |
None
|
Returns:
Name | Type | Description |
---|---|---|
EstimationResult |
EstimationResult
|
The result of the estimation. |
estimate_cost
estimate_cost(
cost_func: Callable[[ParsedState], float],
parameters: Optional[ExecutionParams] = None,
quantile: float = 1.0,
) -> float
Estimates circuit cost using a classical cost function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cost_func
|
Callable[[ParsedState], float]
|
classical circuit sample cost function |
required |
parameters
|
Optional[ExecutionParams]
|
execution parameters sent to 'sample' |
None
|
quantile
|
float
|
drop cost values outside the specified quantile |
1.0
|
Returns:
Type | Description |
---|---|
float
|
cost estimation |
See Also
sample
sample
sample(
parameters: Optional[ExecutionParams] = None,
) -> ExecutionDetails
Samples the quantum program with the given parameters, if any.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameters
|
Optional[ExecutionParams]
|
The values to set for the parameters of the quantum program when sampling. Each key should be the name of a parameter in the quantum program (parameters of the main function), and the value should be the value to set for that parameter. |
None
|
Returns:
Type | Description |
---|---|
ExecutionDetails
|
The result of the sampling. |
submit_batch_estimate
submit_batch_estimate(
hamiltonian: Hamiltonian,
parameters: list[ExecutionParams],
) -> ExecutionJob
Initiates an execution job with the batch_estimate
primitive.
This is a non-blocking version of batch_estimate
: 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:
Name | Type | Description | Default |
---|---|---|---|
hamiltonian
|
Hamiltonian
|
The Hamiltonian to estimate the expectation value of. |
required |
parameters
|
list[ExecutionParams]
|
A list of the parameters for each iteration. Each item is a dictionary where each key should be the name of a parameter in the quantum program (parameters of the main function), and the value should be the value to set for that parameter. |
required |
Returns:
Type | Description |
---|---|
ExecutionJob
|
The execution job. |
submit_batch_sample
submit_batch_sample(
parameters: list[ExecutionParams],
) -> ExecutionJob
Initiates an execution job with the batch_sample
primitive.
This is a non-blocking version of batch_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:
Name | Type | Description | Default |
---|---|---|---|
parameters
|
list[ExecutionParams]
|
A list of the parameters for each iteration. Each item is a dictionary where each key should be the name of a parameter in the quantum program (parameters of the main function), and the value should be the value to set for that parameter. |
required |
Returns:
Type | Description |
---|---|
ExecutionJob
|
The execution job. |
submit_estimate
submit_estimate(
hamiltonian: Hamiltonian,
parameters: Optional[ExecutionParams] = None,
) -> ExecutionJob
Initiates an execution job with the estimate
primitive.
This is a non-blocking version of estimate
: 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:
Name | Type | Description | Default |
---|---|---|---|
hamiltonian
|
Hamiltonian
|
The Hamiltonian to estimate the expectation value of. |
required |
parameters
|
Optional[ExecutionParams]
|
The values to set for the parameters of the quantum program when estimating. Each key should be the name of a parameter in the quantum program (parameters of the main function), and the value should be the value to set for that parameter. |
None
|
Returns:
Type | Description |
---|---|
ExecutionJob
|
The execution job. |
submit_sample
submit_sample(
parameters: Optional[ExecutionParams] = 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:
Name | Type | Description | Default |
---|---|---|---|
parameters
|
Optional[ExecutionParams]
|
The values to set for the parameters of the quantum program when sampling. Each key should be the name of a parameter in the quantum program (parameters of the main function), and the value should be the value to set for that parameter. |
None
|
Returns:
Type | Description |
---|---|
ExecutionJob
|
The execution job. |
update_execution_preferences
update_execution_preferences(
execution_preferences: Optional[ExecutionPreferences],
) -> None
Update the execution preferences for the session.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
execution_preferences
|
Optional[ExecutionPreferences]
|
The execution preferences to update. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
QuantumProgram
Bases: VersionedModel
, CircuitCodeInterface
Methods:
Name | Description |
---|---|
from_qprog |
Creates a |
get_registers_initialization |
|
save_results |
Saves quantum program results as json into a file. |
to_base_program |
|
to_program |
|
Attributes:
Name | Type | Description |
---|---|---|
creation_time |
str
|
|
data |
GeneratedCircuitData
|
|
debug_info |
Optional[list[FunctionDebugInfoInterface]]
|
|
execution_primitives_input |
Optional[PrimitivesInput]
|
|
hardware_data |
SynthesisHardwareData
|
|
initial_values |
Optional[InitialConditions]
|
|
model |
ExecutionModel
|
|
program_circuit |
CircuitCodeInterface
|
|
program_id |
str
|
|
synthesis_duration |
Optional[SynthesisStepDurations]
|
|
transpiled_circuit |
Optional[TranspiledCircuitData]
|
|
creation_time
creation_time: str = Field(
default_factory=_get_formatted_utc_current_time
)
data
data: GeneratedCircuitData
debug_info
debug_info: Optional[list[FunctionDebugInfoInterface]] = (
Field(default=None)
)
execution_primitives_input
execution_primitives_input: Optional[PrimitivesInput] = (
Field(default=None)
)
hardware_data
hardware_data: SynthesisHardwareData
initial_values
initial_values: Optional[InitialConditions] = Field(
default=None
)
model
model: ExecutionModel
program_circuit
program_circuit: CircuitCodeInterface
program_id
program_id: str = Field(default_factory=get_uuid_as_str)
synthesis_duration
synthesis_duration: Optional[SynthesisStepDurations] = (
Field(default=None)
)
transpiled_circuit
transpiled_circuit: Optional[TranspiledCircuitData] = Field(
default=None
)
from_qprog
from_qprog(qprog: str) -> QuantumProgram
Creates a QuantumProgram
instance from a raw quantum program string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qprog
|
str
|
The raw quantum program in string format. |
required |
Returns:
Name | Type | Description |
---|---|---|
QuantumProgram |
QuantumProgram
|
The |
get_registers_initialization
get_registers_initialization(
initial_values: InitialConditions,
) -> dict[RegisterName, RegisterInitialization]
save_results
save_results(
filename: Optional[Union[str, Path]] = None
) -> None
Saves quantum program results as json into a file.
Parameters:
filename (Union[str, Path]): Optional, path + filename of file.
If filename supplied add .json
suffix.
Returns:
None
to_base_program
to_base_program() -> QuantumBaseCode
to_program
to_program(
initial_values: Optional[InitialConditions] = None,
instruction_set: Optional[QuantumInstructionSet] = None,
) -> QuantumCode
Preferences
Bases: BaseModel
Preferences for synthesizing a quantum circuit.
Attributes:
Name | Type | Description |
---|---|---|
machine_precision |
int
|
Specifies the precision used for quantum operations.
Defaults to |
backend_service_provider |
str
|
The provider company or cloud service for the
requested backend. Defaults to |
backend_name |
str
|
The name of the requested backend or target. Defaults to |
custom_hardware_settings |
CustomHardwareSettings
|
Defines custom hardware settings for optimization. This field is ignored if backend preferences are specified. |
debug_mode |
bool
|
If |
output_format |
List[QuantumFormat]
|
Lists the output format(s)
for the quantum circuit. Defaults to |
pretty_qasm |
bool
|
If |
qasm3 |
Optional[bool]
|
If |
transpilation_option |
TranspilationOption
|
Sets the transpilation option to
optimize the circuit. Defaults to |
solovay_kitaev_max_iterations |
Optional[int]
|
Specifies the
maximum number of iterations for the Solovay-Kitaev algorithm, if used.
Defaults to |
timeout_seconds |
int
|
Timeout setting for circuit synthesis
in seconds. Defaults to |
optimization_timeout_seconds |
Optional[int]
|
Specifies the
timeout for optimization in seconds, or |
random_seed |
int
|
Random seed for circuit synthesis. |
Raises:
Type | Description |
---|---|
ClassiqValueError
|
|
ValueError
|
|
Methods:
Name | Description |
---|---|
make_output_format_list |
|
optimization_timeout_less_than_generation_timeout |
|
validate_backend |
|
validate_output_format |
|
Attributes:
Name | Type | Description |
---|---|---|
backend_name |
Optional[Union[PydanticBackendName, AllBackendsNameByVendor]]
|
|
backend_preferences |
Optional[BackendPreferences]
|
Returns the backend preferences. If the backend preferences are not provided, the function sets the backend preferences according to backend name and provider. |
backend_service_provider |
Optional[Union[Provider, ProviderVendor, str]]
|
|
custom_hardware_settings |
CustomHardwareSettings
|
|
debug_mode |
bool
|
|
machine_precision |
PydanticMachinePrecision
|
|
optimization_timeout_seconds |
Optional[PositiveInt]
|
|
output_format |
PydanticConstrainedQuantumFormatList
|
|
pretty_qasm |
bool
|
|
qasm3 |
Optional[bool]
|
|
random_seed |
int
|
|
solovay_kitaev_max_iterations |
Optional[PositiveInt]
|
|
synthesize_all_separately |
bool
|
|
timeout_seconds |
PositiveInt
|
|
transpilation_option |
TranspilationOption
|
|
backend_name
backend_name: Optional[
Union[PydanticBackendName, AllBackendsNameByVendor]
] = Field(
default=None,
description="Name of the requested backend or target.",
)
backend_preferences
backend_preferences: Optional[BackendPreferences]
Returns the backend preferences. If the backend preferences are not provided, the function sets the backend preferences according to backend name and provider.
backend_service_provider
backend_service_provider: Optional[
Union[Provider, ProviderVendor, str]
] = Field(
default=None,
description="Provider company or cloud for the requested backend.",
)
custom_hardware_settings
custom_hardware_settings: CustomHardwareSettings = Field(
default_factory=CustomHardwareSettings,
description="Custom hardware settings which will be used during optimization. This field is ignored if backend preferences are given.",
)
debug_mode
debug_mode: bool = Field(
default=True,
description="Add debug information to the synthesized result. Setting this option to False can potentially speed up the synthesis, and is recommended for executing iterative algorithms.",
)
machine_precision
machine_precision: PydanticMachinePrecision = (
DEFAULT_MACHINE_PRECISION
)
optimization_timeout_seconds
optimization_timeout_seconds: Optional[PositiveInt] = Field(
default=None,
description="Optimization timeout in seconds, or None for no optimization timeout (will still timeout when the generation timeout is over)",
)
output_format
output_format: PydanticConstrainedQuantumFormatList = Field(
default=[QASM],
description="The quantum circuit output format(s). ",
)
pretty_qasm
pretty_qasm: bool = Field(
True,
description="Prettify the OpenQASM2 outputs (use line breaks inside the gate declarations).",
)
qasm3
qasm3: Optional[bool] = Field(
None,
description="Output OpenQASM 3.0 instead of OpenQASM 2.0. Relevant only for the `qasm` and `transpiled_circuit.qasm` attributes of `GeneratedCircuit`.",
)
random_seed
random_seed: int = Field(
default_factory=create_random_seed,
description="The random seed used for the generation",
)
solovay_kitaev_max_iterations
solovay_kitaev_max_iterations: Optional[PositiveInt] = (
Field(
None,
description="Maximum iterations for the Solovay-Kitaev algorithm (if applied).",
)
)
synthesize_all_separately
synthesize_all_separately: bool = Field(
default=False,
description="If true, all functions will be synthesized separately",
)
timeout_seconds
timeout_seconds: PositiveInt = Field(
default=300, description="Generation timeout in seconds"
)
transpilation_option
transpilation_option: TranspilationOption = Field(
default=AUTO_OPTIMIZE,
description="If true, the returned result will contain a transpiled circuit and its depth",
)
make_output_format_list
make_output_format_list(output_format: Any) -> list
optimization_timeout_less_than_generation_timeout
optimization_timeout_less_than_generation_timeout(
optimization_timeout_seconds: Optional[PositiveInt],
info: ValidationInfo,
) -> Optional[PositiveInt]
validate_backend
validate_backend() -> Self
validate_output_format
validate_output_format(
output_format: PydanticConstrainedQuantumFormatList,
info: ValidationInfo,
) -> PydanticConstrainedQuantumFormatList
set_preferences
set_preferences(
serialized_model: SerializedModel,
preferences: Optional[Preferences] = None,
**kwargs: Any
) -> SerializedModel
Overrides the preferences of a (serialized) model and returns the updated model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
serialized_model
|
SerializedModel
|
The model in serialized form. |
required |
preferences
|
Optional[Preferences]
|
The new preferences to be set for the model. Can be passed as keyword arguments. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SerializedModel |
SerializedModel
|
The updated model with the new preferences applied. |
Constraints
Bases: BaseModel
Constraints for the quantum circuit synthesis engine.
This class is used to specify constraints such as maximum width, depth, gate count, and optimization parameters for the synthesis engine, guiding the generation of quantum circuits that satisfy these constraints.
Attributes:
Name | Type | Description |
---|---|---|
max_width |
int
|
Maximum number of qubits allowed in the generated quantum circuit.
Defaults to |
max_depth |
int
|
Maximum depth of the generated quantum circuit. Defaults to |
max_gate_count |
Dict[TranspilerBasisGates, int]
|
A dictionary specifying the maximum allowed count for each type of gate in the quantum circuit. Defaults to an empty dictionary. |
optimization_parameter |
OptimizationParameterType
|
Determines if and how the synthesis engine should optimize
the solution. Defaults to |
Attributes:
Name | Type | Description |
---|---|---|
max_depth |
Optional[PositiveInt]
|
|
max_gate_count |
dict[TranspilerBasisGates, NonNegativeInt]
|
|
max_width |
Optional[PositiveInt]
|
|
model_config |
|
|
optimization_parameter |
OptimizationParameterType
|
|
max_depth
max_depth: Optional[PositiveInt] = None
max_gate_count
max_gate_count: dict[
TranspilerBasisGates, NonNegativeInt
] = Field(default_factory=lambda: defaultdict(int))
max_width
max_width: Optional[PositiveInt] = Field(
default=None,
description="Maximum number of qubits in generated quantum circuit",
)
model_config
model_config = ConfigDict(extra='forbid')
optimization_parameter
optimization_parameter: OptimizationParameterType = Field(
default=NO_OPTIMIZATION,
description="If set, the synthesis engine optimizes the solution according to that chosen parameter",
)
set_constraints
set_constraints(
serialized_model: SerializedModel,
constraints: Optional[Constraints] = None,
**kwargs: Any
) -> SerializedModel
Overrides the constraints of a (serialized) model and returns the updated model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
serialized_model
|
SerializedModel
|
The model in serialized form. |
required |
constraints
|
Optional[Constraints]
|
The new constraints to be set for the model. Can be passed as keyword arguments. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SerializedModel |
SerializedModel
|
The updated model with the new constraints applied. |
ExecutionPreferences
Bases: BaseModel
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:
Name | Type | Description |
---|---|---|
noise_properties |
Optional[NoiseProperties]
|
Properties defining the noise in the quantum circuit. Defaults to |
random_seed |
int
|
The random seed used for the execution. Defaults to a randomly generated seed. |
backend_preferences |
BackendPreferencesTypes
|
Preferences for the backend used to execute the circuit. Defaults to the Classiq Simulator. |
num_shots |
Optional[PositiveInt]
|
The number of shots (executions) to be performed. |
transpile_to_hardware |
TranspilationOption
|
Option to transpile the circuit to the hardware's basis gates
before execution. Defaults to |
job_name |
Optional[str]
|
The name of the job, with a minimum length of 1 character. |
Attributes:
Name | Type | Description |
---|---|---|
backend_preferences |
BackendPreferencesTypes
|
|
job_name |
Optional[str]
|
|
noise_properties |
Optional[NoiseProperties]
|
|
num_shots |
Optional[PositiveInt]
|
|
random_seed |
int
|
|
transpile_to_hardware |
TranspilationOption
|
|
backend_preferences
backend_preferences: BackendPreferencesTypes = (
backend_preferences_field(backend_name=SIMULATOR)
)
job_name
job_name: Optional[str] = Field(
min_length=1, description="The job name", default=None
)
noise_properties
noise_properties: Optional[NoiseProperties] = Field(
default=None,
description="Properties of the noise in the circuit",
)
num_shots
num_shots: Optional[PositiveInt] = Field(default=None)
random_seed
random_seed: int = Field(
default_factory=create_random_seed,
description="The random seed used for the execution",
)
transpile_to_hardware
transpile_to_hardware: TranspilationOption = Field(
default=DECOMPOSE,
description="Transpile the circuit to the hardware basis gates before execution",
title="Transpilation Option",
)
set_execution_preferences
set_execution_preferences(
serialized_model: SerializedModel,
execution_preferences: Optional[
ExecutionPreferences
] = None,
**kwargs: Any
) -> SerializedModel
Overrides the execution preferences of a (serialized) model and returns the updated model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
serialized_model
|
SerializedModel
|
A serialization of the defined model. |
required |
execution_preferences
|
Optional[ExecutionPreferences]
|
The new execution preferences to be set for the model. Can be passed as keyword arguments. |
None
|
Returns: SerializedModel: The model with the attached execution preferences.
For more examples please see: set_execution_preferences
jobs
Classes:
Name | Description |
---|---|
ClassiqExecutionResultError |
|
ExecutionJob |
|
Functions:
Name | Description |
---|---|
get_execution_jobs_async |
|
Attributes:
Name | Type | Description |
---|---|---|
get_execution_jobs |
|
ClassiqExecutionResultError
ClassiqExecutionResultError(primitive: str)
Bases: ClassiqError
ExecutionJob
ExecutionJob(details: _JobDetails)
Methods:
Name | Description |
---|---|
cancel_async |
Cancels the execution job. This implies the cancellation of any ongoing jobs |
cost |
|
from_id |
|
from_id_async |
|
get_batch_estimate_result |
Returns the job's result as a single batch_estimate result after validation. If the result is not yet available, waits for it. |
get_batch_sample_result |
Returns the job's result as a single batch_sample result after validation. If the result is not yet available, waits for it. |
get_estimate_result |
Returns the job's result as a single estimate result after validation. If the result is not yet available, waits for it. |
get_sample_result |
Returns the job's result as a single sample result after validation. If the result is not yet available, waits for it. |
open_in_ide |
|
poll_async |
|
rename_async |
|
result_async |
|
result_value |
|
Attributes:
Name | Type | Description |
---|---|---|
backend_name |
Optional[str]
|
|
cancel |
|
|
end_time |
Optional[datetime]
|
|
error |
Optional[str]
|
|
id |
str
|
|
ide_url |
str
|
|
name |
Optional[str]
|
|
num_shots |
Optional[int]
|
|
poll |
|
|
program_id |
Optional[str]
|
|
provider |
Optional[str]
|
|
rename |
|
|
result |
|
|
start_time |
datetime
|
|
status |
JobStatus
|
|
backend_name
backend_name: Optional[str]
end_time
end_time: Optional[datetime]
error
error: Optional[str]
id
id: str
ide_url
ide_url: str
name
name: Optional[str]
num_shots
num_shots: Optional[int]
program_id
program_id: Optional[str]
provider
provider: Optional[str]
start_time
start_time: datetime
status
status: JobStatus
cancel_async
cancel_async() -> None
Cancels the execution job. This implies the cancellation of any ongoing jobs sent to the provider during this execution job.
The function returns without waiting to the actual cancellation. It is possible to continue polling the job in order to ensure its cancellation, which might not be immediate.
cost
cost(*, verbose: bool = False) -> Union[str, JobCost]
get_batch_estimate_result
get_batch_estimate_result() -> list[EstimationResult]
Returns the job's result as a single batch_estimate result after validation. If the result is not yet available, waits for it.
Returns:
Type | Description |
---|---|
list[EstimationResult]
|
The batch_estimate result of the execution job. |
Raises:
Type | Description |
---|---|
ClassiqExecutionResultError
|
In case the result does not contain a single batch_estimate result. |
ClassiqAPIError
|
In case the job has failed. |
get_batch_sample_result
get_batch_sample_result() -> list[ExecutionDetails]
Returns the job's result as a single batch_sample result after validation. If the result is not yet available, waits for it.
Returns:
Type | Description |
---|---|
list[ExecutionDetails]
|
The batch_sample result of the execution job. |
Raises:
Type | Description |
---|---|
ClassiqExecutionResultError
|
In case the result does not contain a single batch_sample result. |
ClassiqAPIError
|
In case the job has failed. |
get_estimate_result
get_estimate_result() -> EstimationResult
Returns the job's result as a single estimate result after validation. If the result is not yet available, waits for it.
Returns:
Type | Description |
---|---|
EstimationResult
|
The estimate result of the execution job. |
Raises:
Type | Description |
---|---|
ClassiqExecutionResultError
|
In case the result does not contain a single estimate result. |
ClassiqAPIError
|
In case the job has failed. |
get_sample_result
get_sample_result() -> ExecutionDetails
Returns the job's result as a single sample result after validation. If the result is not yet available, waits for it.
Returns:
Type | Description |
---|---|
ExecutionDetails
|
The sample result of the execution job. |
Raises:
Type | Description |
---|---|
ClassiqExecutionResultError
|
In case the result does not contain a single sample result. |
ClassiqAPIError
|
In case the job has failed. |
open_in_ide
open_in_ide() -> None
poll_async
poll_async(timeout_sec: Optional[float] = None) -> None
rename_async
rename_async(name: str) -> None
result_async
result_async(
timeout_sec: Optional[float] = None,
) -> ResultsCollection
result_value
result_value(*args: Any, **kwargs: Any) -> Any
get_execution_jobs_async
get_execution_jobs_async(
offset: int = 0, limit: int = 50
) -> list[ExecutionJob]
BackendPreferences
Bases: BaseModel
Preferences for the execution of the quantum program.
For more details, refer to: BackendPreferences
Attributes:
Name | Type | Description |
---|---|---|
backend_service_provider |
str
|
Provider company or cloud for the requested backend. |
backend_name |
str
|
Name of the requested backend or target. |
Methods:
Name | Description |
---|---|
batch_preferences |
|
is_nvidia_backend |
|
Attributes:
Name | Type | Description |
---|---|---|
backend_name |
str
|
|
backend_service_provider |
ProviderVendor
|
|
hw_provider |
Provider
|
|
backend_name
backend_name: str = Field(
...,
description="Name of the requested backend or target.",
)
backend_service_provider
backend_service_provider: ProviderVendor = Field(
...,
description="Provider company or cloud for the requested backend.",
)
batch_preferences
batch_preferences(
*, backend_names: Iterable[str], **kwargs: Any
) -> list[BackendPreferences]
is_nvidia_backend
is_nvidia_backend() -> bool
Provider
Bases: StrEnum
This class defines all Providers that Classiq supports. This is mainly used in backend_preferences when specifying where do we want to execute the defined model.
Attributes:
Name | Type | Description |
---|---|---|
ALICE_AND_BOB |
|
|
AMAZON_BRAKET |
|
|
AQT |
|
|
AZURE_QUANTUM |
|
|
CLASSIQ |
|
|
GOOGLE |
|
|
IBM_QUANTUM |
|
|
INTEL |
|
|
IONQ |
|
|
IQCC |
|
|
OQC |
|
|
id |
ProviderIDEnum
|
|
ALICE_AND_BOB
ALICE_AND_BOB = 'Alice & Bob'
AMAZON_BRAKET
AMAZON_BRAKET = 'Amazon Braket'
AQT
AQT = 'AQT'
AZURE_QUANTUM
AZURE_QUANTUM = 'Azure Quantum'
CLASSIQ
CLASSIQ = 'Classiq'
GOOGLE = 'Google'
IBM_QUANTUM
IBM_QUANTUM = 'IBM Quantum'
INTEL
INTEL = 'Intel'
IONQ
IONQ = 'IonQ'
IQCC
IQCC = 'IQCC'
OQC
OQC = 'OQC'
id
id: ProviderIDEnum
AzureBackendPreferences
Bases: BackendPreferences
This class inherits from BackendPreferences. This is where you specify Azure Quantum preferences. See usage in the Azure Backend Documentation.
Attributes:
Name | Type | Description |
---|---|---|
location |
str
|
Azure personal resource region. Defaults to |
credentials |
Optional[AzureCredential]
|
The service principal credential to access personal quantum workspace. Defaults to |
ionq_error_mitigation_flag |
Optional[bool]
|
Error mitigation configuration upon running on IonQ through Azure. Defaults to |
Attributes:
Name | Type | Description |
---|---|---|
backend_service_provider |
AZURE_QUANTUM
|
|
credentials |
Optional[AzureCredential]
|
|
ionq_error_mitigation_flag |
Optional[bool]
|
|
location |
str
|
|
run_through_classiq |
bool
|
Returns: |
backend_service_provider
backend_service_provider: AZURE_QUANTUM = Field(
default=AZURE_QUANTUM
)
credentials
credentials: Optional[AzureCredential] = Field(
default=None,
description="The service principal credential to access personal quantum workspace",
)
ionq_error_mitigation_flag
ionq_error_mitigation_flag: Optional[bool] = Field(
default=False,
description="Error mitigation configuration upon running on IonQ through Azure.",
)
location
location: str = Field(
default="East US",
description="Azure personal resource region",
)
run_through_classiq
run_through_classiq: bool
Returns: True
if there are no Azure Credentials.
Therefore you will be running through Classiq's credentials.
AzureBackendPreferences
Bases: BackendPreferences
This class inherits from BackendPreferences. This is where you specify Azure Quantum preferences. See usage in the Azure Backend Documentation.
Attributes:
Name | Type | Description |
---|---|---|
location |
str
|
Azure personal resource region. Defaults to |
credentials |
Optional[AzureCredential]
|
The service principal credential to access personal quantum workspace. Defaults to |
ionq_error_mitigation_flag |
Optional[bool]
|
Error mitigation configuration upon running on IonQ through Azure. Defaults to |
Attributes:
Name | Type | Description |
---|---|---|
backend_service_provider |
AZURE_QUANTUM
|
|
credentials |
Optional[AzureCredential]
|
|
ionq_error_mitigation_flag |
Optional[bool]
|
|
location |
str
|
|
run_through_classiq |
bool
|
Returns: |
backend_service_provider
backend_service_provider: AZURE_QUANTUM = Field(
default=AZURE_QUANTUM
)
credentials
credentials: Optional[AzureCredential] = Field(
default=None,
description="The service principal credential to access personal quantum workspace",
)
ionq_error_mitigation_flag
ionq_error_mitigation_flag: Optional[bool] = Field(
default=False,
description="Error mitigation configuration upon running on IonQ through Azure.",
)
location
location: str = Field(
default="East US",
description="Azure personal resource region",
)
run_through_classiq
run_through_classiq: bool
Returns: True
if there are no Azure Credentials.
Therefore you will be running through Classiq's credentials.
AzureCredential
AzureCredential(**data: Any)
Bases: BaseSettings
Represents the credentials and configuration required to authenticate with Azure services.
Attributes:
Name | Type | Description |
---|---|---|
tenant_id |
str
|
Azure Tenant ID used to identify the directory in which the application is registered. |
client_id |
str
|
Azure Client ID, also known as the application ID, which is used to authenticate the application. |
client_secret |
str
|
Azure Client Secret associated with the application, used for authentication. |
resource_id |
PydanticAzureResourceIDType
|
Azure Resource ID, including the subscription ID, resource group, and workspace, typically used for personal resources. |
Attributes:
Name | Type | Description |
---|---|---|
client_id |
str
|
|
client_secret |
str
|
|
model_config |
|
|
resource_id |
PydanticAzureResourceIDType
|
|
tenant_id |
str
|
|
client_id
client_id: str = Field(description='Azure Client ID')
client_secret
client_secret: str = Field(
description="Azure Client Secret"
)
model_config
model_config = SettingsConfigDict(
title="Azure Service Principal Credential",
env_prefix="AZURE_",
case_sensitive=False,
extra="allow",
)
resource_id
resource_id: PydanticAzureResourceIDType = Field(
description="Azure Resource ID (including Azure subscription ID, resource group and workspace), for personal resource"
)
tenant_id
tenant_id: str = Field(description='Azure Tenant ID')
AzureQuantumBackendNames
Bases: StrEnum
AzureQuantum backend names which Classiq Supports running on.
Attributes:
IONQ_ARIA_1
IONQ_ARIA_1 = 'ionq.qpu.aria-1'
IONQ_ARIA_2
IONQ_ARIA_2 = 'ionq.qpu.aria-2'
IONQ_QPU
IONQ_QPU = 'ionq.qpu'
IONQ_QPU_FORTE
IONQ_QPU_FORTE = 'ionq.qpu.forte-1'
IONQ_SIMULATOR
IONQ_SIMULATOR = 'ionq.simulator'
MICROSOFT_ESTIMATOR
MICROSOFT_ESTIMATOR = 'microsoft.estimator'
MICROSOFT_FULLSTATE_SIMULATOR
MICROSOFT_FULLSTATE_SIMULATOR = (
"microsoft.simulator.fullstate"
)
QCI_MACHINE1
QCI_MACHINE1 = 'qci.machine1'
QCI_NOISY_SIMULATOR
QCI_NOISY_SIMULATOR = 'qci.simulator.noisy'
QCI_SIMULATOR
QCI_SIMULATOR = 'qci.simulator'
QUANTINUUM_API_VALIDATOR1_1
QUANTINUUM_API_VALIDATOR1_1 = 'quantinuum.sim.h1-1sc'
QUANTINUUM_API_VALIDATOR1_2
QUANTINUUM_API_VALIDATOR1_2 = 'quantinuum.sim.h1-2sc'
QUANTINUUM_API_VALIDATOR2_1
QUANTINUUM_API_VALIDATOR2_1 = 'quantinuum.sim.h2-1sc'
QUANTINUUM_QPU1_1
QUANTINUUM_QPU1_1 = 'quantinuum.qpu.h1-1'
QUANTINUUM_QPU1_2
QUANTINUUM_QPU1_2 = 'quantinuum.qpu.h1-2'
QUANTINUUM_QPU2
QUANTINUUM_QPU2 = 'quantinuum.qpu.h2-1'
QUANTINUUM_SIMULATOR1_1
QUANTINUUM_SIMULATOR1_1 = 'quantinuum.sim.h1-1e'
QUANTINUUM_SIMULATOR1_2
QUANTINUUM_SIMULATOR1_2 = 'quantinuum.sim.h1-2e'
QUANTINUUM_SIMULATOR2
QUANTINUUM_SIMULATOR2 = 'quantinuum.sim.h2-1e'
RIGETTI_ANKAA2
RIGETTI_ANKAA2 = 'rigetti.qpu.ankaa-2'
RIGETTI_ANKAA9
RIGETTI_ANKAA9 = 'rigetti.qpu.ankaa-9q-1'
RIGETTI_SIMULATOR
RIGETTI_SIMULATOR = 'rigetti.sim.qvm'
ClassiqBackendPreferences
Bases: BackendPreferences
Represents backend preferences specific to Classiq quantum computing targets.
This class is used to configure the backend options for executing quantum circuits on Classiq's platform.
The relevant backend names for Classiq targets are specified in ClassiqSimulatorBackendNames
& ClassiqNvidiaBackendNames
.
For more details, refer to the Classiq Backend Documentation.
Methods:
Name | Description |
---|---|
is_nvidia_backend |
|
Attributes:
Name | Type | Description |
---|---|---|
backend_service_provider |
CLASSIQ
|
|
backend_service_provider
backend_service_provider: CLASSIQ = Field(default=CLASSIQ)
is_nvidia_backend
is_nvidia_backend() -> bool
ClassiqSimulatorBackendNames
Bases: StrEnum
The simulator backends available in the Classiq provider.
Attributes:
Name | Type | Description |
---|---|---|
SIMULATOR |
|
|
SIMULATOR_DENSITY_MATRIX |
|
|
SIMULATOR_MATRIX_PRODUCT_STATE |
|
|
SIMULATOR_STATEVECTOR |
|
SIMULATOR
SIMULATOR = 'simulator'
SIMULATOR_DENSITY_MATRIX
SIMULATOR_DENSITY_MATRIX = 'simulator_density_matrix'
SIMULATOR_MATRIX_PRODUCT_STATE
SIMULATOR_MATRIX_PRODUCT_STATE = (
"simulator_matrix_product_state"
)
SIMULATOR_STATEVECTOR
SIMULATOR_STATEVECTOR = 'simulator_statevector'
IBMBackendPreferences
Bases: BackendPreferences
Represents the backend preferences specific to IBM Quantum services.
Inherits from BackendPreferences
and adds additional fields and validations
specific to IBM Quantum backends.
Attributes:
Name | Type | Description |
---|---|---|
backend_service_provider |
IBM_QUANTUM
|
Indicates the backend service provider as IBM Quantum. |
access_token |
Optional[str]
|
The IBM Quantum access token to be used with IBM Quantum hosted backends. Defaults to |
provider |
IBMBackendProvider
|
Specifications for identifying a single IBM Quantum provider. Defaults to a new |
qctrl_api_key |
Optional[str]
|
QCTRL API key to access QCTRL optimization abilities. |
run_through_classiq |
bool
|
Run through Classiq's credentials. Defaults to |
See examples in the IBM Quantum Backend Documentation.
Attributes:
Name | Type | Description |
---|---|---|
access_token |
Optional[str]
|
|
backend_service_provider |
IBM_QUANTUM
|
|
provider |
IBMBackendProvider
|
|
qctrl_api_key |
Optional[str]
|
|
run_through_classiq |
bool
|
|
access_token
access_token: Optional[str] = Field(
default=None,
description="IBM Quantum access token to be used with IBM Quantum hosted backends",
)
backend_service_provider
backend_service_provider: IBM_QUANTUM = Field(
default=IBM_QUANTUM
)
provider
provider: IBMBackendProvider = Field(
default_factory=IBMBackendProvider,
description="Provider specs. for identifying a single IBM Quantum provider.",
)
qctrl_api_key
qctrl_api_key: Optional[str] = Field(
default=None,
description="QCTRL API key to access QCTRL optimization abilities",
)
run_through_classiq
run_through_classiq: bool = Field(
default=False,
description="Run through Classiq's credentials",
)
IBMBackendProvider
Bases: BaseModel
Represents the provider specs for identifying an IBM Quantum backend.
Attributes:
Name | Type | Description |
---|---|---|
hub |
str
|
hub parameter of IBM Quantum provider. Defaults to |
group |
str
|
group parameter of IBM Quantum provider. Defaults to |
project |
str
|
project parameter of IBM Quantum provider. Defaults to |
Attributes:
Name | Type | Description |
---|---|---|
group |
str
|
|
hub |
str
|
|
project |
str
|
|
group
group: str = 'open'
hub
hub: str = 'ibm-q'
project
project: str = 'main'
AwsBackendPreferences
Bases: BackendPreferences
AWS-specific backend preferences for quantum computing tasks using Amazon Braket.
This class contains configuration options specific to Amazon Braket, including the AWS role
ARN, S3 bucket details, and the folder path within the S3 bucket. It extends the base
BackendPreferences
class to provide additional properties required for interaction with
Amazon Braket.
Attributes:
Name | Type | Description |
---|---|---|
backend_service_provider |
AMAZON_BRAKET
|
The service provider for the backend, which is Amazon Braket. |
aws_role_arn |
PydanticAwsRoleArn
|
The Amazon Resource Name (ARN) of the role that will be assumed for execution on your Braket account. This is a required field and should be provided to allow secure and authorized access to AWS resources. |
s3_bucket_name |
str
|
The name of the S3 bucket where results and other related data will be stored. This field should contain a valid S3 bucket name under your AWS account. |
s3_folder |
PydanticS3BucketKey
|
The folder path within the specified S3 bucket. This allows for organizing results and data under a specific directory within the S3 bucket. |
For more details, refer to: AwsBackendPreferences examples
Attributes:
Name | Type | Description |
---|---|---|
aws_role_arn |
PydanticAwsRoleArn
|
|
backend_service_provider |
AMAZON_BRAKET
|
|
s3_bucket_name |
str
|
|
s3_folder |
PydanticS3BucketKey
|
|
aws_role_arn
aws_role_arn: PydanticAwsRoleArn = Field(
description="ARN of the role to be assumed for execution on your Braket account."
)
backend_service_provider
backend_service_provider: AMAZON_BRAKET = Field(
default=AMAZON_BRAKET
)
s3_bucket_name
s3_bucket_name: str = Field(description='S3 Bucket Name')
s3_folder
s3_folder: PydanticS3BucketKey = Field(
description="S3 Folder Path Within The S3 Bucket"
)
AmazonBraketBackendNames
Bases: StrEnum
Amazon Braket backend names which Classiq Supports running on.
Attributes:
Name | Type | Description |
---|---|---|
AMAZON_BRAKET_ASPEN_11 |
|
|
AMAZON_BRAKET_DM1 |
|
|
AMAZON_BRAKET_IONQ |
|
|
AMAZON_BRAKET_LUCY |
|
|
AMAZON_BRAKET_M_1 |
|
|
AMAZON_BRAKET_SV1 |
|
|
AMAZON_BRAKET_TN1 |
|
AMAZON_BRAKET_ASPEN_11
AMAZON_BRAKET_ASPEN_11 = 'Aspen-11'
AMAZON_BRAKET_DM1
AMAZON_BRAKET_DM1 = 'dm1'
AMAZON_BRAKET_IONQ
AMAZON_BRAKET_IONQ = 'IonQ Device'
AMAZON_BRAKET_LUCY
AMAZON_BRAKET_LUCY = 'Lucy'
AMAZON_BRAKET_M_1
AMAZON_BRAKET_M_1 = 'Aspen-M-1'
AMAZON_BRAKET_SV1
AMAZON_BRAKET_SV1 = 'SV1'
AMAZON_BRAKET_TN1
AMAZON_BRAKET_TN1 = 'TN1'
IonqBackendPreferences
Bases: BackendPreferences
Represents the backend preferences specific to IonQ services.
Inherits from BackendPreferences
and adds additional fields and configurations
specific to IonQ backends
Attributes:
Name | Type | Description |
---|---|---|
backend_service_provider |
IONQ
|
Indicates the backend service provider as IonQ. |
api_key |
PydanticIonQApiKeyType
|
The IonQ API key required for accessing IonQ's quantum computing services. |
error_mitigation |
bool
|
A configuration option to enable or disable error mitigation during execution. Defaults to |
run_through_classiq |
bool
|
Running through Classiq's credentials while using user's allocated budget. |
See examples in the IonQ Backend Documentation.
Attributes:
Name | Type | Description |
---|---|---|
api_key |
Optional[PydanticIonQApiKeyType]
|
|
backend_service_provider |
IONQ
|
|
error_mitigation |
bool
|
|
run_through_classiq |
bool
|
|
api_key
api_key: Optional[PydanticIonQApiKeyType] = Field(
default=None, description="IonQ API key"
)
backend_service_provider
backend_service_provider: IONQ = Field(default=IONQ)
error_mitigation
error_mitigation: bool = Field(
default=False,
description="Error mitigation configuration.",
)
run_through_classiq
run_through_classiq: bool = Field(
default=False,
description="Running through Classiq's credentials while using user's allocated budget.",
)
IonqBackendNames
ClassiqNvidiaBackendNames
Bases: StrEnum
Classiq's Nvidia simulator backend names.
Attributes:
Name | Type | Description |
---|---|---|
SIMULATOR |
|
SIMULATOR
SIMULATOR = 'nvidia_state_vector_simulator'
GCPBackendPreferences
Bases: BackendPreferences
Represents the backend preferences specific to Google Cloud Platform (GCP) services.
Inherits from BackendPreferences
and sets the backend service provider to Google.
Attributes:
Name | Type | Description |
---|---|---|
backend_service_provider |
GOOGLE
|
Indicates the backend service provider as Google, |
See examples in the Google Cloud Backend Documentation.
Methods:
Name | Description |
---|---|
is_nvidia_backend |
|
Attributes:
Name | Type | Description |
---|---|---|
backend_service_provider |
GOOGLE
|
|
backend_service_provider
backend_service_provider: GOOGLE = Field(default=GOOGLE)
is_nvidia_backend
is_nvidia_backend() -> bool
AliceBobBackendPreferences
Bases: BackendPreferences
Backend preferences specific to Alice&Bob for quantum computing tasks.
This class includes configuration options for setting up a backend using Alice&Bob's quantum hardware.
It extends the base BackendPreferences
class and provides additional parameters required for working
with Alice&Bob's cat qubits, including settings for photon dissipation rates, repetition code distance,
and the average number of photons.
Attributes:
Name | Type | Description |
---|---|---|
backend_service_provider |
ALICE_BOB
|
The service provider for the backend, which is Alice&Bob. |
distance |
Optional[int]
|
The number of times information is duplicated in the repetition code. - Tooltip: Phase-flip probability decreases exponentially with this parameter, bit-flip probability increases linearly. - Supported Values: 3 to 300, though practical values are usually lower than 30. - Default: None. |
kappa_1 |
Optional[float]
|
The rate at which the cat qubit loses one photon, creating a bit-flip. - Tooltip: Lower values mean lower error rates. - Supported Values: 10 to 10^5. Current hardware is at ~10^3. - Default: None. |
kappa_2 |
Optional[float]
|
The rate at which the cat qubit is stabilized using two-photon dissipation. - Tooltip: Higher values mean lower error rates. - Supported Values: 100 to 10^9. Current hardware is at ~10^5. - Default: None. |
average_nb_photons |
Optional[float]
|
The average number of photons. - Tooltip: Bit-flip probability decreases exponentially with this parameter, phase-flip probability increases linearly. - Supported Values: 4 to 10^5, though practical values are usually lower than 30. - Default: None. |
api_key |
str
|
The API key required to access Alice&Bob's quantum hardware. - Required: Yes. |
For more details, refer to the Alice&Bob Backend Documentation.
Attributes:
Name | Type | Description |
---|---|---|
api_key |
Optional[PydanticAliceBobApiKeyType]
|
|
average_nb_photons |
Optional[float]
|
|
backend_service_provider |
ALICE_BOB
|
|
distance |
Optional[int]
|
|
kappa_1 |
Optional[float]
|
|
kappa_2 |
Optional[float]
|
|
parameters |
dict[str, Any]
|
|
api_key
api_key: Optional[PydanticAliceBobApiKeyType] = Field(
default=None, description="AliceBob API key"
)
average_nb_photons
average_nb_photons: Optional[float] = Field(
default=None, description="Average number of photons"
)
backend_service_provider
backend_service_provider: ALICE_BOB = Field(
default=ALICE_AND_BOB
)
distance
distance: Optional[int] = Field(
default=None, description="Repetition code distance"
)
kappa_1
kappa_1: Optional[float] = Field(
default=None,
description="One-photon dissipation rate (Hz)",
)
kappa_2
kappa_2: Optional[float] = Field(
default=None,
description="Two-photon dissipation rate (Hz)",
)
parameters
parameters: dict[str, Any]
AliceBobBackendNames
Bases: StrEnum
Alice & Bob backend names which Classiq Supports running on.
Attributes:
Name | Type | Description |
---|---|---|
LOGICAL_EARLY |
|
|
LOGICAL_TARGET |
|
|
PERFECT_QUBITS |
|
|
TRANSMONS |
|
LOGICAL_EARLY
LOGICAL_EARLY = 'LOGICAL_EARLY'
LOGICAL_TARGET
LOGICAL_TARGET = 'LOGICAL_TARGET'
PERFECT_QUBITS
PERFECT_QUBITS = 'PERFECT_QUBITS'
TRANSMONS
TRANSMONS = 'TRANSMONS'
OQCBackendPreferences
Bases: BackendPreferences
This class inherits from BackendPreferences
.
This is where you specify OQC preferences.
Attributes:
Name | Type | Description |
---|---|---|
username |
str
|
OQC username |
password |
str
|
OQC password |
Attributes:
Name | Type | Description |
---|---|---|
backend_service_provider |
OQC
|
|
password |
str
|
|
username |
str
|
|
backend_service_provider
backend_service_provider: OQC = Field(default=OQC)
password
password: str = Field(description='OQC password')
username
username: str = Field(description='OQC username')
OQCBackendNames
Bases: StrEnum
OQC backend names which Classiq Supports running on.
Attributes:
Name | Type | Description |
---|---|---|
LUCY |
|
LUCY
LUCY = 'Lucy'