Skip to content

_exceptions

qoptcraft.state._exceptions

NotHermitianError()

Bases: ValueError

The matrix is not hermitian.

Source code in qoptcraft/state/_exceptions.py
36
37
38
def __init__(self) -> None:
    message = "The matrix is not hermitian."
    super().__init__(message)

NumberModesError()

Bases: ValueError

Not all states have the same number of modes.

Source code in qoptcraft/state/_exceptions.py
28
29
30
def __init__(self) -> None:
    message = "Not all states have the same number of modes."
    super().__init__(message)

NumberPhotonsError()

Bases: ValueError

Not all states have the same number of photons.

Source code in qoptcraft/state/_exceptions.py
20
21
22
def __init__(self) -> None:
    message = "Not all states have the same number of photons."
    super().__init__(message)

ProbabilityError(sum_probs)

Bases: ValueError

Probabilities don't add up to 1.

Source code in qoptcraft/state/_exceptions.py
4
5
6
def __init__(self, sum_probs: float) -> None:
    message = f"The sum of the probabilities is {sum_probs} instead of 1."
    super().__init__(message)

PureStateLengthError()

Bases: ValueError

States and probabilities differ in length.

Source code in qoptcraft/state/_exceptions.py
12
13
14
def __init__(self) -> None:
    message = "States and probabilities differ in length."
    super().__init__(message)