Skip to content

exceptions

This module contains all custom exception used by OpenSquirrel.

ExporterError

Bases: Exception

Should be raised when a circuit cannot be exported to the desired output format.

Source code in opensquirrel\exceptions.py
class ExporterError(Exception):
    """Should be raised when a circuit cannot be exported to the desired output format."""

UnsupportedGateError

Bases: Exception

Should be raised when a gate is not supported.

Source code in opensquirrel\exceptions.py
class UnsupportedGateError(Exception):
    """Should be raised when a gate is not supported."""

    def __init__(self, gate: Any, *args: Any) -> None:
        """Init of the ``UnsupportedGateError``.

        Args:
            gate: Gate that is not supported.
        """
        super().__init__(f"{gate} not supported", *args)

__init__(gate, *args)

Init of the UnsupportedGateError.

Parameters:

Name Type Description Default
gate Any

Gate that is not supported.

required
Source code in opensquirrel\exceptions.py
def __init__(self, gate: Any, *args: Any) -> None:
    """Init of the ``UnsupportedGateError``.

    Args:
        gate: Gate that is not supported.
    """
    super().__init__(f"{gate} not supported", *args)