Skip to content

Exceptions

Structured exception classes for bloqade-lanes-bytecode.

Each Rust error enum maps to a base exception class. Category-based enums (like ArchSpecError) map to subclasses that carry a descriptive message string. Fine-grained enums (like LaneGroupError, ValidationError) map to subclasses with the variant's fields as attributes.

ArchSpecBusError

ArchSpecBusError(message: str)

Bases: ArchSpecError


              flowchart TD
              bloqade.lanes.bytecode.exceptions.ArchSpecBusError[ArchSpecBusError]
              bloqade.lanes.bytecode.exceptions.ArchSpecError[ArchSpecError]

                              bloqade.lanes.bytecode.exceptions.ArchSpecError --> bloqade.lanes.bytecode.exceptions.ArchSpecBusError
                


              click bloqade.lanes.bytecode.exceptions.ArchSpecBusError href "" "bloqade.lanes.bytecode.exceptions.ArchSpecBusError"
              click bloqade.lanes.bytecode.exceptions.ArchSpecError href "" "bloqade.lanes.bytecode.exceptions.ArchSpecError"
            

Bus topology error (site/word bus structure, membership lists).

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
41
42
def __init__(self, message: str):
    super().__init__(message)

ArchSpecError

ArchSpecError(
    message: str, errors: list[ArchSpecError] | None = None
)

Bases: Exception


              flowchart TD
              bloqade.lanes.bytecode.exceptions.ArchSpecError[ArchSpecError]

              

              click bloqade.lanes.bytecode.exceptions.ArchSpecError href "" "bloqade.lanes.bytecode.exceptions.ArchSpecError"
            

Base class for architecture specification validation errors.

When multiple errors are collected, this is raised with an errors attribute containing the individual subclass instances.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
19
20
21
def __init__(self, message: str, errors: "list[ArchSpecError] | None" = None):
    super().__init__(message)
    self.errors: list[ArchSpecError] = errors or []

ArchSpecGeometryError

ArchSpecGeometryError(message: str)

Bases: ArchSpecError


              flowchart TD
              bloqade.lanes.bytecode.exceptions.ArchSpecGeometryError[ArchSpecGeometryError]
              bloqade.lanes.bytecode.exceptions.ArchSpecError[ArchSpecError]

                              bloqade.lanes.bytecode.exceptions.ArchSpecError --> bloqade.lanes.bytecode.exceptions.ArchSpecGeometryError
                


              click bloqade.lanes.bytecode.exceptions.ArchSpecGeometryError href "" "bloqade.lanes.bytecode.exceptions.ArchSpecGeometryError"
              click bloqade.lanes.bytecode.exceptions.ArchSpecError href "" "bloqade.lanes.bytecode.exceptions.ArchSpecError"
            

Word geometry error (site counts, grid indices, grid shape, non-finite values).

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
34
35
def __init__(self, message: str):
    super().__init__(message)

ArchSpecPathError

ArchSpecPathError(message: str)

Bases: ArchSpecError


              flowchart TD
              bloqade.lanes.bytecode.exceptions.ArchSpecPathError[ArchSpecPathError]
              bloqade.lanes.bytecode.exceptions.ArchSpecError[ArchSpecError]

                              bloqade.lanes.bytecode.exceptions.ArchSpecError --> bloqade.lanes.bytecode.exceptions.ArchSpecPathError
                


              click bloqade.lanes.bytecode.exceptions.ArchSpecPathError href "" "bloqade.lanes.bytecode.exceptions.ArchSpecPathError"
              click bloqade.lanes.bytecode.exceptions.ArchSpecError href "" "bloqade.lanes.bytecode.exceptions.ArchSpecError"
            

Transport path error (invalid lanes, waypoint counts, endpoint mismatches).

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
48
49
def __init__(self, message: str):
    super().__init__(message)

ArchSpecZoneError

ArchSpecZoneError(message: str)

