pyqasm.validate
- validate(program)[source]
Validates a given OpenQASM 3 program for semantic correctness.
- Parameters:
program (openqasm3.ast.Program or str) – The OpenQASM 3 program to validate.
- Raises:
TypeError – If the input is not a string or an openqasm3.ast.Program instance.
ValidationError – If the program fails parsing or semantic validation.
- Return type:
None