guppylang
guppylang copied to clipboard
Pythonic quantum-classical programming language
Allow users to construct Guppy types as Python values using the regular typing syntax. E.g. running `array[qubit, 10]` in the interpreter should return an object that we can later interpret...
Alternative: https://github.com/CQCL/guppylang/issues/277 but it looks like that is not feasible...
Otherwise, returns from those functions will be treated as `Any` by mypy at al
For example, by turning them into `Annotated`. Question: What about pyright and VSCode?
Unfortunately, mypy doesn't `dataclass_transform` on methods yet: https://github.com/python/mypy/issues/16527
Make global function instead
For example (see test in `test_extern.py`): ``` guppy.extern("x", ty="int", module=module) @guppy(module) def main(b: bool) -> int: if b: x = 4 return x ``` This currently crashes (`KeyError: Variable.Id(name='x')` in...
Stop using sum
``` @guppy def p_k_p_gamma_registers( data_qubits_registers: array[array[qubit, n], r], aux_reg: array[qubit, m] @ owned ) -> bool: return True ``` Running the above function results in: ``` cfg = , func_name...