Bases: ArchSpecError


              flowchart TD
              bloqade.lanes.bytecode.exceptions.ArchSpecZoneError[ArchSpecZoneError]
              bloqade.lanes.bytecode.exceptions.ArchSpecError[ArchSpecError]

                              bloqade.lanes.bytecode.exceptions.ArchSpecError --> bloqade.lanes.bytecode.exceptions.ArchSpecZoneError
                


              click bloqade.lanes.bytecode.exceptions.ArchSpecZoneError href "" "bloqade.lanes.bytecode.exceptions.ArchSpecZoneError"
              click bloqade.lanes.bytecode.exceptions.ArchSpecError href "" "bloqade.lanes.bytecode.exceptions.ArchSpecError"
            

Zone configuration error (zone 0 coverage, measurement/entangling zone IDs).

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
27
28
def __init__(self, message: str):
    super().__init__(message)

AtomReloadingNotSupportedError

AtomReloadingNotSupportedError(pc: int)

Bases: ValidationError


              flowchart TD
              bloqade.lanes.bytecode.exceptions.AtomReloadingNotSupportedError[AtomReloadingNotSupportedError]
              bloqade.lanes.bytecode.exceptions.ValidationError[ValidationError]

                              bloqade.lanes.bytecode.exceptions.ValidationError --> bloqade.lanes.bytecode.exceptions.AtomReloadingNotSupportedError
                


              click bloqade.lanes.bytecode.exceptions.AtomReloadingNotSupportedError href "" "bloqade.lanes.bytecode.exceptions.AtomReloadingNotSupportedError"
              click bloqade.lanes.bytecode.exceptions.ValidationError href "" "bloqade.lanes.bytecode.exceptions.ValidationError"
            

Fill instruction requires atom_reloading capability.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
142
143
144
145
146
def __init__(self, pc: int):
    self.pc = pc
    super().__init__(
        f"pc {pc}: fill instruction requires atom_reloading capability"
    )

DecodeError

Bases: Exception


              flowchart TD
              bloqade.lanes.bytecode.exceptions.DecodeError[DecodeError]

              

              click bloqade.lanes.bytecode.exceptions.DecodeError href "" "bloqade.lanes.bytecode.exceptions.DecodeError"
            

Base class for instruction decode errors.

DecodeErrorInProgram

DecodeErrorInProgram(message: str)

Bases: ProgramError


              flowchart TD
              bloqade.lanes.bytecode.exceptions.DecodeErrorInProgram[DecodeErrorInProgram]
              bloqade.lanes.bytecode.exceptions.ProgramError[ProgramError]

                              bloqade.lanes.bytecode.exceptions.ProgramError --> bloqade.lanes.bytecode.exceptions.DecodeErrorInProgram
                


              click bloqade.lanes.bytecode.exceptions.DecodeErrorInProgram href "" "bloqade.lanes.bytecode.exceptions.DecodeErrorInProgram"
              click bloqade.lanes.bytecode.exceptions.ProgramError href "" "bloqade.lanes.bytecode.exceptions.ProgramError"
            

A decode error encountered while parsing a binary program.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
359
360
361
def __init__(self, message: str):
    self.message = message
    super().__init__(f"decode error: {message}")

EmptyProgramError

EmptyProgramError()

Bases: ValidationError


              flowchart TD
              bloqade.lanes.bytecode.exceptions.EmptyProgramError[EmptyProgramError]
              bloqade.lanes.bytecode.exceptions.ValidationError[ValidationError]

                              bloqade.lanes.bytecode.exceptions.ValidationError --> bloqade.lanes.bytecode.exceptions.EmptyProgramError
                


              click bloqade.lanes.bytecode.exceptions.EmptyProgramError href "" "bloqade.lanes.bytecode.exceptions.EmptyProgramError"
              click bloqade.lanes.bytecode.exceptions.ValidationError href "" "bloqade.lanes.bytecode.exceptions.ValidationError"
            

