uniqc.exceptions module#

Custom exceptions for UnifiedQuantum.

This module defines all custom exceptions used throughout the UnifiedQuantum package, providing clear error types for different failure scenarios.

exception uniqc.exceptions.AuthenticationError(message, *, details=None)[source]#

Bases: UnifiedQuantumError

Raised 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.

Parameters:
  • message (str)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.BackendError(message, *, details=None)[source]#

Bases: UnifiedQuantumError

Raised when a backend operation fails.

This is the base class for all backend-related errors.

Parameters:
  • message (str)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.BackendNotAvailableError(message, *, details=None)[source]#

Bases: BackendError

Raised when a backend is not available.

This error indicates that the backend is offline, not configured, or cannot be accessed due to missing dependencies.

Parameters:
  • message (str)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.BackendNotFoundError(message, *, details=None)[source]#

Bases: BackendError

Raised when a requested backend is not found.

This error indicates that the specified backend name is not registered in the backend registry.

Parameters:
  • message (str)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.CircuitError(message, *, details=None)[source]#

Bases: UnifiedQuantumError

Raised when a circuit operation fails.

This is the base class for all circuit-related errors.

Parameters:
  • message (str)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.CircuitTranslationError(message, *, source_format=None, target_format=None, details=None)[source]#

Bases: CircuitError

Raised when circuit translation fails.

This error indicates that a circuit could not be converted from OriginIR to the target backend’s native format.

Parameters:
  • message (str)

  • source_format (str | None)

  • target_format (str | None)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.InsufficientCreditsError(message, *, details=None)[source]#

Bases: UnifiedQuantumError

Raised 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.

Parameters:
  • message (str)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.NetworkError(message, *, url=None, status_code=None, details=None)[source]#

Bases: UnifiedQuantumError

Raised when a network operation fails.

This error covers connection failures, timeouts, DNS errors, and other network-related issues when communicating with quantum computing backends.

Parameters:
  • message (str)

  • url (str | None)

  • status_code (int | None)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.QuotaExceededError(message, *, details=None)[source]#

Bases: UnifiedQuantumError

Raised 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.

Parameters:
  • message (str)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.TaskFailedError(message, *, task_id=None, backend=None, error_code=None, details=None)[source]#

Bases: UnifiedQuantumError

Raised 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.

Parameters:
  • message (str)

  • task_id (str | None)

  • backend (str | None)

  • error_code (str | None)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.TaskNotFoundError(message, *, task_id=None, details=None)[source]#

Bases: UnifiedQuantumError

Raised 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.

Parameters:
  • message (str)

  • task_id (str | None)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.TaskTimeoutError(message, *, task_id=None, timeout=None, details=None)[source]#

Bases: UnifiedQuantumError

Raised 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.

Parameters:
  • message (str)

  • task_id (str | None)

  • timeout (float | None)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.UnifiedQuantumError(message, *, details=None)[source]#

Bases: Exception

Base exception for all UnifiedQuantum errors.

Parameters:
  • message (str)

  • details (dict | None)

Return type:

None

exception uniqc.exceptions.UnsupportedGateError(message, *, gate_name=None, backend=None, details=None)[source]#

Bases: CircuitError

Raised 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.

Parameters:
  • message (str)

  • gate_name (str | None)

  • backend (str | None)

  • details (dict | None)

Return type:

None