DevelopersHiQ / Use it
Diagnostic codes
The checker names every problem with one of 77 stable codes, with the line and column of your source that caused it. A refusal from a lower layer is reported at your line too, so an Objects program can return an Assembly code such as gate.unknown.
77 of 77 codes
Assembly and the IR
Used by all three layers. A refusal from a lower layer comes back at the line of your source that caused it.
| Code | Meaning |
|---|---|
lang.character | A character that is not part of the language |
lang.syntax | The text does not parse |
lang.reserved | A reserved word used as a name |
lang.program_missing | The source does not start with program <name> |
lang.declaration_nested | A declaration inside a block |
lang.unclosed_block | A block is never closed |
lang.array_size | An array size outside 1 to 65,536 |
lang.array_needs_index | An array used without naming an element |
lang.index_expression | An index that is not a number or a loop variable |
lang.index_unknown | An index naming no loop variable in scope |
lang.angle_not_constant | An angle that is not constant |
lang.angle_division | An angle that divides by zero |
lang.bound_not_constant | A loop bound that is not a whole number |
lang.type | Not a type |
lang.invalid | A construct the IR rejected |
gate.unknown | No such gate |
gate.arity | Wrong number of qubits |
gate.params | Wrong number of angles |
qubit.unknown | An undeclared qubit |
qubit.aliased | The same qubit twice in one operation |
qubit.use_after_measure | Used after measurement without reset |
qubit.use_after_release | Used after release |
qubit.double_release | Released twice |
qubit.release_dirty | Released clean while not known to be zero |
qubit.already_allocated | Allocated while live |
qubit.escapes_branch | Lives past the branch that allocated it |
qubit.loop_needs_reset | A loop reuses a qubit with no reset |
qubit.too_many | Too many live qubits |
variable.unknown | An undeclared variable |
name.duplicate | A name declared twice |
name.invalid | Not an identifier |
classical.width | An integer width outside 1 to 64 |
classical.type | Operand types do not fit |
classical.literal_range | A literal does not fit its type |
condition.type | A condition is not a bit or a comparison |
loop.unbounded | A real-time loop has no budget |
loop.budget | A budget outside its range |
loop.step | A step of zero |
switch.subject | A match subject that cannot be switched on |
subroutine.unknown | No such routine |
subroutine.arity | Wrong arguments to a routine |
subroutine.recursion | A routine calls itself |
subroutine.too_deep | Calls nested past 64 |
within.not_invertible | The compute block cannot be inverted |
block.too_deep | Blocks nested past 64 |
expression.too_deep | An expression nested past 64 |
document.too_large | The source is over 256 KiB |
program.too_large | The source expands past 20,000 statements |
Script
Added by HiQ Script on top of the codes above.
| Code | Meaning |
|---|---|
lang.init | An initial value on a qubit or an array |
lang.division | A constant expression divides by zero |
task.duplicate | Two tasks with one name |
task.shares_qubit | Two tasks touch one qubit |
task.shares_variable | One task writes a variable another touches |
Objects
Added by HiQ Objects on top of the codes above.
| Code | Meaning |
|---|---|
l3.syntax | The text does not parse |
l3.main | No main, or more than one |
l3.undefined | An unknown name or member |
l3.unknown_type | An unknown type |
l3.type | A type that does not fit |
l3.duplicate | A name declared twice |
l3.reserved_name | A class or interface named like a gate |
l3.private | A member the caller cannot reach |
l3.arguments | Wrong arguments |
l3.signature | A method that differs from what it implements |
l3.override | An override that overrides nothing |
l3.abstract | An abstract class instantiated |
l3.not_implemented | An abstract or interface method left unimplemented |
l3.recursion | A call that reaches itself |
l3.recursive_class | A class that contains itself |
l3.inheritance_too_deep | Inheritance past 64 |
l3.object_too_deep | Objects nested past 64 |
l3.too_many_objects | More than 65,536 objects |
l3.array_size | An array size outside 1 to 65,536 |
l3.index | An index out of range |
l3.not_constant | A value that must be known at compile time |
l3.not_finite | A compile-time number that is not finite |
l3.division_by_zero | A compile-time division by zero |
Pulse
The pulse layer checks timing and amplitude.
| Code | Meaning |
|---|---|
pulse.timing | A length that is not a multiple of dt |