Program has no instructions.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
152
153
154
155
def __init__(self) -> None:
    super().__init__(
        "program is empty: must contain at least one instruction ending with return or halt"
    )

FeedForwardNotSupportedError

FeedForwardNotSupportedError(pc: int)

Bases: ValidationError


              flowchart TD
              bloqade.lanes.bytecode.exceptions.FeedForwardNotSupportedError[FeedForwardNotSupportedError]
              bloqade.lanes.bytecode.exceptions.ValidationError[ValidationError]

                              bloqade.lanes.bytecode.exceptions.ValidationError --> bloqade.lanes.bytecode.exceptions.FeedForwardNotSupportedError
                


              click bloqade.lanes.bytecode.exceptions.FeedForwardNotSupportedError href "" "bloqade.lanes.bytecode.exceptions.FeedForwardNotSupportedError"
              click bloqade.lanes.bytecode.exceptions.ValidationError href "" "bloqade.lanes.bytecode.exceptions.ValidationError"
            

Multiple measure instructions require feed_forward capability.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
132
133
134
135
136
def __init__(self, pc: int):
    self.pc = pc
    super().__init__(
        f"pc {pc}: multiple measure instructions require feed_forward capability"
    )

LaneGroupError

LaneGroupError(
    message: str, errors: list[LaneGroupError] | None = None
)

Bases: Exception


              flowchart TD
              bloqade.lanes.bytecode.exceptions.LaneGroupError[LaneGroupError]

              

              click bloqade.lanes.bytecode.exceptions.LaneGroupError href "" "bloqade.lanes.bytecode.exceptions.LaneGroupError"
            

Base class for lane group validation errors.

When multiple errors are collected, this is raised with an errors attribute containing the individual subclass instances.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
215
216
217
def __init__(self, message: str, errors: "list[LaneGroupError] | None" = None):
    super().__init__(message)
    self.errors: list[LaneGroupError] = errors or []

LaneValidationError

LaneValidationError(pc: int, error: LaneGroupError)

Bases: ValidationError


              flowchart TD
              bloqade.lanes.bytecode.exceptions.LaneValidationError[LaneValidationError]
              bloqade.lanes.bytecode.exceptions.ValidationError[ValidationError]

                              bloqade.lanes.bytecode.exceptions.ValidationError --> bloqade.lanes.bytecode.exceptions.LaneValidationError
                


              click bloqade.lanes.bytecode.exceptions.LaneValidationError href "" "bloqade.lanes.bytecode.exceptions.LaneValidationError"
              click bloqade.lanes.bytecode.exceptions.ValidationError href "" "bloqade.lanes.bytecode.exceptions.ValidationError"
            

Wraps a LaneGroupError with a program counter for bytecode context.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
123
124
125
126
def __init__(self, pc: int, error: "LaneGroupError"):
    self.pc = pc
    self.error = error
    super().__init__(f"pc {pc}: {error}")

LocationGroupError

LocationGroupError(
    message: str,
    errors: list[LocationGroupError] | None = None,
)

Bases: Exception


              flowchart TD
              bloqade.lanes.bytecode.exceptions.LocationGroupError[LocationGroupError]

              

              click bloqade.lanes.bytecode.exceptions.LocationGroupError href "" "bloqade.lanes.bytecode.exceptions.LocationGroupError"
            

Base class for location group validation errors.

When multiple errors are collected, this is raised with an errors attribute containing the individual subclass instances.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
184
185
186
def __init__(self, message: str, errors: "list[LocationGroupError] | None" = None):
    super().__init__(message)
    self.errors: list[LocationGroupError] = errors or []

LocationValidationError

LocationValidationError(pc: int, error: LocationGroupError)

