uniqc.qasm.exceptions module#

QASM parser exceptions module.

This module defines custom exceptions for OpenQASM 2.0 parsing, including errors for unsupported gates and register-related issues.

Key exports:

NotSupportedGateError: Exception for unsupported quantum gates. RegisterNotFoundError: Exception for missing quantum/classical registers. RegisterOutOfRangeError: Exception for register index out of bounds. RegisterDefinitionError: Exception for invalid register definitions.

exception uniqc.qasm.exceptions.NotSupportedGateError[source]#

Bases: Exception

Raised when an unsupported gate is encountered in OpenQASM 2.

exception uniqc.qasm.exceptions.RegisterDefinitionError[source]#

Bases: Exception

Raised when a register definition is invalid (e.g., duplicate name, empty).

exception uniqc.qasm.exceptions.RegisterNotFoundError[source]#

Bases: Exception

Raised when a quantum or classical register is not found.

exception uniqc.qasm.exceptions.RegisterOutOfRangeError[source]#

Bases: Exception

Raised when a register index exceeds its defined size.