autoqasm.errors module
Errors raised in the AutoQASM build process.
- exception autoqasm.errors.AutoQasmError[source]
Bases:
ExceptionBase class for all AutoQASM exceptions.
- exception autoqasm.errors.AutoQasmTypeError[source]
Bases:
AutoQasmErrorGeneric type error.
- exception autoqasm.errors.UnsupportedFeatureError[source]
Bases:
AutoQasmErrorAutoQASM unsupported feature.
- exception autoqasm.errors.ParameterTypeError[source]
Bases:
AutoQasmErrorAutoQASM parameter type error.
- exception autoqasm.errors.MissingParameterTypeError[source]
Bases:
AutoQasmErrorAutoQASM requires type hints for subroutine parameters.
- exception autoqasm.errors.ParameterNotFoundError[source]
Bases:
AutoQasmErrorA FreeParameter could not be found in the program.
- exception autoqasm.errors.InvalidGateDefinition[source]
Bases:
AutoQasmErrorGate definition does not meet the necessary requirements.
- exception autoqasm.errors.InvalidCalibrationDefinition[source]
Bases:
AutoQasmErrorCalibration definition does not meet the necessary requirements.
- exception autoqasm.errors.InvalidTargetQubit[source]
Bases:
AutoQasmErrorTarget qubit is invalid in the current context.
- exception autoqasm.errors.UnsupportedGate[source]
Bases:
AutoQasmErrorGate is not supported by the target device.
- exception autoqasm.errors.UnsupportedNativeGate[source]
Bases:
AutoQasmErrorNative gate is not supported by the target device.
- exception autoqasm.errors.VerbatimBlockNotAllowed[source]
Bases:
AutoQasmErrorVerbatim block is not supported by the target device.
- exception autoqasm.errors.UnknownQubitCountError[source]
Bases:
AutoQasmErrorMissing declaration for the number of qubits.
- exception autoqasm.errors.OutsideProgramContextError(feature: str | None = None)[source]
Bases:
AutoQasmErrorRaised when an AutoQASM feature is used outside of an active program context (i.e. outside a function decorated with
@aq.main/@aq.subroutine/@aq.gate).- Parameters:
feature (str | None) – The name of the AutoQASM feature being invoked outside of an active program context, if known. Used to produce a slightly more pointed error message.
- exception autoqasm.errors.BuildError[source]
Bases:
AutoQasmErrorNon-AutoQasmError raised during program construction, wrapped with actionable guidance pointing back to the user’s code.
The original exception is preserved via
__cause__.
- exception autoqasm.errors.InsufficientQubitCountError[source]
Bases:
AutoQasmErrorTarget device does not have enough qubits for the program.
- exception autoqasm.errors.UnsupportedConditionalExpressionError(true_type: type | None, false_type: type | None)[source]
Bases:
AutoQasmErrorConditional expressions which return values are not supported.
- exception autoqasm.errors.InvalidAssignmentStatement[source]
Bases:
AutoQasmErrorInvalid assignment statement for an AutoQASM variable.
- exception autoqasm.errors.InvalidArrayDeclaration[source]
Bases:
AutoQasmErrorInvalid declaration of an AutoQASM array variable.
- exception autoqasm.errors.UnsupportedSubroutineReturnType[source]
Bases:
AutoQasmErrorUnsupported return type for an AutoQASM subroutine.
- exception autoqasm.errors.NameConflict[source]
Bases:
AutoQasmErrorName conflict between user-named variables.
- exception autoqasm.errors.NestedMainProgramError[source]
Bases:
AutoQasmErrorMain program nested inside another main program.