"""
Custom exceptions for the pyvelora library.

This module defines general exceptions for vector, matrix, and tensor operations.
"""


class PyveloraError(Exception):
    """Base exception for all pyvelora errors."""
    pass


class ShapeError(PyveloraError):
    """Raised when array shape is invalid or incompatible."""
    pass


class DimensionError(PyveloraError):
    """Raised when dimensions are incompatible for an operation."""
    pass


class ValueError(PyveloraError):
    """Raised when values are invalid."""
    pass


class IndexError(PyveloraError):
    """Raised when index is out of bounds."""
    pass


class OperationError(PyveloraError):
    """Raised when an operation cannot be performed."""
    pass


class SingularMatrixError(PyveloraError):
    """Raised when attempting to invert a singular matrix."""
    pass


class NonSquareMatrixError(PyveloraError):
    """Raised when a square matrix is required but received a non-square matrix."""
    pass
