Changelog¶
The Guppy language is distributed via the guppylang pypi package.
This changelog documents user-facing changes to the Guppy language excluding changes to the compiler internals. The Guppy compiler is versioned with the guppylang-internals package.
Versioning Policy¶
As of August 2025, The Guppy language is undergoing rapid development and is currently unstable. There is a Guppy v1.0 stability milestone that is a work in progress and subject to change.
0.21.11 (2026-04-01)¶
Features¶
Bug Fixes¶
Documentation¶
0.21.10 (2026-03-23)¶
Features¶
Bug Fixes¶
Documentation¶
0.21.9 (2026-02-18)¶
Features¶
Add function to swap two array elements that lowers to hugr swap op (#1459) (15da521)
Add missing bool methods (rxor, rand, ror) (#1498) (6078136)
Allow panicking with different signal values (#1461) (e624d4f)
Compile time array bounds check for literal indices (#1438) (d2dd890)
Lower nat to int conversion to
iu_to_shugr op (#1480) (2ba5720)
Bug Fixes¶
Documentation¶
0.21.8 (2026-01-09)¶
Features¶
Bug Fixes¶
Convert symbolic pytket circuits angle inputs into rotations (#1425) (4724d90)
Fix Hugr generation for tuples in
ResultandEither(#1395) (f8b0d47), closes #1388Improve diagnostics rendering for wasm (#1399) (6604175), (#1398) (a6a539f)
Support comptime expressions in generic argument applications (#1409) (c1aad34), closes #1087
0.21.7 (2025-12-15)¶
Features¶
Bug Fixes¶
Miscellaneous Chores¶
Code Refactoring¶
0.21.6 (2025-10-29)¶
Features¶
0.21.5 (2025-09-22)¶
[!WARNING] The
.compile()method now assumes the function being compiled is an execution entrypoint and therefore checks it takes no arguments. If you have an existing workflow that produces a HUGR with a non-executable function this will break, usecompile_functioninstead.
Features¶
0.21.4 (2025-09-19)¶
Features¶
Bug Fixes¶
Documentation¶
Miscellaneous Chores¶
0.21.3 (2025-08-19)¶
Features¶
Bug Fixes¶
Documentation¶
Extended emulator docs (20651db)
Several docstring fixes
0.21.2 (2025-08-11)¶
Features¶
We can now pass a
startandstepfor the range function just as we can in Python. (#1157) (a1b9333)Update to guppylang-internals 0.22.0
Support float parameters as inputs to symbolic circuits loaded with
guppy.load_pytket. (#1105) (34c546c), closes #1076 (see example below).
from guppylang import guppy
from guppylang.std.angles import pi
from guppylang.std.quantum import qubit, rx, discard
from pytket import Circuit
from sympy import Symbol
a = Symbol("alpha")
circ = Circuit(1, 1)
circ.Rx(a, 0)
circ.Measure(0, 0)
rx_func = guppy.load_pytket("rx", circ, use_arrays=False)
@guppy
def perform_rx_flip() -> int:
"""Perform an X gate as Rx(q, pi)"""
q = qubit()
res = int(rx_func(q, pi))
discard(q)
return res
perform_rx_flip.check()
Bug Fixes¶
Documentation¶
0.21.1 (2025-08-05)¶
Bug Fixes¶
Documentation¶
0.21.0 (2025-08-04)¶
⚠ BREAKING CHANGES¶
All compiler-internal and non-userfacing functionality is moved into a new
guppylang_internalspackageguppy.compile(foo)andguppy.check(foo)are both now deprecated and will be removed in a future release. Their usage should be replaced withfoo.compile()andfoo.check().The
mainfunction no longer has a special status in Guppy. Any function which takes no arguments can be a valid entrypoint to a program.default HUGR output uses compressed binary encoding.
guppylang.tracing.object.GuppyDefinitionmoved toguppylang.defs.GuppyDefinitionguppylang.tracing.object.TypeVarGuppyDefinitionmoved and renamed toguppylang.defs.GuppyTypeVarDefinitionAll
to_hugrmethods on types, arguments, and parameters now require aToHugrContextCompilableDef.compile_outernow requires aToHugrContextguppy.hugr_opnow passes the compiler context to the function generating the opCheckedFunctionDefnow implementsMonomorphizableDefinstead ofCompilableDefCompilerContext.build_compiled_defnow requires an instantiation for the definition’s type parameters TheToHugrContextprotocol now requires two additional methods:type_var_to_hugrandconst_var_to_hugrCompilerContext.{compiled, worklist}andCompilationEngine.compiledare now indexed by a tuple ofDefIdand optionalPartiallyMonomorphizedArgsAny comptime code that previously used constant integers outside the 64-bit signed integer range will now fail to compile.
Capturing closures are now disabled by default. Enabling them requires calling
guppylang.enable_experimental_features(), however note that they are not supported throughout the stack.
Features¶
Add emulation of Guppy programs powered by the Selene framework (#1127)(5e2f595). See the Getting Started guide and the Examples Gallery for example usage.
add error when constant integer out of bounds (#1084) (eee77ae)
Add guppy version metadata to hugr entrypoint (#1039) (0eafbd9), closes #1037
add selene via optional feature and use for testing (#1081) (cefc70e)
Extend comptime arguments to arbitrary non-linear types (#1110) (384dd8c)
store used extensions and versions in HUGR metadata (#1049) (a9a300c), closes #1048
Support arbitrary const generics via monomorphisation (#1033) (bcf9865)
Support Python 3.12 generic syntax (#1051) (ab2e118), closes #823
Bug Fixes¶
Allow array comprehension syntax in comptime functions (#1068) (da8f04a), closes #1067
Allow struct redefinitions for Python < 3.13 (#1108) (959a4e4), closes #1107
Correctly detect
[@custom](https://github.com/custom)_guppy_decoratorin nested scopes (#1086) (678583c)Fix diagnostics rendering for comptime entrypoints (#1099) (fdd2676), closes #1097
Fix frame lookup for Python 3.12 annotation scopes (#1120) (a69e489), closes #1116
Fix hugr conversion and bounds checks on numeric literals (#1100) (73d5e92)
Fix nested function definitions in Python 3.12 (#1064) (090f920)
Stop showing temporary variables in comptime diagnostics (#1112) (63854c5), closes #1111
Turn capturing closures into experimental feature (#1065) (a959b18)
Documentation¶
Code Refactoring¶
0.20.0 (2025-06-19)¶
⚠ BREAKING CHANGES¶
Explicit Guppy modules have been removed. Instead, use the regular @guppy decorator everywhere without passing an explicit module. Compilation is now triggered via the .compile method.
0.19.0 syntax¶
@guppy
def main() -> None:
...
guppy.compile_module()
0.20.0 syntax¶
@guppy
def main() -> None:
...
main.compile()
Features¶
with_ownedstd library function to temporarily take ownership of a borrowed value (#994) (7bf75df), closes #992Add an Either type to the standard library. (#993) (75c1804), closes #991
Added a PriorityQueue structure to the standard library.
Guppy programs can now include
state_resulttags which can be used together with Selene to retrieve the statevector at a given point in the program execution (#905) (2217bbc). See the example notebook on Debugging with State Results.Add optional signature argument to RawCustomFunctionDef (#1005) (79e2d5b), closes #1003
Allow users to wrap
guppyin their own decorator (#1017) (f047c9b)diagnostics: add miette bindings for enhanced error rendering (#998) (c8f2724)
Function overloading via static dispatch (#1000) (6f523d6). See the corresponding section of the language guide for more information.
Bug Fixes¶
Documentation¶
0.19.1 (2025-05-27)¶
Features¶
Bug Fixes¶
0.19.0 (2025-05-22)¶
⚠ BREAKING CHANGES¶
Bools in HUGRs generated by Guppy are represented using a
tket2.boolinstead of the HUGR sum typedeprecated
hresultandqsys_resultmodules have been removed. Usehugr.qysystem.resultdirectly.Generated HUGRs now refer to entrypoints and are always modules in envelopes.
Features¶
Bug Fixes¶
Documentation¶
Code Refactoring¶
0.18.2 (2025-05-19)¶
Features¶
Bug Fixes¶
Better error message for unsupported generic comptime functions (#951) (35bfbcb), closes #944
Capture entire Python scope when defining comptime functions (#952) (898a033), closes #945
Fix
result/panic/exitcalls in comptime functions (#949) (ac4a515)Fix resolution of generic lengths in array constructor (#940) (0f1d5db)
Fix too narrow rendering of indented diagnostic labels (#933) (94821aa), closes #916
Use correct copyable/droppable terminology for type arg errors (#935) (6a44a1c), closes #867
0.18.1 (2025-04-26)¶
Features¶
Bug Fixes¶
add missing compilation for int rshift (#885) (5cd9225), closes #886
Allow standalone compilation of pytket functions (#903) (6416513)
deprecate zz_max and define in terms of zz_phase (#917) (85f5f6b), closes #914
Fix diagnostics spans for dynamically defined notebook functions (#907) (51b1b81), closes #906
0.18.0 (2025-03-25)¶
⚠ BREAKING CHANGES¶
Lists loaded from
py(...)expressions are now turned into immutablefrozenarrays instead of regulararrays.Guppy decorators now return instances of
GuppyDefinition
Features¶
0.17.1 (2025-03-24)¶
Features¶
Bug Fixes¶
qsystem: remove unsupported random_nat and maybe_rng (635e7ed)
Documentation¶
0.17.0 (2025-03-18)¶
⚠ BREAKING CHANGES¶
load_pytkettakes arrays by default (passuse_arrays=Falsefor qubit arguments)Optionis now a builtin type.angle.{__mul__, __rmul__, __truediv__, __rtruediv__now take afloatinstead of anint.
Features¶
add
Option.unwrap_nothing()method (#829) (abb1aa1), closes #810Allow explicit application of type arguments (#821) (8f90c04), closes #770
Generalise scalar angle operations to float (#824) (d3f5c7f)
Implement
floattointandnatcasts (#831) (b56d66c), closes #794qsystem: add Random number generation module (08fbf47)
Bug Fixes¶
Correctly handle assignments of arrays in control-flow (#845) (32ded02), closes #844
Define
lenof arrays using Guppy (#863) (6868ff6), closes #804Fix array comprehensions with generic element type (#865) (50df0db), closes #864
Fix compiler diagnostics when calling
checkinstead ofcompile(#854) (9993338)Fix diagnostic spans for indented code (#856) (d9fc9fd), closes #852
Fix error message for conditional shadowing of global variables (#815) (bdaae11), closes #772
Fix linearity checking for array copies (#841) (d9b085f), closes #838
Fix rendering of line breaks in diagnostics (#819) (75efd22), closes #818
Prevent reordering of operations with side-effects (#855) (75eb441)
Documentation¶
0.16.0 (2025-02-19)¶
⚠ BREAKING CHANGES¶
CompiledGlobalsrenamed toCompilerContext
Features¶
Code Refactoring¶
0.15.0 (2025-02-07)¶
⚠ BREAKING CHANGES¶
classical arrays can no longer be implicitly copied
pytketcircuits no longer supported bypyexpressions (use@pytketorload_pytketinstead)
Features¶
Bug Fixes¶
Documentation¶
0.14.0 (2024-12-19)¶
⚠ BREAKING CHANGES¶
Lists in
py(...)expressions are now turned into Guppy arrays instead of lists.dirty_qubitfunction removedmeasure_return renamed to
project_z
Features¶
add
maybe_qubitstdlib function (#705) (a49f70e), closes #627add measure_array and discard_array quantum function (#710) (3ad49ff)
Add method to load pytket circuit without function stub (#712) (ee1e3de)
Allow generic nat args in statically sized ranges (#706) (f441bb8), closes #663
Implicit coercion of numeric types (#702) (df4745b), closes #701
Load
pytketcircuit as a function definition (#672) (b21b7e1)qsystem std functions with updated primitives (#679) (b0f041f)
Unpacking assignment of iterable types with static size (#688) (602e243)
Bug Fixes¶
Accept non-negative int literals and py expressions as nats (#708) (a93d4fe), closes #704
Allow borrowing inside comprehensions (#723) (02b6ab0), closes #719
Detect unsupported default arguments (#659) (94ac7e3), closes #658
Ensure
ints can be treated as booleans (#709) (6ef6d60), closes #681Fix implicit modules in IPython shells (#662) (4ecb5f2), closes #661
Properly report error for unsupported constants (#724) (d0c2da4), closes #721
Properly report errors for unsupported expressions (#692) (7f24264), closes #691
Documentation¶
0.13.1 (2024-11-15)¶
Features¶
Bug Fixes¶
0.13.0 (2024-11-12)¶
⚠ BREAKING CHANGES¶
preludemodule renamed tostd
Features¶
Bug Fixes¶
Documentation¶
Miscellaneous Chores¶
Code Refactoring¶
0.12.2 (2024-10-21)¶
Features¶
Bug Fixes¶
0.12.1 (2024-09-23)¶
Features¶
Miscellaneous Chores¶
0.12.0 (2024-09-18)¶
⚠ BREAKING CHANGES¶
Pytket circuits loaded via a
pyexpression no longer take ownership of the passed qubits.Lists and function tensors are no longer available by default.
guppylang.enable_experimental_features()must be called before compilation to enable them.The
GuppyModuleargument is now optional for all decorators and no longer the first positional argument. Removed the explicit module objectsbuiltins,quantum, andangle.quantum_functionalis now its own Guppy module and no longer implicitly comes withquantum.Linear function arguments are now borrowed by default; removed the now redundant
@inoutannotation
Features¶
Add functions to quantum module and make quantum_functional independent (#494) (0b0b1af)
Hide lists and function tensors behind experimental flag (#501) (c867f48)
Make linear types @inout by default; add @owned annotation (#486) (e900c96)
Only lower definitions to Hugr if they are used (#496) (cc2c8a4)
Support implicit modules for all decorators and turn builtins into implicit module (#476) (cc8a424)
Bug Fixes¶
0.11.0 (2024-09-11)¶
⚠ BREAKING CHANGES¶
guppy.take_modulerenamed toguppy.get_moduleand no longer removes the module from the state.Quantum operations
rx,rz,phased_x, andzz_maxuse theangletype instead of floats.
Features¶
Bug Fixes¶
0.10.0 (2024-09-11)¶
⚠ BREAKING CHANGES¶
Bumped the
hugrdependency to0.8.0GuppyModule.loadno longer loads the content of modules but instead just brings the name of the module into scope. UseGuppyModule.load_allto get the old behaviour.Removed
guppylang.hugr_builder.hugr.Hugr, compiling a module returns ahugr.Packageinstead.
Features¶
Add equality test for booleans (#394) (dd702ce), closes #363
Add qualified imports and make them the default (#443) (553ec51)
Allow imports of function definitions and aliased imports (#432) (e23b666)
Inout arguments (#311) (060649b), closes #315 #316 #349 #344 #321 #331 #350 #340 #351
Use cell name instead of file for notebook errors (#382) (d542601)
Use the hugr builder (536abf9)
Bug Fixes¶
Documentation¶
Miscellaneous Chores¶
0.9.0 (2024-08-12)¶
⚠ BREAKING CHANGES¶
Bug Fixes¶
0.8.1 (2024-08-08)¶
Bug Fixes¶
0.8.0 (2024-07-30)¶
Features¶
Bug Fixes¶
0.7.0 (2024-07-25)¶
⚠ BREAKING CHANGES¶
qubits are now reset on allocation
Features¶
Bug Fixes¶
0.6.2 (2024-07-10)¶
Features¶
update to hugr-python 0.4 (af770c3)
0.6.1 (2024-07-09)¶
Features¶
update to
hugr-py 0.3(3da3936)
0.6.0 (2024-07-02)¶
Features¶
Bug Fixes¶
0.5.2 (2024-06-13)¶
Bug Fixes¶
0.5.1 (2024-06-12)¶
Bug Fixes¶
0.5.0 (2024-06-10)¶
Features¶
0.4.0 (2024-05-30)¶
Features¶
Export py function (6dca95d)
0.3.0 (2024-05-22)¶
Features¶
Bug Fixes¶
Documentation¶
0.2.0 (2024-04-11)¶
⚠ BREAKING CHANGES¶
Make
qubittype lower case (#165)
Features¶
Bug Fixes¶
Documentation¶
Code Refactoring¶
Continuous Integration¶
0.1.0¶
First release of Guppy! 🐟
This is an alpha release that implements basic language features and compilation to hugr v0.1.