uniqc.exceptions module¶
Custom exceptions for UnifiedQuantum.
This module is the single source of truth for all custom exceptions in the package. Sub-modules re-export from here so that legacy import paths continue to work, but every exception class is defined in this file.
Exception hierarchy:
UnifiedQuantumError
├── AuthenticationError
├── InsufficientCreditsError
├── QuotaExceededError
├── NetworkError
├── TaskFailedError
├── TaskTimeoutError
├── TaskNotFoundError
├── BackendError
│ ├── BackendNotAvailableError
│ └── BackendNotFoundError
├── CircuitError
│ ├── CircuitTranslationError
│ ├── UnsupportedGateError
│ ├── NotSupportedGateError
│ ├── RegisterNotFoundError
│ ├── RegisterOutOfRangeError
│ ├── RegisterDefinitionError
│ ├── NotMatrixableError
│ └── TimelineDurationError
├── ConfigError
│ ├── ConfigValidationError
│ ├── PlatformNotFoundError
│ └── ProfileNotFoundError
├── CompilationFailedError
├── TopologyError
├── StaleCalibrationError
├── BackendOptionsError (also ValueError)
└── MissingDependencyError (also ImportError)
- exception uniqc.exceptions.AuthenticationError(message, *, details=None, hint_key=None)[source]¶
Bases:
UnifiedQuantumErrorRaised when authentication fails (invalid token, expired credentials, etc.).
This error indicates that the provided API token or credentials are invalid, expired, or do not have the required permissions.
- exception uniqc.exceptions.BackendError(message, *, details=None, hint_key=None)[source]¶
Bases:
UnifiedQuantumErrorRaised when a backend operation fails.
This is the base class for all backend-related errors.
- exception uniqc.exceptions.BackendNotAvailableError(message, *, details=None, hint_key=None)[source]¶
Bases:
BackendErrorRaised when a backend is not available.
This error indicates that the backend is offline, not configured, or cannot be accessed due to missing dependencies.
- exception uniqc.exceptions.BackendNotFoundError(message, *, details=None, hint_key=None)[source]¶
Bases:
BackendErrorRaised when a requested backend is not found.
This error indicates that the specified backend name is not registered in the backend registry.
- exception uniqc.exceptions.BackendOptionsError(message, *, details=None, hint_key=None)[source]¶
Bases:
UnifiedQuantumError,ValueErrorRaised when
BackendOptionsconstruction, validation, or normalisation fails.
- exception uniqc.exceptions.CircuitError(message, *, details=None, hint_key=None)[source]¶
Bases:
UnifiedQuantumErrorBase class for all circuit-related errors.
- exception uniqc.exceptions.CircuitTranslationError(message, *, source_format=None, target_format=None, details=None)[source]¶
Bases:
CircuitErrorRaised when circuit translation or IR conversion fails.
This covers failures converting between OriginIR, OpenQASM 2, and other intermediate representations.
- exception uniqc.exceptions.CompilationFailedError(message, *, details=None, hint_key=None)[source]¶
Bases:
UnifiedQuantumErrorRaised when quantum circuit compilation fails.
- exception uniqc.exceptions.ConfigError(message, *, details=None, hint_key=None)[source]¶
Bases:
UnifiedQuantumErrorBase exception for configuration-related errors.
- exception uniqc.exceptions.ConfigValidationError(message, *, details=None, hint_key=None)[source]¶
Bases:
ConfigErrorRaised when configuration validation fails.
- exception uniqc.exceptions.InsufficientCreditsError(message, *, details=None, hint_key=None)[source]¶
Bases:
UnifiedQuantumErrorRaised when the account has insufficient credits to run a task.
This error indicates that the user’s account balance is too low to execute the requested quantum computation.
- exception uniqc.exceptions.MissingDependencyError(package, extra=None, install_hint=None)[source]¶
Bases:
UnifiedQuantumError,ImportErrorRaised when an optional dependency is not installed.
Inherits from both
UnifiedQuantumErrorandImportErrorso that it can be caught by either.
- exception uniqc.exceptions.NetworkError(message, *, url=None, status_code=None, details=None)[source]¶
Bases:
UnifiedQuantumErrorRaised when a network operation fails.
This error covers connection failures, timeouts, DNS errors, and other network-related issues when communicating with quantum computing backends.
- exception uniqc.exceptions.NotMatrixableError(message, *, details=None, hint_key=None)[source]¶
Bases:
CircuitErrorRaised when a circuit or gate has no unitary matrix representation.
- exception uniqc.exceptions.NotSupportedGateError(message, *, details=None, hint_key=None)[source]¶
Bases:
CircuitErrorRaised when an unsupported gate is encountered in OpenQASM 2.
- exception uniqc.exceptions.PlatformNotFoundError(message, *, details=None, hint_key=None)[source]¶
Bases:
ConfigErrorRaised when an unsupported platform is referenced.
- exception uniqc.exceptions.ProfileNotFoundError(message, *, details=None, hint_key=None)[source]¶
Bases:
ConfigErrorRaised when a configuration profile is not found.
- exception uniqc.exceptions.QuotaExceededError(message, *, details=None, hint_key=None)[source]¶
Bases:
UnifiedQuantumErrorRaised when the user has exceeded their usage quota.
This error indicates that the user has reached their daily, monthly, or total usage limit for the quantum computing service.
- exception uniqc.exceptions.RegisterDefinitionError(message, *, details=None, hint_key=None)[source]¶
Bases:
CircuitErrorRaised when a register definition is invalid (e.g., duplicate name, empty).
- exception uniqc.exceptions.RegisterNotFoundError(message, *, details=None, hint_key=None)[source]¶
Bases:
CircuitErrorRaised when a quantum or classical register is not found.
- exception uniqc.exceptions.RegisterOutOfRangeError(message, *, details=None, hint_key=None)[source]¶
Bases:
CircuitErrorRaised when a register index exceeds its defined size.
- exception uniqc.exceptions.StaleCalibrationError(message, *, details=None, hint_key=None)[source]¶
Bases:
UnifiedQuantumErrorRaised when calibration data exceeds the allowed age (TTL).
- exception uniqc.exceptions.TaskFailedError(message, *, task_id=None, backend=None, error_code=None, details=None)[source]¶
Bases:
UnifiedQuantumErrorRaised when a quantum task fails on the backend.
This error indicates that the task was submitted successfully but failed during execution on the quantum computer or simulator.
- exception uniqc.exceptions.TaskNotFoundError(message, *, task_id=None, details=None)[source]¶
Bases:
UnifiedQuantumErrorRaised when a task cannot be found.
This error indicates that the specified task ID does not exist or the user does not have permission to access it.
- exception uniqc.exceptions.TaskTimeoutError(message, *, task_id=None, timeout=None, details=None)[source]¶
Bases:
UnifiedQuantumErrorRaised when waiting for a task result exceeds the timeout.
This error indicates that the task did not complete within the specified timeout period. The task may still be running.
- exception uniqc.exceptions.TimelineDurationError(message, *, details=None, hint_key=None)[source]¶
Bases:
CircuitErrorRaised when a logical circuit cannot be scheduled without gate durations.
- exception uniqc.exceptions.TopologyError(message, *, details=None, hint_key=None)[source]¶
Bases:
UnifiedQuantumErrorRaised when an invalid qubit or topology is used.
- exception uniqc.exceptions.UnifiedQuantumError(message, *, details=None, hint_key=None)[source]¶
Bases:
ExceptionBase exception for all UnifiedQuantum errors.
- exception uniqc.exceptions.UnsupportedGateError(message, *, gate_name=None, backend=None, details=None)[source]¶
Bases:
CircuitErrorRaised when a circuit contains an unsupported gate.
This error indicates that the target backend does not support one or more gates present in the circuit.