Bases: ValidationError


              flowchart TD
              bloqade.lanes.bytecode.exceptions.LocationValidationError[LocationValidationError]
              bloqade.lanes.bytecode.exceptions.ValidationError[ValidationError]

                              bloqade.lanes.bytecode.exceptions.ValidationError --> bloqade.lanes.bytecode.exceptions.LocationValidationError
                


              click bloqade.lanes.bytecode.exceptions.LocationValidationError href "" "bloqade.lanes.bytecode.exceptions.LocationValidationError"
              click bloqade.lanes.bytecode.exceptions.ValidationError href "" "bloqade.lanes.bytecode.exceptions.ValidationError"
            

Wraps a LocationGroupError with a program counter for bytecode context.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
114
115
116
117
def __init__(self, pc: int, error: "LocationGroupError"):
    self.pc = pc
    self.error = error
    super().__init__(f"pc {pc}: {error}")

MissingTerminatorError

MissingTerminatorError(pc: int)

Bases: ValidationError


              flowchart TD
              bloqade.lanes.bytecode.exceptions.MissingTerminatorError[MissingTerminatorError]
              bloqade.lanes.bytecode.exceptions.ValidationError[ValidationError]

                              bloqade.lanes.bytecode.exceptions.ValidationError --> bloqade.lanes.bytecode.exceptions.MissingTerminatorError
                


              click bloqade.lanes.bytecode.exceptions.MissingTerminatorError href "" "bloqade.lanes.bytecode.exceptions.MissingTerminatorError"
              click bloqade.lanes.bytecode.exceptions.ValidationError href "" "bloqade.lanes.bytecode.exceptions.ValidationError"
            

Program does not end with a return or halt instruction.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
161
162
163
def __init__(self, pc: int):
    self.pc = pc
    super().__init__(f"pc {pc}: program must end with return or halt")

ParseError

Bases: Exception


              flowchart TD
              bloqade.lanes.bytecode.exceptions.ParseError[ParseError]

              

              click bloqade.lanes.bytecode.exceptions.ParseError href "" "bloqade.lanes.bytecode.exceptions.ParseError"
            

Base class for SST text format parse errors.

ProgramError

Bases: Exception


              flowchart TD
              bloqade.lanes.bytecode.exceptions.ProgramError[ProgramError]

              

              click bloqade.lanes.bytecode.exceptions.ProgramError href "" "bloqade.lanes.bytecode.exceptions.ProgramError"
            

Base class for BLQD binary format errors.

UnreachableInstructionError

UnreachableInstructionError(pc: int)

Bases: ValidationError


              flowchart TD
              bloqade.lanes.bytecode.exceptions.UnreachableInstructionError[UnreachableInstructionError]
              bloqade.lanes.bytecode.exceptions.ValidationError[ValidationError]

                              bloqade.lanes.bytecode.exceptions.ValidationError --> bloqade.lanes.bytecode.exceptions.UnreachableInstructionError
                


              click bloqade.lanes.bytecode.exceptions.UnreachableInstructionError href "" "bloqade.lanes.bytecode.exceptions.UnreachableInstructionError"
              click bloqade.lanes.bytecode.exceptions.ValidationError href "" "bloqade.lanes.bytecode.exceptions.ValidationError"
            

Instruction follows a return or halt and is unreachable.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
169
170
171
def __init__(self, pc: int):
    self.pc = pc
    super().__init__(f"pc {pc}: unreachable instruction after return or halt")

ValidationError

ValidationError(
    message: str,
    errors: list[ValidationError] | None = None,
)

Bases: Exception


              flowchart TD
              bloqade.lanes.bytecode.exceptions.ValidationError[ValidationError]

              

              click bloqade.lanes.bytecode.exceptions.ValidationError href "" "bloqade.lanes.bytecode.exceptions.ValidationError"
            

Base class for bytecode validation errors.

When multiple errors are collected, this is raised with an errors attribute containing the individual subclass instances.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/exceptions.py
62
63
64
def __init__(self, message: str, errors: "list[ValidationError] | None" = None):
    super().__init__(message)
    self.errors: list[ValidationError] = errors or []