qalgebra.core.exceptions module

Exceptions and Errors raised by QAlgebra.

Summary

Exceptions:

AlgebraError

Base class for all algebraic errors.

AlgebraException

Base class for all algebraic exceptions.

BasisNotSetError

Raised if the basis or a Hilbert space dimension is unavailable.

CannotSimplify

Raised when a rule cannot further simplify an expression.

CannotSymbolicallyDiagonalize

Matrix cannot be diagonalized analytically.

InfiniteSumError

Raised when expanding a sum into an infinite number of terms.

NoConjugateMatrix

Raised when entries of Matrix have no defined conjugate.

NonSquareMatrix

Raised when a Matrix fails to be square.

OverlappingSpaces

Raised when objects fail to be in separate Hilbert spaces.

SpaceTooLargeError

Raised when objects fail to be have overlapping Hilbert spaces.

UnequalSpaces

Raised when objects fail to be in the same Hilbert space.

__all__: AlgebraError, AlgebraException, BasisNotSetError, CannotSimplify, CannotSymbolicallyDiagonalize, InfiniteSumError, NoConjugateMatrix, NonSquareMatrix, OverlappingSpaces, SpaceTooLargeError, UnequalSpaces

Reference

exception qalgebra.core.exceptions.AlgebraException[source]

Bases: Exception

Base class for all algebraic exceptions.

These should only be used for internat signaling, and never be raised to a user.

exception qalgebra.core.exceptions.AlgebraError[source]

Bases: ValueError

Base class for all algebraic errors.

exception qalgebra.core.exceptions.InfiniteSumError[source]

Bases: qalgebra.core.exceptions.AlgebraError

Raised when expanding a sum into an infinite number of terms.

exception qalgebra.core.exceptions.CannotSimplify[source]

Bases: qalgebra.core.exceptions.AlgebraException

Raised when a rule cannot further simplify an expression.

exception qalgebra.core.exceptions.BasisNotSetError[source]

Bases: qalgebra.core.exceptions.AlgebraError

Raised if the basis or a Hilbert space dimension is unavailable.

exception qalgebra.core.exceptions.UnequalSpaces[source]

Bases: qalgebra.core.exceptions.AlgebraError

Raised when objects fail to be in the same Hilbert space.

This happens for example when trying to add two states from different Hilbert spaces.

exception qalgebra.core.exceptions.OverlappingSpaces[source]

Bases: qalgebra.core.exceptions.AlgebraError

Raised when objects fail to be in separate Hilbert spaces.

exception qalgebra.core.exceptions.SpaceTooLargeError[source]

Bases: qalgebra.core.exceptions.AlgebraError

Raised when objects fail to be have overlapping Hilbert spaces.

exception qalgebra.core.exceptions.CannotSymbolicallyDiagonalize[source]

Bases: qalgebra.core.exceptions.AlgebraException

Matrix cannot be diagonalized analytically.

Signals that a fallback to numerical diagonalization is required.

exception qalgebra.core.exceptions.NonSquareMatrix[source]

Bases: qalgebra.core.exceptions.AlgebraError

Raised when a Matrix fails to be square.

exception qalgebra.core.exceptions.NoConjugateMatrix[source]

Bases: qalgebra.core.exceptions.AlgebraError

Raised when entries of Matrix have no defined conjugate.